Commit 1dbdec0b by 吕明尚

测试环境开门取消设备

parent a2665a0f
...@@ -7,7 +7,6 @@ import lombok.Data; ...@@ -7,7 +7,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
......
...@@ -1622,23 +1622,23 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1622,23 +1622,23 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if (Objects.isNull(sRoomVo)) { if (Objects.isNull(sRoomVo)) {
throw new BaseException("房间不存在!"); throw new BaseException("房间不存在!");
} }
LambdaQueryWrapper<Device> deviceLambdaQueryWrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<Device> deviceLambdaQueryWrapper = new LambdaQueryWrapper<>();
deviceLambdaQueryWrapper.eq(Device::getRoomId, sOrder.getRoomId()); // deviceLambdaQueryWrapper.eq(Device::getRoomId, sOrder.getRoomId());
deviceLambdaQueryWrapper.in(Device::getDevType, DeviceType.DEVICE_CCEE.getCode(), DeviceType.DEVICE_0001.getCode()); // deviceLambdaQueryWrapper.in(Device::getDevType, DeviceType.DEVICE_CCEE.getCode(), DeviceType.DEVICE_0001.getCode());
List<Device> deviceList = deviceService.list(deviceLambdaQueryWrapper); // List<Device> deviceList = deviceService.list(deviceLambdaQueryWrapper);
if (CollectionUtils.isEmpty(deviceList)) { // if (CollectionUtils.isEmpty(deviceList)) {
throw new BaseException("房间设备缺失!"); // throw new BaseException("房间设备缺失!");
} // }
if (deviceList.stream().filter(device -> // if (deviceList.stream().filter(device ->
device.getDevType().equals(DeviceType.DEVICE_CCEE.getCode()) // device.getDevType().equals(DeviceType.DEVICE_CCEE.getCode())
).collect(Collectors.toList()).isEmpty()) { // ).collect(Collectors.toList()).isEmpty()) {
throw new BaseException("房间门锁设备不存在!"); // throw new BaseException("房间门锁设备不存在!");
} // }
if (deviceList.stream().filter(item -> // if (deviceList.stream().filter(item ->
item.getDevType().equals(DeviceType.DEVICE_0001.getCode()) // item.getDevType().equals(DeviceType.DEVICE_0001.getCode())
).collect(Collectors.toList()).isEmpty()) { // ).collect(Collectors.toList()).isEmpty()) {
throw new BaseException("房间取电设备不存在!"); // throw new BaseException("房间取电设备不存在!");
} // }
//当前房间是否有保洁任务 //当前房间是否有保洁任务
LambdaQueryWrapper<SCleanRecords> recordsQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SCleanRecords> recordsQueryWrapper = new LambdaQueryWrapper<>();
recordsQueryWrapper.eq(SCleanRecords::getRoomId, sOrder.getRoomId()); recordsQueryWrapper.eq(SCleanRecords::getRoomId, sOrder.getRoomId());
...@@ -1688,24 +1688,25 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1688,24 +1688,25 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
roomService.updateById(sRoom); roomService.updateById(sRoom);
redisUtil.delete(ReceiptRdeisEnum.ORDER_NO.getValue() + sOrder.getOrderNo()); redisUtil.delete(ReceiptRdeisEnum.ORDER_NO.getValue() + sOrder.getOrderNo());
//开门、取电 //开门、取电
deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone(),DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode()); // deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone(),DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode());
//语音 //语音
deviceOpService.asyncActionExecute(sOrder.getRoomId(), sOrder.getConsumerPhone(), VoiceEnum.OPEN.getCode(), // 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(new Date(), DatePattern.NORM_DATETIME_PATTERN),
cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1), // cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1),
DatePattern.NORM_DATETIME_PATTERN), "1", 30L, DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode()); // DatePattern.NORM_DATETIME_PATTERN), "1", 30L, DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode());
} else { }
deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone(),DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode()); // else {
if (ObjectUtil.isEmpty(sOrder.getArrivalTime())) { // deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone(),DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode());
//语音 // 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), // deviceOpService.asyncActionExecute(sOrder.getRoomId(), sOrder.getConsumerPhone(), VoiceEnum.OPEN.getCode(),
cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1), // cn.hutool.core.date.DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN),
DatePattern.NORM_DATETIME_PATTERN), "1", 30L, DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode()); // cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1),
sOrder.setArrivalTime(new Date()); // DatePattern.NORM_DATETIME_PATTERN), "1", 30L, DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode());
baseMapper.updateById(sOrder); // sOrder.setArrivalTime(new Date());
} // baseMapper.updateById(sOrder);
} // }
// }
return "开锁成功"; 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