Sfoglia il codice sorgente

bug3792,过滤添加客户档案电话空格,修改通话记录查询条件

lihai 5 anni fa
parent
commit
bd73863b4a

+ 7 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -397,9 +397,9 @@ namespace CallCenterApi.Interface.Controllers.customer
397 397
                 if (getunique(0, input.F_CustomerCode))
398 398
                     return Error("编号已被占用,请重新输入!");
399 399
             }
400
-            if (string.IsNullOrEmpty(input.F_LegalPhone))
400
+            if (string.IsNullOrEmpty(input.F_LegalPhone.Trim()))
401 401
                 return Error("请输入客户电话");
402
-            if (getunphone(0, input.F_LegalPhone))
402
+            if (getunphone(0, input.F_LegalPhone.Trim()))
403 403
                 return Error("已存在该客户请勿重复添加");
404 404
             int i = 0;
405 405
             if (string.IsNullOrEmpty(input.F_CustomerCode))
@@ -530,7 +530,7 @@ namespace CallCenterApi.Interface.Controllers.customer
530 530
                     Input1.F_Channel = model[i].F_Channel;// 渠道类型:总经销、二级商、种田大户、农户、化工客户、公司员工
531 531
                     Input1.F_Credit = model[i].F_Credit;//信用等级:一星、二星、三星、四星、五星、空
532 532
                     Input1.F_Legal = model[i].F_Legal;//法人 
533
-                    Input1.F_LegalPhone = model[i].F_LegalPhone;//法人电话
533
+                    Input1.F_LegalPhone = model[i].F_LegalPhone.Trim();//法人电话
534 534
                     Input1.F_AddressProvince = model[i].F_AddressProvince;//省
535 535
                     Input1.F_AddressCity = model[i].F_AddressCity;//市
536 536
                     Input1.F_AddressCountry = model[i].F_AddressCountry;//县
@@ -601,7 +601,7 @@ namespace CallCenterApi.Interface.Controllers.customer
601 601
             model.F_Channel = input.F_Channel;// 渠道类型:总经销、二级商、种田大户、农户、化工客户、公司员工
602 602
             model.F_Credit = input.F_Credit;//信用等级:一星、二星、三星、四星、五星、空
603 603
             model.F_Legal = input.F_Legal;//法人 
604
-            model.F_LegalPhone = input.F_LegalPhone;//法人电话
604
+            model.F_LegalPhone = input.F_LegalPhone.Trim();//法人电话
605 605
             model.F_AddressProvince = input.F_AddressProvince;//省
606 606
             model.F_AddressCity = input.F_AddressCity;//市
607 607
             model.F_AddressCountry = input.F_AddressCountry;//县
@@ -640,7 +640,7 @@ namespace CallCenterApi.Interface.Controllers.customer
640 640
         private bool getunphone(int id, string phone)
641 641
         {
642 642
             var sql = " F_IsDelete=0 ";
643
-            sql += "and (F_LegalPhone='" + phone + "')";
643
+            sql += "and (F_LegalPhone='" + phone.Trim() + "')";
644 644
             if (id > 0)
645 645
                 sql += " and F_CustomerId<>" + id;
646 646
             var count = cusbll.GetModelList(sql).Count();
@@ -812,7 +812,7 @@ namespace CallCenterApi.Interface.Controllers.customer
812 812
                                             dModel.F_Gender = "1";
813 813
                                         }
814 814
                                     }
815
-                                    dModel.F_LegalPhone = dr["客户电话"].ToString();
815
+                                    dModel.F_LegalPhone = dr["客户电话"].ToString().Trim();
816 816
                                     dModel.F_AddressProvince = dr["省"].ToString();
817 817
                                     dModel.F_AddressCity = dr["市"].ToString();
818 818
                                     dModel.F_AddressCountry = dr["县"].ToString();
@@ -873,7 +873,7 @@ namespace CallCenterApi.Interface.Controllers.customer
873 873
                                                 CustomerBase.F_Gender = "1";
874 874
                                             }
875 875
                                         }
876
-                                        CustomerBase.F_LegalPhone = dr["客户电话"].ToString();
876
+                                        CustomerBase.F_LegalPhone = dr["客户电话"].ToString().Trim();
877 877
                                         CustomerBase.F_AddressProvince = dr["省"].ToString();
878 878
                                         CustomerBase.F_AddressCity = dr["市"].ToString();
879 879
                                         CustomerBase.F_AddressCountry = dr["县"].ToString();

+ 5 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -201,19 +201,16 @@ namespace CallCenterApi.Interface.Controllers.tel
201 201
                 }
202 202
                 if (!string.IsNullOrEmpty(tephone))
203 203
                 {
204
-                    Model.T_Cus_CustomerBaseNew cus = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
205
-         .FirstOrDefault();
206
-                    Model.T_Cus_CustomerBaseNew cusll = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='0" + tephone + "'  ")
207
-        .FirstOrDefault();
204
+                    //12:08 2020/2/27 过滤字段F_LegalPhone字段中的空格
205
+                    Model.T_Cus_CustomerBaseNew cus = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='" + tephone + "'  ").FirstOrDefault();
206
+                    Model.T_Cus_CustomerBaseNew cusll = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='0" + tephone + "'  ").FirstOrDefault();
208 207
                     if (cus != null)
209 208
                     {
210
-                        dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
211
-               .FirstOrDefault().F_Legal;
209
+                        dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='" + tephone + "'  ").FirstOrDefault().F_Legal;
212 210
                     }
213 211
                     else if (cusll!=null )
214 212
                     {
215
-                        dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='0" + tephone + "'  ")
216
-               .FirstOrDefault().F_Legal;
213
+                        dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" REPLACE(F_LegalPhone,' ','') ='0" + tephone + "'  ").FirstOrDefault().F_Legal;
217 214
                     }
218 215
                 }
219 216