修复订单确认页优惠券问题

This commit is contained in:
beaver383
2019-10-09 15:43:40 +08:00
parent 6fec6b588a
commit 898942fa82
6 changed files with 67 additions and 33 deletions

View File

@@ -25,10 +25,20 @@ public class CouponVerifyService {
* @param checkedGoodsPrice
* @return
*/
public LitemallCoupon checkCoupon(Integer userId, Integer couponId, BigDecimal checkedGoodsPrice) {
public LitemallCoupon checkCoupon(Integer userId, Integer couponId, Integer userCouponId, BigDecimal checkedGoodsPrice) {
LitemallCoupon coupon = couponService.findById(couponId);
LitemallCouponUser couponUser = couponUserService.queryOne(userId, couponId);
if (coupon == null || couponUser == null) {
if (coupon == null) {
return null;
}
LitemallCouponUser couponUser = couponUserService.findById(userCouponId);
if (couponUser == null) {
couponUser = couponUserService.queryOne(userId, couponId);
} else if (!couponId.equals(couponUser.getCouponId())) {
return null;
}
if (couponUser == null) {
return null;
}