From 69bee82b81626b82b7f39f0e459e4f56b1699b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 三月 2019 12:02:16 +0800 Subject: [PATCH] 正式数据库修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java index b064408..d20e351 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java +++ b/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, "鍒哥被鍨嬩笉姝g‘"); } @@ -521,6 +529,7 @@ @Transactional @Override public List<UserSystemCouponVO> getOrderCouponList(Long uid) throws UserSystemCouponException, Exception { + if (uid == null) { throw new UserSystemCouponException(1, "鐢ㄦ埛鏈櫥褰�"); } @@ -530,7 +539,7 @@ // 閫�鍥炲埜 sendBackTimeOutCoupon(uid); // 娲诲姩棰嗗彇鍒� - receivedCoupon(uid); +// receivedCoupon(uid); // 璁㈠崟鐩稿叧鐨勫埜 List<SystemCoupon> couponList = systemCouponService.getOrderCouponList(); @@ -560,7 +569,7 @@ sendBackTimeOutCoupon(uid); // 娲诲姩棰嗗彇鍒� - receivedCoupon(uid); +// receivedCoupon(uid); // 鍟嗗搧鐩稿叧鐨勫埜 List<SystemCoupon> couponList = systemCouponService.getGoodsCouponList(); @@ -1545,7 +1554,6 @@ } if (receive) { - // 鎻掑叆璁板綍 PushCouponRecord pushCouponRecord = new PushCouponRecord(); pushCouponRecord.setPushCoupon(pushCoupon); -- Gitblit v1.8.0