修复代客下单多个商品计算总金额错误的bug

This commit is contained in:
谭凯凯
2024-12-04 17:07:24 +08:00
committed by Tankaikai
parent feceb08a3e
commit 25a6735026

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.ysk.cashier.config.security.security.TokenProvider;
@@ -544,7 +545,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
cashierCart.setProGroupInfo(JSONObject.toJSONString(foods));
}
}else if (isFixGroup) {
} else if (isFixGroup) {
String groupSnap = product.getGroupSnap();
if (StrUtil.isNotBlank(groupSnap)) {
ArrayList<ProductGroupVo.Food> foods = new ArrayList<>();
@@ -2278,7 +2279,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
for (TbCashierCart cashierCart : cashierCarts) {
if (cashierCart.getUserCouponId() == null) {
cashierCart.setTotalAmount(cashierCart.getTotalAmount().multiply(discount).setScale(2, RoundingMode.HALF_UP));
totalAmount = cashierCart.getTotalAmount();
totalAmount = NumberUtil.add(totalAmount, cashierCart.getTotalAmount());
}
// item.setSalePrice(item.getSalePrice().multiply(discount).setScale(2, RoundingMode.HALF_UP));
// item.setMemberPrice(item.getMemberPrice().multiply(discount).setScale(2, RoundingMode.HALF_UP));