From dc20bf7713654341d994d568bc0b55cfd5c23614 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期五, 29 三月 2019 10:56:33 +0800 Subject: [PATCH] 免单券退回时间 改为10分钟 --- 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 e71d99f..2d3ff11 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, "鐢ㄦ埛鏈櫥褰�"); } @@ -1222,8 +1231,8 @@ @Transactional @Override public void sendBackTimeOutCoupon(Long uid) { - // 瓒呰繃120绉� 鏈鍖归厤鐨勫埜 - List<UserSystemCouponRecord> list = userSystemCouponRecordService.getCouponByUsingTimeOut(uid, 120L); + // 瓒呰繃10鍒嗛挓 鏈鍖归厤鐨勫埜 + List<UserSystemCouponRecord> list = userSystemCouponRecordService.getCouponByUsingTimeOut(uid,600L); if (list == null || list.size() == 0) { return; } @@ -1545,7 +1554,6 @@ } if (receive) { - // 鎻掑叆璁板綍 PushCouponRecord pushCouponRecord = new PushCouponRecord(); pushCouponRecord.setPushCoupon(pushCoupon); -- Gitblit v1.8.0