删除单子 清台

This commit is contained in:
2026-03-30 18:14:55 +08:00
parent 875c61adb6
commit 15920ce384

View File

@@ -1669,6 +1669,18 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
if (orderInfo.getPlaceNum().equals(1)) {
orderInfoService.updateById(new OrderInfo().setId(orderId)
.setStatus(OrderStatusEnums.CANCELLED.getCode()));
ShopTable table = shopTableService.getOneByTableCode(orderInfo.getShopId(), orderInfo.getTableCode());
if (table != null) {
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
if ("auto".equals(shopInfo.getTableClearType())) {
table.setStatus(ShopTableStatusEnum.IDLE.getValue());
} else {
DateTime dateTime = DateUtil.offsetMinute(DateUtil.date(), shopInfo.getTableClearTime());
table.setCreateTime(LocalDateTimeUtil.of(dateTime));
redisService.set(RedisCst.classKeyExpired.EXPIRED_TABLE + table.getId(), "", 60L * shopInfo.getTableClearTime());
}
shopTableService.updateById(table);
}
rabbitPublisher.sendOrderCancelMsg(orderInfo.getId().toString());
return true;
}