于继渤 1 год назад
Родитель
Сommit
83b6ddef1d

+ 14 - 0
src/main/java/com/dk/mdm/service/ivt/outbound/OutCommon.java

@@ -10,6 +10,7 @@ import com.dk.mdm.model.pojo.mst.Customer;
 import com.dk.mdm.model.pojo.sale.MultiOwner;
 import com.dk.mdm.model.vo.ivt.OutboundVO;
 import com.dk.mdm.service.common.CommonService;
+import com.dk.mdm.service.mst.CustomerService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -33,6 +34,9 @@ public class OutCommon {
     private CustomerMapper customerMapper;
 
     @Autowired
+    private CustomerService customerService;
+
+    @Autowired
     private MultiOwnerMapper multiOwnerMapper;
 
 
@@ -61,6 +65,16 @@ public class OutCommon {
                     .setReportStaff(outboundVO.getMakeStaff()).setSaleStatus(Constant.SaleStatus.CHENGJIAO.getName()).setCpId(outboundVO.getCpId());
             customerMapper.insert(customer);
             outboundVO.setCusId(customer.getCusId());
+        }else {
+            //编辑客户
+            Customer customer = new Customer();
+            customer.setCusName(outboundVO.getCusName()).setCusId(outboundVO.getCusId())
+                    .setCusPhone(outboundVO.getCusPhone()).setAddressArea(outboundVO.getAddressArea()).setAddressName(outboundVO.getAddressName())
+                    .setAddressNo(outboundVO.getAddressNo()).setAddressGcj02(outboundVO.getAddressGcj02()).setAddressFull(outboundVO.getAddressFull())
+                    .setContactName(outboundVO.getContactName()).setContactPhone(outboundVO.getContactPhone()).setCusFrom(outboundVO.getCusFrom())
+                    .setChannelId(outboundVO.getSalesChannel()).setOrgId(outboundVO.getOrgId()).setStaffId(outboundVO.getStaffId())
+                    .setSaleStatus(Constant.SaleStatus.CHENGJIAO.getName());
+            customerService.updateByUuid(customer);
         }
 
         return outboundVO;

+ 4 - 3
src/main/java/com/dk/mdm/service/ivt/outbound/OutboundSaleOrderService.java

@@ -106,9 +106,10 @@ public class OutboundSaleOrderService extends BaseService<Outbound> {
     @Transactional(rollbackFor = {Exception.class})
     public ResponseResultVO<?> saleOrderOutboundInsert(OutboundVO outboundVO) {
         //region 如果没有客户id,要新建
-        if (outboundVO.getCusId() == null) {
-            outboundVO = outCommon.insertCustomer(outboundVO);
-        }
+//        if (outboundVO.getCusId() == null) {
+//
+//        }
+        outboundVO = outCommon.insertCustomer(outboundVO);
         //endregion
 
         //region  查询当前公司的系统参数  自动办理信息  并赋值