瀏覽代碼

Merge remote-tracking branch 'origin/feature/asyncOrder' into feature/asyncOrder

qzy 2 周之前
父節點
當前提交
499fb995a7
共有 1 個文件被更改,包括 9 次插入4 次删除
  1. 9 4
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java

+ 9 - 4
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java

@@ -1,6 +1,7 @@
 package com.pj.tb_order;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -72,7 +73,7 @@ import javax.annotation.Resource;
 @Transactional(rollbackFor = Exception.class)
 @Slf4j
 public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implements IService<TbOrder> {
-
+    static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss sss");
     /**
      * 底层 Mapper 对象
      */
@@ -929,7 +930,9 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         //todo: 收到航通007报文即收到海关结关信息,转发结关信息给到银行
         PaymentDto paymentDto = new PaymentDto();
         paymentDto.setTradeNo(tbOrder.getTradeNo());
-        paymentDto.setDeclTime(htTradeSettlement.getDeclTime());
+
+        String date = tbOrder.getFinishTime() != null ? sdf.format(tbOrder.getFinishTime()) : sdf.format(new Date());
+        paymentDto.setDeclTime(date);
         paymentDto.setFieldCode(htTradeSettlement.getFieldCode());
         paymentDto.setChannelNo(tbOrder.getChannelNo());
         paymentDto.setTrans(tbOrder.getPlatSeqNo());
@@ -973,7 +976,9 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 
                 //todo: 收到航通007报文即收到海关结关信息,转发结关信息给到银行
                 paymentDto.setTradeNo(tbOrder.getTradeNo());
-                paymentDto.setDeclTime(htTradeSettlement.getDeclTime());
+
+                String date = tbOrder.getFinishTime() != null ? sdf.format(tbOrder.getFinishTime()) : sdf.format(new Date());
+                paymentDto.setDeclTime(date);
 
                 paymentDto.setFieldCode(htTradeSettlement.getFieldCode());
                 paymentDto.setChannelNo(tbOrder.getChannelNo());
@@ -1030,7 +1035,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 
                 //todo: 收到航通007报文即收到海关结关信息,转发结关信息给到银行
                 paymentDto.setTradeNo(tbOrder.getTradeNo());
-                paymentDto.setDeclTime(htPassCardDTO.getCheckTime());
+                paymentDto.setDeclTime(sdf.format(new Date()));
                 paymentDto.setFieldCode(htPassCardDTO.getAreaNo());
                 paymentDto.setChannelNo(htPassCardDTO.getChannelNo());
                 paymentDto.setTrans(tbOrder.getPlatSeqNo());