加入购物车修改
This commit is contained in:
parent
2eaa98a4bc
commit
492fa159b9
|
|
@ -128,7 +128,7 @@ public class TbCashierCart implements Serializable {
|
|||
|
||||
@Column(name = "`table_id`")
|
||||
@ApiModelProperty(value = "台桌id")
|
||||
private Long tableId;
|
||||
private String tableId;
|
||||
|
||||
@Column(name = "`pack_fee`")
|
||||
@ApiModelProperty(value = "打包费")
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
tbCashierCart.setCreatedAt(System.currentTimeMillis());
|
||||
tbCashierCart.setIsSku(product.getTypeEnum());
|
||||
if (StrUtil.isNotBlank(addCartDTO.getTableId())) {
|
||||
tbCashierCart.setTableId(Long.valueOf(addCartDTO.getTableId()));
|
||||
tbCashierCart.setTableId(addCartDTO.getTableId());
|
||||
}
|
||||
tbCashierCart.setName(product.getName());
|
||||
tbCashierCart.setProductId(String.valueOf(product.getId()));
|
||||
|
|
@ -579,7 +579,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
|
||||
if (removeCartDTO.getTableId() != null) {
|
||||
// 清空购物车 出票
|
||||
long carCount = countCar(cashierCart.getTableId(), cashierCart.getShopId(), cashierCart.getMasterId());
|
||||
long carCount = countCar(Long.valueOf(cashierCart.getTableId()), cashierCart.getShopId(), cashierCart.getMasterId());
|
||||
|
||||
log.info("购物车数量: {}", carCount);
|
||||
if (cashierCart.getOrderId() != null && carCount < 1) {
|
||||
|
|
@ -1697,7 +1697,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
tbCashierCart = new TbCashierCart();
|
||||
tbCashierCart.setStatus("create");
|
||||
tbCashierCart.setCreatedAt(System.currentTimeMillis());
|
||||
tbCashierCart.setTableId(Long.valueOf(choseCountDTO.getTableId()));
|
||||
tbCashierCart.setTableId(choseCountDTO.getTableId());
|
||||
tbCashierCart.setName("客座费");
|
||||
tbCashierCart.setSalePrice(shopInfo.getTableFee());
|
||||
tbCashierCart.setMasterId(choseCountDTO.getMasterId());
|
||||
|
|
@ -1839,13 +1839,15 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
// 设置打包费
|
||||
item.setPackFee(product.getPackFee() != null ?
|
||||
product.getPackFee().multiply(BigDecimal.valueOf(item.getNumber())) : BigDecimal.ZERO);
|
||||
item.setTableId(null);
|
||||
item.setTableId("");
|
||||
item.setUseType(OrderUseTypeEnum.TAKEOUT.getValue());
|
||||
});
|
||||
|
||||
List<TbOrderDetail> detailList = orderDetailMapper.selectList(new LambdaQueryWrapper<TbOrderDetail>()
|
||||
.in(TbOrderDetail::getCartId, choseModelDTO.getCartIds())
|
||||
.eq(TbOrderDetail::getShopId, choseModelDTO.getShopId()));
|
||||
detailList.forEach(item -> {
|
||||
item.setUseType(OrderUseTypeEnum.TAKEOUT.getValue());
|
||||
TbProduct product = productMap.get(item.getProductId().toString());
|
||||
// 设置打包费
|
||||
item.setPackAmount(product.getPackFee() != null ?
|
||||
|
|
|
|||
Loading…
Reference in New Issue