1.添加购物车逻辑修改
This commit is contained in:
parent
6360d01041
commit
0600a1d90e
|
|
@ -285,7 +285,31 @@ public class OrderService {
|
||||||
cashierCartMapper.updateByPrimaryKeySelective(cart);
|
cashierCartMapper.updateByPrimaryKeySelective(cart);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<TbCashierCart> list = cashierCartMapper.selectALlByMasterId(masterId, "create");
|
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
||||||
|
.notIn(TbCashierCart::getStatus, "final", "refund", "closed", "pending")
|
||||||
|
.eq(TbCashierCart::getShopId, cart.getShopId());
|
||||||
|
|
||||||
|
TbCashierCart finalCart = cart;
|
||||||
|
queryWrapper.eq(TbCashierCart::getTableId, cart.getTableId())
|
||||||
|
.and(q -> {
|
||||||
|
q.or(
|
||||||
|
query -> {
|
||||||
|
query.eq(TbCashierCart::getMasterId, finalCart.getMasterId())
|
||||||
|
.or()
|
||||||
|
.isNull(TbCashierCart::getMasterId)
|
||||||
|
.or()
|
||||||
|
.eq(TbCashierCart::getMasterId, "");
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.or(query -> {
|
||||||
|
query.eq(TbCashierCart::getOrderId, finalCart.getOrderId())
|
||||||
|
.or()
|
||||||
|
.isNull(TbCashierCart::getOrderId);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper.eq(TbCashierCart::getStatus, "create"));
|
||||||
|
// List<TbCashierCart> list = cashierCartMapper.selectALlByMasterId(masterId, "create");
|
||||||
// TbCashierCart cashierCart = cashierCartMapper.selectByDetail(masterId, productId, shopId, skuId.toString(), DateUtils.getDay(), uuid, tableId);
|
// TbCashierCart cashierCart = cashierCartMapper.selectByDetail(masterId, productId, shopId, skuId.toString(), DateUtils.getDay(), uuid, tableId);
|
||||||
|
|
||||||
String finalMasterId = masterId;
|
String finalMasterId = masterId;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue