Просмотр исходного кода

无车优化,自有车接口返回

Administrator 3 лет назад
Родитель
Сommit
8e67f82463

+ 25 - 88
src/main/java/com/jkcredit/invoice/credit/custInterface/NoCarInterServiceImpl.java

@@ -92,6 +92,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || StringUtils.isEmpty(plateColor)
 
             ){
+                result.setMsg("必传参数有空值");
                 return  result;
             }
 
@@ -177,6 +178,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || StringUtils.isEmpty(plateColor)
 
             ){
+                result.setMsg("必传参数有空值");
                 return  result;
             }
 
@@ -232,7 +234,6 @@ public class NoCarInterServiceImpl implements NoCarInterService {
      * @return
      */
     @Override
-    @Transactional(isolation= Isolation.READ_COMMITTED)
     public DataResult noCarBillStart(String appKey, String api, String data,String requestid) {
 
         long costtimestart = System.currentTimeMillis();
@@ -270,6 +271,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || StringUtils.isEmpty(taxplayerCode)
 
             ){
+                result.setMsg("必传参数有空值");
                 return  result;
             }
             CustomerRec customerRec = new CustomerRec();
@@ -300,19 +302,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarWayBill.setTaxplayerCode(taxplayerCode);
             noCarWayBill.setHisFlag(0);
             noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
-            NoCarWayBill noCarWayBillDb =null ;
-            try {
-                noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
-            }catch (Exception e){
-                log.info("xuyaoshanchuyundan:"+num);
-                result.setMsg("平台运单号存在多条,请联系管理员删除无效运单");
-                return result;
-            }
-            if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 1||noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)) {
-                log.info("chongfuyundanhao:"+noCarWayBillDb.getBillNum());
-                result.setMsg("运单号重复");
-                return result;
-            }
+
             List<CustomerCarRec> customerCarRecs = new ArrayList<>();
             CustomerCarRec customerCarRec = new CustomerCarRec();
             customerCarRec.setCompanyName(noCarWayBill.getCompanyName());
@@ -324,7 +314,6 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             customerCarRec.setBusinessType("2");
             customerCarRec.setServiceOperation(1);//默认运营车辆
             noCarWayBill.setTitleType(2);
-            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
             noCarWayBill.setInterType(0);//接口
 
             //先查询上游是否已经备案
@@ -335,12 +324,12 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                 if(respR.getCode() ==1){
                     noCarWayBill.setFailReason(respR.getMsg());
                     noCarWayBill.setBillwayStatus(-2);
-                    insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                    insertOrUpdateBillStart(noCarWayBill);
                     result.setMsg("车牌号备案失败,失败原因:"+respR.getMsg());
                     return result;
                 }
             }
-            RespR rs = noCarService.noCarWaybillStart(noCarWayBill,noCarWayBillDb);
+            RespR rs = noCarService.noCarWaybillStart(noCarWayBill);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarBillStart-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
@@ -354,9 +343,6 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                 result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
-                noCarWayBill.setFailReason(rs.getMsg());
-                noCarWayBill.setBillwayStatus(-2);
-                insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
                 return result;
             }
         } catch (Exception e) {
@@ -398,35 +384,17 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || StringUtils.isEmpty(endTime)
 
             ){
+                result.setMsg("必传参数有空值");
                 return  result;
             }
-
-
-            NoCarWayBill noCarWayBill1 =null ;
-            try {
-                noCarWayBill1 = noCarWaybillMapper.selectByBillNum(num);
-            }catch (Exception e){
-                log.info("xuyaoshanchuyundan:"+num);
-                result.setMsg("平台运单号存在多条,请联系管理员删除无效运单");
-                return result;
-            }
-            if (null == noCarWayBill1){
-                log.info("chongfuyundanhao1:"+num);
-                result.setMsg("运单开始指令还未上传!");
-                return result;
-            }
-
-
             NoCarWayBill noCarWayBill = new NoCarWayBill();
+            noCarWayBill.setCustomerName(appKey);
             noCarWayBill.setBillNum(num);
             noCarWayBill.setDestAddr(realDestAddr);
             noCarWayBill.setPredictEndTime(DateUtil.getDistanceHoursFormat(endTime));
-            noCarWayBill.setStartTime(noCarWayBill1.getStartTime());
-            noCarWayBill.setHisFlag(noCarWayBill1.getHisFlag());
+            noCarWayBill.setHisFlag(0);
             noCarWayBill.setInterType(0);//接口
-            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
-            noCarWayBill.setInterfaceEndTime(DateUtil.getCurrentDateStr());
-            RespR rs = noCarService.noCarWaybillEnd(noCarWayBill,noCarWayBill1);
+            RespR rs = noCarService.noCarWaybillEnd(noCarWayBill);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarBillEnd-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
@@ -460,7 +428,6 @@ public class NoCarInterServiceImpl implements NoCarInterService {
      * @return
      */
     @Override
-    @Transactional(isolation= Isolation.READ_COMMITTED)
     public DataResult noCarHisWaybillStart(String appKey, String api, String data,String requestid) {
 
         long costtimestart = System.currentTimeMillis();
@@ -498,6 +465,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || StringUtils.isEmpty(taxplayerCode)
 
             ){
+                result.setMsg("有空的必填运单要素,请检查");
                 return  result;
             }
 
@@ -528,19 +496,6 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
             noCarWayBill.setInterType(0);//接口
 
-            NoCarWayBill noCarWayBillDb =null ;
-            try {
-                noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
-            }catch (Exception e){
-                 log.info("xuyaoshanchuyundan:"+noCarWayBillDb.getBillNum());
-                result.setMsg("平台运单号存在多条,请联系管理员删除无效运单");
-                return result;
-            }
-            if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 1||noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)) {
-                log.info("chongfuyundanhao1:"+noCarWayBillDb.getBillNum());
-                result.setMsg("运单号重复");
-                return result;
-            }
             List<CustomerCarRec> customerCarRecs = new ArrayList<>();
             CustomerCarRec customerCarRec = new CustomerCarRec();
             customerCarRec.setCompanyName(noCarWayBill.getCompanyName());
@@ -561,11 +516,11 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     result.setMsg("车牌号备案失败,失败原因:"+respR.getMsg());
                     noCarWayBill.setFailReason(respR.getMsg());
                     noCarWayBill.setBillwayStatus(-2);
-                    insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                    insertOrUpdateBillStart(noCarWayBill);
                     return result;
                 }
             }
-            RespR rs = noCarService.noCarHisWaybillStart(noCarWayBill,noCarWayBillDb);
+            RespR rs = noCarService.noCarHisWaybillStart(noCarWayBill);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarHisWaybillStart-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
@@ -576,13 +531,9 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                 result.setMsg(rs.getData().toString());
                 return result;
             } else {
-
                 result.setData(3);
                 result.setCode(200);
                 result.setMsg(rs.getMsg());
-                noCarWayBill.setFailReason(rs.getMsg());
-                noCarWayBill.setBillwayStatus(-2);
-                insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
                 return result;
             }
         } catch (Exception e) {
@@ -593,13 +544,15 @@ public class NoCarInterServiceImpl implements NoCarInterService {
     }
 
     //插入或者更新运单
-    public void insertOrUpdateBill(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb){
-        NoCarWayBill noCarWayBillDb1 = noCarWaybillMapper.selectByBillNumforLock(noCarWayBill.getBillNum());
-        if(noCarWayBillDb1 == null){
+    public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill){
+        noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
+        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+        NoCarWayBill curr = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        if(curr == null){
             noCarWaybillMapper.insert(noCarWayBill);
         }else{
-            if(noCarWayBillDb1.getBillwayStatus()<0)
-            noCarWaybillMapper.updateByBillNum(noCarWayBill);
+            if(curr.getBillwayStatus()<1)
+                noCarWaybillMapper.updateByBillNum(noCarWayBill);
         }
     }
 
@@ -635,34 +588,17 @@ public class NoCarInterServiceImpl implements NoCarInterService {
                     || StringUtils.isEmpty(endTime)
 
             ){
+                result.setMsg("有空的必填运单要素,请检查");
                 return  result;
             }
-
-
-            NoCarWayBill noCarWayBill1 =null ;
-            try {
-                noCarWayBill1 = noCarWaybillMapper.selectByBillNum(num);
-            }catch (Exception e){
-                log.info("xuyaoshanchuyundan:"+num);
-                result.setMsg("平台运单号存在多条,请联系管理员删除无效运单");
-                return result;
-            }
-            if (null == noCarWayBill1){
-                result.setMsg("未上传开始运单");
-                return result;
-            }
-
-
             NoCarWayBill noCarWayBill = new NoCarWayBill();
             noCarWayBill.setBillNum(num);
             noCarWayBill.setDestAddr(realDestAddr);
             noCarWayBill.setPredictEndTime(DateUtil.getDistanceHoursFormat(endTime));
-            noCarWayBill.setStartTime(noCarWayBill1.getStartTime());
-            noCarWayBill.setHisFlag(noCarWayBill1.getHisFlag());
+            noCarWayBill.setHisFlag(1);
+            noCarWayBill.setCustomerName(appKey);
             noCarWayBill.setInterType(0);//接口
-            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
-            noCarWayBill.setInterfaceEndTime(DateUtil.getCurrentDateStr());
-            RespR rs = noCarService.noCarHisWaybillEnd(noCarWayBill,noCarWayBill1);
+            RespR rs = noCarService.noCarHisWaybillEnd(noCarWayBill);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarHisWaybillEnd-] result is "
                     + rs.toString() + ", request is " + data + " ,costtime="
@@ -714,6 +650,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             if(StringUtils.isEmpty(data)|| null == jsonObject || StringUtils.isEmpty(num)
 
             ){
+                result.setMsg("有空的必填运单要素,请检查");
                 return  result;
             }
 

+ 27 - 0
src/main/java/com/jkcredit/invoice/model/entity/waybill/NoCarWayBill.java

@@ -63,6 +63,15 @@ public class NoCarWayBill implements Cloneable{
      */
     private String predictEndTime;
 
+    /**
+     * 存储开始运单的目的地址,在结束运单上传后这个值才有意义,转储作用
+     */
+    private String destAddrPre;
+    /**
+     * 存储开始运单的结束时间,在结束运单上传后这个值才有意义,转储作用
+     */
+    private String preEndTime;
+
     @Excel(name = "运单预计完成时间",format="yyyy-MM-dd HH:mm:ss",databaseFormat = "yyyy-MM-dd HH:mm:ss")
     private Date predictEndTimeDate;
 
@@ -471,6 +480,22 @@ public class NoCarWayBill implements Cloneable{
         return (NoCarWayBill)super.clone();
     }
 
+    public String getDestAddrPre() {
+        return destAddrPre;
+    }
+
+    public void setDestAddrPre(String destAddrPre) {
+        this.destAddrPre = destAddrPre;
+    }
+
+    public String getPreEndTime() {
+        return preEndTime;
+    }
+
+    public void setPreEndTime(String preEndTime) {
+        this.preEndTime = preEndTime;
+    }
+
     @Override
     public String toString() {
         return "NoCarWayBill{" +
@@ -510,4 +535,6 @@ public class NoCarWayBill implements Cloneable{
                 ", endEnd='" + endEnd + '\'' +
                 '}';
     }
+
+
 }

+ 4 - 4
src/main/java/com/jkcredit/invoice/service/lowerService/NoCarService.java

@@ -38,25 +38,25 @@ public interface NoCarService {
      * 运单指令开始
      * @return
      */
-    RespR noCarWaybillStart(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb);
+    RespR noCarWaybillStart(NoCarWayBill noCarWayBill);
 
     /**
      * 运单指令结束
      * @return
      */
-    RespR noCarWaybillEnd(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb);
+    RespR noCarWaybillEnd(NoCarWayBill noCarWayBill);
 
     /**
      * 历史运单指令开始
      * @return
      */
-    RespR noCarHisWaybillStart(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb);
+    RespR noCarHisWaybillStart(NoCarWayBill noCarWayBill);
 
     /**
      * 历史运单指令结束
      * @return
      */
-    RespR noCarHisWaybillEnd(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb);
+    RespR noCarHisWaybillEnd(NoCarWayBill noCarWayBill);
 
     /**
      * 获取发票和运单状态 true 实时 false 走本地

+ 143 - 74
src/main/java/com/jkcredit/invoice/service/lowerService/impl/NoCarServiceImpl.java

@@ -220,10 +220,22 @@ public class NoCarServiceImpl implements NoCarService{
     }
 
     @Override
-    public RespR noCarWaybillStart(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb) {
+    public RespR noCarWaybillStart(NoCarWayBill noCarWayBill) {
         log.info("运单上传开始:NoCarServiceImpl.noCarWaybillStart{}",noCarWayBill);
+        NoCarWayBill noCarWayBillDb = null;
+        try {
+            noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        }catch (Exception e){
+            return new RespR(false,"有重复运单,请联系管理员删除");
+        }
+        if(noCarWayBillDb!=null && noCarWayBillDb.getBillwayStatus()>0){
+            return new   RespR(false,"开始指令已经上传成功");
+        }
         //如果运单时间和当前时间差了三天,直接返回
         if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),new Date())<-72){
+            noCarWayBill.setFailReason("失败,运单开始时间超72小时");
+            noCarWayBill.setBillwayStatus(-2);
+            insertOrUpdateBillStart(noCarWayBill);
             return new RespR(false,"失败,运单开始时间超72小时");
         }
        /* if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
@@ -233,28 +245,34 @@ public class NoCarServiceImpl implements NoCarService{
         RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
         if(respR.getCode() == 1){
             log.info("运单上传失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,respR.getMsg());
+            noCarWayBill.setFailReason(respR.getMsg());
+            noCarWayBill.setBillwayStatus(-2);
+            insertOrUpdateBillStart(noCarWayBill);
             return  respR;
         }
         WaybillStartRequest waybillStartRequest = buildWaybillStartRequest(noCarWayBill);
         RespR<WaybillStartResponse> responseRespR = noCarInterface.waybillStart(waybillStartRequest);
         if(responseRespR.getCode() == 1){
             log.info("运单上传失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,responseRespR.getMsg());
+            noCarWayBill.setFailReason(respR.getMsg());
+            noCarWayBill.setBillwayStatus(-2);
+            insertOrUpdateBillStart(noCarWayBill);
             return new RespR(false,responseRespR.getMsg());
         }else{
-            noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
-            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
-            noCarWayBill.setHisFlag(0);
             noCarWayBill.setBillwayStatus(1);
-            insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+            insertOrUpdateBillStart(noCarWayBill);
         }
         return new RespR(responseRespR.getData());
     }
     //插入或者更新运单
-    public void insertOrUpdateBill(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb){
-
-        if(noCarWaybillMapper.selectByBillNumforLock(noCarWayBill.getBillNum()) == null){
+    public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill){
+        noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
+        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+        NoCarWayBill curr = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        if(curr == null){
             noCarWaybillMapper.insert(noCarWayBill);
         }else{
+            if(curr.getBillwayStatus()<1)
             noCarWaybillMapper.updateByBillNum(noCarWayBill);
         }
     }
@@ -284,37 +302,58 @@ public class NoCarServiceImpl implements NoCarService{
         return waybillStartRequest;
     }
     public RespR checkCarWayBillAndSetInfo(NoCarWayBill noCarWayBill){
-        Customer customer = customerMapper.selectByCustomerName(noCarWayBill.getCustomerName());
-        if(customer==null || customer.getAccstatus() ==1){
-            return new RespR(false,"客户不存在或者已经停用");
-        }
-        CustomerRec customerRecParm = new CustomerRec();
-        customerRecParm.setCompanyName(noCarWayBill.getCompanyName());
-        customerRecParm.setCustomerName(noCarWayBill.getCustomerName());
-        CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecParm);
-        if(customerRec == null || customerRec.getRecStatus()!=1){
-            return new RespR(false,"客户未备案企业或运单编号与查询主体不符");
+        try {
+            Customer customer = customerMapper.selectByCustomerName(noCarWayBill.getCustomerName());
+            if(customer==null || customer.getAccstatus() ==1){
+                return new RespR(false,"客户不存在或者已经停用");
+            }
+            CustomerRec customerRecParm = new CustomerRec();
+            customerRecParm.setCompanyName(noCarWayBill.getCompanyName());
+            customerRecParm.setCustomerName(noCarWayBill.getCustomerName());
+            CustomerRec customerRec = customerRecMapper.selectByCustomerNameAndCompany(customerRecParm);
+            if(customerRec == null || customerRec.getRecStatus()!=1){
+                return new RespR(false,"客户未备案企业或运单编号与查询主体不符");
+            }
+            noCarWayBill.setCompanyNum(customerRec.getCompanyNum());
+            noCarWayBill.setCompanyAdress(customerRec.getCompanyAdress());
+            noCarWayBill.setCompanyTel(customerRec.getCompanyPhone());
+            noCarWayBill.setCompanyBank(customerRec.getCompanyOpenbank());
+            noCarWayBill.setCompanyBankAcc(customerRec.getCompanyOpenbankAcc());
+        }catch (Exception e){
+            e.printStackTrace();
+            log.info("运单企业信息设置错误{}",noCarWayBill);
+            return new RespR(false,"运单企业信息设置错误"+e.getMessage());
         }
-        noCarWayBill.setCompanyNum(customerRec.getCompanyNum());
-        noCarWayBill.setCompanyAdress(customerRec.getCompanyAdress());
-        noCarWayBill.setCompanyTel(customerRec.getCompanyPhone());
-        noCarWayBill.setCompanyBank(customerRec.getCompanyOpenbank());
-        noCarWayBill.setCompanyBankAcc(customerRec.getCompanyOpenbankAcc());
+
         return new RespR();
     }
     @Override
-    public RespR noCarWaybillEnd(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBill1) {
+    public RespR noCarWaybillEnd(NoCarWayBill noCarWayBill) {
         log.info("运单结束开始:NoCarServiceImpl.noCarWaybillEnd{}",noCarWayBill);
-        if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill1.getHisFlag() ==1 ){
-            log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
-            noCarWayBill.setFailReason((noCarWayBill1 == null?"":noCarWayBill1.getFailReason())+";当前运单状态无法结束,请检查当前指令状态");
-            noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
-            return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
+        NoCarWayBill noCarWayBillDb = null;
+        try {
+            noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        }catch (Exception e){
+            return new RespR(false,"有重复运单,请联系管理员删除");
         }
-        noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
-        noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
-        noCarWayBill1.setBatchNumEnd(noCarWayBill.getBatchNumEnd());
-        noCarWayBill1.setInterType(noCarWayBill.getInterType());
+        if(noCarWayBillDb == null){
+            try{
+                noCarWayBillDb = (NoCarWayBill)noCarWayBill.clone();
+            }catch (Exception e){
+                e.printStackTrace();
+                return new RespR(false,"系统异常,请重试");
+            }
+
+        }
+        if(noCarWayBillDb.getBillwayStatus() >1 ){
+            return new RespR(false,"运单已经结束或者是历史已结束运单,请联系管理员确认");
+        }
+        noCarWayBillDb.setPreEndTime(noCarWayBillDb.getPredictEndTime());
+        noCarWayBillDb.setDestAddrPre(noCarWayBillDb.getDestAddr());
+        noCarWayBillDb.setDestAddr(noCarWayBill.getDestAddr());
+        noCarWayBillDb.setPredictEndTime(noCarWayBill.getPredictEndTime());
+        noCarWayBillDb.setBatchNumEnd(noCarWayBill.getBatchNumEnd());
+        noCarWayBillDb.setInterType(noCarWayBill.getInterType());
         /*if((DateUtil.getDistanceHours(noCarWayBill1.getStartTime(),DateUtil.StringToDate(noCarWayBill1.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
             //noCarWayBill1.setBillwayStatus(4);
             noCarWayBill1.setFailReason("失败,承运时长超96小时");
@@ -326,38 +365,60 @@ public class NoCarServiceImpl implements NoCarService{
         WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
         String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();
         waybillEndRequest.setCompanyNum(companyNum);
-        waybillEndRequest.setNum(noCarWayBill1.getBillNum());
-        waybillEndRequest.setRealDestAddr(noCarWayBill1.getDestAddr());
-        waybillEndRequest.setEndTime(DateUtil.dateFormate(noCarWayBill1.getPredictEndTime()));
+        waybillEndRequest.setNum(noCarWayBillDb.getBillNum());
+        waybillEndRequest.setRealDestAddr(noCarWayBillDb.getDestAddr());
+        waybillEndRequest.setEndTime(DateUtil.dateFormate(noCarWayBillDb.getPredictEndTime()));
         RespR<WaybillEndResponse> waybillEndResponseRespR = noCarInterface.waybillEnd(waybillEndRequest);
         if(waybillEndResponseRespR.getCode() == 1){
             log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,waybillEndResponseRespR.getMsg());
-            noCarWayBill1.setBillwayStatus(-3);
-            noCarWayBill1.setFailReason(waybillEndResponseRespR.getMsg());
-            noCarWaybillMapper.updateByBillNum(noCarWayBill1);
+            noCarWayBillDb.setBillwayStatus(-3);
+            noCarWayBillDb.setFailReason(waybillEndResponseRespR.getMsg());
+            insertOrUpdateBillEnd(noCarWayBillDb);
             return new RespR(false,waybillEndResponseRespR.getMsg());
         }else if("4".equals(waybillEndResponseRespR.getData().getInfo())){
             log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"运单已经超时");
-            noCarWayBill1.setBillwayStatus(4);
-            noCarWayBill1.setFailReason(waybillEndResponseRespR.getMsg());
-            noCarWaybillMapper.updateByBillNum(noCarWayBill1);
+            noCarWayBillDb.setBillwayStatus(4);
+            noCarWayBillDb.setFailReason(waybillEndResponseRespR.getMsg());
+            insertOrUpdateBillEnd(noCarWayBillDb);
             return new RespR(false,"运单已经超时");
         }
-        noCarWayBill1.setInterfaceEndTime(DateUtil.getCurrentDateStr());
-        noCarWayBill1.setBillwayStatus(2);
-        noCarWayBill1.setUpdateTime(DateUtil.getCurrentDateStr());
-        noCarWaybillMapper.updateByBillNum(noCarWayBill1);
+        noCarWayBillDb.setInterfaceEndTime(DateUtil.getCurrentDateStr());
+        noCarWayBillDb.setBillwayStatus(2);
+        noCarWayBillDb.setUpdateTime(DateUtil.getCurrentDateStr());
+        insertOrUpdateBillEnd(noCarWayBillDb);
         return new RespR(waybillEndResponseRespR.getData());
     }
-
+    //插入或者更新运单
+    public void insertOrUpdateBillEnd(NoCarWayBill noCarWayBill){
+        noCarWayBill.setInterfaceEndTime(DateUtil.getCurrentDateStr());
+        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+        NoCarWayBill curr = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        if(curr == null){
+            noCarWaybillMapper.insert(noCarWayBill);
+        }else{
+            if(curr.getBillwayStatus()>1){
+                return;
+            }
+            noCarWaybillMapper.updateByBillNum(noCarWayBill);
+        }
+    }
     @Override
-    public RespR noCarHisWaybillStart(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBill1) {
+    public RespR noCarHisWaybillStart(NoCarWayBill noCarWayBill) {
         log.info("历史运单开始上传:NoCarServiceImpl.noCarHisWaybillStart{},msg{}",noCarWayBill,"开始");
-        if(noCarWayBill1!=null && noCarWayBill1.getBillwayStatus() ==1){
-            return new RespR(false,"运单号重复");
+        NoCarWayBill noCarWayBillDb = null;
+        try {
+            noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        }catch (Exception e){
+            return new RespR(false,"有重复运单,请联系管理员删除");
+        }
+        if(noCarWayBillDb!=null && noCarWayBillDb.getBillwayStatus()>0){
+            return new   RespR(false,"开始指令已经上传成功,请勿重复上传");
         }
         if(DateUtil.getDistanceDays(noCarWayBill.getStartTime(),new Date())>-20){
             log.info("历史运单开始上传失败:NoCarServiceImpl.noCarHisWaybillStart{},msg{}",noCarWayBill,"必须是二十天前的运单");
+            noCarWayBill.setBillwayStatus(-2);
+            noCarWayBill.setFailReason("失败,运单未满20天时效");
+            insertOrUpdateBillStart(noCarWayBill);
             return new RespR(false,"失败,运单未满20天时效");
         }
        /* if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
@@ -368,6 +429,9 @@ public class NoCarServiceImpl implements NoCarService{
         RespR respR = checkCarWayBillAndSetInfo(noCarWayBill);
         if(respR.getCode() == 1){
             log.info("历史运单开始上传失败:NoCarServiceImpl.noCarHisWaybillStart{},msg{}",noCarWayBill,respR.getMsg());
+            noCarWayBill.setBillwayStatus(-2);
+            noCarWayBill.setFailReason(respR.getMsg());
+            insertOrUpdateBillStart(noCarWayBill);
             return  respR;
         }
         WaybillHistoryStartRequest waybillHistoryStartRequest = BuildNoCarHisWaybill(noCarWayBill);
@@ -375,13 +439,15 @@ public class NoCarServiceImpl implements NoCarService{
 
         if(responseRespR.getCode() == 1){
             log.info("历史运单开始上传失败:NoCarServiceImpl.noCarHisWaybillStart{},msg{}",noCarWayBill,responseRespR.getMsg());
+            noCarWayBill.setBillwayStatus(-2);
+            noCarWayBill.setFailReason(responseRespR.getMsg());
+            insertOrUpdateBillStart(noCarWayBill);
             return new RespR(false,responseRespR.getMsg());
         }else{
             noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
             noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
-            noCarWayBill.setHisFlag(1);
             noCarWayBill.setBillwayStatus(1);
-            insertOrUpdateBill(noCarWayBill,noCarWayBill1);
+            insertOrUpdateBillStart(noCarWayBill);
         }
         return new RespR(responseRespR.getData());
     }
@@ -408,17 +474,22 @@ public class NoCarServiceImpl implements NoCarService{
         return waybillStartRequest;
     }
     @Override
-    public RespR noCarHisWaybillEnd(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBill1) {
+    public RespR noCarHisWaybillEnd(NoCarWayBill noCarWayBill) {
+        NoCarWayBill noCarWayBillDb = null;
+        try {
+            noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        }catch (Exception e){
+            return new RespR(false,"有重复运单,请联系管理员删除");
+        }
         log.info("历史运单结束上传:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill,"开始");
-        if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill.getHisFlag() ==0 || noCarWayBill1.getBillwayStatus() == -3 ){
-            log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
-            noCarWayBill.setFailReason((noCarWayBill1 == null?"":noCarWayBill1.getFailReason())+"当前运单状态无法结束,请检查当前指令状态");
-            noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
-            return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
+        if(noCarWayBillDb!=null && noCarWayBillDb.getBillwayStatus()>1){
+            return new RespR(false,"结束运单已经上传,无需再次上传");
         }
-        noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
-        noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
-        noCarWayBill1.setInterType(noCarWayBill.getInterType());
+        noCarWayBillDb.setPreEndTime(noCarWayBillDb.getPredictEndTime());
+        noCarWayBillDb.setDestAddrPre(noCarWayBillDb.getDestAddr());
+        noCarWayBillDb.setDestAddr(noCarWayBill.getDestAddr());
+        noCarWayBillDb.setPredictEndTime(noCarWayBill.getPredictEndTime());
+        noCarWayBillDb.setInterType(noCarWayBill.getInterType());
         /*if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
             log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill,"运单已经超时,请拆分");
             noCarWayBill.setFailReason("失败,承运时长超96小时");
@@ -428,27 +499,25 @@ public class NoCarServiceImpl implements NoCarService{
         WaybillHistoryEndRequest waybillEndRequest = new WaybillHistoryEndRequest();
         String companyNum = paramService.getParamsByParamName("REQUEST_COMPANY_NUM").getParamValue();
         waybillEndRequest.setCompanyNum(companyNum);
-        waybillEndRequest.setNum(noCarWayBill1.getBillNum());
-        waybillEndRequest.setRealDestAddr(noCarWayBill1.getDestAddr());
-        waybillEndRequest.setEndTime(DateUtil.dateFormate(noCarWayBill1.getPredictEndTime()));
+        waybillEndRequest.setNum(noCarWayBillDb.getBillNum());
+        waybillEndRequest.setRealDestAddr(noCarWayBillDb.getDestAddr());
+        waybillEndRequest.setEndTime(DateUtil.dateFormate(noCarWayBillDb.getPredictEndTime()));
         RespR<WaybillHistoryEndResponse> waybillEndResponseRespR = noCarInterface.waybillHistoryEnd(waybillEndRequest);
         if(waybillEndResponseRespR.getCode() == 1){
-            noCarWayBill1.setBillwayStatus(-3);
-            noCarWayBill1.setFailReason(waybillEndResponseRespR.getMsg());
-            noCarWaybillMapper.updateByBillNum(noCarWayBill1);
-            log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill1,waybillEndResponseRespR.getMsg());
+            noCarWayBillDb.setBillwayStatus(-3);
+            noCarWayBillDb.setFailReason(waybillEndResponseRespR.getMsg());
+            insertOrUpdateBillEnd(noCarWayBillDb);
+            log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBillDb,waybillEndResponseRespR.getMsg());
 
             return new RespR(false,waybillEndResponseRespR.getMsg());
         }else if("4".equals(waybillEndResponseRespR.getData().getInfo())){
             noCarWayBill.setBillwayStatus(4);
-            noCarWaybillMapper.updateByBillNum(noCarWayBill1);
-            log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill1,"运单已经超时,请拆分");
+            insertOrUpdateBillEnd(noCarWayBillDb);
+            log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBillDb,"运单已经超时,请拆分");
             return new RespR(false,"运单已经超时");
         }
-        noCarWayBill1.setInterfaceEndTime(DateUtil.getCurrentDateStr());
-        noCarWayBill1.setBillwayStatus(2);
-        noCarWayBill1.setUpdateTime(DateUtil.getCurrentDateStr());
-        noCarWaybillMapper.updateByBillNum(noCarWayBill1);
+        noCarWayBillDb.setBillwayStatus(2);
+        insertOrUpdateBillEnd(noCarWayBillDb);
         return new RespR(waybillEndResponseRespR.getData());
     }
     public WaybillNumFindInvoiceResponse buildInterFaceVoiceData(NoCarWayBill noCarWayBill,List<BillInvoice> billInvoices){

+ 19 - 30
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarBillWayServiceImpl.java

@@ -59,12 +59,15 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
         return noCarWaybillMapper.selectAllByPageException(page,noCarWayBill);
     }
     //插入或者更新运单
-    public void insertOrUpdateBill(NoCarWayBill noCarWayBill,NoCarWayBill noCarWayBillDb){
-
-        if(noCarWayBillDb == null){
+    public void insertOrUpdateBillStart(NoCarWayBill noCarWayBill){
+        noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
+        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+        NoCarWayBill curr = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
+        if(curr == null){
             noCarWaybillMapper.insert(noCarWayBill);
         }else{
-            noCarWaybillMapper.updateByBillNum(noCarWayBill);
+            if(curr.getBillwayStatus()<1)
+                noCarWaybillMapper.updateByBillNum(noCarWayBill);
         }
     }
     @Override
@@ -91,16 +94,12 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
                     noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
                     noCarWaybillMapperImprt.insertImport(noCarWayBill);
-                    NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
-                    if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 1||noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)){
-                        noCarWaybillMapperImprt.updateBillway(-2,"失败,运单号重复",noCarWayBill);
-                    }
                     customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
                     if(customerRec == null){
                         noCarWaybillMapperImprt.updateBillway(-2,"企业税号未备案",noCarWayBill);
                         noCarWayBill.setFailReason("企业税号未备案");
                         noCarWayBill.setBillwayStatus(-2);
-                        insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                        insertOrUpdateBillStart(noCarWayBill);
                         stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append("企业税号未备案#");
                         return;
                     }
@@ -110,7 +109,7 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                         noCarWaybillMapperImprt.updateBillway(-2,"失败,运单开始时间超72小时#",noCarWayBill);
                         noCarWayBill.setBillwayStatus(-2);
                         noCarWayBill.setFailReason("失败,运单开始时间超72小时");
-                        insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                        insertOrUpdateBillStart(noCarWayBill);
                         return;
 
                     }
@@ -148,7 +147,7 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                                 noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
                                 noCarWayBill.setBillwayStatus(-2);
                                 noCarWayBill.setFailReason(respR.getMsg());
-                                insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                                insertOrUpdateBillStart(noCarWayBill);
                                 return;
                             }
                         }
@@ -156,12 +155,9 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
 
 
                     //3.进行上传
-                    RespR respR = noCarService.noCarWaybillStart(noCarWayBill,noCarWayBillDb);
+                    RespR respR = noCarService.noCarWaybillStart(noCarWayBill);
                     if (respR.getCode() == 1){
                         noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
-                        noCarWayBill.setBillwayStatus(-2);
-                        noCarWayBill.setFailReason(respR.getMsg());
-                        insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
                         stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
                     }else{
                         noCarWaybillMapperImprt.updateBillway(1,"",noCarWayBill);
@@ -205,18 +201,12 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                         noCarWayBill.setHisFlag(1);
                         noCarWayBill.setCustomerName(customerName);
                         noCarWaybillMapperImprt.insertImport(noCarWayBill);
-                        NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
-                        if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)){
-                            noCarWaybillMapperImprt.updateBillway(-2,"失败,运单号重复",noCarWayBill);
-                        }else if(noCarWayBillDb!=null && noCarWayBillDb.getBillwayStatus()==1){
-                            noCarWayBill.setBillwayStatus(1);
-                        }
                         if(customerRec == null || customerRec.getRecStatus()!=1){
                             stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append("企业税号未备案#");
                             noCarWaybillMapperImprt.updateBillway(-2,"企业税号未备案#",noCarWayBill);
                             noCarWayBill.setBillwayStatus(-2);
                             noCarWayBill.setFailReason("企业税号未备案");
-                            insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                            insertOrUpdateBillStart(noCarWayBill);
                             return;
                         }
                         noCarWayBill.setCompanyName(customerRec.getCompanyName());
@@ -226,13 +216,13 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                             noCarWayBill.setBillwayStatus(-2);
                             noCarWayBill.setFailReason("失败,运单未满20天时效");
                             noCarWaybillMapperImprt.updateBillway(-2,"失败,运单未满20天时效#",noCarWayBill);
-                            insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                            insertOrUpdateBillStart(noCarWayBill);
                             return;
                         }
                         if(DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96){
                             noCarWayBill.setBillwayStatus(-2);
                             noCarWayBill.setFailReason("运单已经超时,请拆分");
-                            insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                            insertOrUpdateBillStart(noCarWayBill);
                             noCarWaybillMapperImprt.updateBillway(-2,"运单已经超时,请拆分#",noCarWayBill);
                             log.info("运单结束失败:NoCarServiceImpl.noCarWaybillStart{},msg{}",noCarWayBill,"运单已经超时,请拆分");
                             return;
@@ -260,7 +250,7 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                                     stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
                                     noCarWayBill.setBillwayStatus(-2);
                                     noCarWayBill.setFailReason(respR.getMsg());
-                                    insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                                    insertOrUpdateBillStart(noCarWayBill);
                                     return;
                                 }
                             }
@@ -276,18 +266,18 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                             noCarWayBillClo = noCarWayBill;
                         }
 
-                        RespR respR = noCarService.noCarHisWaybillStart(noCarWayBill,noCarWayBillDb);
+                        RespR respR = noCarService.noCarHisWaybillStart(noCarWayBill);
                         if (respR.getCode() == 1){
                             stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");
                             noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
                             noCarWayBill.setBillwayStatus(-2);
                             noCarWayBill.setFailReason(respR.getMsg());
-                            insertOrUpdateBill(noCarWayBill,noCarWayBillDb);
+                            insertOrUpdateBillStart(noCarWayBill);
                             log.info(noCarWayBill.getBillNum()+"#开始指令失败"+respR.getMsg());
                         }else{
                             log.info(noCarWayBill.getBillNum()+"#开始指令成功"+respR.getMsg());
                             //3.kais指令上传
-                            respR = noCarService.noCarHisWaybillEnd(noCarWayBillClo,noCarWayBill);
+                            respR = noCarService.noCarHisWaybillEnd(noCarWayBillClo);
 
                             if(respR.getCode() == 1){
                                 noCarWaybillMapperImprt.updateBillway(1,respR.getMsg(),noCarWayBill);
@@ -334,8 +324,7 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                         noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
                         noCarWayBill.setHisFlag(0);
                         noCarWaybillMapperImprt.insertImport(noCarWayBill);
-                        NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
-                        RespR respR = noCarService.noCarWaybillEnd(noCarWayBill,noCarWayBillDb);
+                        RespR respR = noCarService.noCarWaybillEnd(noCarWayBill);
                         if (respR.getCode() == 1){
                             noCarWaybillMapperImprt.updateBillway(-2,respR.getMsg(),noCarWayBill);
                             stringBuffer.append("#").append(noCarWayBill.getBillNum()).append(":").append(respR.getMsg()).append("#");

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

@@ -205,7 +205,9 @@
         companyTel = #{companyTel,jdbcType=VARCHAR},
         companyNum = #{companyNum,jdbcType=VARCHAR},
         failReason = #{failReason,jdbcType=VARCHAR},
-        interType = #{interType,jdbcType=INTEGER}
+        interType = #{interType,jdbcType=INTEGER},
+        destAddrPre = #{destAddrPre,jdbcType=VARCHAR},
+        preEndTime = #{preEndTime,jdbcType=VARCHAR}
         where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
     </update>
     <update id="updateByBillNumTimeRes" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >