Compare commits
2 Commits
5eda003316
...
15920ce384
| Author | SHA1 | Date | |
|---|---|---|---|
| 15920ce384 | |||
| 875c61adb6 |
@@ -1669,6 +1669,18 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
if (orderInfo.getPlaceNum().equals(1)) {
|
if (orderInfo.getPlaceNum().equals(1)) {
|
||||||
orderInfoService.updateById(new OrderInfo().setId(orderId)
|
orderInfoService.updateById(new OrderInfo().setId(orderId)
|
||||||
.setStatus(OrderStatusEnums.CANCELLED.getCode()));
|
.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());
|
rabbitPublisher.sendOrderCancelMsg(orderInfo.getId().toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1690,6 +1702,18 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
orderInfoService.updateById(new OrderInfo().setId(orderId)
|
orderInfoService.updateById(new OrderInfo().setId(orderId)
|
||||||
.setStatus(OrderStatusEnums.CANCELLED.getCode())
|
.setStatus(OrderStatusEnums.CANCELLED.getCode())
|
||||||
.setOriginAmount(BigDecimal.ZERO));
|
.setOriginAmount(BigDecimal.ZERO));
|
||||||
|
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);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
BigDecimal totalAmount = BigDecimal.ZERO;
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
||||||
|
|||||||
Reference in New Issue
Block a user