Commit 0bc520e7 by wuwenlong

used order open the door bugfix;

parent 41f2fb4a
......@@ -944,7 +944,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
).collect(Collectors.toList()).isEmpty()) {
throw new BaseException("房间取电设备不存在!");
}
if (ObjectUtil.isEmpty(sOrder.getArrivalTime())) {
if (sOrder.getStatus().equals(OrderStatusEnum.UNUSED.getCode())) {
if (RoomStatusEnum.HOLD.getValue().compareTo(sRoomVo.getStatus()) == 0
|| !checkOrderOpenDoor(sOrder)) {
throw new BaseException("房间当前时段已被占用不可开门!");
......@@ -984,9 +984,17 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
cn.hutool.core.date.DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN),
cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1),
DatePattern.NORM_DATETIME_PATTERN), "1", 10L);
} else {
deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone());
if (ObjectUtil.isEmpty(sOrder.getArrivalTime())) {
//语音
deviceOpService.asyncActionExecute(sOrder.getRoomId(), sOrder.getConsumerPhone(), VoiceEnum.OPEN.getCode(),
cn.hutool.core.date.DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN),
cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1),
DatePattern.NORM_DATETIME_PATTERN), "1", 10L);
sOrder.setArrivalTime(new Date());
baseMapper.updateById(sOrder);
}
}
return "开锁成功";
}
......
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