于继渤 2 лет назад
Родитель
Сommit
cc6903373f

+ 2 - 2
src/main/java/com/dk/mdm/controller/mst/CustomerController.java

@@ -45,7 +45,7 @@ public class CustomerController{
      * @author : 于继渤
      * @date : 2023/1/5 9:39
      */
-    @ApiOperation( value = "新建角色(权限)", notes = "新建角色权限" )
+    @ApiOperation( value = "新建", notes = "v" )
     @PostMapping({"insert"})
     public ResponseResultVO<?> insert(@RequestBody CustomerVO customerVO) {
         return customerService.insert(customerVO);
@@ -56,7 +56,7 @@ public class CustomerController{
      * @author : 于继渤
      * @date : 2023/1/5 9:39
      */
-    @ApiOperation( value = "编辑角色权限(编辑角色权限)", notes = "编辑角色权限" )
+    @ApiOperation( value = "编辑", notes = "编辑" )
     @PostMapping({"update"})
     public ResponseResultVO<?> update(@RequestBody CustomerVO customerVO) {
         return customerService.update(customerVO);

+ 16 - 0
src/main/java/com/dk/mdm/service/mst/CustomerService.java

@@ -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();
     }