yujian
2019-03-08 03d83b8a3d265e8a0e813c76ddf63862b32e6400
用户抽奖代码优化  默认送10%奖励券
1个文件已修改
12 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -181,7 +181,15 @@
            throw new UserSystemCouponException(1, "参数不正确");
        }
        SystemCoupon coupon = systemCouponService.getCouponByType(couponType);
        SystemCoupon coupon = null;
        if (couponType.equals(CouponTypeEnum.welfareFreeCoupon.name())) {
            // 福利免单券
            coupon = systemCouponService.getCouponByType(couponType);
        } else if (couponType.equals(CouponTypeEnum.rebatePercentCoupon.name())) {
            // 奖励券10%
            coupon = systemCouponService.getCouponByTypeAndPercent(couponType,new BigDecimal(10));
        }
        if (coupon == null) {
            throw new UserSystemCouponException(1, "券类型不正确");
        }
@@ -521,6 +529,7 @@
    @Transactional
    @Override
    public List<UserSystemCouponVO> getOrderCouponList(Long uid) throws UserSystemCouponException, Exception {
        if (uid == null) {
            throw new UserSystemCouponException(1, "用户未登录");
        }
@@ -1545,7 +1554,6 @@
            }
            
            if (receive) {
                // 插入记录
                PushCouponRecord pushCouponRecord = new PushCouponRecord();
                pushCouponRecord.setPushCoupon(pushCoupon);