LG88888888 3 years ago
parent
commit
751b78bf05

+ 10 - 2
src/main/java/net/chenlin/dp/modules/api/controller/CustomerController.java

@@ -39,15 +39,23 @@ public class CustomerController {
     }
 
 
-    public List<ICustomerEdit> ls() throws OpenAPIException {
+    /**
+     * 客户档案修改接口
+     * @throws OpenAPIException
+     */
+    public void ICustomerEdit() throws OpenAPIException {
         DynamicDataSource.setDataSource("last-data-source");
         List<ICustomerEdit> iCustomerEdits = customerMapper.ICustomerEditList();
         DynamicDataSource.setDataSource("");
         if (iCustomerEdits!=null&&iCustomerEdits.size()>0){
             for (ICustomerEdit i:iCustomerEdits){
                 String s = customerService.editCustomer(i);
+                if (s.equals("0")){
+                    DynamicDataSource.setDataSource("last-data-source");
+                    customerMapper.UpdateCustomer(i.getCode());
+                    DynamicDataSource.setDataSource("");
+                }
             }
         }
-        return iCustomerEdits;
     }
 }