打包费
This commit is contained in:
@@ -468,10 +468,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
tbCashierCart.setSalePrice(productSku.getSalePrice());
|
tbCashierCart.setSalePrice(productSku.getSalePrice());
|
||||||
tbCashierCart.setTotalAmount(new BigDecimal(addCartDTO.getNum()).multiply(productSku.getSalePrice()));
|
tbCashierCart.setTotalAmount(new BigDecimal(addCartDTO.getNum()).multiply(productSku.getSalePrice()));
|
||||||
tbCashierCart.setSkuName(productSku.getSpecSnap());
|
tbCashierCart.setSkuName(productSku.getSpecSnap());
|
||||||
if (!addCartDTO.isPack()) {
|
// 设置打包费
|
||||||
|
if (!addCartDTO.isPack() && !shopEatTypeInfoDTO.isTakeout()) {
|
||||||
tbCashierCart.setPackFee(BigDecimal.ZERO);
|
tbCashierCart.setPackFee(BigDecimal.ZERO);
|
||||||
} else {
|
} 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()));
|
tbCashierCart.setTotalAmount(tbCashierCart.getTotalAmount().add(tbCashierCart.getPackFee()));
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -483,11 +485,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
tbCashierCart.setCategoryId(product.getCategoryId());
|
tbCashierCart.setCategoryId(product.getCategoryId());
|
||||||
tbCashierCart.setNote(addCartDTO.getNote());
|
tbCashierCart.setNote(addCartDTO.getNote());
|
||||||
tbCashierCart.setPlatformType(OrderPlatformTypeEnum.PC.getValue());
|
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);
|
cashierCartRepository.save(tbCashierCart);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user