fix: 创建订单会员价计算有误修复

This commit is contained in:
张松
2024-11-06 15:08:01 +08:00
parent e0b67cb3cd
commit 4ca85ef425
2 changed files with 3 additions and 8 deletions

View File

@@ -165,7 +165,7 @@ public class TbCashierCart implements Serializable {
private String platformType;
// 优惠券id
private Integer userCouponId;
private BigDecimal memberPrice;
private BigDecimal memberPrice = BigDecimal.ZERO;
private Integer isMember;
public void copy(TbCashierCart source){

View File

@@ -1344,14 +1344,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
if (TableConstant.CashierCart.Status.CREATE.equalsVals(tbCashierCart.getStatus())) {
cartInfoDTO.setNewAddTotalAmount(cartInfoDTO.getNewAddTotalAmount().add(tbCashierCart.getTotalAmount()));
}
tbCashierCart.setIsMember(tbCashierCart.getMemberPrice() == null && shopUser != null && shopUser.getIsVip() == 1 ? 0 : 1);
tbCashierCart.resetTotalAmount();
if (shopUser != null) {
if (shopUser.getIsVip() == 0) {
tbCashierCart.setIsMember(0);
}else {
tbCashierCart.setIsMember(tbCashierCart.getMemberPrice() == null ? 0 : 1);
}
}
cartInfoDTO.setTotalAmount(cartInfoDTO.getTotalAmount().add(tbCashierCart.getTotalAmount()));
}
cartInfoDTO.setCashierCartIds(cartIdList);