|
|
@@ -1518,7 +1518,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
if(param.getCouponUserId()!=null){
|
|
|
LiveCouponUser couponUser=liveCouponUserService.selectLiveCouponUserById(param.getCouponUserId());
|
|
|
if(couponUser!=null&&couponUser.getStatus()==0){
|
|
|
- if(couponUser.getUseMinPrice().compareTo(payPrice)==-1){
|
|
|
+ if(couponUser.getUseMinPrice().compareTo(payPrice) < 1){
|
|
|
payPrice=payPrice.subtract(couponUser.getCouponPrice());
|
|
|
deductionPrice = couponUser.getCouponPrice();
|
|
|
}
|
|
|
@@ -2193,12 +2193,14 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
if (!couponUser.getUserId().toString().equals(liveOrder.getUserId())){
|
|
|
return R.error("非法操作");
|
|
|
}
|
|
|
- liveOrder.setUserCouponId(couponUser.getId());
|
|
|
- liveOrder.setDiscountMoney(couponUser.getCouponPrice());
|
|
|
- //更新优惠券状态
|
|
|
- couponUser.setStatus(1);
|
|
|
- couponUser.setUseTime(new Date());
|
|
|
- liveCouponUserService.updateLiveCouponUser(couponUser);
|
|
|
+ if(couponUser.getUseMinPrice().compareTo(payPrice) < 1){
|
|
|
+ liveOrder.setUserCouponId(couponUser.getId());
|
|
|
+ liveOrder.setDiscountMoney(couponUser.getCouponPrice());
|
|
|
+ //更新优惠券状态
|
|
|
+ couponUser.setStatus(1);
|
|
|
+ couponUser.setUseTime(new Date());
|
|
|
+ liveCouponUserService.updateLiveCouponUser(couponUser);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|