fix: 购物车全部退单清空购物车
This commit is contained in:
@@ -938,11 +938,19 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
if (TableConstant.OrderInfo.UseType.TAKEOUT.equalsVals(cashierCart.getUseType())) {
|
||||
return;
|
||||
}
|
||||
List<TbCashierCart> cashierCarts = mpCashierCartService.selectByShopEatTypeAndOrderId(shopEatTypeInfoDTO, cashierCart.getMasterId(), cashierCart.getOrderId() == null ? null : cashierCart.getOrderId(), false, TableConstant.OrderInfo.Status.CREATE);
|
||||
if (cashierCarts.isEmpty() && cashierCart.getOrderId() != null) {
|
||||
List<TbCashierCart> cashierCarts = mpCashierCartService.selectByShopEatTypeAndOrderId(shopEatTypeInfoDTO, cashierCart.getMasterId(), cashierCart.getOrderId() == null ? null : cashierCart.getOrderId(), false);
|
||||
int activateCount = 0;
|
||||
ArrayList<Integer> cartIds = new ArrayList<>();
|
||||
for (TbCashierCart item : cashierCarts) {
|
||||
if (TableConstant.OrderInfo.Status.CREATE.equalsVals(item.getStatus())) {
|
||||
activateCount++;
|
||||
}
|
||||
}
|
||||
if (activateCount == 0 && cashierCart.getOrderId() != null) {
|
||||
mpOrderDetailService.remove(new LambdaQueryWrapper<TbOrderDetail>()
|
||||
.eq(TbOrderDetail::getOrderId, cashierCart.getOrderId()));
|
||||
mpOrderInfoService.removeById(cashierCart.getOrderId());
|
||||
mpCashierCartService.removeByIds(cashierCarts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user