Browse Source

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

Administrator 1 year ago
parent
commit
28a039f07d

+ 5 - 0
src/main/java/com/jkcredit/invoice/controller/business/NoCarController.java

@@ -536,6 +536,11 @@ public class NoCarController {
                     strError = "第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确";
                     throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
                 }
+                if (!org.apache.commons.lang3.StringUtils.isNumeric(noCarWayBill.getPlateColor())) {
+                    log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否是数值码");
+                    strError = "第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否是数值码";
+                    throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否是数值码");
+                }
                 if (null == noCarWayBill.getStartTimeDate()) {
                     log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
                     strError = "第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确";

+ 21 - 3
src/main/java/com/jkcredit/invoice/task/ScheduledBillTask.java

@@ -1,5 +1,7 @@
 package com.jkcredit.invoice.task;
 
+import cn.com.taiji.sdk.model.comm.protocol.tts.trade.service.TradeApplyQueryRequest;
+import cn.com.taiji.sdk.model.comm.protocol.tts.trade.service.TradeApplyQueryResponse;
 import com.jkcredit.invoice.mapper.binvoce.SelfCarApplMapper;
 import com.jkcredit.invoice.mapper.customer.CustomerCarRecMapper;
 import com.jkcredit.invoice.mapper.waybill.NoCarWaybillMapper;
@@ -14,12 +16,15 @@ import com.jkcredit.invoice.service.lowerservice.vo.SelfCarDueQueryVo;
 import com.jkcredit.invoice.service.manager.ParamService;
 import com.jkcredit.invoice.service.selfcar.SelfCarTradeService;
 import com.jkcredit.invoice.service.thead.ThreadPoolFactory;
+import com.jkcredit.invoice.service.upservice.SelfCarInterface;
 import com.jkcredit.invoice.util.DateUtil;
+import com.jkcredit.invoice.util.RespR;
 import com.mchange.v1.identicator.IdHashSet;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
 
 import java.net.InetAddress;
 import java.text.DateFormat;
@@ -149,12 +154,13 @@ public class ScheduledBillTask {
             e.printStackTrace();
         }
     }
-
+    @Autowired
+    SelfCarInterface selfCarInterface;
     /**
      * @Scheduled(cron = "0 0 23 * * ?", zone = "Asia/Shanghai")
      * @throws Exception
      */
-    @Scheduled(cron = "0 55 23 * * ?", zone = "Asia/Shanghai")
+    @Scheduled(cron = "0 58 23 * * ?", zone = "Asia/Shanghai")
     public void getSefCarInvoice() throws Exception {
         InetAddress addr = InetAddress.getLocalHost();
         String ip = paramService.getParamsByParamName("CURR_SELF_IP").getParamValue();
@@ -183,6 +189,18 @@ public class ScheduledBillTask {
             applQueryInvVo.setCompanyName(selfCarTrade.getCompanyName());
             applQueryInvVo.setCustomerName(selfCarTrade.getCustomId());
             applQueryInvVo.setCompanyReferencenum(selfCarTrade.getCompanyReferencenum());
+            if(StringUtils.isEmpty(selfCarTrade.getApplId())){
+                //1.获取到交易id
+                TradeApplyQueryRequest tradeApplyQueryRequest = new TradeApplyQueryRequest();
+                tradeApplyQueryRequest.setCompanyNum(selfCarTrade.getCompanyNum());
+                tradeApplyQueryRequest.setCardId(selfCarTrade.getCardId());
+                tradeApplyQueryRequest.setTradeId(selfCarTrade.getTradeId());
+                RespR<TradeApplyQueryResponse> respR = selfCarInterface.queryApplyQueryByTradeId(tradeApplyQueryRequest);
+                if(respR.getCode()!=1){
+                    selfCarTrade.setApplId(respR.getData().getApplyId());
+                    selfCarTrade.setAclTime(DateUtil.getCurrentDateStr());
+                }
+            }
             applQueryInvVo.setApplId(selfCarTrade.getApplId());
             map.put(selfCarTrade.getApplId(),applQueryInvVo);
         });
@@ -199,4 +217,4 @@ public class ScheduledBillTask {
         selfCarTradeService.updateTradesDb(lst);
         log.info("getSefCarInvoice处理完成");
     }
-}
+}

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

@@ -174,6 +174,12 @@
         from t_SellCarTrade
         where  status = 3 and
         updateTime >concat(curdate(),' 00:00:00')
+        UNION ALL
+        select
+        <include refid="baseSql" />
+        from t_SellCarTrade
+        where  aclTime is null and
+        updateTime >concat(curdate(),' 00:00:00') and status>1
     </select>
     <update id="upDateCompany" parameterType="com.jkcredit.invoice.model.vo.CompanyVo">
         UPDATE t_SellCarTrade set companyName = #{newCompanyName} where companyName = #{oldCompanyName}