From d4020168658efdee89a633083cd9c14b06c4d863 Mon Sep 17 00:00:00 2001 From: zhangf <1603559716@qq.com> Date: 星期三, 11 九月 2024 17:09:10 +0800 Subject: [PATCH] 修改消息推送时间间隔 --- src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/DataReceiveServiceImpl.java | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/DataReceiveServiceImpl.java b/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/DataReceiveServiceImpl.java index ee3ecc3..4eb1eb3 100644 --- a/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/DataReceiveServiceImpl.java +++ b/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/DataReceiveServiceImpl.java @@ -5,6 +5,7 @@ import com.gkhy.fourierSpecialGasMonitor.commons.domain.Result; import com.gkhy.fourierSpecialGasMonitor.commons.enums.ForeignResultCode; import com.gkhy.fourierSpecialGasMonitor.commons.enums.ResultCode; +import com.gkhy.fourierSpecialGasMonitor.commons.enums.SystemCacheKeyEnum; import com.gkhy.fourierSpecialGasMonitor.commons.exception.DataReceiveException; import com.gkhy.fourierSpecialGasMonitor.decorator.WarningThresholdUpdateEvent; import com.gkhy.fourierSpecialGasMonitor.entity.*; @@ -118,7 +119,7 @@ private static final DateTimeFormatter warnLogFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss"); - private static final String[] DEVICE_EXC_RECEIVER = {"17625323889","18019908965"}; + private static final String[] DEVICE_EXC_RECEIVER = {"17625323889","18019908965","18899396560"}; @PostConstruct public void init() { @@ -200,7 +201,7 @@ descs.add(GasFluxStateEnum.INVERSION_FAILED_10_MINUTES_NO_DATA.getDesc()); } String message = JSON.toJSONString(reqDTO); - //todo 暂时改为实时推送给前端 + //暂时改为实时推送给前端 try { GasDeviceExcWebsocketServer.sendInfo(message,null); } catch (IOException e) { @@ -212,8 +213,7 @@ if (lastLog == null || now.compareTo(lastLog.getTime().plusHours(1)) >= 0) { Map<String, String> mesMap = new HashMap<>(); mesMap.put("message","数据异常,无法进行监测"); - mesMap.put(" level","设备离线"); - //// TODO: 2024/2/22 + mesMap.put(" level","设备离线"); // todo List<String> deviceExcReceiver = Arrays.asList(DEVICE_EXC_RECEIVER); if (!CollectionUtils.isEmpty(deviceExcReceiver)) { List<String> distinctPhone = deviceExcReceiver.stream().distinct().collect(Collectors.toList()); @@ -274,7 +274,7 @@ private void execDataCountAndPush(UploadGasConcentrationReqDTO reqDto){ - RBucket<List<GasCategory>> bucket = redissonClient.getBucket("gas_category_cache_info"); + RBucket<List<GasCategory>> bucket = redissonClient.getBucket(SystemCacheKeyEnum.KEY_GAS_CATEGORY.getKey()); List<GasCategory> gasCategoryCache = bucket.get(); if (CollectionUtils.isEmpty(gasCategoryCache)){ gasCategoryCache = gasCategoryService.list(); @@ -377,7 +377,6 @@ Map<String, String> mesMap = new HashMap<>(); mesMap.put("message",warnTime+" "+gasCategory.getName()); mesMap.put(" level",warnThresholdName); - //todo if (!CollectionUtils.isEmpty(phone)) { List<String> distinctPhone = phone.stream().distinct().collect(Collectors.toList()); logger.info("【气体浓度异常短信发送】-----发送内容:" + content + " 发送时间: " + now + " 接收人手机号:" + distinctPhone); -- Gitblit v1.9.2