fix: 霸王餐扣减优惠券金额
This commit is contained in:
@@ -2,11 +2,14 @@ package com.chaozhanggui.system.cashierservice.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TbUserCouponVo {
|
||||
private Integer id;
|
||||
private BigDecimal fullAmount;
|
||||
private BigDecimal discountAmount;
|
||||
private Integer couponId;
|
||||
private Integer proId;
|
||||
//优惠券名称
|
||||
|
||||
@@ -423,6 +423,8 @@ public class PayService {
|
||||
if (userCouponVo == null) {
|
||||
throw new MsgException("存在不可用优惠券");
|
||||
}
|
||||
|
||||
shouldPayAmount = shouldPayAmount.subtract(userCouponVo.getDiscountAmount());
|
||||
ActivateInInfoVO activateInInfoVO = new ActivateInInfoVO()
|
||||
.setId(userCouponVo.getId())
|
||||
.setCouponId(userCouponVo.getCouponId())
|
||||
|
||||
@@ -54,7 +54,8 @@ public class TbShopCouponServiceImpl implements TbShopCouponService {
|
||||
//券id 券使用描述
|
||||
Map<Integer, JsonObject> coupons = new HashMap<>();
|
||||
for (TbUserCouponVo tbUserCouponVo : tbUserCouponVos) {
|
||||
if (tbUserCouponVo.getType() != null && tbUserCouponVo.getType() == 1) {
|
||||
if (tbUserCouponVo.getType() != null && tbUserCouponVo.getType() == 1 &&
|
||||
tbUserCouponVo.getFullAmount().compareTo(amount) <= 0) {
|
||||
if (!coupons.containsKey(tbUserCouponVo.getCouponId())) {
|
||||
setCouponInfo(coupons, tbUserCouponVo, amount, week, now, formatter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user