Bladeren bron

修改导入bug

mengjie 6 jaren geleden
bovenliggende
commit
f190f51e4d

+ 6 - 37
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -50,8 +50,7 @@ namespace CallCenterApi.Interface.Controllers.customer
50 50
             string sql = "";
51 51
             DataTable dt = new DataTable();
52 52
             #region 筛选条件
53
-            if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
54
-                sql += $" and F_KeyWords like '%" + keywords.Trim() + "%'";
53
+            
55 54
             if (!string.IsNullOrWhiteSpace(code))//客户编号
56 55
                 sql += $" and F_CustomerCode like '%" + code.Trim() + "%'";
57 56
             if (!string.IsNullOrWhiteSpace(cmpname))//公司名称
@@ -59,21 +58,12 @@ namespace CallCenterApi.Interface.Controllers.customer
59 58
             if (!string.IsNullOrWhiteSpace(cmpaddress))//公司地址
60 59
                 sql += $" and (F_CompanyAddress like '%" + cmpaddress.Trim() 
61 60
                     + "%')";
62
-            if (!string.IsNullOrWhiteSpace(legname))//法人姓名
63
-                sql += $" and F_LegalName like '%" + legname.Trim() + "%'";
61
+            
64 62
             if (!string.IsNullOrWhiteSpace(legtel))//法人电话
65 63
                 sql += $" and F_LegalTel like '%" + legtel.Trim() + "%'";
66 64
             if (!string.IsNullOrWhiteSpace(custype))//客户类型
67 65
                 sql += $" and F_CusType = '" + custype.Trim() + "'";
68
-            if (!string.IsNullOrWhiteSpace(conname) || !string.IsNullOrWhiteSpace(contel))
69
-            {
70
-                var sqlcon = " where F_DeleteFlag=0 ";
71
-                if (!string.IsNullOrWhiteSpace(conname)) // 联系人
72
-                    sqlcon += " and F_Name like '%" + conname + "%'";
73
-                if (!string.IsNullOrWhiteSpace(contel)) //联系人电话
74
-                    sqlcon += " and F_Telephone like '%" + contel + "%'";
75
-                sql += $" and F_CustomerId in (select F_CustomerId from T_Cus_ContactPersonNew " + sqlcon + " )";
76
-            }
66
+            
77 67
             #endregion
78 68
 
79 69
             int recordCount = 0;
@@ -87,7 +77,7 @@ namespace CallCenterApi.Interface.Controllers.customer
87 77
                 dt = BLL.PagerBLL.GetListPager(
88 78
                     "T_Cus_CustomerBaseNew",
89 79
                     "F_CustomerId",
90
-                    "*,dbo.GetDeptName(F_BeDept) as F_BeDeptName,dbo.GetCusType(F_CusType) as F_CusType",
80
+                    "*,dbo.GetDeptName(F_BeDept) as F_BeDeptName,dbo.GetCusType(F_CusType) as F_CusTypeName",
91 81
                     sql,
92 82
                     "ORDER BY F_CustomerId desc",
93 83
                     pagesize,
@@ -95,28 +85,7 @@ namespace CallCenterApi.Interface.Controllers.customer
95 85
                     true,
96 86
                     out recordCount);
97 87
                 #region
98
-                dt.Columns.Add("F_Contact");
99
-                var dept = new BLL.T_Sys_Department().GetModelList("");
100
-                foreach (DataRow dr in dt.Rows)
101
-                {
102
-                    #region 绑定联系人信息
103
-                    var contact = "";
104
-                    string cusid = dr["F_CustomerId"] != null ? dr["F_CustomerId"].ToString() : "";
105
-                    if (cusid != "")
106
-                    {
107
-                        var conlist = conbll.GetModelList(" F_CustomerId=" + cusid);
108
-                        if (conlist.Count > 0)
109
-                        {
110
-                            foreach (var item in conlist)
111
-                            {
112
-                                contact += item.F_Name + "(" + item.F_Telephone + "),";
113
-                            }
114
-                        }
115
-                        dr["F_Contact"] = contact.TrimEnd(',');
116
-                    }
117
-                    #endregion
118
-                }
119
-
88
+                
120 89
                 #endregion
121 90
             }
122 91
             var obj = new
@@ -846,7 +815,7 @@ namespace CallCenterApi.Interface.Controllers.customer
846 815
                         
847 816
                         #region  信息对应
848 817
                        
849
-                        cusmodel.F_CustomerCode = dataRow["客户名"].ToString();
818
+                        cusmodel.F_CustomerCode = dataRow["客户名"].ToString();
850 819
                         cusmodel.F_LegalTel = dataRow["客户电话"].ToString();
851 820
                         
852 821
                         cusmodel.F_CompanyAddress= dataRow["客户地址"].ToString();