feat: 空订单删除
This commit is contained in:
@@ -1313,9 +1313,11 @@ public class OrderService {
|
|||||||
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper);
|
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper);
|
||||||
int orderId = 0;
|
int orderId = 0;
|
||||||
ArrayList<Integer> ids = new ArrayList<>();
|
ArrayList<Integer> ids = new ArrayList<>();
|
||||||
|
TbCashierCart cart = null;
|
||||||
for (TbCashierCart cashierCart : list) {
|
for (TbCashierCart cashierCart : list) {
|
||||||
if (StrUtil.isNotBlank(cashierCart.getOrderId())) {
|
if (StrUtil.isNotBlank(cashierCart.getOrderId())) {
|
||||||
orderId = Integer.parseInt(cashierCart.getOrderId());
|
orderId = Integer.parseInt(cashierCart.getOrderId());
|
||||||
|
cart = cashierCart;
|
||||||
}
|
}
|
||||||
|
|
||||||
ids.add(cashierCart.getId());
|
ids.add(cashierCart.getId());
|
||||||
@@ -1337,12 +1339,12 @@ public class OrderService {
|
|||||||
producer.cons(jsonObject1.toString());
|
producer.cons(jsonObject1.toString());
|
||||||
|
|
||||||
if (!shopEatTypeInfoDTO.isDineInAfter() && Objects.nonNull(orderInfo) && !orderInfo.getStatus().equals("pending")) {
|
if (!shopEatTypeInfoDTO.isDineInAfter() && Objects.nonNull(orderInfo) && !orderInfo.getStatus().equals("pending")) {
|
||||||
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
|
// tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
|
||||||
|
tbOrderInfoMapper.deleteByPrimaryKey(orderId);
|
||||||
orderDetailMapper.deleteByOUrderId(orderId);
|
orderDetailMapper.deleteByOUrderId(orderId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!ids.isEmpty()) {
|
if (!ids.isEmpty()) {
|
||||||
mpCashierCartMapper.deleteBatchIds(ids);
|
mpCashierCartMapper.deleteBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user