Browse Source

1、后台管理系统增加 上传企业开票经办人和营业执照信息
2、后台管理系统增加 上传企业开票经办人证明附件信息

mashengyi 7 tháng trước cách đây
mục cha
commit
07fb248984

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

@@ -10,8 +10,6 @@ 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;
@@ -140,7 +138,7 @@ public class CustomerCompanyManagerOperController {
         customerRec.setCompanyNum(operatorSendCodeVo.getBuyerCode());
         List<CustomerRec> customerRecList = customerRecMapper.selectByCompanyNum(customerRec);
         operatorSendCodeVo.setBuyerCode(customerRecList.get(0).getCompanyReferencenum());
-        return noCarCompanyMangerOper.operatorSendCode(operatorSendCodeVo);
+        return noCarCompanyMangerOper.operatorSendCode(operatorSendCodeVo, customerRec);
     }
     /**
      * @param operatorSendCodeVo
@@ -154,6 +152,6 @@ public class CustomerCompanyManagerOperController {
         customerRec.setCompanyNum(operatorSendCodeVo.getBuyerCode());
         List<CustomerRec> customerRecList = customerRecMapper.selectByCompanyNum(customerRec);
         operatorSendCodeVo.setBuyerCode(customerRecList.get(0).getCompanyReferencenum());
-        return noCarCompanyMangerOper.operatorValidCode(operatorSendCodeVo);
+        return noCarCompanyMangerOper.operatorValidCode(operatorSendCodeVo, customerRec);
     }
 }

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

@@ -1450,7 +1450,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             log.info("[-NoCarInterServiceImpl.operatorSendCode-] request appKey=" + appKey + " ,api=" + api + " ,data=" + data + " ,requestid=" + requestid);
             OperatorSendCodeVo operatorSendCodeVo = new OperatorSendCodeVo();
             operatorSendCodeVo.setBuyerCode(taxplayerCode);
-            RespR re = noCarCompanyMangerOper.operatorSendCode(operatorSendCodeVo);
+            RespR re = noCarCompanyMangerOper.operatorSendCode(operatorSendCodeVo, customerRec);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.operatorSendCode-] result is "
                     + re.toString() + ", request is " + data + " ,costtime="
@@ -1507,7 +1507,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             OperatorSendCodeVo operatorSendCodeVo = new OperatorSendCodeVo();
             operatorSendCodeVo.setBuyerCode(taxplayerCode);
             operatorSendCodeVo.setValidCode(validCode);
-            RespR re = noCarCompanyMangerOper.operatorValidCode(operatorSendCodeVo);
+            RespR re = noCarCompanyMangerOper.operatorValidCode(operatorSendCodeVo, customerRec);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.operatorValidCode-] result is "
                     + re.toString() + ", request is " + data + " ,costtime="

+ 39 - 0
src/main/java/com/jkcredit/invoice/model/entity/invoice/HcInvoice.java

@@ -68,6 +68,21 @@ public class HcInvoice {
      */
     private String yearMonth;
 
+    /**
+     * 税额,单位:分
+     */
+    private String totalTaxAmount;
+
+    /**
+     * 税率,单位:分
+     */
+    private String taxRate;
+
+    /**
+     * 开票时间:yyyy-MM-ddTHH:mm:ss
+     */
+    private String invoiceMakeTime;
+
     public String getSellerName() {
         return sellerName;
     }
@@ -171,4 +186,28 @@ public class HcInvoice {
     public void setYearMonth(String yearMonth) {
         this.yearMonth = yearMonth;
     }
+
+    public String getTotalTaxAmount() {
+        return totalTaxAmount;
+    }
+
+    public void setTotalTaxAmount(String totalTaxAmount) {
+        this.totalTaxAmount = totalTaxAmount;
+    }
+
+    public String getTaxRate() {
+        return taxRate;
+    }
+
+    public void setTaxRate(String taxRate) {
+        this.taxRate = taxRate;
+    }
+
+    public String getInvoiceMakeTime() {
+        return invoiceMakeTime;
+    }
+
+    public void setInvoiceMakeTime(String invoiceMakeTime) {
+        this.invoiceMakeTime = invoiceMakeTime;
+    }
 }

+ 1 - 0
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -1086,6 +1086,7 @@ public class NoCarServiceImpl implements NoCarService {
                     HcInvoice hcInvoice = new HcInvoice();
                     BeanUtils.copyProperties(waybillInvoiceRedQueryModel, hcInvoice);
                     hcInvoice.setYearMonth(hcInvoiceQueryVo.getMonth());
+                    hcInvoice.setInvoiceMakeTime(DateUtil.tLocalDateTimeToString(waybillInvoiceRedQueryModel.getInvoiceMakeTime()));
                     hcInvoiceMapper.insertHcInvoice(hcInvoice);
                 }
             }

+ 3 - 2
src/main/java/com/jkcredit/invoice/service/nocar/NoCarCompanyMangerOper.java

@@ -2,6 +2,7 @@ package com.jkcredit.invoice.service.nocar;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jkcredit.invoice.model.entity.customer.CustomerRec;
 import com.jkcredit.invoice.model.entity.waybill.NoCarCompanyManger;
 import com.jkcredit.invoice.model.vo.OperatorEditConfirmVo;
 import com.jkcredit.invoice.model.vo.OperatorEditVo;
@@ -23,9 +24,9 @@ public interface NoCarCompanyMangerOper {
     @Deprecated
     RespR operatorEvidence(OperatorEvidenceVo operatorEvidenceVo);
 
-    RespR operatorSendCode(OperatorSendCodeVo operatorSendCodeVo);
+ RespR operatorSendCode(OperatorSendCodeVo operatorSendCodeVo, CustomerRec customerRec);
 
-    RespR operatorValidCode(OperatorSendCodeVo operatorSendCodeVo);
+ RespR operatorValidCode(OperatorSendCodeVo operatorSendCodeVo, CustomerRec customerRec);
 
     IPage getCustomerCompanyManagerDetailPage(Page page, NoCarCompanyManger noCarCompanyManger);
 

+ 24 - 5
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarCompanyMangerOperImpl.java

@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jkcredit.invoice.common.CommonConst;
 import com.jkcredit.invoice.mapper.waybill.NoCarCompanyMangerMapper;
+import com.jkcredit.invoice.model.entity.customer.CustomerRec;
 import com.jkcredit.invoice.model.entity.waybill.NoCarCompanyManger;
 import com.jkcredit.invoice.model.vo.OperatorEditConfirmVo;
 import com.jkcredit.invoice.model.vo.OperatorEditVo;
@@ -129,21 +130,39 @@ public class NoCarCompanyMangerOperImpl extends ServiceImpl<NoCarCompanyMangerMa
     }
 
     @Override
-    public RespR operatorSendCode(OperatorSendCodeVo operatorSendCodeVo) {
+    public RespR operatorSendCode(OperatorSendCodeVo operatorSendCodeVo, CustomerRec customerRec) {
+        NoCarCompanyManger noCarCompanyManger = new NoCarCompanyManger();
+        noCarCompanyManger.setCompanyNum(customerRec.getCompanyNum());
+        QueryWrapper<NoCarCompanyManger> queryWrapper = new QueryWrapper<>();
+        queryWrapper.select("operator_mobile").eq("company_num", noCarCompanyManger.getCompanyNum());
+        NoCarCompanyManger noCarCompanyMangerDb = noCarCompanyMangerMapper.selectOne(queryWrapper);
+        if (noCarCompanyMangerDb == null) {
+            return new RespR(false, "未上传开票经办人,请联系管理员上传");
+        }
+
         OperatorSendCodeRequest operatorSendCodeRequest = new OperatorSendCodeRequest();
         operatorSendCodeRequest.setBuyerCode(operatorSendCodeVo.getBuyerCode());
         String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();
         operatorSendCodeRequest.setCompanyNum(companyNum);
         RespR respR = noCarInterface.operatorSendCode(operatorSendCodeRequest);
-        if(respR.getCode()==1){
-            return new RespR(false,respR.getMsg());
-        }else {
+        if (respR.getCode() == 1) {
+            return new RespR(false, respR.getMsg());
+        } else {
             return new RespR("success");
         }
     }
 
     @Override
-    public RespR operatorValidCode(OperatorSendCodeVo operatorSendCodeVo) {
+    public RespR operatorValidCode(OperatorSendCodeVo operatorSendCodeVo, CustomerRec customerRec) {
+        NoCarCompanyManger noCarCompanyManger = new NoCarCompanyManger();
+        noCarCompanyManger.setCompanyNum(customerRec.getCompanyNum());
+        QueryWrapper<NoCarCompanyManger> queryWrapper = new QueryWrapper<>();
+        queryWrapper.select("operator_mobile").eq("company_num", noCarCompanyManger.getCompanyNum());
+        NoCarCompanyManger noCarCompanyMangerDb = noCarCompanyMangerMapper.selectOne(queryWrapper);
+        if (noCarCompanyMangerDb == null) {
+            return new RespR(false, "未上传开票经办人,请联系管理员上传");
+        }
+
         OperatorValidCodeRequest operatorValidCodeRequest = new OperatorValidCodeRequest();
         operatorValidCodeRequest.setBuyerCode(operatorSendCodeVo.getBuyerCode());
         String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();

+ 10 - 0
src/main/java/com/jkcredit/invoice/util/DateUtil.java

@@ -150,6 +150,16 @@ public class DateUtil {
         return dateTime.toString(format1);
     }
 
+
+    public static String tLocalDateTimeToString(LocalDateTime time) {
+        //转换后格式
+        java.time.format.DateTimeFormatter outputFormatter = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
+        //将传入时间按照format格式转换为DateTime类型
+        String dateTime = time.format(outputFormatter);
+        //转换为format1字符串类型
+        return dateTime;
+    }
+
     /**
      * 判断time是否在now的n天之内
      *

+ 5 - 4
src/main/java/com/jkcredit/invoice/util/QueryDemoTest_opera.java

@@ -6,7 +6,6 @@ import org.apache.commons.httpclient.NameValuePair;
 import org.apache.commons.httpclient.methods.PostMethod;
 
 import java.io.BufferedReader;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -96,7 +95,7 @@ public class QueryDemoTest_opera {
          */
         JSONObject paramJsonObj = new JSONObject();
         //CMCC_MOBILE_CHECK_V8//CMCC_3RD_V2//CMCC_3RD_DETAIL_V1//
-        paramJsonObj.put("api", "COMPANY_COMPANYDETAILADD");
+        paramJsonObj.put("api", "WAYBILL_OPERATORVALIDCODE");
         paramJsonObj.put("appKey", APP_KEY);
         paramJsonObj.put("appSecret", APP_SECRET);
 
@@ -114,12 +113,14 @@ public class QueryDemoTest_opera {
          * 具体业务参数放在data中
          */
         JSONObject dataJson = new JSONObject();
-        dataJson.put("taxplayerCode", "91110105MA01BCJJ8U");
+        dataJson.put("taxplayerCode", "91111205MA01BCJJ8U");
+        dataJson.put("validCode", "122222");
+
         dataJson.put("operatorName", "张三");
         dataJson.put("operatorMobile", "19910751229");
         dataJson.put("identificationId", "410327199311279656");
         dataJson.put("contractFileName", "测试msy.pdf");
-        dataJson.put("base64Str", Base64Util.getPdfBinary(new File("/Users/mashengyi/Downloads/b10852e4-430a-4222-b088-41f12d41b941.pdf")));
+        //dataJson.put("base64Str", Base64Util.getPdfBinary(new File("/Users/mashengyi/Downloads/b10852e4-430a-4222-b088-41f12d41b941.pdf")));
 
         return dataJson;
     }

+ 18 - 12
src/main/resources/mapper/invoice/hcInvoiceMapper.xml

@@ -29,7 +29,10 @@
         invoiceCode,
         invoiceNum,
         invoiceUrl,
-        yearMonth
+        yearMonth,
+        totalTaxAmount,
+        taxRate,
+        invoiceMakeTime
     </sql>
 
     <select id="selectAllByPage" resultMap="BaseResultMap">
@@ -54,17 +57,20 @@
     <insert id="insertHcInvoice" parameterType="com.jkcredit.invoice.model.entity.invoice.HcInvoice">
         INSERT INTO t_hcinvoice (<include refid="baseSql"></include>)
          VALUES (   #{sellerName,jdbcType=VARCHAR},
-                    #{sellerTaxpayerCode,jdbcType=VARCHAR},
-                    #{buyerName,jdbcType=VARCHAR},
-                    #{buyerTaxpayerCode,jdbcType=VARCHAR},
-                    #{amount,jdbcType=INTEGER},
-                    #{rawInvoiceId,jdbcType=VARCHAR},
-                    #{rawInvoiceCode,jdbcType=VARCHAR},
-                    #{rawInvoiceNum,jdbcType=VARCHAR},
-                    #{invoiceCode,jdbcType=VARCHAR},
-                    #{invoiceNum,jdbcType=VARCHAR},
-                    #{invoiceUrl,jdbcType=VARCHAR},
-                    #{yearMonth,jdbcType=VARCHAR}
+        #{sellerTaxpayerCode,jdbcType=VARCHAR},
+        #{buyerName,jdbcType=VARCHAR},
+        #{buyerTaxpayerCode,jdbcType=VARCHAR},
+        #{amount,jdbcType=INTEGER},
+        #{rawInvoiceId,jdbcType=VARCHAR},
+        #{rawInvoiceCode,jdbcType=VARCHAR},
+        #{rawInvoiceNum,jdbcType=VARCHAR},
+        #{invoiceCode,jdbcType=VARCHAR},
+        #{invoiceNum,jdbcType=VARCHAR},
+        #{invoiceUrl,jdbcType=VARCHAR},
+        #{yearMonth,jdbcType=VARCHAR},
+        #{totalTaxAmount,jdbcType=VARCHAR},
+        #{taxRate,jdbcType=VARCHAR},
+        #{invoiceMakeTime,jdbcType=VARCHAR}
         )
     </insert>
     <delete id="deleteByMounth" parameterType="java.lang.String">