|
|
@@ -2,10 +2,12 @@ package com.dk.mdm.service.mst;
|
|
|
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
import com.dk.common.infrastructure.constant.Constant;
|
|
|
+import com.dk.common.infrastructure.util.LocalDateTimeUtils;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.CustomerConvert;
|
|
|
+import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
|
import com.dk.mdm.model.pojo.mst.Customer;
|
|
|
import com.dk.mdm.mapper.mst.CustomerMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
|
@@ -18,6 +20,8 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.Date;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
@@ -39,6 +43,10 @@ public class CustomerService extends BaseService<Customer> {
|
|
|
@Autowired
|
|
|
private CommonService commonService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AuthUtils authUtils;
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 重写主键
|
|
|
* @author : 于继渤
|
|
|
@@ -75,6 +83,14 @@ public class CustomerService extends BaseService<Customer> {
|
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMER.getName(), true);
|
|
|
customer.setCusId(uniqueNoteCode.get("outId").toString());
|
|
|
customer.setCusCode(uniqueNoteCode.get("outNote").toString());
|
|
|
+ //设置公司id
|
|
|
+ customer.setCpId(authUtils.getStaff().getCpId());
|
|
|
+ //设置报备人
|
|
|
+ customer.setReportStaff(authUtils.getStaff().getStaffId());
|
|
|
+ //报备日期
|
|
|
+ customer.setReportTime(LocalDateTime.now());
|
|
|
+ //销售状态 (【系统字典】客销状态:公海、潜客、成
|
|
|
+ customer.setSaleStatus(Constant.saleStatus.SALE_STATUS_POTENTIAL.getName());
|
|
|
customerMapper.insert(customer);
|
|
|
return ResponseResultUtil.success();
|
|
|
}
|