Commit 8c9a7505 by 吕明尚

定时任务增加异常捕获

parent e78932ff
......@@ -275,7 +275,8 @@ public class RedisTask {
add(OrderStatusEnum.INUSE.getCode());
}});
List<SOrder> sOrders = isOrderService.list(queryWrapper);
keys.stream().forEach(o -> {
for (String o : keys) {
try {
//获取key对应的value
String value = redisUtil.get(String.valueOf(o));
JSONObject jsonObject = new JSONObject(value);
......@@ -299,12 +300,12 @@ public class RedisTask {
DateUtil.format(DateUtil.offsetMinute(new Date(), 1), DatePattern.NORM_DATETIME_PATTERN), "1",
DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode());
logger.debug("订单号为:" + sOrder.getOrderNo() + "的订单距离结束时间还有15分钟");
// 从门店集合中判断门店id相同的门店对象
// 从门店集合中判断门店id相同的门店对象
SOrder finalSOrder = sOrder;
SStore sStore = sStoreList.stream().filter(item -> item.getId().equals(finalSOrder.getStoreId())).findFirst().orElse(null);
// 从房间集合中判断房间id相同的房间对象
// 从房间集合中判断房间id相同的房间对象
SRoom sRoom = sRoomList.stream().filter(item -> item.getId().equals(finalSOrder.getRoomId())).findFirst().orElse(null);
// 通知用户
// 通知用户
smsService.sendSmsOrderEndRemind(sOrder.getConsumerPhone(), sStore, sRoom);
//推送订单结束消息
wechatNewService.sendMiniSubscribeMessage(sOrder, MessageReminderEnum.END);
......@@ -375,7 +376,10 @@ public class RedisTask {
redisUtil.set(ReceiptRdeisEnum.ROOM_EXPIRE_TIME.getValue() + sOrder.getOrderNo(), json.toString());
logger.debug("订单号为:" + sOrder.getOrderNo() + "的订单已结束,更改订单状态为已使用");
}
});
} catch (BaseException e) {
continue;
}
}
logger.debug("AutoAddSCleanRecords:自动添加保洁记录结束");
}
@XxlJob("autoRoomExpireTime")
......
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