Administrator vor 7 Monaten
Ursprung
Commit
e5a2852ff0

+ 64 - 4
src/main/java/com/jkcredit/invoice/controller/business/CustomerCompanyManagerOperController.java

@@ -3,9 +3,15 @@ package com.jkcredit.invoice.controller.business;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.annotation.LoginRequired;
 import com.jkcredit.invoice.annotation.annotationdes.AuthenticationInterceptor;
+import com.jkcredit.invoice.mapper.customer.CustomerRecMapper;
+import com.jkcredit.invoice.model.entity.customer.CustomerRec;
 import com.jkcredit.invoice.model.entity.user.User;
 import com.jkcredit.invoice.model.entity.waybill.NoCarCompanyManger;
+import com.jkcredit.invoice.model.vo.OperatorEditConfirmVo;
+import com.jkcredit.invoice.model.vo.OperatorEditVo;
+import com.jkcredit.invoice.model.vo.OperatorSendCodeVo;
 import com.jkcredit.invoice.model.vo.UserVo;
+import com.jkcredit.invoice.service.customer.CustomerRecService;
 import com.jkcredit.invoice.service.lowerservice.CheckHasAuthRole;
 import com.jkcredit.invoice.service.nocar.NoCarCompanyMangerOper;
 import com.jkcredit.invoice.util.RespR;
@@ -18,6 +24,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * All rights Reserved, Designed By www.erayt.com
  *
@@ -41,7 +49,8 @@ public class CustomerCompanyManagerOperController {
 
     @Autowired
     private CheckHasAuthRole checkHasAuthRole;
-
+    @Autowired
+    CustomerRecMapper customerRecMapper;
     /**
      * 新增上传企业开票经办人
      *
@@ -75,13 +84,14 @@ public class CustomerCompanyManagerOperController {
      * 分页查询企业开票经办人
      *
      * @param page   参数集
-     * @param userVo 查询参数列表
+     * @param user 查询参数列表
      * @return 用户集合
      */
     @PostMapping("/page")
     @ApiOperation(value = "分页查询企业开票经办人", notes = "分页查询企业开票经办人")
-    @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
-    public RespR getCustomerCompanyManagerDetailPage(Page page, NoCarCompanyManger noCarCompanyManger, UserVo userVo) {
+    @LoginRequired
+    public RespR getCustomerCompanyManagerDetailPage(Page page, NoCarCompanyManger noCarCompanyManger, User user) {
+        checkHasAuthRole.checkCustomerRole(user, noCarCompanyManger.getCustId());
         return new RespR<>(noCarCompanyMangerOper.getCustomerCompanyManagerDetailPage(page, noCarCompanyManger));
     }
 
@@ -96,4 +106,54 @@ public class CustomerCompanyManagerOperController {
     public RespR getCustomerCompanyManagerDetail(@RequestBody NoCarCompanyManger noCarCompanyManger, User user) {
         return noCarCompanyMangerOper.noCarCompanyMangerQuery(noCarCompanyManger);
     }
+
+    /**
+     * @param operatorEditVo
+     * @return
+     */
+    @PostMapping("/updateNoCarCompanyManger")
+    @ApiOperation(value = "修改企业开票经办人", notes = "修改企业开票经办人")
+    @LoginRequired
+    public RespR updateNoCarCompanyManger(@RequestBody OperatorEditVo operatorEditVo) {
+        return noCarCompanyMangerOper.operatorEdit(operatorEditVo);
+    }
+
+    /**
+     * @param operatorEditConfirmVo
+     * @return
+     */
+    @PostMapping("/updateNoCarCompanyMangerConfirm")
+    @ApiOperation(value = "确认修改企业开票经办人", notes = "确认修改企业开票经办人")
+    @LoginRequired
+    public RespR updateNoCarCompanyMangerConfirm(@RequestBody OperatorEditConfirmVo operatorEditConfirmVo) {
+        return noCarCompanyMangerOper.operatorEditConfirm(operatorEditConfirmVo);
+    }
+    /**
+     * @param operatorSendCodeVo
+     * @return
+     */
+    @PostMapping("/sendCode")
+    @ApiOperation(value = "发送验证码", notes = "发送验证码")
+    @LoginRequired
+    public RespR sendCode(@RequestBody OperatorSendCodeVo operatorSendCodeVo) {
+        CustomerRec customerRec = new CustomerRec();
+        customerRec.setCompanyNum(operatorSendCodeVo.getBuyerCode());
+        List<CustomerRec> customerRecList = customerRecMapper.selectByCompanyNum(customerRec);
+        operatorSendCodeVo.setBuyerCode(customerRecList.get(0).getCompanyReferencenum());
+        return noCarCompanyMangerOper.operatorSendCode(operatorSendCodeVo);
+    }
+    /**
+     * @param operatorSendCodeVo
+     * @return
+     */
+    @PostMapping("/confirmCode")
+    @ApiOperation(value = "确认验证码", notes = "确认验证码")
+    @LoginRequired
+    public RespR confirmCode(@RequestBody OperatorSendCodeVo operatorSendCodeVo) {
+        CustomerRec customerRec = new CustomerRec();
+        customerRec.setCompanyNum(operatorSendCodeVo.getBuyerCode());
+        List<CustomerRec> customerRecList = customerRecMapper.selectByCompanyNum(customerRec);
+        operatorSendCodeVo.setBuyerCode(customerRecList.get(0).getCompanyReferencenum());
+        return noCarCompanyMangerOper.operatorValidCode(operatorSendCodeVo);
+    }
 }

+ 4 - 1
src/main/java/com/jkcredit/invoice/credit/SimpleCoreFilter.java

@@ -158,7 +158,10 @@ public class SimpleCoreFilter implements Filter {
             "/customerCompany/operatorEvidenceAdd",
             "/customerCompany/page",
             "/customerCompany/noCarCompanyMangerQuery",
-
+            "/customerCompany/updateNoCarCompanyManger",
+            "/customerCompany/updateNoCarCompanyMangerConfirm",
+            "/customerCompany/sendCode",
+            "/customerCompany/confirmCode",
             //登陆管理
             "/auth/login/loginOut",
 

+ 2 - 0
src/main/java/com/jkcredit/invoice/credit/interserver/NoCarInterServiceImpl.java

@@ -1206,6 +1206,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarCompanyManger.setIdentificationId(identificationId);
             noCarCompanyManger.setContractFileName(contractFileName);
             noCarCompanyManger.setBase64Str(base64Str);
+            noCarCompanyManger.setCustId(customerRec.getCustomerName());
+            noCarCompanyManger.setCompanyName(customerRec.getCompanyName());
             RespR re = noCarCompanyMangerOper.companyDetailAdd(noCarCompanyManger);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.companyDetailAdd-] result is "

+ 8 - 0
src/main/java/com/jkcredit/invoice/model/entity/waybill/NoCarCompanyManger.java

@@ -37,6 +37,14 @@ public class NoCarCompanyManger extends BaseMode{
      * 经办人身份证
      */
     private String identificationId;
+    /**
+     * 企业名称
+     */
+    private String companyName;
+    /**
+     * 客户Id
+     */
+    private String custId;
 
     /**
      * 经办人姓名

+ 14 - 13
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarCompanyMangerOperImpl.java

@@ -71,11 +71,11 @@ public class NoCarCompanyMangerOperImpl extends ServiceImpl<NoCarCompanyMangerMa
             return new RespR(false,respR.getMsg());
         }else{
             UpdateWrapper<NoCarCompanyManger> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.set("operatorNameTemp",operatorEditVo.getTargetOperatorName());
-            updateWrapper.set("operatorMobileTemp",operatorEditVo.getSourceOperatorMobile());
-            updateWrapper.set("identificationIdTemp",operatorEditVo.getTargetIdentificationId());
-            updateWrapper.set("status","2");
-            updateWrapper.eq("companyNum",operatorEditVo.getCompanyNum());
+            updateWrapper.set("operator_name_temp",operatorEditVo.getTargetOperatorName());
+            updateWrapper.set("operator_mobile_temp",operatorEditVo.getSourceOperatorMobile());
+            updateWrapper.set("identification_id_temp",operatorEditVo.getTargetIdentificationId());
+            updateWrapper.set("status",CommonConst.TWO);
+            updateWrapper.eq("company_num",operatorEditVo.getCompanyNum());
             NoCarCompanyManger noCarCompanyManger  = new NoCarCompanyManger();
             noCarCompanyManger.setCompanyNum(operatorEditVo.getCompanyNum());
             noCarCompanyMangerMapper.update(noCarCompanyManger,updateWrapper);
@@ -94,14 +94,14 @@ public class NoCarCompanyMangerOperImpl extends ServiceImpl<NoCarCompanyMangerMa
             return new RespR(false,respR.getMsg());
         }else{
             QueryWrapper<NoCarCompanyManger> queryWrapper = new QueryWrapper<>();
-            queryWrapper.select("operatorNameTemp","operatorMobileTemp","identificationIdTemp").eq("companyNum",operatorEditConfirmVo.getCompanyNum());
+            queryWrapper.select("operator_name_temp","operator_mobile_temp","identification_id_temp").eq("company_num",operatorEditConfirmVo.getCompanyNum());
             NoCarCompanyManger noCarCompanyMangerDb = noCarCompanyMangerMapper.selectOne(queryWrapper);
             UpdateWrapper<NoCarCompanyManger> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.set("operatorName",noCarCompanyMangerDb.getOperatorNameTemp());
-            updateWrapper.set("operatorMobile",noCarCompanyMangerDb.getOperatorMobileTemp());
-            updateWrapper.set("identificationId",noCarCompanyMangerDb.getIdentificationIdTemp());
-            updateWrapper.set("status","1");
-            updateWrapper.eq("companyNum",operatorEditConfirmVo.getCompanyNum());
+            updateWrapper.set("operator_name",noCarCompanyMangerDb.getOperatorNameTemp());
+            updateWrapper.set("operator_mobile",noCarCompanyMangerDb.getOperatorMobileTemp());
+            updateWrapper.set("identification_id",noCarCompanyMangerDb.getIdentificationIdTemp());
+            updateWrapper.set("status",CommonConst.ONE);
+            updateWrapper.eq("company_num",operatorEditConfirmVo.getCompanyNum());
             noCarCompanyMangerMapper.update(noCarCompanyMangerDb,updateWrapper);
             return new RespR("success");
         }
@@ -117,8 +117,9 @@ public class NoCarCompanyMangerOperImpl extends ServiceImpl<NoCarCompanyMangerMa
             return new RespR(false,respR.getMsg());
         }else{
             UpdateWrapper<NoCarCompanyManger> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.set("contractFileName",operatorEvidenceVo.getContractFileName());
-            updateWrapper.set("base64Str",operatorEvidenceVo.getBase64Str());
+            updateWrapper.set("operator_evidence_contract_file_name",operatorEvidenceVo.getContractFileName());
+            updateWrapper.set("operator_evidence_base64_str",operatorEvidenceVo.getBase64Str());
+            updateWrapper.set("status", CommonConst.FOR);
             updateWrapper.eq("companyNum",operatorEvidenceVo.getCompanyNum());
             NoCarCompanyManger noCarCompanyManger  = new NoCarCompanyManger();
             noCarCompanyManger.setCompanyNum(operatorEvidenceVo.getCompanyNum());

+ 5 - 1
src/main/resources/mapper/customer/CustomerCompanyManagerMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.jkcredit.invoice.mapper.waybill.NoCarCompanyMangerMapper">
     <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.waybill.NoCarCompanyManger">
         <result column="company_num" property="companyNum" jdbcType="VARCHAR"/>
+        <result column="company_name" property="companyName" jdbcType="VARCHAR"/>
         <result column="operator_name" property="operatorName" jdbcType="VARCHAR"/>
         <result column="operator_mobile" property="operatorMobile" jdbcType="VARCHAR"/>
         <result column="identification_id" property="identificationId" jdbcType="VARCHAR"/>
@@ -14,7 +15,7 @@
         <result column="status" property="status" jdbcType="VARCHAR"/>
     </resultMap>
     <sql id="Base_Column_List">
-    company_num, operator_name,operator_mobile, identification_id, operator_name_temp, operator_mobile_temp, identification_id_temp, contract_file_name, status,operator_evidence_contract_file_name
+    company_num,company_name, operator_name,operator_mobile, identification_id, operator_name_temp, operator_mobile_temp, identification_id_temp, contract_file_name, status,operator_evidence_contract_file_name
   </sql>
 
 
@@ -26,6 +27,9 @@
             <if test="noCarCompanyManger.companyNum != null and noCarCompanyManger.companyNum != ''">company_num =
                 #{noCarCompanyManger.companyNum}
             </if>
+            <if test="noCarCompanyManger.custId != null and noCarCompanyManger.custId != ''">cust_id =
+                #{noCarCompanyManger.custId}
+            </if>
             <if test="noCarCompanyManger.operatorName != null and noCarCompanyManger.operatorName != ''">AND
                 operator_name = #{noCarCompanyManger.operatorName}
             </if>