From 06c90934915b75c086eb7b3f031249ef0c79c5ef Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 7 May 2019 11:11:04 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=AE=A2=E5=8D=95=E5=A4=84=E7=90=86][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E6=95=B4=E7=90=86=E7=9B=AE=E5=89=8D?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/WxOrderService.java | 13 ++++++++++ .../service/impl/WxOrderServiceImpl.java | 25 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java index 2c8218f6c..399140ab7 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java @@ -165,4 +165,17 @@ public interface WxOrderService { void updateOrderGroupStatusByCouponChannelId(Long id, String tenantId, Integer code); + + /** + * 订单处理 + * 1. 检查coupon是否免费 + */ + boolean checkCouponIsFree(WxCUser user, WxCoupon coupon); + + // 2. 创建免费订单, 领取 couponOrder + WxOrder saveFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId); + + // 3. 创建有价订单 + WxOrder saveNoFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId); + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 2fb3b84e1..e4a1c1ec4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -349,7 +349,7 @@ public class WxOrderServiceImpl implements WxOrderService { String couponIdStr = String.valueOf(couponId); WxCoupon coupon = wxCouponMapper.selectByPrimaryKey(couponId); if (coupon == null) { - logger.error("券不存在, couponId: " + couponIdStr); + logger.error("券不存在, couponId: " + couponId); throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); } @@ -1389,4 +1389,27 @@ public class WxOrderServiceImpl implements WxOrderService { wxOrderMapper.updateStatusByPressCouponId(updateOrder); } + @Override + public boolean checkCouponIsFree(WxCUser user, WxCoupon coupon) { + return false; + } + + @Override + public WxOrder saveFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId) { + // 1. check user info and coupon info + // 2. 减库存 + // 3. save order + // 4. 积分券 -- 扣减积分 + // 10. coupon order + // 11. 生成完成后一系列操作 + return null; + } + + @Override + public WxOrder saveNoFreeOrderForCoupon(WxCUser user, WxCoupon coupon, Long couponChannelId, boolean isPress, Long orderGroupId, String formId) { + // 1. check user info and coupon info + // 2. save order + return null; + } + }