|
@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xy.config.DeviceThreadPoolConfig;
|
|
|
import com.xy.dbmapper.SyncUpdate;
|
|
|
-import com.xy.device.EnumDevcieDoorStatus;
|
|
|
import com.xy.device.EnumDeviceTempConfig;
|
|
|
import com.xy.device.EnumMqttCmdTempletTask;
|
|
|
-import com.xy.dto.*;
|
|
|
+import com.xy.dto.CommandMqtt;
|
|
|
+import com.xy.dto.DeviceEventMsgDto;
|
|
|
+import com.xy.dto.DeviceStatusDto;
|
|
|
+import com.xy.dto.DeviceTempRecordsDto;
|
|
|
import com.xy.entity.*;
|
|
|
import com.xy.mapper.DeviceStatusMapper;
|
|
|
import com.xy.mapper.entity.DeviceStatusCount;
|
|
@@ -68,26 +70,11 @@ public class DeviceStatusServiceImpl extends ServiceImpl<DeviceStatusMapper, Dev
|
|
|
@ApiOperation("上报信息")
|
|
|
public R up(DeviceStatusDto.Up up) {
|
|
|
log.info("设备信息上报:{}", JSONUtil.toJsonStr(up));
|
|
|
- ThreadPoolUtils.excPoll(DeviceThreadPoolConfig.DEVICE_STATUS_UP, 4)
|
|
|
+ ThreadPoolUtils.excPoll(DeviceThreadPoolConfig.DEVICE_STATUS_UP, 3)
|
|
|
.execute(() -> {
|
|
|
//修改状态信息
|
|
|
updateById(copy(DeviceStatus.class, up).setUpdateTime(LocalDateTime.now()));
|
|
|
})
|
|
|
- .execute(() -> {
|
|
|
- //上报关门
|
|
|
- if (!Emptys.check(up.getDoorStateL())) {
|
|
|
- return;
|
|
|
- }
|
|
|
- Integer value = SysDictUtils.getValue(EnumDevcieDoorStatus.Code.CODE.getCode(), EnumDevcieDoorStatus.LOCKED.getCode(), Integer.class);
|
|
|
- if (!up.getDoorStateL().equals(value)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- activityInfoService.abort(new ActivityInfoDto.Abort()
|
|
|
- .setDeviceId(up.getDeviceId())
|
|
|
- .setWorkType(2)
|
|
|
- .setTimeout(60 * 1)
|
|
|
- );
|
|
|
- })
|
|
|
.execute(() -> {
|
|
|
//温度上报
|
|
|
if (!Emptys.check(up.getTempValue())) {
|