Quellcode durchsuchen

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

lihai vor 5 Jahren
Ursprung
Commit
bd73863b4a

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

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

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

201
                 }
201
                 }
202
                 if (!string.IsNullOrEmpty(tephone))
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
                     if (cus != null)
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
                     else if (cusll!=null )
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