feat: 1.退款接口修改

This commit is contained in:
张松
2024-11-20 17:59:08 +08:00
parent 0d81ab7f47
commit 515759f05f

View File

@@ -2153,10 +2153,15 @@ public class TbShopTableServiceImpl implements TbShopTableService {
BigDecimal discount = BigDecimal.valueOf(payDTO.getDiscount());
cashierCarts.forEach(item -> {
item.setTotalAmount(item.getTotalAmount().multiply(discount).setScale(2, RoundingMode.HALF_UP));
item.setSalePrice(item.getSalePrice().multiply(discount).setScale(2, RoundingMode.HALF_UP));
item.setMemberPrice(item.getMemberPrice().multiply(discount).setScale(2, RoundingMode.HALF_UP));
});
detailList.forEach(item -> {
item.setPriceAmount(item.getPriceAmount().multiply(discount).setScale(2, RoundingMode.HALF_UP));
item.setPrice(item.getPrice().multiply(discount).setScale(2, RoundingMode.HALF_UP));
item.setMemberPrice(item.getMemberPrice().multiply(discount).setScale(2, RoundingMode.HALF_UP));
});
mpCashierCartService.updateBatchById(cashierCarts);