huangzhen
2023-12-28 d6ae4bd543971312b51ba0e40b2565f63ed682e0
src/main/java/com/gkhy/fourierSpecialGasMonitor/schedule/HeartbeatSchedule.java
@@ -42,14 +42,14 @@
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    //@Scheduled(cron = "1 * * * * *") // 每分钟执行一次
    @Scheduled(cron = "1 * * * * ?") // 每天凌晨执行
    @Scheduled(cron = "0/30 * * * * ?")
    @Async(value = "SocketTaskExecutor")
    public void gasConcentrationStatus() {
        GasConcentration gasConcentration = gasConcentrationService.getLastData();
        if (gasConcentration != null){
            LocalDateTime lastReceiveTime = gasConcentration.getDataReceivingTime().plusMinutes(1);
            LocalDateTime lastReceiveTime = gasConcentration.getDataReceivingTime().plusMinutes(2);
            if (LocalDateTime.now().compareTo(lastReceiveTime) > 0){
                try {
                    heartbeatExcWebsocketServer.sendInfo(HeartbeatExecEnum.GAS_CONCENTRATION.getStatus()+"",null);
@@ -61,7 +61,7 @@
                    if (save == null)
                        throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"设备异常日志保存失败");
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_WEBSOCKET_SEND_INFO_FAIL.getCode(),"设备异常消息推送失败");
                }
            }
        }
@@ -84,7 +84,7 @@
                    if (save == null)
                        throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"设备异常日志保存失败");
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_WEBSOCKET_SEND_INFO_FAIL.getCode(),"设备异常消息推送失败");
                }
            }
        }