Commit 680216d4 by 吕明尚

分享开门增加语音播报

parent 5ae7bd84
package share.system.service.impl; package share.system.service.impl;
import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -133,8 +134,25 @@ public class OpenInterfaceServiceImpl implements OpenInterfaceService { ...@@ -133,8 +134,25 @@ public class OpenInterfaceServiceImpl implements OpenInterfaceService {
throw new BaseException("当前房间待保洁中,请等待!"); throw new BaseException("当前房间待保洁中,请等待!");
} }
} }
//开门、取电
deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone(), DeviceOpSourceEnum.DEVICE_SOURCE_20.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(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1),
DatePattern.NORM_DATETIME_PATTERN), "1", 30L, DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode());
} else {
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),
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());
sOrder.setArrivalTime(new Date());
orderService.updateById(sOrder);
}
} }
deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone(), DeviceOpSourceEnum.DEVICE_SOURCE_20.getCode());
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