|
|
@@ -61,6 +61,7 @@ namespace CallCenterApi.Interface.Controllers.customer
|
|
61
|
61
|
ajresult.message = "客户唯一标识超出长度";
|
|
62
|
62
|
return Process();
|
|
63
|
63
|
}
|
|
|
64
|
+ Model.T_Cus_CustomerBaseNew _Customer = new Model.T_Cus_CustomerBaseNew();
|
|
64
|
65
|
CustomerNewController cus = new CustomerNewController();
|
|
65
|
66
|
if (!string.IsNullOrEmpty(customercode))
|
|
66
|
67
|
{
|
|
|
@@ -73,9 +74,8 @@ namespace CallCenterApi.Interface.Controllers.customer
|
|
73
|
74
|
|
|
74
|
75
|
if (cus.getunique(0, customercode))
|
|
75
|
76
|
{
|
|
76
|
|
- ajresult.state = (int)CodeStatus.参数逻辑错误;
|
|
77
|
|
- ajresult.message = "客户编号已被占用,请重新输入!";
|
|
78
|
|
- return Process();
|
|
|
77
|
+ _Customer = new BLL.T_Cus_CustomerBaseNew().GetModelList("F_IsDelete=0 and F_CustomerCode='" + customercode + "'")
|
|
|
78
|
+ .FirstOrDefault();
|
|
79
|
79
|
}
|
|
80
|
80
|
}
|
|
81
|
81
|
else
|
|
|
@@ -152,10 +152,22 @@ namespace CallCenterApi.Interface.Controllers.customer
|
|
152
|
152
|
|
|
153
|
153
|
if (!t_Cus_Customerrecords.ExistsCuscodeuuid(uuid)) //uuid不存在时,防止重复添加
|
|
154
|
154
|
{
|
|
155
|
|
- int cusid = cus .CustemweCode(customercode, gender.ToString (),
|
|
156
|
|
- companyname, area, branch, salesman, salesphone, channel, credit, customername
|
|
157
|
|
- , customerphone, province, city, country, township, addressfull, brands, product
|
|
158
|
|
- , isrunxlx, annualsales, formula, raisecrops, plantingarea, fertilizerbrand, remark);
|
|
|
155
|
+ int cusid = 0;
|
|
|
156
|
+ if (_Customer != null)
|
|
|
157
|
+ {
|
|
|
158
|
+ cusid = cus.CustemweCode(customercode, gender.ToString(),
|
|
|
159
|
+ companyname, area, branch, salesman, salesphone, channel, credit, customername
|
|
|
160
|
+ , customerphone, province, city, country, township, addressfull, brands, product
|
|
|
161
|
+ , isrunxlx, annualsales, formula, raisecrops, plantingarea, fertilizerbrand, remark, _Customer.F_CustomerId );
|
|
|
162
|
+ }
|
|
|
163
|
+ else
|
|
|
164
|
+ {
|
|
|
165
|
+ cusid = cus.CustemweCode(customercode, gender.ToString(),
|
|
|
166
|
+ companyname, area, branch, salesman, salesphone, channel, credit, customername
|
|
|
167
|
+ , customerphone, province, city, country, township, addressfull, brands, product
|
|
|
168
|
+ , isrunxlx, annualsales, formula, raisecrops, plantingarea, fertilizerbrand, remark);
|
|
|
169
|
+ }
|
|
|
170
|
+
|
|
159
|
171
|
if (cusid==0)
|
|
160
|
172
|
{
|
|
161
|
173
|
ajresult.state = (int)CodeStatus.异常结果类型;
|
|
|
@@ -461,7 +473,7 @@ namespace CallCenterApi.Interface.Controllers.customer
|
|
461
|
473
|
return Process();
|
|
462
|
474
|
}
|
|
463
|
475
|
CustomerNewController cus = new CustomerNewController();
|
|
464
|
|
- if (cus .DelCustomer (id .ToString ()))
|
|
|
476
|
+ if (cus .DelCustomers(id .ToString ()))
|
|
465
|
477
|
{
|
|
466
|
478
|
cusmodel.F_Cuscode = id.ToString();
|
|
467
|
479
|
cusmodel.F_Cuscodeuuid = uuid;
|