| | |
| | | |
| | | |
| | | |
| | | @Scheduled(cron = "0 0/1 * * * ?") |
| | | @Scheduled(cron = "0 0/10 * * * ?") |
| | | @Async(value = "SocketTaskExecutor") |
| | | public void gasConcentrationStatus() { |
| | | GasConcentration gasConcentration = gasConcentrationService.getLastData(); |
| | | if (gasConcentration != null){ |
| | | LocalDateTime lastReceiveTime = gasConcentration.getDataReceivingTime().plusMinutes(2); |
| | | LocalDateTime lastReceiveTime = gasConcentration.getDataReceivingTime().plusMinutes(10); |
| | | if (LocalDateTime.now().compareTo(lastReceiveTime) > 0){ |
| | | try { |
| | | heartbeatExcWebsocketServer.sendInfo(HeartbeatExecEnum.GAS_CONCENTRATION.getStatus()+"",null); |
| | |
| | | deviceExceptionLog.setTime(now); |
| | | deviceExceptionLog.setContent(content); |
| | | deviceExceptionLog.setExecDesc(HeartbeatExecEnum.GAS_CONCENTRATION.getDesc()); |
| | | deviceExceptionLog.setDelFlag(0); |
| | | DeviceExceptionLog save = deviceExceptionLogService.save(deviceExceptionLog); |
| | | if (save == null) |
| | | throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"设备异常日志保存失败"); |
| | |
| | | deviceExceptionLog.setTime(now); |
| | | deviceExceptionLog.setContent(content); |
| | | deviceExceptionLog.setExecDesc(HeartbeatExecEnum.GAS_FLUX.getDesc()); |
| | | deviceExceptionLog.setDelFlag(0); |
| | | DeviceExceptionLog save = deviceExceptionLogService.save(deviceExceptionLog); |
| | | if (save == null) |
| | | throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"设备异常日志保存失败"); |