Pārlūkot izejas kodu

按车补扣款放开注释

qzy 3 nedēļas atpakaļ
vecāks
revīzija
3c98a63bf3

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

@@ -554,6 +554,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
                     .setSxb010StatusTime(new Date());
         } else if (1 == SXB010Status) {//扣款成功
             tbOrder.setSxb010Status(1)
+                    .setRefundStatus(0)
                     .setSxb010StatusTime(new Date());
             //如果已经过了卡三,则补发送一次通关报文给银行
             if (tbOrder.getFinishStatus() == 1) {
@@ -766,9 +767,11 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
             throw new AjaxError("订单无商品信息");
         }
         Integer deductionCount = tbOrder.getDeductionCount() + 1;
-        String tradeNo=tbOrder.getTradeNo();
-        tradeNo=StrUtil.subBefore(tradeNo,"_",false);
-        tbOrder.setTradeNo(tradeNo + "_" + deductionCount);
+        if (tbOrder.getRefundStatus()!=0){
+            String tradeNo=tbOrder.getTradeNo();
+            tradeNo=StrUtil.subBefore(tradeNo,"_",false);
+            tbOrder.setTradeNo(tradeNo + "_" + deductionCount);
+        }
         PaymentDto paymentDto = this.getPaymentData(tbOrder);
         StaticLog.info("\n---订单补扣款---sendSXB010——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
         paymentServerInterface.sendSXB010(paymentDto);
@@ -792,12 +795,14 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         if (!tbOrders.isEmpty()) {
             for (TbOrder tbOrder : tbOrders) {
                 Integer deductionCount = tbOrder.getDeductionCount() + 1;
-                String tradeNo=tbOrder.getTradeNo();
-                tradeNo=StrUtil.subBefore(tradeNo,"_",false);
-                tbOrder.setTradeNo(tradeNo + "_" + deductionCount);
+                if (tbOrder.getRefundStatus()!=0){
+                    String tradeNo=tbOrder.getTradeNo();
+                    tradeNo=StrUtil.subBefore(tradeNo,"_",false);
+                    tbOrder.setTradeNo(tradeNo + "_" + deductionCount);
+                }
                 PaymentDto paymentDto = this.getPaymentData(tbOrder);
                 StaticLog.info("\n---订单补扣款——按车---sendSXB010——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
-                //paymentServerInterface.sendSXB010(paymentDto);
+                paymentServerInterface.sendSXB010(paymentDto);
 
                 tbOrder.setDeductionCount(deductionCount);
                 tbOrder.setDeductionTime(new Date());