Explorar o código

修改销售订单提交时冻结电子钱包金额

yzc %!s(int64=2) %!d(string=hai) anos
pai
achega
2892fa421b

+ 8 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -779,6 +779,14 @@ public class KwoTradeOrderService {
             if (!Objects.equals(HttpStatus.SUCCESS_CODE, updateResult.getCode())) {
                 throw new BusinessException(updateResult.getMsg());
             }
+            //代客下单冻结金额
+            if (Objects.equals(source, OrderSourceEnum.SALE.getType()) && param.getTrading().startsWith("1")){
+                HttpResult freezeResult = paymentDubboService.freezeMoney(orderCheck.getProcureTopEntId(),
+                        ChannelEnum.getByTrading(param.getTrading()), orderCheck.getSupplyTopEntId(), param.getPrice(), order.getId());
+                if (!Objects.equals(HttpStatus.SUCCESS_CODE, freezeResult.getCode())) {
+                    throw new BusinessException(freezeResult.getMsg());
+                }
+            }
         }
         order.setAmount(param.getAmount()).setUnit(Objects.isNull(param.getGoodsInfo()) ? null : param.getGoodsInfo().getUnit())
                 .setPrice(param.getPrice()).setTrading(param.getTrading()).setPickupType(param.getPickupType())