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