From 232320b0bdbf97e984b0d309274a9995a862c5b3 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 29 Sep 2021 09:55:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hai/service/impl/HighOrderServiceImpl.java | 18 ++++++++++++++++++ .../pay/impl/GoodsOrderServiceImpl.java | 13 +++++++++++++ 2 files changed, 31 insertions(+) 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 94e2356a..5aa9a14a 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 @@ -85,6 +85,12 @@ public class HighOrderServiceImpl implements HighOrderService { @Resource private HighOrderService highOrderService; + @Resource + private HighActivityInfoService highActivityInfoService; + + @Resource + private HighActivityUserLotteryNumService highActivityUserLotteryNumService; + @Override @Transactional(propagation= Propagation.REQUIRES_NEW) public void insertOrder(HighOrder highOrder) throws Exception { @@ -275,6 +281,12 @@ public class HighOrderServiceImpl implements HighOrderService { highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 highUserCouponMapper.insert(highUserCoupon); } + + // 查询卡券是否有活动 + Map activity = highActivityInfoService.getNewActivityByCouponId(coupon.getId()); + if (activity != null && MapUtils.getLong(activity, "id") != null) { + highActivityUserLotteryNumService.addLotteryNum(MapUtils.getLong(activity, "id"),highOrder.getMemId(), 1); + } } } @@ -429,6 +441,12 @@ public class HighOrderServiceImpl implements HighOrderService { highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 highUserCouponMapper.insert(highUserCoupon); } + + // 查询卡券是否有活动 + Map activity = highActivityInfoService.getNewActivityByCouponId(coupon.getId()); + if (activity != null && MapUtils.getLong(activity, "id") != null) { + highActivityUserLotteryNumService.addLotteryNum(MapUtils.getLong(activity, "id"),order.getMemId(), 1); + } } if (highChildOrder.getGoodsType() == 2) { diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index fe80585a..53285717 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -22,6 +22,7 @@ import com.hai.model.ResultProfitSharing; import com.hai.service.*; import com.hai.service.pay.NotifyService; import com.hai.service.pay.PayService; +import org.apache.commons.collections4.MapUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; @@ -81,6 +82,12 @@ public class GoodsOrderServiceImpl implements PayService { @Resource private HighCouponCodeOtherMapper highCouponCodeOtherMapper; + @Resource + private HighActivityInfoService highActivityInfoService; + + @Resource + private HighActivityUserLotteryNumService highActivityUserLotteryNumService; + @Resource private NotifyService notifyService; @@ -199,6 +206,12 @@ public class GoodsOrderServiceImpl implements PayService { highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 highUserCouponMapper.insert(highUserCoupon); } + + // 查询卡券是否有活动 + Map activity = highActivityInfoService.getNewActivityByCouponId(coupon.getId()); + if (activity != null && MapUtils.getLong(activity, "id") != null) { + highActivityUserLotteryNumService.addLotteryNum(MapUtils.getLong(activity, "id"),order.getMemId(), 1); + } } if (highChildOrder.getGoodsType() == 2) {