Browse Source

优化代码

lishiqiang 2 tuần trước cách đây
mục cha
commit
44cdf81e79

+ 6 - 11
ship-module-trade/ship-module-trade-biz/src/main/java/com/yc/ship/module/trade/service/otc/impl/OtcTradeOrderServiceImpl.java

@@ -488,17 +488,12 @@ public class OtcTradeOrderServiceImpl implements OtcTradeOrderService {
                     log.error("发送短信异常", e);
                 }
                 List<BigDecimal> amountList = new ArrayList<>();
-                try {
-                    List<OrderPolicyDO> orderPolicyList = orderPolicyMapper.selectList(OrderPolicyDO::getOrderId, orderId);
-                    if (!orderPolicyList.isEmpty()) {
-                        orderPolicyList.forEach(item -> {
-                            amountList.add(item.getAmount());
-                            policyApi.updatePolicySurplusNum(item.getId(), tradeOrderDO.getVoyageId(), item.getPreUseNum());
-                        });
-                    }
-
-                }catch (Exception e){
-                    log.error("政策执行异常", e);
+                List<OrderPolicyDO> orderPolicyList = orderPolicyMapper.selectList(OrderPolicyDO::getOrderId, orderId);
+                if (!orderPolicyList.isEmpty()) {
+                    orderPolicyList.forEach(item -> {
+                        amountList.add(item.getAmount());
+                        policyApi.updatePolicySurplusNum(item.getPolicyId(), tradeOrderDO.getVoyageId(), item.getPreUseNum());
+                    });
                 }
                 BigDecimal amount = amountList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
                 int orderStatus = TradeOrderStatusEnum.UNPAID.getStatus();