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