瀏覽代碼

修改市场客户资料安卓接口

yuanrf 1 年之前
父節點
當前提交
84a21c92f9
共有 1 個文件被更改,包括 28 次插入19 次删除
  1. 28 19
      OASystem/OASystem.Infrastructure/Repositories/CRM/NewClientDataRepository.cs

+ 28 - 19
OASystem/OASystem.Infrastructure/Repositories/CRM/NewClientDataRepository.cs

@@ -265,26 +265,33 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 }
                 string sqlWhere = string.Empty;
 
-                #region 联系人条件
-                if (!string.IsNullOrWhiteSpace(dto.Contact))
+                if (dto.PortType == 1)
                 {
-                    sqlWhere += string.Format(@" And s.Contact like '%{0}%'", dto.Contact);
-                }
-                #endregion
+                    #region 联系人条件
+                    if (!string.IsNullOrWhiteSpace(dto.Contact))
+                    {
+                        sqlWhere += string.Format(@" And s.Contact like '%{0}%'", dto.Contact);
+                    }
+                    #endregion
 
-                #region 地区条件
-                if (!string.IsNullOrWhiteSpace(dto.Location))
-                {
-                    sqlWhere += string.Format(@" And s.Location like '%{0}%'", dto.Location);
-                }
-                #endregion
+                    #region 地区条件
+                    if (!string.IsNullOrWhiteSpace(dto.Location))
+                    {
+                        sqlWhere += string.Format(@" And s.Location like '%{0}%'", dto.Location);
+                    }
+                    #endregion
 
-                #region 单位条件
-                if (!string.IsNullOrWhiteSpace(dto.Client))
+                    #region 单位条件
+                    if (!string.IsNullOrWhiteSpace(dto.Client))
+                    {
+                        sqlWhere += string.Format(@" And s.Client like '%{0}%'", dto.Client);
+                    }
+                    #endregion
+                }
+                else if (dto.PortType == 2 || dto.PortType == 3)
                 {
-                    sqlWhere += string.Format(@" And s.Client like '%{0}%'", dto.Client);
+                    sqlWhere += string.Format("And (Contact like '%{0}%' or Location  like '%{0}%' or Client like '%{0}%' )", dto.Client);
                 }
-                #endregion
 
                 if (state == -1)
                 {
@@ -367,6 +374,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 string sqlNew = string.Format(@"select (SELECT  COUNT(1) FROM Crm_NewClientData s left Join Sys_SetData s1  On s.Lvlid=s1.Id {0}) AS countPage,* from (select ROW_NUMBER() 
                                                     over(order by s.CreateTime desc) RowNumber,s.*,s1.Name as 'LvlName' from Crm_NewClientData s left Join Sys_SetData s1  On s.Lvlid=s1.Id {0}) as co where    
                                                     RowNumber between {1} and {2} ", sqlWhere, pIndex, pSize);
+
                 List<NewClientDataView> NewClientDataView = await _sqlSugar.SqlQueryable<NewClientDataView>(sqlNew).ToListAsync();
                 foreach (var item in NewClientDataView)
                 {
@@ -396,7 +404,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                         //负责人下拉框
                         List<dynamic> _Users = new List<dynamic>();
                         List<Sys_Users> users = _sqlSugar.Queryable<Sys_Users>()
-                        .Where(u => (u.CnName == "张海麟" || u.CnName == "安宁" || u.CnName == "李彩娟" || u.CnName == "舒庆" || u.CnName == "李媛媛") && u.IsDel == 0).ToList();
+                        .Where(u => u.IsDel == 0).ToList();
                         foreach (Sys_Users user in users)
                         {
                             var data = new
@@ -493,6 +501,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                     }
                     else if (dto.PortType == 2 || dto.PortType == 3)
                     {
+
                         List<NewClientDataAndroidIOSView> newClientDataIOSViews = new List<NewClientDataAndroidIOSView>();
                         foreach (var item in NewClientDataView)
                         {
@@ -516,7 +525,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                             Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = newClientDataIOSViews },
                         };
                     }
-                    
+
                 }
                 else
                 {
@@ -539,7 +548,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 //负责人下拉框
                 List<dynamic> _Users = new List<dynamic>();
                 List<Sys_Users> users = _sqlSugar.Queryable<Sys_Users>()
-                .Where(u => (u.CnName == "张海麟" || u.CnName == "安宁" || u.CnName == "李彩娟" || u.CnName == "舒庆" || u.CnName == "李媛媛") && u.IsDel == 0).ToList();
+                .Where(u =>  u.IsDel == 0).ToList();
                 foreach (Sys_Users user in users)
                 {
                     var data = new
@@ -761,7 +770,7 @@ namespace OASystem.Infrastructure.Repositories.CRM
             //负责人下拉框
             List<dynamic> _Users = new List<dynamic>();
             List<Sys_Users> users = _sqlSugar.Queryable<Sys_Users>()
-            .Where(u => (u.CnName == "张海麟" || u.CnName == "安宁" || u.CnName == "李彩娟" || u.CnName == "舒庆" || u.CnName == "李媛媛") && u.IsDel == 0).ToList();
+            .Where(u =>  u.IsDel == 0).ToList();
             foreach (Sys_Users user in users)
             {
                 var data = new