打包费

This commit is contained in:
SongZhang 2024-10-12 17:51:37 +08:00
parent a8ab3706dd
commit d3cac60125
1 changed files with 4 additions and 7 deletions

View File

@ -468,10 +468,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
tbCashierCart.setSalePrice(productSku.getSalePrice());
tbCashierCart.setTotalAmount(new BigDecimal(addCartDTO.getNum()).multiply(productSku.getSalePrice()));
tbCashierCart.setSkuName(productSku.getSpecSnap());
if (!addCartDTO.isPack()) {
// 设置打包费
if (!addCartDTO.isPack() && !shopEatTypeInfoDTO.isTakeout()) {
tbCashierCart.setPackFee(BigDecimal.ZERO);
} else {
tbCashierCart.setPackFee(new BigDecimal(addCartDTO.getNum()).multiply(product.getPackFee()));
tbCashierCart.setPackFee(product.getPackFee() != null ?
product.getPackFee().multiply(BigDecimal.valueOf(addCartDTO.getNum())) : BigDecimal.ZERO);
tbCashierCart.setTotalAmount(tbCashierCart.getTotalAmount().add(tbCashierCart.getPackFee()));
}
@ -483,11 +485,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
tbCashierCart.setCategoryId(product.getCategoryId());
tbCashierCart.setNote(addCartDTO.getNote());
tbCashierCart.setPlatformType(OrderPlatformTypeEnum.PC.getValue());
// 设置打包费
if (shopEatTypeInfoDTO.isTakeout()) {
tbCashierCart.setPackFee(product.getPackFee() != null ?
product.getPackFee().multiply(BigDecimal.valueOf(addCartDTO.getNum())) : BigDecimal.ZERO);
}
cashierCartRepository.save(tbCashierCart);
} else {