打包费
This commit is contained in:
parent
a8ab3706dd
commit
d3cac60125
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue