|
@@ -35,24 +35,30 @@ namespace OASystem.Infrastructure.Repositories.CRM
|
|
|
public async Task<Result> GetCrm_ClientCompanyList(DtoBase dto)
|
|
|
{
|
|
|
Result result = new Result() { Code = -2 };
|
|
|
-
|
|
|
- if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
|
|
|
+ try
|
|
|
{
|
|
|
- string sql = string.Format(@"Select ccc.Id,ccc.CompanyName,ccc.Address,ccc.PostCodes,su.CnName UserName,ccc.CreateTime,ccc.Remark
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
|
|
|
+ {
|
|
|
+ string sql = string.Format(@"Select ccc.Id,ccc.CompanyFullName,ccc.CompanyAbbreviation,ccc.Address,ccc.PostCodes,su.CnName UserName,ccc.CreateTime,ccc.Remark
|
|
|
From Crm_CustomerCompany ccc Inner Join Sys_Users su On ccc.CreateUserId = su.Id where ccc.IsDel=0 order by CreateTime Desc");
|
|
|
|
|
|
- var _clientCompanyList = await _sqlSugar.SqlQueryable<CustomerCompanyListView>(sql).ToListAsync();
|
|
|
- if (_clientCompanyList.Count > 0)
|
|
|
- {
|
|
|
- result.Code = 0;
|
|
|
- result.Msg = "成功!";
|
|
|
- result.Data = _clientCompanyList;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- result.Msg = "查询失败!";
|
|
|
+ var _clientCompanyList = await _sqlSugar.SqlQueryable<CustomerCompanyListView>(sql).ToListAsync();
|
|
|
+ if (_clientCompanyList.Count > 0)
|
|
|
+ {
|
|
|
+ result.Code = 0;
|
|
|
+ result.Msg = "成功!";
|
|
|
+ result.Data = _clientCompanyList;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.Msg = "查询失败!";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ result.Msg = ex.Message;
|
|
|
+ }
|
|
|
|
|
|
return result;
|
|
|
}
|