소스 검색

后端代码提交

mashengyi 3 년 전
부모
커밋
2d9f65d122

+ 7 - 6
src/main/java/com/jkcredit/invoice/controller/localBussiness/NoCarController.java

@@ -192,17 +192,18 @@ public class NoCarController {
     @LoginRequired
     public RespR updateStatus(String noCarWayBillStr) {
         List<NoCarWayBill> noCarWayBills = JSON.parseArray(noCarWayBillStr,NoCarWayBill.class);
-        try {
+
             if(noCarWayBills!=null && noCarWayBills.size()>0){
                 noCarWayBills.stream().forEach(noCarWayBill -> {
-                    noCarService.getInvoiceByWayBillNumReal(noCarWayBill,true);
+                    try {
+                         noCarService.getInvoiceByWayBillNumReal(noCarWayBill,true);
+                    }catch (Exception e){
+                        e.printStackTrace();
+                    }
                 });
             }
             return new RespR("更新成功");
-        }catch (Exception e){
-            e.printStackTrace();
-            return new RespR(false,e.getMessage());
-        }
+
     }
     public void delGetInvoce(Integer historyFlag){
         log.info("开始取票HISflag:"+historyFlag);

+ 6 - 3
src/main/java/com/jkcredit/invoice/credit/custInterface/NoCarInterServiceImpl.java

@@ -285,10 +285,11 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarWayBill.setTitleType(titleType);
             noCarWayBill.setTaxplayerCode(taxplayerCode);
             noCarWayBill.setHisFlag(0);
-
+            noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
             NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
 
             if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 1||noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)) {
+                log.info("chongfuyundanhao:"+noCarWayBillDb.getBillNum());
                 result.setMsg("运单号重复");
                 return result;
             }
@@ -394,6 +395,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarWayBill.setHisFlag(noCarWayBill1.getHisFlag());
             noCarWayBill.setInterType(0);//接口
             noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+            noCarWayBill.setInterfaceEndTime(DateUtil.getCurrentDateStr());
             RespR rs = noCarService.noCarWaybillEnd(noCarWayBill);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarBillEnd-] result is "
@@ -491,7 +493,8 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarWayBill.setTitleType(titleType);
             noCarWayBill.setTaxplayerCode(taxplayerCode);
             noCarWayBill.setHisFlag(1);
-
+            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+            noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
             NoCarWayBill noCarWayBillDb = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
 
             if(noCarWayBillDb!=null && (noCarWayBillDb.getBillwayStatus() == 1||noCarWayBillDb.getBillwayStatus() == 2 || noCarWayBillDb.getBillwayStatus() == 3 || noCarWayBillDb.getBillwayStatus() == 4)) {
@@ -509,7 +512,6 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             customerCarRec.setBusinessType("2");
             customerCarRec.setServiceOperation(1);//默认运营车辆
             noCarWayBill.setTitleType(2);
-            noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
             //先查询上游是否已经备案
             RespR<VehicleQueryResponse> respRquery = noCarService.customerCarRecQueryUpper(customerCarRec);
             if(respRquery.getCode() == 1 || respRquery.getData() == null || respRquery.getData().getResult() == null || respRquery.getData().getResult().size()<=0){
@@ -611,6 +613,7 @@ public class NoCarInterServiceImpl implements NoCarInterService {
             noCarWayBill.setHisFlag(noCarWayBill1.getHisFlag());
             noCarWayBill.setInterType(0);//接口
             noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
+            noCarWayBill.setInterfaceEndTime(DateUtil.getCurrentDateStr());
             RespR rs = noCarService.noCarHisWaybillEnd(noCarWayBill);
             long costtimeend = System.currentTimeMillis();
             log.info("[-NoCarInterServiceImpl.noCarHisWaybillEnd-] result is "

+ 1 - 1
src/main/java/com/jkcredit/invoice/mapper/waybill/NoCarWaybillMapper.java

@@ -21,7 +21,7 @@ public interface NoCarWaybillMapper extends BaseMapper<NoCarWayBill>{
     int updateByPrimaryKey(NoCarWayBill record);
 
     int updateByBillNum(NoCarWayBill record);
-
+    int updateByBillNumTimeRes(NoCarWayBill record);
     NoCarWayBill selectByBillNum(String wayBillNum);
 
     List<NoCarWayBill> selectByHisFlagAndBillStatus(NoCarWayBill noCarWayBill);

+ 9 - 8
src/main/java/com/jkcredit/invoice/service/lowerService/impl/NoCarServiceImpl.java

@@ -305,6 +305,8 @@ public class NoCarServiceImpl implements NoCarService{
 
         if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill1.getHisFlag() ==1 ){
             log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
+            noCarWayBill.setFailReason("当前运单状态无法结束,请检查当前指令状态");
+            noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
             return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
         }
         noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
@@ -313,7 +315,7 @@ public class NoCarServiceImpl implements NoCarService{
         if((DateUtil.getDistanceHours(noCarWayBill1.getStartTime(),DateUtil.StringToDate(noCarWayBill1.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
             //noCarWayBill1.setBillwayStatus(4);
             noCarWayBill1.setFailReason("失败,承运时长超96小时");
-            noCarWaybillMapper.updateByBillNum(noCarWayBill1);
+            noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
             log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"运单已经超时,请拆分");
             return new RespR(false,"失败,承运时长超96小时");
         }
@@ -412,12 +414,16 @@ public class NoCarServiceImpl implements NoCarService{
         NoCarWayBill noCarWayBill1 = noCarWaybillMapper.selectByBillNum(noCarWayBill.getBillNum());
         if(noCarWayBill1 == null || noCarWayBill1.getBillwayStatus() !=1 || noCarWayBill.getHisFlag() ==0 || noCarWayBill1.getBillwayStatus() == -3 ){
             log.info("运单结束失败:NoCarServiceImpl.noCarWaybillEnd{},msg{}",noCarWayBill,"当前运单状态无法结束,请检查当前指令状态");
+            noCarWayBill.setFailReason("当前运单状态无法结束,请检查当前指令状态");
+            noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
             return new RespR(false,"当前运单状态无法结束,请检查当前指令状态");
         }
         noCarWayBill1.setDestAddr(noCarWayBill.getDestAddr());
         noCarWayBill1.setPredictEndTime(noCarWayBill.getPredictEndTime());
         if((DateUtil.getDistanceHours(noCarWayBill.getStartTime(),DateUtil.StringToDate(noCarWayBill.getPredictEndTime()))<-96) && (noCarWayBill.getInterType() != 0)){
             log.info("历史运单结束上传失败:NoCarServiceImpl.noCarHisWaybillEnd{},msg{}",noCarWayBill,"运单已经超时,请拆分");
+            noCarWayBill.setFailReason("失败,承运时长超96小时");
+            noCarWaybillMapper.updateByBillNumTimeRes(noCarWayBill);
             return new RespR(false,"失败,承运时长超96小时");
         }
         WaybillEndRequest waybillEndRequest = new WaybillEndRequest();
@@ -533,18 +539,13 @@ public class NoCarServiceImpl implements NoCarService{
                     }
                     billInvoiceMapper.insert(billInvoice);
                 });
-                List<BillInvoice> billInvoices1 = billInvoiceMapper.selectByBillNum(noCarWayBill.getBillNum());
-                if(billInvoices1!=null && billInvoices1.size()>0 && noCarWayBill.getInterType() != 0){
-
-                    return new RespR(billInvoices1);
-                }else if(billInvoices1!=null && billInvoices1.size()>0 && noCarWayBill.getInterType() == 0){
+                if(noCarWayBill.getInterType() == 0){
                     return new RespR(responseRespR.getData());
                 }
             }
 
         }
-        //查询
-        return new RespR(false,responseRespR.getData());
+        return new RespR("success");
     }
     public BillInvoice buildFromInvoiceProcessingListModel(InvoiceProcessingListModel invoiceProcessingListModel){
         BillInvoice billInvoice = new BillInvoice();

+ 5 - 0
src/main/java/com/jkcredit/invoice/service/nocar/impl/NoCarBillWayServiceImpl.java

@@ -89,6 +89,7 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     noCarWayBill.setBillwayStatus(-2);
                     noCarWayBill.setHisFlag(0);
                     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)){
@@ -197,6 +198,8 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                         customerRec.setCompanyReferencenum(noCarWayBill.getTaxplayerCode());
                         customerRec = customerRecMapper.selectByCustomerNameAndCompanyReference(customerRec);
                         noCarWayBill.setIntfaceStartTime(DateUtil.getCurrentDateStr());
+                        noCarWayBill.setInterfaceEndTime(DateUtil.getCurrentDateStr());
+                        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
                         noCarWayBill.setBatchNum(batchNumber);
                         noCarWayBill.setTitleType(2);
                         noCarWayBill.setBillwayStatus(-2);
@@ -330,6 +333,8 @@ public class NoCarBillWayServiceImpl extends ServiceImpl<NoCarWaybillMapper,NoCa
                     try {
                         noCarWayBill.setBatchNum(batchNumber);
                         noCarWayBill.setBatchNumEnd(batchNumber);
+                        noCarWayBill.setInterfaceEndTime(DateUtil.getCurrentDateStr());
+                        noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
                         noCarWayBill.setHisFlag(0);
                         noCarWaybillMapperImprt.insertImport(noCarWayBill);
                         RespR respR = noCarService.noCarWaybillEnd(noCarWayBill);

+ 6 - 0
src/main/resources/mapper/waybill/NoCarWaybillMapper.xml

@@ -208,6 +208,12 @@
         failReason = #{failReason,jdbcType=VARCHAR}
         where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
     </update>
+    <update id="updateByBillNumTimeRes" parameterType="com.jkcredit.invoice.model.entity.waybill.NoCarWayBill" >
+        update t_waybill_no
+        set interfaceEndTime = #{interfaceEndTime,jdbcType=VARCHAR},
+        failReason = #{failReason,jdbcType=VARCHAR}
+        where  billNum = BINARY #{billNum,jdbcType=VARCHAR}
+    </update>
     <select id="selectByBillNum" resultMap="BaseResultMap" parameterType="java.lang.String" >
         select
         <include refid="baseSql" />