From a55ba0dd4268fa9c0fcb68bf7871d04a489966d7 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Sat, 27 Mar 2021 21:12:00 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4diam'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hai/service/impl/HighOrderServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index abe63ffc..d35a57ca 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -61,7 +61,8 @@ public class HighOrderServiceImpl implements HighOrderService { public void insertOrder(HighOrder highOrder) throws Exception { highOrderMapper.insert(highOrder); - for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { + for (int i = 0; i < highOrder.getHighChildOrderList().size();i++) { + HighChildOrder childOrder = highOrder.getHighChildOrderList().get(i); childOrder.setOrderId(highOrder.getId()); highChildOrderMapper.insert(childOrder); @@ -86,7 +87,6 @@ public class HighOrderServiceImpl implements HighOrderService { // 查看是否需要赠送卡卷 List handselListByCoupon = highCouponHandselService.getHandselListByCoupon(childOrder.getGoodsId()); if (handselListByCoupon != null && handselListByCoupon.size() > 0) { - List handselChildOrderList = new ArrayList<>(); for (HighCouponHandsel highCouponHandsel : handselListByCoupon) { // 查询卡卷信息 HighCouponModel coupon = highCouponService.getCouponById(highCouponHandsel.getHandselCouponId()); @@ -109,10 +109,9 @@ public class HighOrderServiceImpl implements HighOrderService { highChildOrder.setGiveawayType(true); // 是否是赠品 0:否 1:是 highChildOrder.setChildOrdeStatus(1); // 1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 highChildOrder.setPraiseStatus(0); - handselChildOrderList.add(highChildOrder); + highOrder.getHighChildOrderList().add(highChildOrder); } } - highOrder.getHighChildOrderList().addAll(handselChildOrderList); } } }