Commit 864b6977 by YG8999

自动生成保洁定时任务添加修改房间状态为空闲

parent 86a15486
package share.quartz.task;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse;
......@@ -19,11 +20,10 @@ import share.common.core.redis.RedisUtil;
import share.common.enums.OrderStatusEnum;
import share.common.enums.OrderTypeEnum;
import share.common.enums.ReceiptRdeisEnum;
import share.common.enums.RoomStatusEnum;
import share.system.domain.SOrder;
import share.system.service.ISCleanRecordsService;
import share.system.service.ISConsumerCouponService;
import share.system.service.ISOrderService;
import share.system.service.QPService;
import share.system.domain.SRoom;
import share.system.service.*;
import java.io.IOException;
import java.util.Date;
......@@ -51,6 +51,9 @@ public class RedisTask {
@Autowired
private ISOrderService isOrderService;
@Autowired
private ISRoomService roomService;
public void AuToReceiptCode() {
//获取redis中所有以tuangou.receipt.prepare开头的key
......@@ -128,6 +131,13 @@ public class RedisTask {
//更改订单状态
sOrder.setStatus(OrderStatusEnum.USED.getCode());
isOrderService.updateById(sOrder);
// 修改房间状态
SRoom room = roomService.getById(sOrder.getRoomId());
if (ObjectUtil.isNotEmpty(room)) {
room.setStatus(RoomStatusEnum.FREE.getValue());
room.setUpdateTime(new Date());
roomService.updateById(room);
}
//判断订单是否已经添加保洁记录
boolean b = isCleanRecordsService.addSCleanRecords(sOrder.getStoreId(), sOrder.getRoomId());
if (b) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment