Pārlūkot izejas kodu

客户档案物料档案对接

duhongyu 5 gadi atpakaļ
vecāks
revīzija
32ac13341e

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

@@ -810,7 +810,7 @@ namespace CallCenterApi.Interface.Controllers.customer
810 810
         /// </summary>
811 811
         /// <param name="ids"></param>getunique
812 812
         /// <returns></returns>
813
-        public bool  DelCustomer(string id)
813
+        public bool  DelCustomers(string id)
814 814
         {
815 815
               if (cusbll.DeleteList(id))
816 816
                 {

+ 20 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/XLXCustomerController.cs

@@ -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;

+ 18 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/MaterialManageXLXController.cs

@@ -45,6 +45,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
45 45
                 return Process();
46 46
             }
47 47
             MaterialManageController cus = new MaterialManageController();
48
+            Model.T_Wo_MaterialManage _Customer = new Model.T_Wo_MaterialManage();
48 49
             if (!string.IsNullOrEmpty(materialcode))
49 50
             {
50 51
                 if (!cus.valcode(materialcode))
@@ -56,9 +57,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
56 57
 
57 58
                 if (cus.getunique(0, materialcode))
58 59
                 {
59
-                    ajresult.state = (int)CodeStatus.参数逻辑错误;
60
-                    ajresult.message = "物料编号已被占用,请重新输入!";
61
-                    return Process();
60
+                    _Customer = new BLL.T_Wo_MaterialManage().GetModelList("F_IsDelete=0 and F_MaterialCode='" + materialcode + "'")
61
+                 .FirstOrDefault(); ;
62 62
                 }
63 63
             }
64 64
             else
@@ -79,11 +79,23 @@ namespace CallCenterApi.Interface.Controllers.workorder
79 79
                 ajresult.message = "安全验证未通过";
80 80
                 return Process();
81 81
             }
82
+          
82 83
             if (!t_Cus_Customerrecords.ExistsCuscodeuuid(uuid))  //uuid不存在时,防止重复添加
83 84
             {
84
-                int cusid = cus.Add ( materialcode,  materialname,  model,  specs,
85
-            level1,  level2,  level3,  brand,  materialeffect, 
86
-           craft,  pipeline,  remark);
85
+                int cusid = 0;
86
+                if (_Customer!=null )
87
+                {
88
+                    cusid= cus.Add(materialcode, materialname, model, specs,
89
+           level1, level2, level3, brand, materialeffect,
90
+          craft, pipeline, remark, _Customer.F_Id );
91
+                }
92
+                else
93
+                {
94
+                    cusid = cus.Add(materialcode, materialname, model, specs,
95
+             level1, level2, level3, brand, materialeffect,
96
+            craft, pipeline, remark);
97
+
98
+                }
87 99
                 if (cusid == 0)
88 100
                 {
89 101
                     ajresult.state = (int)CodeStatus.异常结果类型;