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; + } + }