fix: 订单优惠券折扣金额不准确修复

This commit is contained in:
张松
2024-11-21 15:13:36 +08:00
parent 7c8d22f5ed
commit 6bc9a2aaa6

View File

@@ -1457,7 +1457,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
OrderCartInfoDTO cartInfoDTO = new OrderCartInfoDTO(); OrderCartInfoDTO cartInfoDTO = new OrderCartInfoDTO();
List<TbCashierCart> allCashierCarts; List<TbCashierCart> allCashierCarts;
if (orderId != null) { if (orderId != null) {
allCashierCarts = mpCashierCartService.selectByOrderIdAndState(orderId, null); allCashierCarts = mpCashierCartService.selectByOrderIdAndState(orderId);
}else { }else {
allCashierCarts = mpCashierCartService.selectByShopEatType(shopEatTypeInfoDTO, masterId); allCashierCarts = mpCashierCartService.selectByShopEatType(shopEatTypeInfoDTO, masterId);
} }
@@ -2082,7 +2082,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
private BigDecimal getCartCouponDiscount(TbOrderInfo orderInfo, PayDTO payDTO) { private BigDecimal getCartCouponDiscount(TbOrderInfo orderInfo, PayDTO payDTO) {
Set<String> productIdSet = new HashSet<>(); Set<String> productIdSet = new HashSet<>();
List<TbCashierCart> cashierCarts = mpCashierCartService.selectByOrderIdAndState(orderInfo.getId(), null); List<TbCashierCart> cashierCarts = mpCashierCartService.selectByOrderIdAndState(orderInfo.getId());
ArrayList<TbCashierCart> activateCartInfo = new ArrayList<>(); ArrayList<TbCashierCart> activateCartInfo = new ArrayList<>();
for (TbCashierCart cashierCart : cashierCarts) { for (TbCashierCart cashierCart : cashierCarts) {
productIdSet.add(cashierCart.getProductId()); productIdSet.add(cashierCart.getProductId());