Browse Source

上传原始运单

Administrator 1 year ago
parent
commit
9aeefd1bd7

BIN
lib/sdk-b2b-protocol-1.5.3.jar


BIN
lib/sdk-b2b-protocol-1.5.4.jar


BIN
lib/sdk-common-1.0.jar


BIN
lib/sdk-waybill-protocol-1.4.jar


+ 7 - 7
pom.xml

@@ -291,28 +291,28 @@
         </dependency>-->
 
         <dependency>
-            <groupId>sdk-common-1.0</groupId>
+            <groupId>sdk-common-2.0</groupId>
             <artifactId>sdk</artifactId>
             <scope>system</scope>
-            <version>1.0</version>
-            <systemPath>${project.basedir}/lib/sdk-common-1.0.jar</systemPath>
+            <version>2.0</version>
+            <systemPath>${project.basedir}/lib/sdk-common-2.0.jar</systemPath>
         </dependency>
 
         <!--无车-->
         <dependency>
-            <groupId>sdk-waybill-protocol-1.4</groupId>
+            <groupId>sdk-waybill-protocol-1.5</groupId>
             <artifactId>sdk</artifactId>
             <scope>system</scope>
             <version>1.0</version>
-            <systemPath>${project.basedir}/lib/sdk-waybill-protocol-1.4.jar</systemPath>
+            <systemPath>${project.basedir}/lib/sdk-waybill-protocol-1.5.jar</systemPath>
         </dependency>
         <!--有车-->
         <dependency>
-            <groupId>sdk-b2b-protocol-1.5.3</groupId>
+            <groupId>sdk-b2b-protocol-1.5.4</groupId>
             <artifactId>sdk</artifactId>
             <scope>system</scope>
             <version>1.0</version>
-            <systemPath>${project.basedir}/lib/sdk-b2b-protocol-1.5.3.jar</systemPath>
+            <systemPath>${project.basedir}/lib/sdk-b2b-protocol-1.5.4.jar</systemPath>
         </dependency>
         <!--调用第三方的依赖包-->
         <dependency>

+ 9 - 1
src/main/java/com/jkcredit/invoice/controller/business/CustomerController.java

@@ -294,7 +294,15 @@ public class CustomerController {
         }
         return customerService.contractAdd(customerRec);
     }
-
+    @PostMapping("/promiseAdd")
+    @ApiOperation(value = "承诺协议上传确认", notes = "承诺协议上传确认")
+    @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
+    public RespR promiseAdd(@RequestBody CustomerRec customerRec) {
+        if (!checkHasAuthRole.checkMessage(customerRec.getCompanyNum(),customerRec.getPromiseFileName(),customerRec.getPromiseBase64Str())){
+            return new RespR(false, "协议上传确认失败,请查看数据是否维护准确");
+        }
+        return customerService.promiseAdd(customerRec);
+    }
     @PostMapping("/contractStatusFail")
     @ApiOperation(value = "协议上传失败状态确认", notes = "协议上传失败状态确认")
     @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)

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

@@ -126,6 +126,7 @@ public class SimpleCoreFilter implements Filter {
             "/customer/customRecharge",
             "/customer/customeRec",
             "/customer/contractAdd",
+            "/customer/promiseAdd",
             "/customer/contractDownload",
             "/customer/generateWord",
             "/customer/findCustomerRecTimeList",

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

@@ -109,6 +109,7 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
             String buyerAddr = jsonObject.getString("buyerAddr");
             //购方电话
             String buyerTel = jsonObject.getString("buyerTel");
+            String mail = jsonObject.getString("mail"); // 下游添加邮箱字段 非必传
             //购方开户行
             String buyerBank = jsonObject.getString("buyerBank");
             //购方银行账号
@@ -135,7 +136,7 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
                 return result;
             }
 
-            CustomerRec customerRec = getCustomerRec(interType, name, taxpayerCode, customerName, cust, companyType, operatingRangeType, contact, tel, buyerAddr, buyerTel, buyerBank, buyerBankAccount);
+            CustomerRec customerRec = getCustomerRec(interType, name, taxpayerCode, customerName, cust, companyType, operatingRangeType, contact, tel, buyerAddr, buyerTel, buyerBank, buyerBankAccount,mail);
 
             return getDataResult(data, costtimestart, result, customerRec);
         } catch (Exception e) {
@@ -184,7 +185,7 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
         }
     }
 
-    private CustomerRec getCustomerRec(Integer interType, String name, String taxpayerCode, String customerName, Customer cust, Integer companyType, Integer operatingRangeType, String contact, String tel, String buyerAddr, String buyerTel, String buyerBank, String buyerBankAccount) {
+    private CustomerRec getCustomerRec(Integer interType, String name, String taxpayerCode, String customerName, Customer cust, Integer companyType, Integer operatingRangeType, String contact, String tel, String buyerAddr, String buyerTel, String buyerBank, String buyerBankAccount,String mail) {
         CustomerRec customerRec = new CustomerRec();
         //客户名称
         customerRec.setCustomerName(customerName);
@@ -204,6 +205,7 @@ public class CustomerInterLowerServiceImpl implements CustomerInterLowerService
         customerRec.setCompanyAdress(buyerAddr);
         //公司电话
         customerRec.setCompanyPhone(buyerTel);
+        customerRec.setInvoiceMail(mail);
         //0-接口 1-平台
         customerRec.setInterType(interType);
         //业务类型 0 -自有车 1-外协车 2-无车

+ 2 - 0
src/main/java/com/jkcredit/invoice/mapper/customer/CustomerRecMapper.java

@@ -172,6 +172,8 @@ public interface CustomerRecMapper extends BaseMapper<CustomerRec> {
      */
     int updateByPrimaryKey(CustomerRec record);
 
+    int updatePromiseInfo(CustomerRec record);
+
     /**
      * 分页查询下企业备案信息
      * @param page

+ 54 - 1
src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerRec.java

@@ -70,6 +70,10 @@ public class CustomerRec {
     private String companyAdress;
 
     /**
+     * 公司邮箱
+     */
+    private String invoiceMail;
+    /**
      * 公司电话
      */
     @NotNull(message = "公司电话不能为空")
@@ -177,9 +181,18 @@ public class CustomerRec {
      * 企业注册失败原因
      */
     private String fileMessage;
-
+    //承诺书文件名
+    private String promiseFileName;
+    //承诺书base64码
+    private String promiseBase64Str;
+    //承诺书状态 1-未上传 2-上传失败 3-上传成功
+    private String promiseFileStatus;
 
     /**
+     * 协议码
+     */
+    private String promiseNum;
+    /**
      * 协议上传状态
      * 1、协议上传失败
      * 2、协议上传成功,审批中
@@ -436,6 +449,46 @@ public class CustomerRec {
         this.contractStatus = contractStatus;
     }
 
+    public String getInvoiceMail() {
+        return invoiceMail;
+    }
+
+    public void setInvoiceMail(String invoiceMail) {
+        this.invoiceMail = invoiceMail;
+    }
+
+    public String getPromiseFileName() {
+        return promiseFileName;
+    }
+
+    public void setPromiseFileName(String promiseFileName) {
+        this.promiseFileName = promiseFileName;
+    }
+
+    public String getPromiseBase64Str() {
+        return promiseBase64Str;
+    }
+
+    public void setPromiseBase64Str(String promiseBase64Str) {
+        this.promiseBase64Str = promiseBase64Str;
+    }
+
+    public String getPromiseFileStatus() {
+        return promiseFileStatus;
+    }
+
+    public void setPromiseFileStatus(String promiseFileStatus) {
+        this.promiseFileStatus = promiseFileStatus;
+    }
+
+    public String getPromiseNum() {
+        return promiseNum;
+    }
+
+    public void setPromiseNum(String promiseNum) {
+        this.promiseNum = promiseNum;
+    }
+
     @Override
     public String toString() {
         return "CustomerRec{" +

+ 7 - 1
src/main/java/com/jkcredit/invoice/service/customer/CustomerService.java

@@ -71,8 +71,14 @@ public interface CustomerService extends IService<Customer> {
      * @return
      */
     RespR contractAdd(CustomerRec customerRec);
-
     /**
+     * 承诺协议上传
+     *
+     * @param customerRec
+     * @return
+     */
+    RespR promiseAdd(CustomerRec customerRec);
+      /**
      * 协议下载
      *
      * @param id

+ 24 - 0
src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerServiceImpl.java

@@ -129,6 +129,30 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
 
     }
 
+    @Override
+    public RespR promiseAdd(CustomerRec customerRec) {
+        log.info("开始上传承诺协议:CustomerServiceImpl.promiseAdd{}", customerRec);
+        if (customerRec.getRecStatus().intValue() == REC_STATUS_UN) {
+            return new RespR(false, "无法上传承诺协议,未注册");
+        }
+        ConfirmContractAddRequest b2bContractAddRequest = new ConfirmContractAddRequest();
+        b2bContractAddRequest.setCompanyNum(customerRec.getCompanyNum());
+        b2bContractAddRequest.setContractFileName(customerRec.getPromiseFileName());
+        b2bContractAddRequest.setBase64Str(customerRec.getPromiseBase64Str());
+        RespR<ConfirmContractAddResponse> responseRespR = commInterFace.promiseAdd(b2bContractAddRequest);
+        if (responseRespR.getCode() == 1) {
+            log.info("传承协议上传失败:CustomerServiceImpl.promiseAdd{}---msg{}", customerRec, responseRespR.getMsg());
+            customerRec.setPromiseFileStatus("2");
+            customerRecMapper.updatePromiseInfo(customerRec);
+            return new RespR(false,responseRespR.getMsg());
+        }else{
+            log.info("传承协议上传成功:CustomerServiceImpl.promiseAdd");
+            customerRec.setPromiseFileStatus("3");
+            customerRec.setPromiseNum(responseRespR.getData().getContractNum());
+            customerRecMapper.updatePromiseInfo(customerRec);
+            return new RespR("传承协议上传成功");
+        }
+    }
 
     @Override
     public RespR contractStatusFail(CustomerRec customerRec) {

+ 73 - 21
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -4,23 +4,7 @@ import cn.com.taiji.sdk.model.comm.protocol.tts.vehicle.VehicleQueryRequest;
 import cn.com.taiji.sdk.model.comm.protocol.tts.vehicle.VehicleQueryResponse;
 import cn.com.taiji.sdk.model.comm.protocol.tts.vehicle.VehicleRegisterRequest;
 import cn.com.taiji.sdk.model.comm.protocol.tts.vehicle.VehicleRegisterResponse;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.InvoiceProcessingListModel;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillCountPageRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillCountQueryRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillCountQueryResponse;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillEndRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillEndResponse;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillHistoryEndRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillHistoryEndResponse;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillHistoryStartRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillHistoryStartResponse;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillInvoiceRedQueryModel;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillInvoiceRedQueryRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillInvoiceRedQueryResponse;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillNumFindInvoiceRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillNumFindInvoiceResponse;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillStartRequest;
-import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.WaybillStartResponse;
+import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jkcredit.invoice.common.CommonConstants;
@@ -303,6 +287,18 @@ public class NoCarServiceImpl implements NoCarService {
         if(StringUtils.isEmpty(waybillStartRequest.getBase64Str())){
             return new RespR(false,"未上传运单文件");
         }
+       if(noCarWayBillDb.getBillwayStatus() == 0){
+            RespR<WaybillOriginEndResponse> responseRespR1 = sendOrgWayBillInfo(noCarWayBill);
+            if(responseRespR1.getCode() == 1){
+                noCarWayBill.setFailReason(responseRespR1.getMsg());
+                insertOrUpdateBillStart(noCarWayBill);
+                return new RespR(false, responseRespR1.getMsg());
+            }else{
+                noCarWayBill.setBillwayStatus(1);
+                insertOrUpdateBillStart(noCarWayBill);
+            }
+            return responseRespR1;
+        }
         RespR<WaybillStartResponse> responseRespR = noCarInterface.waybillStart(waybillStartRequest);
         if (responseRespR.getCode() == 1) {
             log.info("运单上传失败:NoCarServiceImpl.noCarWaybillStart{},msg{}", noCarWayBill, responseRespR.getMsg());
@@ -311,8 +307,17 @@ public class NoCarServiceImpl implements NoCarService {
             insertOrUpdateBillStart(noCarWayBill);
             return new RespR(false, responseRespR.getMsg());
         } else {
-            noCarWayBill.setBillwayStatus(1);
+            noCarWayBill.setBillwayStatus(0);
             insertOrUpdateBillStart(noCarWayBill);
+            RespR<WaybillOriginEndResponse> responseRespR1 = sendOrgWayBillInfo(noCarWayBill);
+            if(responseRespR1.getCode() == 1){
+                noCarWayBill.setFailReason(responseRespR1.getMsg());
+                insertOrUpdateBillStart(noCarWayBill);
+                return new RespR(false, responseRespR1.getMsg());
+            }else{
+                noCarWayBill.setBillwayStatus(1);
+                insertOrUpdateBillStart(noCarWayBill);
+            }
         }
         return new RespR(responseRespR.getData());
     }
@@ -328,9 +333,7 @@ public class NoCarServiceImpl implements NoCarService {
         if (curr == null) {
             noCarWaybillMapper.insert(noCarWayBill);
         } else {
-            if (curr.getBillwayStatus() < 1) {
                 noCarWaybillMapper.updateByBillNum(noCarWayBill);
-            }
         }
     }
     @Autowired
@@ -552,6 +555,12 @@ public class NoCarServiceImpl implements NoCarService {
                         insertOrUpdateBillStart(noCarWayBill);
                         return new RespR(false, responseRespR.getMsg());
                     }
+                    RespR<WaybillOriginEndResponse> responseRespR1 = sendOrgWayBillInfo(noCarWayBillClone);
+                    if(responseRespR1.getCode() == 1){
+                        noCarWayBill.setFailReason(responseRespR1.getMsg());
+                        insertOrUpdateBillStart(noCarWayBill);
+                        return new RespR(false, responseRespR1.getMsg());
+                    }
                 } catch (CloneNotSupportedException e) {
                     e.printStackTrace();
                     noCarWayBill.setBillwayStatus(-2);
@@ -568,6 +577,18 @@ public class NoCarServiceImpl implements NoCarService {
             return new RespR(true);
         }else{
             WaybillHistoryStartRequest waybillHistoryStartRequest = buildNoCarHisWaybill(orgBillNum,noCarWayBill);
+            if(noCarWayBillDb.getBillwayStatus() == 0){
+                RespR<WaybillOriginEndResponse> responseRespR1 = sendOrgWayBillInfo(noCarWayBill);
+                if(responseRespR1.getCode() == 1){
+                    noCarWayBill.setFailReason(responseRespR1.getMsg());
+                    insertOrUpdateBillStart(noCarWayBill);
+                    return new RespR(false, responseRespR1.getMsg());
+                }else{
+                    noCarWayBill.setBillwayStatus(1);
+                    insertOrUpdateBillStart(noCarWayBill);
+                }
+                return responseRespR1;
+            }
             if(StringUtils.isEmpty(waybillHistoryStartRequest.getBase64Str())){
                 return new RespR(false,"运单文件未上传");
             }
@@ -582,13 +603,44 @@ public class NoCarServiceImpl implements NoCarService {
             } else {
                 noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
                 noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
-                noCarWayBill.setBillwayStatus(1);
+                noCarWayBill.setBillwayStatus(0);
                 insertOrUpdateBillStart(noCarWayBill);
+                RespR<WaybillOriginEndResponse> responseRespR1 = sendOrgWayBillInfo(noCarWayBill);
+                if(responseRespR1.getCode() == 1){
+                    noCarWayBill.setFailReason(responseRespR1.getMsg());
+                    insertOrUpdateBillStart(noCarWayBill);
+                    return new RespR(false, responseRespR1.getMsg());
+                }else{
+                    noCarWayBill.setBillwayStatus(1);
+                    insertOrUpdateBillStart(noCarWayBill);
+                }
             }
             return new RespR(responseRespR.getData());
         }
     }
+    public RespR<WaybillOriginEndResponse> sendOrgWayBillInfo(NoCarWayBill noCarWayBill){
+        WaybillOriginEndRequest waybillOriginEndRequest = new WaybillOriginEndRequest();
+        waybillOriginEndRequest.setCompanyNum(noCarWayBill.getCompanyNum());
+        waybillOriginEndRequest.setBase64Str(noCarWayBill.getBase64Str());
+        waybillOriginEndRequest.setWaybillFileName(noCarWayBill.getWaybillFileName());
+        if(noCarWayBill.getBase64Str() == null){
+            NoCarWayBillFileInfo noCarWayBillFileInfo =  wayBillFileMapper.selectFileInfo(noCarWayBill.getFileBatchNum(),noCarWayBill.getBillNum());
+            if(noCarWayBillFileInfo!=null){
+                waybillOriginEndRequest.setWaybillFileName(noCarWayBillFileInfo.getFileName());
+                waybillOriginEndRequest.setBase64Str(noCarWayBillFileInfo.getBase64Str());
+            }
 
+        }
+        waybillOriginEndRequest.setContractType(2);
+        RespR<WaybillOriginEndResponse> responseRespR = noCarInterface.waybillOrgEnd(waybillOriginEndRequest);
+        if(responseRespR.getCode() == 1){
+            responseRespR = noCarInterface.waybillOrgEnd(waybillOriginEndRequest);
+            if(responseRespR.getCode() == 1){
+                responseRespR = noCarInterface.waybillOrgEnd(waybillOriginEndRequest);
+            }
+        }
+        return responseRespR;
+    }
     public WaybillHistoryStartRequest buildNoCarHisWaybill(String orgBillNum,NoCarWayBill noCarWayBill) {
         WaybillHistoryStartRequest waybillStartRequest = new WaybillHistoryStartRequest();
         String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();

+ 8 - 0
src/main/java/com/jkcredit/invoice/service/upservice/CommInterFace.java

@@ -34,6 +34,14 @@ public interface CommInterFace {
     RespR<B2bContractAddResponse> b2bContractAdd(B2bContractAddRequest contractAddRequest);
 
     /**
+     * 承诺协议上传
+     *
+     * @param confirmContractAddRequest
+     * @return
+     */
+    RespR<ConfirmContractAddResponse> promiseAdd(ConfirmContractAddRequest confirmContractAddRequest);
+
+    /**
      * 协议查询
      *
      * @param b2bContractQueryRequest

+ 6 - 0
src/main/java/com/jkcredit/invoice/service/upservice/NoCarInterface.java

@@ -56,6 +56,12 @@ public interface NoCarInterface {
     RespR<WaybillHistoryStartResponse> waybillHistoryStart(WaybillHistoryStartRequest waybillHistoryStartRequest);
 
     /**
+     * 上传原始运单
+     * @param waybillOriginEndRequest
+     * @return
+     */
+    RespR<WaybillOriginEndResponse> waybillOrgEnd(WaybillOriginEndRequest waybillOriginEndRequest);
+    /**
      * 历史运单结束指令
      *
      * @param waybillHistoryEndRequest

+ 23 - 0
src/main/java/com/jkcredit/invoice/service/upservice/impl/CommInterFaceImpl.java

@@ -89,6 +89,29 @@ public class CommInterFaceImpl implements CommInterFace {
     }
 
     @Override
+    public RespR<ConfirmContractAddResponse> promiseAdd(ConfirmContractAddRequest confirmContractAddRequest) {
+        String fileName = confirmContractAddRequest.getFilename();
+        long startTime = System.currentTimeMillis();
+
+        try {
+            log.info("CommInterFaceImpl.promiseAdd上游请求参数,Filename:{},CompanyNum:{},responseFileName:{},cost={}ms", confirmContractAddRequest.getFilename(), confirmContractAddRequest.getCompanyNum(), confirmContractAddRequest.getContractFileName(), System.currentTimeMillis() - startTime);
+            //(4)指定协议的响应模型(IssuerUploadResponse),调用upload 发送数据
+            ConfirmContractAddResponse response = ETCCommHelper.upload(fileName, confirmContractAddRequest, ConfirmContractAddResponse.class);
+            log.info("CommInterFaceImpl.promiseAdd上游接口返回:{}   ,请求参数-Filename:{},CompanyNum:{},ContractFileName:{},cost={}ms", response.toString(), confirmContractAddRequest.getFilename(), confirmContractAddRequest.getCompanyNum(), confirmContractAddRequest.getContractFileName(), System.currentTimeMillis() - startTime);
+            log.info("conName" + response.getContractNum());
+            return new RespR<>(response);
+        } catch (IOException e) {
+            e.printStackTrace();
+            log.error("CommInterFaceImpl.promiseAdd:{} ,请求参数-Filename:{},CompanyNum:{},ContractFileName:{},cost={}ms", e.getMessage(), confirmContractAddRequest.getFilename(), confirmContractAddRequest.getCompanyNum(), confirmContractAddRequest.getContractFileName(), System.currentTimeMillis() - startTime);
+            return new RespR(false, "网络异常,请联系管理人员");
+        } catch (ApiRequestException apie) {
+            log.error("CommInterFaceImpl.promiseAdd:{} ,请求参数-Filename:{},CompanyNum:{},ContractFileName:{},cost={}ms", apie.getMessage().replaceAll("[\r\n]", ""), confirmContractAddRequest.getFilename(), confirmContractAddRequest.getCompanyNum(), confirmContractAddRequest.getContractFileName(), System.currentTimeMillis() - startTime);
+            apie.printStackTrace();
+            return new RespR(false, apie.getMessage());
+        }
+    }
+
+    @Override
     public RespR<B2bContractQueryResponse> b2bContractQuery(B2bContractQueryRequest b2bContractQueryRequest) {
         String fileName = b2bContractQueryRequest.getFilename();
         long startTime = System.currentTimeMillis();

+ 21 - 1
src/main/java/com/jkcredit/invoice/service/upservice/impl/NoCarInterfaceImpl.java

@@ -27,7 +27,7 @@ import com.jkcredit.invoice.util.RespR;
 import com.jkcredit.invoice.util.StringUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
-
+import cn.com.taiji.sdk.model.comm.protocol.tts.waybill.*;
 import java.io.IOException;
 
 /**
@@ -157,7 +157,27 @@ public class NoCarInterfaceImpl implements NoCarInterface {
             return new RespR(false, apie.getMessage());
         }
     }
+    @Override
+    public RespR<WaybillOriginEndResponse> waybillOrgEnd(WaybillOriginEndRequest waybillOriginEndRequest) {
+        String fileName = waybillOriginEndRequest.getFilename();
+        long startTime = System.currentTimeMillis();
+        try {
+            log.info("NoCarInterfaceImpl.waybillHistoryEnd请求参数:{}", waybillOriginEndRequest.toString());
+            //(4)指定协议的响应模型(IssuerUploadResponse),调用upload 发送数据
+            WaybillOriginEndResponse response = ETCCommHelper.upload(fileName, waybillOriginEndRequest, WaybillOriginEndResponse.class);
+            log.info("NoCarInterfaceImpl.waybillHistoryEnd上游接口返回:{},请求参数:{},cost={}ms", response.toString(), waybillOriginEndRequest.toString(), System.currentTimeMillis() - startTime);
 
+            return new RespR<>(response);
+        } catch (IOException e) {
+            log.error(e.getMessage() + " ,请求参数:" + waybillOriginEndRequest.toString() + " ,cost=" + (System.currentTimeMillis() - startTime) + "ms");
+            e.printStackTrace();
+            return new RespR(false, "网络异常,请联系管理人员");
+        } catch (ApiRequestException apie) {
+            log.error(apie.getMessage().replaceAll("[\r\n]", "") + " ,请求参数:" + waybillOriginEndRequest.toString() + " ,cost=" + (System.currentTimeMillis() - startTime) + "ms");
+            apie.printStackTrace();
+            return new RespR(false, apie.getMessage());
+        }
+    }
     @Override
     public RespR<WaybillHistoryEndResponse> waybillHistoryEnd(WaybillHistoryEndRequest waybillHistoryEndRequest) {
         String fileName = waybillHistoryEndRequest.getFilename();

+ 50 - 6
src/main/resources/mapper/customer/CustomerRecMapper.xml

@@ -30,6 +30,10 @@
     <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
     <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
     <result column="lowerBase64Str" property="lowerBase64Str" jdbcType="VARCHAR" />
+    <result column="invoiceMail" property="invoiceMail" jdbcType="VARCHAR" />
+    <result column="promiseFileName" property="promiseFileName" jdbcType="VARCHAR" />
+    <result column="promiseFileStatus" property="promiseFileStatus" jdbcType="VARCHAR" />
+    <result column="promiseNum" property="promiseNum" jdbcType="VARCHAR" />
   </resultMap>
 
 
@@ -61,7 +65,10 @@
     <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
     <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
     <result column="lowerBase64Str" property="lowerBase64Str" jdbcType="VARCHAR" />
-
+    <result column="invoiceMail" property="invoiceMail" jdbcType="VARCHAR" />
+    <result column="promiseFileName" property="promiseFileName" jdbcType="VARCHAR" />
+    <result column="promiseFileStatus" property="promiseFileStatus" jdbcType="VARCHAR" />
+    <result column="promiseNum" property="promiseNum" jdbcType="VARCHAR" />
   </resultMap>
   <resultMap id="BaseResultMapNoLocalBase64Str" type="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
     <id column="id" property="id" jdbcType="INTEGER" />
@@ -89,12 +96,16 @@
     <result column="contractSuc" property="contractSuc" jdbcType="INTEGER" />
     <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
     <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
+    <result column="invoiceMail" property="invoiceMail" jdbcType="VARCHAR" />
+    <result column="promiseFileName" property="promiseFileName" jdbcType="VARCHAR" />
+    <result column="promiseFileStatus" property="promiseFileStatus" jdbcType="VARCHAR" />
+    <result column="promiseNum" property="promiseNum" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     id, customerName,company_leader, company_leader_Phone, company_name, company_referenceNum, company_openbank,
     company_openbank_acc, company_adress, company_phone, createTime, company_belong_name, 
     rec_status, inter_type,bussiness_type,company_type,operating_rangeType,company_num,service_startTime
-    ,service_endTime,service_type,contractFileName,contractSuc,contrantNum,lowerFileName,fileMessage
+    ,service_endTime,service_type,contractFileName,contractSuc,contrantNum,lowerFileName,fileMessage,invoiceMail,promiseFileName,promiseFileStatus,promiseNum
   </sql>
 
   <select id="selectAllByPage" resultMap="BaseResultMap">
@@ -292,14 +303,14 @@
       company_openbank_acc, company_adress, company_phone, 
       createTime, company_belong_name, rec_status, 
       inter_type,bussiness_type,company_type,operating_rangeType,company_num,
-      service_startTime,service_endTime,service_type,contractFileName,base64Str,contractSuc,lowerFileName,lowerBase64Str
+      service_startTime,service_endTime,service_type,contractFileName,base64Str,contractSuc,lowerFileName,lowerBase64Str,invoiceMail
       )
     values (#{customerName,jdbcType=VARCHAR}, #{companyLeader,jdbcType=VARCHAR}, #{companyLeaderPhone,jdbcType=VARCHAR},
       #{companyName,jdbcType=VARCHAR}, #{companyReferencenum,jdbcType=VARCHAR}, #{companyOpenbank,jdbcType=VARCHAR}, 
       #{companyOpenbankAcc,jdbcType=VARCHAR}, #{companyAdress,jdbcType=VARCHAR}, #{companyPhone,jdbcType=VARCHAR}, 
       #{createtime,jdbcType=TIMESTAMP}, #{companyBelongName,jdbcType=VARCHAR}, #{recStatus,jdbcType=INTEGER}, 
       #{interType,jdbcType=INTEGER}, #{bussinessType,jdbcType=INTEGER},#{companyType,jdbcType=INTEGER},#{operatingRangeType,jdbcType=INTEGER},#{companyNum,jdbcType=VARCHAR},
-      #{serviceStartTime,jdbcType=VARCHAR},#{serviceEndTime,jdbcType=VARCHAR},#{serviceType,jdbcType=INTEGER},#{contractFileName,jdbcType=VARCHAR},#{base64Str,jdbcType=VARCHAR},#{contractSuc,jdbcType=INTEGER},#{lowerFileName,jdbcType=VARCHAR},#{lowerBase64Str,jdbcType=VARCHAR}
+      #{serviceStartTime,jdbcType=VARCHAR},#{serviceEndTime,jdbcType=VARCHAR},#{serviceType,jdbcType=INTEGER},#{contractFileName,jdbcType=VARCHAR},#{base64Str,jdbcType=VARCHAR},#{contractSuc,jdbcType=INTEGER},#{lowerFileName,jdbcType=VARCHAR},#{lowerBase64Str,jdbcType=VARCHAR},#{invoiceMail,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
@@ -344,6 +355,9 @@
       <if test="interType != null" >
         inter_type,
       </if>
+      <if test="invoiceMail !=null">
+        invoiceMail
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
@@ -385,6 +399,9 @@
       <if test="interType != null" >
         #{interType,jdbcType=INTEGER},
       </if>
+      <if test="invoiceMail !=null">
+        #{invoiceMail,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
@@ -468,10 +485,32 @@
       <if test="fileMessage != null" >
         fileMessage = #{fileMessage,jdbcType=VARCHAR},
       </if>
+      <if test="invoiceMail !=null">
+        invoiceMail = #{invoiceMail,jdbcType=VARCHAR},
+      </if>
     </set>
     where  company_name = BINARY #{companyName,jdbcType=VARCHAR} and  bussiness_type = #{bussinessType,jdbcType=INTEGER} and company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR}
   </update>
 
+  <update id="updatePromiseInfo" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec">
+    update t_customer_rec
+    <set >
+    <if test="promiseFileName != null and promiseFileName != ''" >
+      promiseFileName = #{promiseFileName,jdbcType=VARCHAR},
+    </if>
+      <if test="promiseBase64Str != null and promiseBase64Str != ''" >
+        promiseBase64Str = #{promiseBase64Str,jdbcType=VARCHAR},
+      </if>
+      <if test="promiseFileStatus != null and promiseFileStatus != ''" >
+        promiseFileStatus = #{promiseFileStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="promiseNum != null and promiseNum != ''" >
+        promiseNum = #{promiseNum,jdbcType=VARCHAR},
+      </if>
+    </set>
+     where  id = BINARY #{id,jdbcType=BIGINT}
+  </update>
+
 
 
 
@@ -571,6 +610,9 @@
       <if test="fileMessage != null" >
         fileMessage = #{fileMessage,jdbcType=VARCHAR},
       </if>
+      <if test="invoiceMail !=null">
+        invoiceMail = #{invoiceMail,jdbcType=VARCHAR},
+      </if>
     </set>
     where  id = BINARY #{id,jdbcType=BIGINT}
   </update>
@@ -598,7 +640,8 @@
   contractFileName = #{contractFileName,jdbcType=VARCHAR},
   base64Str = #{base64Str,jdbcType=VARCHAR},
   contractSuc = #{contractSuc,jdbcType=INTEGER},
-  contrantNum = #{contrantNum,jdbcType=VARCHAR}
+  contrantNum = #{contrantNum,jdbcType=VARCHAR},
+  invoiceMail = #{invoiceMail,jdbcType=VARCHAR}
   where id = #{id,jdbcType=INTEGER}
 </update>
   <update id="updateByCompany" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
@@ -625,7 +668,8 @@
     contractFileName = #{contractFileName,jdbcType=VARCHAR},
     base64Str = #{base64Str,jdbcType=VARCHAR},
     contractSuc = #{contractSuc,jdbcType=INTEGER},
-    contrantNum = #{contrantNum,jdbcType=VARCHAR}
+    contrantNum = #{contrantNum,jdbcType=VARCHAR},
+    invoiceMail = #{invoiceMail,jdbcType=VARCHAR}
     where  company_name = BINARY #{companyName,jdbcType=VARCHAR} and bussiness_type = #{bussinessType,jdbcType=INTEGER} and company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR}
   </update>
 </mapper>

+ 1 - 1
src/main/resources/mapper/waybill/NoCarWaybillMapper.xml

@@ -216,7 +216,7 @@
         destAddrPre = #{destAddrPre,jdbcType=VARCHAR},
         preEndTime = #{preEndTime,jdbcType=VARCHAR},
         splitFlag = #{splitFlag,jdbcType=INTEGER}
-        where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
+        where  billNum = BINARY #{billNum,jdbcType=VARCHAR} and billwayStatus &lt;= #{billwayStatus,jdbcType=INTEGER}
     </update>
     <update id="updateByBillNumTimeRes" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >
         update t_waybill_no