فهرست منبع

电子钱包预付款逻辑校验错误修改

xucaiqin 2 سال پیش
والد
کامیت
f43f18063d

+ 0 - 15
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/constant/ChannelEnum.java

@@ -109,19 +109,4 @@ public enum ChannelEnum {
         }
         return null;
     }
-
-    /**
-     * 字典值转
-     *
-     * @param value 渠道字典值 1
-     * @return huifu
-     */
-    public static String valueToChannel(String value) {
-        for (ChannelEnum channelEnum : ChannelEnum.values()) {
-            if (channelEnum.getValue().equals(value)) {
-                return channelEnum.getChannel();
-            }
-        }
-        return null;
-    }
 }

+ 11 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java

@@ -21,6 +21,7 @@ import com.sckw.payment.model.*;
 import com.sckw.payment.model.constant.LedgerEnum;
 import com.sckw.payment.model.constant.SettlementEnum;
 import com.sckw.payment.model.constant.TradeUnitType;
+import com.sckw.payment.model.constant.TradingEnum;
 import com.sckw.payment.model.dto.*;
 import com.sckw.payment.model.vo.req.*;
 import com.sckw.payment.model.vo.res.LedgerCountSumVo;
@@ -253,17 +254,22 @@ public class KwpLedgerTradeService extends AbsLedger {
         tradeOrderService.check(ids);
         List<OrderDetailRes> resList = new ArrayList<>();
         Map<Long, String> map = new HashMap<>();
-
+        String trading = tradeSendReq.getTrading();
         for (Long id : ids) {
             OrderDetailRes orderDetailById = tradeOrderInfoService.getOrderDetailById(id);
             if (Objects.isNull(orderDetailById)) {
                 throw new BusinessException("订单未找到");
             }
-            KwpTradeFreeze byTOrderId = kwpTradeFreezeService.getByTOrderId(id);
-            if (Objects.isNull(byTOrderId)) {
-                throw new BusinessException("未找到关联的冻结单");
+            //1x 预付款 2x 货到付款 3x 线下付款
+            Integer prefix = TradingEnum.getPrefix(trading);
+            //仅预付款需要校验冻结单号
+            if (Objects.nonNull(prefix) && prefix == TradingEnum.PRE_PAY.getStatus() ) {
+                KwpTradeFreeze byTOrderId = kwpTradeFreezeService.getByTOrderId(id);
+                if(Objects.isNull(byTOrderId)){
+                    throw new BusinessException("未找到关联的冻结单");
+                }
+                map.put(id, byTOrderId.getOrderNo());
             }
-            map.put(id, byTOrderId.getOrderNo());
             resList.add(orderDetailById);
         }
         for (Long id : ids) {