From 4abd5e9c815cbbfccfe97fc0b2bca612b2b24991 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 24 Jul 2024 10:50:46 +0800 Subject: [PATCH 01/11] =?UTF-8?q?#=E6=B0=B4=E4=BD=8D=E8=B0=83=E5=BA=A6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduled/RealTargetScheduledTask.java | 1 + .../home/impl/ObtainGenerationServiceImpl.java | 25 +++++++++++----------- .../operation/home/impl/RealTargetServiceImpl.java | 11 ++++++---- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java index 4e68cab..9591c87 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java @@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Arrays; diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java index a6ff70d..0259de2 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java @@ -19,7 +19,6 @@ import com.hnac.hzims.scheduled.service.operation.home.ObtainGenerationService; import com.hnac.hzims.scheduled.service.operation.plate.DataService; import com.hnac.hzims.scheduled.service.operation.station.StationService; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; -import io.undertow.util.CopyOnWriteMap; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.CollectionUtil; @@ -65,6 +64,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("obtain-generation-pool-%d").build() , new ThreadPoolExecutor.CallerRunsPolicy()); + /** * 设备近3年发电量数据 : 按月分割 * @param param @@ -135,8 +135,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { CountDownLatch countDownLatch = new CountDownLatch(limits.size()); List saves = new CopyOnWriteArrayList<>(); for(List item : limits){ - try{ - pool.submit(()->{ + pool.submit(()->{ + try{ item.forEach(station->{ // 站点设备集合 List eminfos = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList()); @@ -179,10 +179,11 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { }); countDownLatch.countDown(); log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList())); - }); - }catch (Exception e){ - log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); - } + }catch (Exception e){ + countDownLatch.countDown(); + log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); + } + }); } // 等待所有线程执行完成 try { @@ -220,9 +221,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 3); calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH)); String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; - stations.forEach(station->{ - this.threeGenerateService.saveBatch(this.saveFillGenerate(station,start,end)); - }); + stations.forEach(station-> this.threeGenerateService.saveBatch(this.saveFillGenerate(station,start,end))); } /** @@ -310,6 +309,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList())); }); }catch (Exception e){ + countDownLatch.countDown(); log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); } } @@ -382,6 +382,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList())); }); }catch (Exception e){ + countDownLatch.countDown(); log.error("save_generation_execute_complete_error : {}" ,e.getMessage()); } } @@ -486,9 +487,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { // 接收月份发电量对象 Map son = new HashMap<>(); // 遍历月份数据 - months.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(iter -> { - son.put(iter.getKey(), (float) iter.getValue().stream().mapToDouble(o -> o.getGenerate().doubleValue()).sum()); - }); + months.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(iter -> son.put(iter.getKey(), (float) iter.getValue().stream().mapToDouble(o -> o.getGenerate().doubleValue()).sum())); container.put(optional.get().getId(), son); }); redisTemplate.opsForValue().set(recent_year_power_data, container); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 67f90ce..52e5fd1 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -127,7 +127,7 @@ public class RealTargetServiceImpl implements RealTargetService { private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key"; // 创建线程池 - private static final ExecutorService pool = new ThreadPoolExecutor(20, 20, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("load-power-data-pool-%d").build() , new ThreadPoolExecutor.CallerRunsPolicy()); + private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("load-power-data-pool-%d").build() , new ThreadPoolExecutor.CallerRunsPolicy()); @Override public void loadEmInfo(String param) { @@ -573,19 +573,22 @@ public class RealTargetServiceImpl implements RealTargetService { waterLevelVo.setRearCurveMap(rearCurveMap); list.add(waterLevelVo); } + log.error("load_water_level : 线程执行完成 {}", item.getInstanceCode()); countDownLatch.countDown(); - }catch (Exception exception){ - log.error("load_water_level_error : {}",exception.getMessage()); + } catch (Exception exception) { + log.error("load_water_level_error : 线程执行失败 {}", exception.getMessage()); countDownLatch.countDown(); } }); } try { + log.error("load_water_level :等待线程执行"); countDownLatch.await(); } catch (InterruptedException e) { e.printStackTrace(); Thread.currentThread().interrupt(); } + log.error("load_water_level :线程执行完成"); redisTemplate.opsForValue().set(loadwater_level_key,list); } @@ -1132,7 +1135,7 @@ public class RealTargetServiceImpl implements RealTargetService { } /** - * 获取水位当年数据 + * 获取水位当日数据 * @param instanceCode * @param signage * @return From a919638092a4c2ed5e0c6546ceee23af5630e5b2 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 24 Jul 2024 12:29:35 +0800 Subject: [PATCH 02/11] =?UTF-8?q?#=E6=B0=B4=E4=BD=8D=E8=B0=83=E5=BA=A6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/scheduled/ScheduledApplication.java | 4 +- .../scheduled/RealTargetScheduledTask.java | 7 +- .../operation/home/impl/RealTargetServiceImpl.java | 78 ++++++++++++---------- 3 files changed, 49 insertions(+), 40 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java index 6b524df..676adbb 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java @@ -21,11 +21,11 @@ import javax.annotation.Resource; @Resource public class ScheduledApplication extends SpringBootServletInitializer { public static void main(String[] args) { - BladeApplication.run("hzims-scheduled", ScheduledApplication.class, args); + BladeApplication.run("hzims-scheduled-ysj", ScheduledApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { - return BladeApplication.createSpringApplicationBuilder(builder, "hzims-scheduled", ScheduledApplication.class); + return BladeApplication.createSpringApplicationBuilder(builder, "hzims-scheduled-ysj", ScheduledApplication.class); } } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java index 9591c87..a2b873f 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java @@ -110,9 +110,10 @@ public class RealTargetScheduledTask { /** * 水利-站点水位数据 */ - @XxlJob(LOAD_WATER_LEVEL) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadWaterLevel(String param) { + //@XxlJob(LOAD_WATER_LEVEL) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadWaterLevel() { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 52e5fd1..522184b 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -545,40 +545,9 @@ public class RealTargetServiceImpl implements RealTargetService { List list = new CopyOnWriteArrayList<>(); CountDownLatch countDownLatch = new CountDownLatch(modelList.size()); for(HzimsAnalyzeModelStationEntity item : modelList){ - pool.submit(() -> { - try{ - List multiAnalyzeCodePOList=new ArrayList<>(); - MultiAnalyzeCodePO multiAnalyzeCodePO=new MultiAnalyzeCodePO(); - multiAnalyzeCodePO.setDeviceCode(item.getInstanceCode()); - multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL)); - multiAnalyzeCodePOList.add(multiAnalyzeCodePO); - R>result=analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList); - if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData())){ - WaterLevelVo waterLevelVo=new WaterLevelVo(); - waterLevelVo.setStationCode(item.getStationId()); - // 前水位 - double frontWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); - waterLevelVo.setFrontWaterLevel(frontWaterLevel); - // 后水位 - double rearWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); - waterLevelVo.setRearWaterLevel(rearWaterLevel); - // 下泄流量 - double dischargeFlow=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.DISCHARGE_FLOW); - waterLevelVo.setDischargeFlow(dischargeFlow); - // 前水位当日曲线 - Map frontCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); - waterLevelVo.setFrontCurveMap(frontCurveMap); - // 后水位当日曲线 - Map rearCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); - waterLevelVo.setRearCurveMap(rearCurveMap); - list.add(waterLevelVo); - } - log.error("load_water_level : 线程执行完成 {}", item.getInstanceCode()); - countDownLatch.countDown(); - } catch (Exception exception) { - log.error("load_water_level_error : 线程执行失败 {}", exception.getMessage()); - countDownLatch.countDown(); - } + pool.execute(() -> { + this.queryWaterLeve(list,item); + countDownLatch.countDown(); }); } try { @@ -588,11 +557,50 @@ public class RealTargetServiceImpl implements RealTargetService { e.printStackTrace(); Thread.currentThread().interrupt(); } - log.error("load_water_level :线程执行完成"); + log.error("load_water_level :线程执行结束"); redisTemplate.opsForValue().set(loadwater_level_key,list); } /** + * 水位数据查询 + * @param list + * @param item + */ + private void queryWaterLeve(List list,HzimsAnalyzeModelStationEntity item) { + try{ + List multiAnalyzeCodePOList=new ArrayList<>(); + MultiAnalyzeCodePO multiAnalyzeCodePO=new MultiAnalyzeCodePO(); + multiAnalyzeCodePO.setDeviceCode(item.getInstanceCode()); + multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL)); + multiAnalyzeCodePOList.add(multiAnalyzeCodePO); + R>result=analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList); + if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData())){ + WaterLevelVo waterLevelVo=new WaterLevelVo(); + waterLevelVo.setStationCode(item.getStationId()); + // 前水位 + double frontWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); + waterLevelVo.setFrontWaterLevel(frontWaterLevel); + // 后水位 + double rearWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); + waterLevelVo.setRearWaterLevel(rearWaterLevel); + // 下泄流量 + double dischargeFlow=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.DISCHARGE_FLOW); + waterLevelVo.setDischargeFlow(dischargeFlow); + // 前水位当日曲线 + Map frontCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); + waterLevelVo.setFrontCurveMap(frontCurveMap); + // 后水位当日曲线 + Map rearCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); + waterLevelVo.setRearCurveMap(rearCurveMap); + list.add(waterLevelVo); + } + log.error("load_water_level : 小节线程执行完成 {}", item.getInstanceCode()); + } catch (Exception exception) { + log.error("load_water_level_error : 线程执行失败 {}", exception.getMessage()); + } + } + + /** * 光伏站-逆变器实时加载 * * @param param From 1aa0c912a34cc294304ef386efb342e7dd6ba6db Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 24 Jul 2024 16:13:04 +0800 Subject: [PATCH 03/11] =?UTF-8?q?#sdk=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7f?= =?UTF-8?q?ix.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/scheduled/ScheduledApplication.java | 4 +- .../scheduled/RealTargetScheduledTask.java | 7 +- .../operation/home/impl/RealTargetServiceImpl.java | 81 ++++++++++------------ pom.xml | 15 ++-- 4 files changed, 50 insertions(+), 57 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java index 676adbb..6b524df 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java @@ -21,11 +21,11 @@ import javax.annotation.Resource; @Resource public class ScheduledApplication extends SpringBootServletInitializer { public static void main(String[] args) { - BladeApplication.run("hzims-scheduled-ysj", ScheduledApplication.class, args); + BladeApplication.run("hzims-scheduled", ScheduledApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { - return BladeApplication.createSpringApplicationBuilder(builder, "hzims-scheduled-ysj", ScheduledApplication.class); + return BladeApplication.createSpringApplicationBuilder(builder, "hzims-scheduled", ScheduledApplication.class); } } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java index a2b873f..9591c87 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java @@ -110,10 +110,9 @@ public class RealTargetScheduledTask { /** * 水利-站点水位数据 */ - //@XxlJob(LOAD_WATER_LEVEL) - @Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadWaterLevel() { - String param = ""; + @XxlJob(LOAD_WATER_LEVEL) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadWaterLevel(String param) { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 522184b..0392d17 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.operation.home.impl; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -39,6 +40,7 @@ import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; import com.hnac.hzinfo.sdk.v5.device.dto.ReductionDataDTO; import com.hnac.hzinfo.sdk.v5.device.vo.ReductionDataVO; +import com.xxl.job.core.log.XxlJobLogger; import io.undertow.util.CopyOnWriteMap; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -546,59 +548,52 @@ public class RealTargetServiceImpl implements RealTargetService { CountDownLatch countDownLatch = new CountDownLatch(modelList.size()); for(HzimsAnalyzeModelStationEntity item : modelList){ pool.execute(() -> { - this.queryWaterLeve(list,item); - countDownLatch.countDown(); + try{ + List multiAnalyzeCodePOList = new ArrayList<>(); + MultiAnalyzeCodePO multiAnalyzeCodePO = new MultiAnalyzeCodePO(); + multiAnalyzeCodePO.setDeviceCode(item.getInstanceCode()); + multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL)); + multiAnalyzeCodePOList.add(multiAnalyzeCodePO); + R> result = analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList); + if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData())){ + WaterLevelVo waterLevelVo=new WaterLevelVo(); + waterLevelVo.setStationCode(item.getStationId()); + // 前水位 + double frontWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); + waterLevelVo.setFrontWaterLevel(frontWaterLevel); + // 后水位 + double rearWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); + waterLevelVo.setRearWaterLevel(rearWaterLevel); + // 下泄流量 + double dischargeFlow=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.DISCHARGE_FLOW); + waterLevelVo.setDischargeFlow(dischargeFlow); + // 前水位当日曲线 + Map frontCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); + waterLevelVo.setFrontCurveMap(frontCurveMap); + // 后水位当日曲线 + Map rearCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); + waterLevelVo.setRearCurveMap(rearCurveMap); + list.add(waterLevelVo); + } + countDownLatch.countDown(); + XxlJobLogger.log("load_water_level : 子线程执行完成 {}", item.getInstanceCode()); + } catch (Exception exception) { + countDownLatch.countDown(); + XxlJobLogger.log("load_water_level_error : 子线程执行失败 {}", exception.getMessage()); + } }); - } + } try { - log.error("load_water_level :等待线程执行"); + XxlJobLogger.log("load_water_level :等待线程执行"); countDownLatch.await(); } catch (InterruptedException e) { e.printStackTrace(); Thread.currentThread().interrupt(); } - log.error("load_water_level :线程执行结束"); + XxlJobLogger.log("load_water_level :线程执行结束"); redisTemplate.opsForValue().set(loadwater_level_key,list); } - /** - * 水位数据查询 - * @param list - * @param item - */ - private void queryWaterLeve(List list,HzimsAnalyzeModelStationEntity item) { - try{ - List multiAnalyzeCodePOList=new ArrayList<>(); - MultiAnalyzeCodePO multiAnalyzeCodePO=new MultiAnalyzeCodePO(); - multiAnalyzeCodePO.setDeviceCode(item.getInstanceCode()); - multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL)); - multiAnalyzeCodePOList.add(multiAnalyzeCodePO); - R>result=analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList); - if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData())){ - WaterLevelVo waterLevelVo=new WaterLevelVo(); - waterLevelVo.setStationCode(item.getStationId()); - // 前水位 - double frontWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); - waterLevelVo.setFrontWaterLevel(frontWaterLevel); - // 后水位 - double rearWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); - waterLevelVo.setRearWaterLevel(rearWaterLevel); - // 下泄流量 - double dischargeFlow=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.DISCHARGE_FLOW); - waterLevelVo.setDischargeFlow(dischargeFlow); - // 前水位当日曲线 - Map frontCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); - waterLevelVo.setFrontCurveMap(frontCurveMap); - // 后水位当日曲线 - Map rearCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); - waterLevelVo.setRearCurveMap(rearCurveMap); - list.add(waterLevelVo); - } - log.error("load_water_level : 小节线程执行完成 {}", item.getInstanceCode()); - } catch (Exception exception) { - log.error("load_water_level_error : 线程执行失败 {}", exception.getMessage()); - } - } /** * 光伏站-逆变器实时加载 diff --git a/pom.xml b/pom.xml index fee8f9d..90876d9 100644 --- a/pom.xml +++ b/pom.xml @@ -75,8 +75,7 @@ com.hnac.hzinfo.data hzinfo-data-sdk - - 5.1.1.RELEASE.fix.5 + 5.1.1.RELEASE.fix.8 com.xuxueli @@ -89,6 +88,12 @@ 3.3.2 + + org.apache.httpcomponents + httpclient + 4.5.2 + + com.hnac.hzims @@ -163,12 +168,6 @@ - org.apache.httpcomponents - httpclient - 4.5.2 - - - com.google.zxing core 3.1.0 From ffecf0ffdb5ea7d2304c62a540347edb04db1a5b Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 1 Aug 2024 10:26:55 +0800 Subject: [PATCH 04/11] =?UTF-8?q?#=E6=96=B0=E7=89=88=E7=94=B5=E7=AB=99?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/home/impl/RealTargetServiceImpl.java | 186 +++++++++++++++++---- 1 file changed, 152 insertions(+), 34 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 0392d17..527d67a 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -1,6 +1,5 @@ package com.hnac.hzims.scheduled.service.operation.home.impl; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -8,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.hnac.hzims.EquipmentConstants; import com.hnac.hzims.equipment.entity.EmParamEntity; +import com.hnac.hzims.equipment.entity.ThirtyGenerationEntity; +import com.hnac.hzims.equipment.entity.ThreeGenerationEntity; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.hzimsweather.feign.IHeWeatherWeatherClient; import com.hnac.hzims.hzimsweather.vo.RainFallCountByMonthVo; @@ -20,6 +21,8 @@ import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.scheduled.service.equipment.DeviceParamService; import com.hnac.hzims.scheduled.service.equipment.DeviceService; +import com.hnac.hzims.scheduled.service.equipment.ThirtyGenerateService; +import com.hnac.hzims.scheduled.service.equipment.ThreeGenerateService; import com.hnac.hzims.scheduled.service.operation.fill.*; import com.hnac.hzims.scheduled.service.operation.home.ModelStationService; import com.hnac.hzims.scheduled.service.operation.home.RealTargetService; @@ -38,8 +41,6 @@ import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO; import com.hnac.hzinfo.sdk.core.response.HzPage; import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; -import com.hnac.hzinfo.sdk.v5.device.dto.ReductionDataDTO; -import com.hnac.hzinfo.sdk.v5.device.vo.ReductionDataVO; import com.xxl.job.core.log.XxlJobLogger; import io.undertow.util.CopyOnWriteMap; import lombok.RequiredArgsConstructor; @@ -58,7 +59,6 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.*; @@ -98,6 +98,10 @@ public class RealTargetServiceImpl implements RealTargetService { private final ModelStationService modelStationService; + private final ThreeGenerateService threeGenerateService; + + private final ThirtyGenerateService thirtyGenerateService; + private final RedisTemplate redisTemplate; private final IHeWeatherWeatherClient heWeatherWeatherClient; @@ -278,6 +282,10 @@ public class RealTargetServiceImpl implements RealTargetService { if(CollectionUtil.isEmpty(stations)){ return; } + // 设备30日发电量 + List generations = this.thirtyGenerations(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); + // 设备当年发电量 + List generationYears = this.threeGenerations(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); // 补充填补发电指标 List targets = this.generteFill(stations); // 水电站设备 @@ -289,19 +297,20 @@ public class RealTargetServiceImpl implements RealTargetService { try{ HydropowerUnitTargetVo target = new HydropowerUnitTargetVo(); target.setDeptId(device.getCreateDept()); + Optional station = stations.stream().filter(o->o.getRefDept().equals(device.getCreateDept())).findFirst(); + station.ifPresent(stationEntity -> target.setDeptName(stationEntity.getName())); target.setDeviceCode(device.getEmCode()); target.setDeviceName(device.getName()); - target.setDeptName(device.getName()); // 当年发电量 - target.setPowerYear(this.getGenerationPower(device, 0)); + target.setPowerYear(this.devicePowerYear(generationYears,device)); // 当月发电量 - target.setPowerMon(this.getGenerationPower(device, 1)); + target.setPowerMon(this.devicePowerMon(generationYears,device)); // 当日发电量 - target.setPowerDay(this.getGenerationPower(device, 2)); + target.setPowerDay(this.devicePowerDay(generations,device)); // 当天有功功率 target.setActivePowerVoList(this.getLoadsByDay(device)); // 30天发电量 - target.setGenerationPowerVoList(this.getGenerationPowerList(device)); + target.setGenerationPowerVoList(this.getGenerationPowerList(generations,device)); targets.add(target); countDownLatch.countDown(); }catch (Exception exception){ @@ -323,6 +332,75 @@ public class RealTargetServiceImpl implements RealTargetService { redisTemplate.opsForValue().set(load_hydropower_unit_target_key,targets); } + + /** + * 去年发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerYesterYear(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o -> StringUtil.isNotBlank(o.getDeviceCode()) && o.getDeviceCode().equals(device.getEmCode())).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + + /** + * 当年发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerYear(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o -> StringUtil.isNotBlank(o.getDeviceCode()) && o.getDeviceCode().equals(device.getEmCode())).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + + /** + * 当月发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerMon(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o-> StringUtil.isNotBlank(o.getDeviceCode()) && o.getDeviceCode().equals(device.getEmCode()) && o.getStrMonth().contains(DateUtil.format(new Date(),"yyyy-MM"))).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + + } + + /** + * 设备当日发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerDay(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + return (float) generations.stream().filter(o->o.getDeviceCode().equals(device.getEmCode()) && o.getStrDay().contains(DateUtil.format(new Date(),DateUtil.PATTERN_DATE))).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + + /** + * 设备昨日发电量 + * @param generations + * @param device + * @return + */ + private Float devicePowerYesterDay(List generations, EminfoAndEmParamVo device) { + if(CollectionUtil.isEmpty(generations)){ + return 0f; + } + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_MONTH,-1); + return (float) generations.stream().filter(o->o.getDeviceCode().equals(device.getEmCode()) && o.getStrDay().contains(DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE))).mapToDouble(o->o.getGenerate().doubleValue()).sum(); + } + /** * 水利-泵组实时加载 * @param param @@ -1365,9 +1443,6 @@ public class RealTargetServiceImpl implements RealTargetService { in(StationEntity::getType, types); } }}); - // 设备信息 -// List devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference>() { -// }); // 开始时间 Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12); @@ -1381,8 +1456,6 @@ public class RealTargetServiceImpl implements RealTargetService { Map> powerMap = new HashMap<>(); stationList.forEach(station -> { // 站点设备集合 -// List stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList()); -// log.error("load_power_data station :" + station.getCode() + "==== device :" + stationDevices ); Map generateMap = this.getGenerateYearByWindEnergy(station,start,end); if(MapUtils.isEmpty(generateMap)){ return; @@ -1890,33 +1963,78 @@ public class RealTargetServiceImpl implements RealTargetService { return dataService.periodTargetFloat(start,end,5,accessRules,device.getEmCode(),device.getRideCount(),HomePageConstant.HYDROPOWER_GENERATE_POWER); } + /** - * 近30天发电量 - * @param device + * 站点设备近30天发电量 + * @param stations * @return */ - private List getGenerationPowerList(EminfoAndEmParamVo device) { + private List thirtyGenerations(List stations) { Calendar calendar = Calendar.getInstance(); String end = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME); calendar.add(Calendar.DAY_OF_MONTH,-29); - calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); - calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE)); - calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND)); - String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME); - List records = dataService.periodTargetData(start,end,5,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER); - if(CollectionUtil.isEmpty(records)){ - return new ArrayList<>(); - } - return records.stream().map(record -> { - GenerationPowerVo generate = new GenerationPowerVo(); - Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); - generate.setDate(DateUtil.format(time,DateUtil.PATTERN_DATE)); - if(StringUtil.isEmpty(record.getVal())){ - generate.setGenerate(0f); + String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATE); + return thirtyGenerateService.list(Wrappers.lambdaQuery() + .in(ThirtyGenerationEntity::getStationId,stations) + .ge(ThirtyGenerationEntity::getStrDay,start) + .le(ThirtyGenerationEntity::getStrDay,end) + ); + } + + /** + * 站点设备今年发电量 + * @param stations + * @return + */ + private List threeGenerations(List stations) { + return threeGenerateService.list(Wrappers.lambdaQuery() + .in(ThreeGenerationEntity::getStationId,stations) + .like(ThreeGenerationEntity::getStrMonth,DateUtil.format(new Date(),"yyyy")) + ); + } + + /** + * 查询设备去年发电量 + * @param stations + * @return + */ + private List threeYesterGenerations(List stations) { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.YEAR,-1); + return threeGenerateService.list(Wrappers.lambdaQuery() + .in(ThreeGenerationEntity::getStationId,stations) + .like(ThreeGenerationEntity::getStrMonth,DateUtil.format(calendar.getTime(),"yyyy")) + ); + } + + + /** + * 设备近30天发电量组装 + * @param generations + * @param device + * @return + */ + private List getGenerationPowerList(List generations,EminfoAndEmParamVo device) { + Calendar calendar = Calendar.getInstance(); + Date end = calendar.getTime(); + calendar.add(Calendar.DAY_OF_MONTH,-29); + Date start = calendar.getTime(); + List powers = new ArrayList<>(); + while (end.compareTo(start) >= 0){ + GenerationPowerVo power = new GenerationPowerVo(); + if (CollectionUtil.isEmpty(generations)) { + power.setDate(DateUtil.format(start,DateUtil.PATTERN_DATE)); + power.setGenerate(0f); }else{ - generate.setGenerate(Float.parseFloat(String.valueOf(Double.parseDouble(record.getVal()) * device.getRideCount()))); + String date = DateUtil.format(start,DateUtil.PATTERN_DATE); + power.setDate(date); + power.setGenerate((float) generations.stream().filter(iter->iter.getDeviceCode().equals(device.getEmCode()) && iter.getStrDay().contains(date)).mapToDouble(o->o.getGenerate().doubleValue()).sum()); } - return generate; - }).collect(Collectors.toList()); + calendar.add(Calendar.DAY_OF_MONTH,1); + powers.add(power); + start = calendar.getTime(); + } + return powers; } + } \ No newline at end of file From f6570f00b42690b6bccbd15660c530528e4bed7c Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 1 Aug 2024 10:57:56 +0800 Subject: [PATCH 05/11] =?UTF-8?q?#=E7=A5=81=E9=98=B3=E5=9B=A2=E7=BB=93?= =?UTF-8?q?=E5=8A=9F=E7=8E=87=E7=BB=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduled/service/operation/monitor/impl/MonitorServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index 279ef93..ed55ba7 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -361,7 +361,7 @@ public class MonitorServiceImpl implements MonitorService { device.setState(-1); return; } - if("0.000000".equals(powers.get(0).getValue()) || "-".equals(powers.get(0).getValue()) || HomePageConstant.ON.equals(powers.get(0).getValue())){ + if("0.000000".equals(powers.get(0).getValue()) || "0.000005".equals(powers.get(0).getValue()) || "-".equals(powers.get(0).getValue()) || HomePageConstant.ON.equals(powers.get(0).getValue())){ device.setState(-1); return; } From 39d1799b045720515c02cbf0a8cec808705c07d2 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 7 Aug 2024 11:04:56 +0800 Subject: [PATCH 06/11] =?UTF-8?q?#=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java | 10 +++------- .../main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java | 9 ++------- .../java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java | 11 +++-------- .../main/java/com/hnac/hzims/alarm/mqtt/SoeMqttConsumer.java | 9 +++------ .../java/com/hnac/hzims/alarm/mqtt/VideoMqttConsumer.java | 9 +++------ 5 files changed, 14 insertions(+), 34 deletions(-) diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java index 87acece..e52a759 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java @@ -29,16 +29,12 @@ public class DroolsMqttConsumer implements SubscribeCallBack { private AlarmSaveService alarmSaveService; @Override public void onMessage(Map data) { - log.info("DroolsMqttConsumer监听到消息"+data.toString()); + log.error("DroolsMqttConsumer监听到消息"+data.toString()); String s = JSONObject.toJSONString(data); //消费代码 List alarmEntities = droolsAlarmService.receiveMessage(s); + log.error("监听规则引擎有效消息 : {}" ,alarmEntities.get(0).getAlarmId()); //统一数据处理 - try { - alarmSaveService.save(alarmEntities); - }catch (Exception e){ - log.error("规则引擎告警数据处理报错(DroolsAlarm):"+e); - System.out.println("规则引擎告警数据处理报错(DroolsAlarm):"+e); - } + alarmSaveService.save(alarmEntities); } } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java index 827825c..aa5f4ca 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java @@ -29,18 +29,13 @@ public class FdpMqttConsumer implements SubscribeCallBack { @Override public void onMessage(Map data) { String s = JSONObject.toJSONString(data); - log.info("监听Fdp消息 : {}" ,s); + log.error("FdpMqttConsumer监听到消息 : {}" ,s); //消费代码 List alarmEntities = fdpAlarmService.receiveMessage(s); if(CollectionUtil.isEmpty(alarmEntities)){ return; } log.error("监听Fdp有效消息 : {}" ,alarmEntities.get(0).getAlarmId()); - //统一数据处理 - try { - alarmSaveService.save(alarmEntities); - }catch (Exception e){ - throw new ServiceException("集中监控告警数据处理报错(FdpAlarm):"+e); - } + alarmSaveService.save(alarmEntities); } } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java index 82880ad..c891b9f 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java @@ -29,18 +29,13 @@ public class HZ300MqttConsumer implements SubscribeCallBack { private AlarmSaveService alarmSaveService; @Override public void onMessage(Map data) { - log.error("HZ3000队列监听到消息 : {}",data); + log.error("HZ3000MqttConsumer监听到消息 : {}",data); //消费代码 List alarmEntities = systemAlarmService.receiveMessage(JSONObject.toJSONString(data)); if(CollectionUtil.isEmpty(alarmEntities)){ - log.error("HZ3000消息转换数据异常"); return; } - //统一数据处理 - try { - alarmSaveService.save(alarmEntities); - }catch (Exception e){ - log.error("HZ3000告警数据处理报错(HZ300Alarm):{}" , e.getMessage()); - } + log.error("监听HZ3000有效消息 : {}" ,alarmEntities.get(0).getAlarmId()); + alarmSaveService.save(alarmEntities); } } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/SoeMqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/SoeMqttConsumer.java index 13fae87..2ecbe66 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/SoeMqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/SoeMqttConsumer.java @@ -27,15 +27,12 @@ public class SoeMqttConsumer implements SubscribeCallBack { private AlarmSaveService alarmSaveService; @Override public void onMessage(Map data) { - log.info("SoeMqttConsumer监听到消息"+data.toString()); + log.error("SoeMqttConsumer监听到消息"+data.toString()); String s = JSONObject.toJSONString(data); //消费代码 List alarmEntities = soeAlarmService.receiveMessage(s); + log.error("监听设备实例有效消息 : {}" ,alarmEntities.get(0).getAlarmId()); //统一数据处理 - try { - alarmSaveService.save(alarmEntities); - }catch (Exception e){ - log.error("条件告警数据处理报错(SoeAlarm):"+e); - } + alarmSaveService.save(alarmEntities); } } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/VideoMqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/VideoMqttConsumer.java index 447db7b..eaa9ef6 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/VideoMqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/VideoMqttConsumer.java @@ -26,15 +26,12 @@ public class VideoMqttConsumer implements SubscribeCallBack { private AlarmSaveService alarmSaveService; @Override public void onMessage(Map data) { - log.info("VideoMqttConsumer队列监听到消息 : {}",data); + log.error("VideoMqttConsumer监听到消息 : {}",data); String s = JSONObject.toJSONString(data); //消费代码 List alarmEntities = videoAlarmService.receiveMessage(s); + log.error("监听视频告警有效消息 : {}" ,alarmEntities.get(0).getAlarmId()); //统一数据处理 - try { - alarmSaveService.save(alarmEntities); - }catch (Exception e){ - log.error("HZ3000告警数据处理报错(HZ300Alarm):"+e); - } + alarmSaveService.save(alarmEntities); } } From 44b1e25b165ae474aa8cef94bb5ec6a6866f909f Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 8 Aug 2024 20:01:35 +0800 Subject: [PATCH 07/11] =?UTF-8?q?#=E5=91=8A=E8=AD=A6=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/alarm/mqtt/MqttConfig.java | 4 ++-- .../source/service/impl/SoeAlarmServiceImpl.java | 19 +++++++++++-------- .../operation/monitor/impl/MonitorServiceImpl.java | 6 ++---- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java index 6a2c34e..2c78b7d 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/MqttConfig.java @@ -72,9 +72,9 @@ public class MqttConfig { MqttAsyncClient hz3000Client = hz3000SoeSubscribe.subscribe(mqttConfig, Collections.singletonList("#"), hz300MqttConsumer); log.info(hz3000Client.toString()+hz3000Client.getClientId()); //视频 - SoeSubscribe subscribe = new SoeSubscribe(); + /*SoeSubscribe subscribe = new SoeSubscribe(); MqttAsyncClient videoClient = subscribe.subscribe(mqttConfig, Collections.singletonList("#"), videoMqttConsumer); - log.info(videoClient.toString()+videoClient.getClientId()); + log.info(videoClient.toString()+videoClient.getClientId());*/ }catch (MqttException e){ log.error(e.toString()) ; } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java index cf05d3d..dfff6be 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java @@ -3,27 +3,24 @@ package com.hnac.hzims.alarm.source.service.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.hnac.hzims.alarm.config.entity.AlarmEntity; -import com.hnac.hzims.alarm.config.vo.DroolsAlarmVo; import com.hnac.hzims.alarm.config.vo.SoeAlarmVo; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.source.service.DroolsAlarmService; import com.hnac.hzims.alarm.source.service.MessageService; import com.hnac.hzims.alarm.source.service.SoeAlarmService; import com.hnac.hzims.common.constant.CommonConstant; -import com.hnac.hzims.common.utils.CommonUtil; import com.hnac.hzims.common.utils.DateUtil; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.time.ZoneId; -import java.util.*; +import java.util.Collections; +import java.util.List; import java.util.stream.Collectors; import static com.hnac.hzims.alarm.config.constants.AlarmConstants.*; @@ -60,10 +57,9 @@ public class SoeAlarmServiceImpl implements SoeAlarmService { private AlarmEntity getAlarmEntity(SoeAlarmVo item) { AlarmEntity entity = new AlarmEntity(); - String format = DateUtil.format(item.getTs(), org.springblade.core.tool.utils.DateUtil.PATTERN_DATETIME_MINI); - entity.setAlarmId(format+"-"+item.getDeviceCode()); + String format = DateUtil.format(item.getTs(),DateUtil.PATTERN_DATETIME_MINI); + entity.setAlarmId(format); entity.setAlarmSource(LEVEL_ALARM); - entity.setAlarmType(ONE_LEVEL); entity.setAlarmContext(item.getName()); ZoneId zoneId = ZoneId.systemDefault(); LocalDateTime localDateTime = LocalDateTime.ofInstant(item.getTs().toInstant(), zoneId); @@ -71,6 +67,13 @@ public class SoeAlarmServiceImpl implements SoeAlarmService { entity.setAlarmValue(item.getCurrentValue()); entity.setAlarmSignage(item.getSignage()); entity.setAlarmLevel(Integer.valueOf(item.getLevel())); + if(entity.getAlarmLevel() == 0){ + entity.setAlarmType(ONE_LEVEL); + }else if (entity.getAlarmLevel() == 1){ + entity.setAlarmType(TWO_LEVEL); + }else { + entity.setAlarmType(THREE_LEVEL); + } entity.setAlarmStatus(1); entity.setDeviceCode(item.getDeviceCode()); entity.setTenantId(CommonConstant.TENANT_ID); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index ed55ba7..3fbfb56 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -78,7 +78,7 @@ public class MonitorServiceImpl implements MonitorService { private final IAnalyseDataSearchClient analyseDataSearchClient; - private static final ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); + private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); @Value("${hzims.equipment.emInfo.emInfoList}") @@ -191,13 +191,12 @@ public class MonitorServiceImpl implements MonitorService { // 数据切割 int limit = countStep(stationRealVos.size()); List> list = Stream.iterate(0, n -> n + 1).limit(limit).parallel().map(a -> stationRealVos.stream().skip((long) a * 5).limit(5).parallel().collect(Collectors.toList())).collect(Collectors.toList()); - ExecutorService pool = Executors.newFixedThreadPool(limit); // Map valueMap = new ConcurrentHashMap<>(); // > Map> keyMap = new ConcurrentHashMap<>(); CountDownLatch countDownLatch = new CountDownLatch(limit); - pool.execute(()-> list.forEach(stations -> { + pool.execute(()-> list.forEach(stations -> { stations.forEach(stationReal -> { String[] realIdArr = stationReal.getRealId(); List realIds = Stream.of(realIdArr).collect(Collectors.toList()); @@ -230,7 +229,6 @@ public class MonitorServiceImpl implements MonitorService { e.printStackTrace(); Thread.currentThread().interrupt(); } - pool.shutdown(); // redis 存储 redisTemplate.opsForValue().set(real_cache_final,JSONObject.toJSONString(valueMap)); redisTemplate.opsForValue().set(real_gather_cache_final,JSONObject.toJSONString(keyMap)); From cf8f6896cac492a1e3edac176a69606a13bb5d39 Mon Sep 17 00:00:00 2001 From: Jone <515616805@qq.com> Date: Fri, 9 Aug 2024 16:32:52 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=88=A0=E9=99=A4iml=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blade-gateway/blade-gateway.iml | 293 ---------------- hzims-back.iml | 81 ----- hzims-biz-common/hzims-biz-common.iml | 287 ---------------- hzims-service-api/alarm-api/alarm-api.iml | 288 ---------------- hzims-service-api/assets-api/assets-api.iml | 321 ----------------- hzims-service-api/base-info-api/base-info-api.iml | 239 ------------- hzims-service-api/basic-api/basic-api.iml | 297 ---------------- hzims-service-api/common-api/common-api.iml | 300 ---------------- .../dam-safety-api/dam-safety-api.iml | 239 ------------- .../digital-twin-display-api.iml | 238 ------------- hzims-service-api/equipment-api/equipment-api.iml | 295 ---------------- .../hzims-operational-api.iml | 311 ----------------- hzims-service-api/hzims-service-api.iml | 276 --------------- hzims-service-api/inspect-api/inspect-api.iml | 18 - hzims-service-api/message-api/message-api.iml | 298 ---------------- .../safeproduct-api/safeproduct-api.iml | 8 - hzims-service-api/spare-api/spare-api.iml | 226 ------------ hzims-service-api/ticket-api/ticket-api.iml | 313 ----------------- hzims-service-api/topvision-api/topvision-api.iml | 287 ---------------- .../video-image-api/video-image-api.iml | 239 ------------- .../water-quality-api/water-quality-api.iml | 239 ------------- .../water-rain-api/water-rain-api.iml | 239 ------------- hzims-service/assets/assets.iml | 364 -------------------- hzims-service/equipment/hzims-equipment.iml | 369 -------------------- hzims-service/hzims-alarm/hzims-alarm.iml | 339 ------------------ hzims-service/hzims-basic/hzims-basic.iml | 341 ------------------ hzims-service/hzims-service.iml | 291 ---------------- hzims-service/inspect/hzinfo-inspect.iml | 18 - hzims-service/message/message.iml | 363 -------------------- hzims-service/operational/hzims-operational.iml | 363 -------------------- hzims-service/safeproduct/safeproduct.iml | 380 --------------------- hzims-service/ticket/hzims-ticket.iml | 368 -------------------- hzims-service/topvision/topvision.iml | 344 ------------------- 33 files changed, 8872 deletions(-) delete mode 100644 blade-gateway/blade-gateway.iml delete mode 100644 hzims-back.iml delete mode 100644 hzims-biz-common/hzims-biz-common.iml delete mode 100644 hzims-service-api/alarm-api/alarm-api.iml delete mode 100644 hzims-service-api/assets-api/assets-api.iml delete mode 100644 hzims-service-api/base-info-api/base-info-api.iml delete mode 100644 hzims-service-api/basic-api/basic-api.iml delete mode 100644 hzims-service-api/common-api/common-api.iml delete mode 100644 hzims-service-api/dam-safety-api/dam-safety-api.iml delete mode 100644 hzims-service-api/digital-twin-display-api/digital-twin-display-api.iml delete mode 100644 hzims-service-api/equipment-api/equipment-api.iml delete mode 100644 hzims-service-api/hzims-operational-api/hzims-operational-api.iml delete mode 100644 hzims-service-api/hzims-service-api.iml delete mode 100644 hzims-service-api/inspect-api/inspect-api.iml delete mode 100644 hzims-service-api/message-api/message-api.iml delete mode 100644 hzims-service-api/safeproduct-api/safeproduct-api.iml delete mode 100644 hzims-service-api/spare-api/spare-api.iml delete mode 100644 hzims-service-api/ticket-api/ticket-api.iml delete mode 100644 hzims-service-api/topvision-api/topvision-api.iml delete mode 100644 hzims-service-api/video-image-api/video-image-api.iml delete mode 100644 hzims-service-api/water-quality-api/water-quality-api.iml delete mode 100644 hzims-service-api/water-rain-api/water-rain-api.iml delete mode 100644 hzims-service/assets/assets.iml delete mode 100644 hzims-service/equipment/hzims-equipment.iml delete mode 100644 hzims-service/hzims-alarm/hzims-alarm.iml delete mode 100644 hzims-service/hzims-basic/hzims-basic.iml delete mode 100644 hzims-service/hzims-service.iml delete mode 100644 hzims-service/inspect/hzinfo-inspect.iml delete mode 100644 hzims-service/message/message.iml delete mode 100644 hzims-service/operational/hzims-operational.iml delete mode 100644 hzims-service/safeproduct/safeproduct.iml delete mode 100644 hzims-service/ticket/hzims-ticket.iml delete mode 100644 hzims-service/topvision/topvision.iml diff --git a/blade-gateway/blade-gateway.iml b/blade-gateway/blade-gateway.iml deleted file mode 100644 index 66b262b..0000000 --- a/blade-gateway/blade-gateway.iml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-back.iml b/hzims-back.iml deleted file mode 100644 index 219078a..0000000 --- a/hzims-back.iml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-biz-common/hzims-biz-common.iml b/hzims-biz-common/hzims-biz-common.iml deleted file mode 100644 index 2a5f11b..0000000 --- a/hzims-biz-common/hzims-biz-common.iml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/alarm-api/alarm-api.iml b/hzims-service-api/alarm-api/alarm-api.iml deleted file mode 100644 index c167c30..0000000 --- a/hzims-service-api/alarm-api/alarm-api.iml +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/assets-api/assets-api.iml b/hzims-service-api/assets-api/assets-api.iml deleted file mode 100644 index ea3ac1c..0000000 --- a/hzims-service-api/assets-api/assets-api.iml +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/base-info-api/base-info-api.iml b/hzims-service-api/base-info-api/base-info-api.iml deleted file mode 100644 index 3e0824c..0000000 --- a/hzims-service-api/base-info-api/base-info-api.iml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/basic-api/basic-api.iml b/hzims-service-api/basic-api/basic-api.iml deleted file mode 100644 index cdcc109..0000000 --- a/hzims-service-api/basic-api/basic-api.iml +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/common-api/common-api.iml b/hzims-service-api/common-api/common-api.iml deleted file mode 100644 index 1990bc3..0000000 --- a/hzims-service-api/common-api/common-api.iml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/dam-safety-api/dam-safety-api.iml b/hzims-service-api/dam-safety-api/dam-safety-api.iml deleted file mode 100644 index 3e0824c..0000000 --- a/hzims-service-api/dam-safety-api/dam-safety-api.iml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/digital-twin-display-api/digital-twin-display-api.iml b/hzims-service-api/digital-twin-display-api/digital-twin-display-api.iml deleted file mode 100644 index 277c4cb..0000000 --- a/hzims-service-api/digital-twin-display-api/digital-twin-display-api.iml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/equipment-api/equipment-api.iml b/hzims-service-api/equipment-api/equipment-api.iml deleted file mode 100644 index ba71ce8..0000000 --- a/hzims-service-api/equipment-api/equipment-api.iml +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/hzims-operational-api/hzims-operational-api.iml b/hzims-service-api/hzims-operational-api/hzims-operational-api.iml deleted file mode 100644 index e4b498c..0000000 --- a/hzims-service-api/hzims-operational-api/hzims-operational-api.iml +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/hzims-service-api.iml b/hzims-service-api/hzims-service-api.iml deleted file mode 100644 index 0fc3a82..0000000 --- a/hzims-service-api/hzims-service-api.iml +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/inspect-api/inspect-api.iml b/hzims-service-api/inspect-api/inspect-api.iml deleted file mode 100644 index 40defed..0000000 --- a/hzims-service-api/inspect-api/inspect-api.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/message-api/message-api.iml b/hzims-service-api/message-api/message-api.iml deleted file mode 100644 index 37d66d3..0000000 --- a/hzims-service-api/message-api/message-api.iml +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/safeproduct-api.iml b/hzims-service-api/safeproduct-api/safeproduct-api.iml deleted file mode 100644 index 1daccae..0000000 --- a/hzims-service-api/safeproduct-api/safeproduct-api.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/spare-api/spare-api.iml b/hzims-service-api/spare-api/spare-api.iml deleted file mode 100644 index 660192e..0000000 --- a/hzims-service-api/spare-api/spare-api.iml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/ticket-api/ticket-api.iml b/hzims-service-api/ticket-api/ticket-api.iml deleted file mode 100644 index 02fe1c6..0000000 --- a/hzims-service-api/ticket-api/ticket-api.iml +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/topvision-api/topvision-api.iml b/hzims-service-api/topvision-api/topvision-api.iml deleted file mode 100644 index 4e0e3d6..0000000 --- a/hzims-service-api/topvision-api/topvision-api.iml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/video-image-api/video-image-api.iml b/hzims-service-api/video-image-api/video-image-api.iml deleted file mode 100644 index 3e0824c..0000000 --- a/hzims-service-api/video-image-api/video-image-api.iml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/water-quality-api/water-quality-api.iml b/hzims-service-api/water-quality-api/water-quality-api.iml deleted file mode 100644 index 3e0824c..0000000 --- a/hzims-service-api/water-quality-api/water-quality-api.iml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service-api/water-rain-api/water-rain-api.iml b/hzims-service-api/water-rain-api/water-rain-api.iml deleted file mode 100644 index 3e0824c..0000000 --- a/hzims-service-api/water-rain-api/water-rain-api.iml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/assets/assets.iml b/hzims-service/assets/assets.iml deleted file mode 100644 index ce48480..0000000 --- a/hzims-service/assets/assets.iml +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/equipment/hzims-equipment.iml b/hzims-service/equipment/hzims-equipment.iml deleted file mode 100644 index f654d02..0000000 --- a/hzims-service/equipment/hzims-equipment.iml +++ /dev/null @@ -1,369 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/hzims-alarm/hzims-alarm.iml b/hzims-service/hzims-alarm/hzims-alarm.iml deleted file mode 100644 index bdc9342..0000000 --- a/hzims-service/hzims-alarm/hzims-alarm.iml +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/hzims-basic/hzims-basic.iml b/hzims-service/hzims-basic/hzims-basic.iml deleted file mode 100644 index e3753b5..0000000 --- a/hzims-service/hzims-basic/hzims-basic.iml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/hzims-service.iml b/hzims-service/hzims-service.iml deleted file mode 100644 index 06a88a4..0000000 --- a/hzims-service/hzims-service.iml +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/inspect/hzinfo-inspect.iml b/hzims-service/inspect/hzinfo-inspect.iml deleted file mode 100644 index 40defed..0000000 --- a/hzims-service/inspect/hzinfo-inspect.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/message/message.iml b/hzims-service/message/message.iml deleted file mode 100644 index 4ad42fe..0000000 --- a/hzims-service/message/message.iml +++ /dev/null @@ -1,363 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/operational/hzims-operational.iml b/hzims-service/operational/hzims-operational.iml deleted file mode 100644 index dd41660..0000000 --- a/hzims-service/operational/hzims-operational.iml +++ /dev/null @@ -1,363 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/safeproduct/safeproduct.iml b/hzims-service/safeproduct/safeproduct.iml deleted file mode 100644 index 0abed5b..0000000 --- a/hzims-service/safeproduct/safeproduct.iml +++ /dev/null @@ -1,380 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/ticket/hzims-ticket.iml b/hzims-service/ticket/hzims-ticket.iml deleted file mode 100644 index fd84d02..0000000 --- a/hzims-service/ticket/hzims-ticket.iml +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/topvision/topvision.iml b/hzims-service/topvision/topvision.iml deleted file mode 100644 index 2371ba1..0000000 --- a/hzims-service/topvision/topvision.iml +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From e71ee9a69f072d1ea5773190bdc3aca819d07090 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 12 Aug 2024 08:37:06 +0800 Subject: [PATCH 09/11] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/monitor/impl/MonitorServiceImpl.java | 54 +++++++++++++--------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index 3fbfb56..bb23b2d 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -78,7 +78,7 @@ public class MonitorServiceImpl implements MonitorService { private final IAnalyseDataSearchClient analyseDataSearchClient; - private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); + private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 60L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(256), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); @Value("${hzims.equipment.emInfo.emInfoList}") @@ -196,7 +196,7 @@ public class MonitorServiceImpl implements MonitorService { // > Map> keyMap = new ConcurrentHashMap<>(); CountDownLatch countDownLatch = new CountDownLatch(limit); - pool.execute(()-> list.forEach(stations -> { + pool.execute(()-> list.forEach(stations -> { stations.forEach(stationReal -> { String[] realIdArr = stationReal.getRealId(); List realIds = Stream.of(realIdArr).collect(Collectors.toList()); @@ -222,9 +222,12 @@ public class MonitorServiceImpl implements MonitorService { }); countDownLatch.countDown(); })); - // 等待所有线程执行完成 try { - countDownLatch.await(); + // 等待所有线程执行完成(至多等待三秒,超过三秒任务认为线程发生阻塞) + boolean flag = countDownLatch.await(3,TimeUnit.SECONDS); + if(!flag){ + log.error("实时数据调度发生阻塞 : {}" , DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); + } } catch (InterruptedException e) { e.printStackTrace(); Thread.currentThread().interrupt(); @@ -299,27 +302,36 @@ public class MonitorServiceImpl implements MonitorService { for(Map> item : limit){ // 提交线程任务 pool.submit(()->{ - item.forEach((key,value)->{ - RealStationVo realStation = new RealStationVo(); - // 设备信息 - List devices = this.monitorRealDevice(value,realTimeData); - // 设备状态 - this.deviceStatus(devices,deviceClassifyMap); - realStation.setDeviceList(devices.stream().sorted(Comparator.comparing(RealDeviceVo::getDeviceName)).collect(Collectors.toList())); - // 站点基础信息: 编码、名称、限制水位、服务类型、机构、排序 - this.stationBaseInfo(stations.stream().filter(station->key.equals(station.getCode())).findFirst(),sorts,realStation); - // 站点总功率计算 - this.stationActivePower(devices,realStation); - // 站点铃铛、数据中断状态 - this.stationStatus(aborts,bells,realStation); - realStations.add(realStation); - }); - countDownLatch.countDown(); + try{ + item.forEach((key,value)->{ + RealStationVo realStation = new RealStationVo(); + // 设备信息 + List devices = this.monitorRealDevice(value,realTimeData); + // 设备状态 + this.deviceStatus(devices,deviceClassifyMap); + realStation.setDeviceList(devices.stream().sorted(Comparator.comparing(RealDeviceVo::getDeviceName)).collect(Collectors.toList())); + // 站点基础信息: 编码、名称、限制水位、服务类型、机构、排序 + this.stationBaseInfo(stations.stream().filter(station->key.equals(station.getCode())).findFirst(),sorts,realStation); + // 站点总功率计算 + this.stationActivePower(devices,realStation); + // 站点铃铛、数据中断状态 + this.stationStatus(aborts,bells,realStation); + realStations.add(realStation); + }); + countDownLatch.countDown(); + }catch (Exception e){ + countDownLatch.countDown(); + Thread.currentThread().interrupt(); + } }); } // 等待所有线程执行完成 try { - countDownLatch.await(); + // 等待所有线程执行完成(至多等待二秒,超过二秒任务认为线程发生阻塞) + boolean flag = countDownLatch.await(2,TimeUnit.SECONDS); + if(!flag){ + log.error("集中监控数据调度发生阻塞 : {}" , DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); + } } catch (InterruptedException e) { e.printStackTrace(); Thread.currentThread().interrupt(); From 02dd1fece2b823cb353da21f1eb90d79bf226ae1 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 12 Aug 2024 15:56:27 +0800 Subject: [PATCH 10/11] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BB=BB=E5=8A=A1=E8=BF=90=E8=A1=8C=E5=A0=B5?= =?UTF-8?q?=E5=A1=9E=E9=82=AE=E4=BB=B6=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/common/constant/CommonConstant.java | 1 + .../operation/monitor/impl/MonitorServiceImpl.java | 31 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/CommonConstant.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/CommonConstant.java index 71e02f3..16e5c92 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/CommonConstant.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/constant/CommonConstant.java @@ -59,4 +59,5 @@ public interface CommonConstant { */ Long SYSTEM_USER = 1434782836098891778L; + Long SYSTEM_DEPT_ID = 20000001L; } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index bb23b2d..b7a2a03 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -6,11 +6,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.hnac.hzims.common.constant.CommonConstant; import com.hnac.hzims.equipment.entity.WorkshopInfoEntity; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; +import com.hnac.hzims.message.dto.MailPushDto; +import com.hnac.hzims.message.fegin.IPushMsgClient; import com.hnac.hzims.operational.config.enume.ConfigStatus; import com.hnac.hzims.operational.config.vo.StationRealVo; import com.hnac.hzims.operational.main.constant.HomePageConstant; +import com.hnac.hzims.operational.main.vo.AreaMonthReportVo; import com.hnac.hzims.operational.main.vo.RealAttributeVo; import com.hnac.hzims.operational.main.vo.RealDeviceVo; import com.hnac.hzims.operational.main.vo.RealStationVo; @@ -35,6 +39,7 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.*; import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.entity.User; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; @@ -76,6 +81,8 @@ public class MonitorServiceImpl implements MonitorService { private final RedisClient redisClient; + private final IPushMsgClient pushMsgClient; + private final IAnalyseDataSearchClient analyseDataSearchClient; private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 60L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(256), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); @@ -227,6 +234,8 @@ public class MonitorServiceImpl implements MonitorService { boolean flag = countDownLatch.await(3,TimeUnit.SECONDS); if(!flag){ log.error("实时数据调度发生阻塞 : {}" , DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); + // 发生邮件 + this.sendMonthReport("实时数据运行堵塞"); } } catch (InterruptedException e) { e.printStackTrace(); @@ -331,6 +340,8 @@ public class MonitorServiceImpl implements MonitorService { boolean flag = countDownLatch.await(2,TimeUnit.SECONDS); if(!flag){ log.error("集中监控数据调度发生阻塞 : {}" , DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); + // 发生邮件 + this.sendMonthReport("集中监控数据运行堵塞"); } } catch (InterruptedException e) { e.printStackTrace(); @@ -748,4 +759,24 @@ public class MonitorServiceImpl implements MonitorService { } return result; } + + /** + * 推送当月月报 + */ + private void sendMonthReport(String text) { + // 发送邮件 + MailPushDto pushDto = new MailPushDto(); + pushDto.setBusinessClassify("system"); + pushDto.setBusinessKey("Run_Blocking"); + pushDto.setSubject(text); + pushDto.setText(text); + pushDto.setToAccount(Collections.singletonList("1069818635@qq.com").toArray(new String[0])); + pushDto.setHtml(false); + pushDto.setCreateUser(CommonConstant.SYSTEM_USER); + pushDto.setTenantId(CommonConstant.TENANT_ID); + pushDto.setCreateDept(CommonConstant.SYSTEM_DEPT_ID); + pushDto.setMailType(0); + pushDto.setFromAccount("huangxing951023@163.com"); + pushMsgClient.sendMail(pushDto); + } } \ No newline at end of file From d3a9d08b94eaf49ac973ad149c17c32fd1d4164f Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 12 Aug 2024 17:07:38 +0800 Subject: [PATCH 11/11] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BB=BB=E5=8A=A1=E8=BF=90=E8=A1=8C=E5=A0=B5?= =?UTF-8?q?=E5=A1=9E=E9=82=AE=E4=BB=B6=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/monitor/impl/MonitorServiceImpl.java | 62 +++++++++++----------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index b7a2a03..6a39591 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -85,8 +85,9 @@ public class MonitorServiceImpl implements MonitorService { private final IAnalyseDataSearchClient analyseDataSearchClient; - private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 60L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(256), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); + private static final ExecutorService pool = new ThreadPoolExecutor(20, 20, 2L, TimeUnit.MINUTES, new LinkedBlockingQueue<>(256), new ThreadFactoryBuilder().setNameFormat("load-monitoring-pool-%d").build(), new ThreadPoolExecutor.CallerRunsPolicy()); + private static boolean isSendMail = true; @Value("${hzims.equipment.emInfo.emInfoList}") public String device_cache_final; @@ -232,18 +233,19 @@ public class MonitorServiceImpl implements MonitorService { try { // 等待所有线程执行完成(至多等待三秒,超过三秒任务认为线程发生阻塞) boolean flag = countDownLatch.await(3,TimeUnit.SECONDS); - if(!flag){ + if(!flag && isSendMail){ log.error("实时数据调度发生阻塞 : {}" , DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); + isSendMail = false; // 发生邮件 this.sendMonthReport("实时数据运行堵塞"); + }else if(flag){ + // redis 存储 + redisTemplate.opsForValue().set(real_cache_final,JSONObject.toJSONString(valueMap)); + redisTemplate.opsForValue().set(real_gather_cache_final,JSONObject.toJSONString(keyMap)); } } catch (InterruptedException e) { - e.printStackTrace(); Thread.currentThread().interrupt(); } - // redis 存储 - redisTemplate.opsForValue().set(real_cache_final,JSONObject.toJSONString(valueMap)); - redisTemplate.opsForValue().set(real_gather_cache_final,JSONObject.toJSONString(keyMap)); } /** @@ -310,44 +312,40 @@ public class MonitorServiceImpl implements MonitorService { // 切割数据遍历 for(Map> item : limit){ // 提交线程任务 - pool.submit(()->{ - try{ - item.forEach((key,value)->{ - RealStationVo realStation = new RealStationVo(); - // 设备信息 - List devices = this.monitorRealDevice(value,realTimeData); - // 设备状态 - this.deviceStatus(devices,deviceClassifyMap); - realStation.setDeviceList(devices.stream().sorted(Comparator.comparing(RealDeviceVo::getDeviceName)).collect(Collectors.toList())); - // 站点基础信息: 编码、名称、限制水位、服务类型、机构、排序 - this.stationBaseInfo(stations.stream().filter(station->key.equals(station.getCode())).findFirst(),sorts,realStation); - // 站点总功率计算 - this.stationActivePower(devices,realStation); - // 站点铃铛、数据中断状态 - this.stationStatus(aborts,bells,realStation); - realStations.add(realStation); - }); - countDownLatch.countDown(); - }catch (Exception e){ - countDownLatch.countDown(); - Thread.currentThread().interrupt(); - } + pool.execute(()->{ + item.forEach((key,value)->{ + RealStationVo realStation = new RealStationVo(); + // 设备信息 + List devices = this.monitorRealDevice(value,realTimeData); + // 设备状态 + this.deviceStatus(devices,deviceClassifyMap); + realStation.setDeviceList(devices.stream().sorted(Comparator.comparing(RealDeviceVo::getDeviceName)).collect(Collectors.toList())); + // 站点基础信息: 编码、名称、限制水位、服务类型、机构、排序 + this.stationBaseInfo(stations.stream().filter(station->key.equals(station.getCode())).findFirst(),sorts,realStation); + // 站点总功率计算 + this.stationActivePower(devices,realStation); + // 站点铃铛、数据中断状态 + this.stationStatus(aborts,bells,realStation); + realStations.add(realStation); + }); + countDownLatch.countDown(); }); } // 等待所有线程执行完成 try { // 等待所有线程执行完成(至多等待二秒,超过二秒任务认为线程发生阻塞) - boolean flag = countDownLatch.await(2,TimeUnit.SECONDS); - if(!flag){ + boolean flag = countDownLatch.await(3,TimeUnit.SECONDS); + if(!flag && isSendMail){ log.error("集中监控数据调度发生阻塞 : {}" , DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); + isSendMail = false; // 发生邮件 this.sendMonthReport("集中监控数据运行堵塞"); + }else if(flag){ + redisTemplate.opsForValue().set(moniter_station_cache_final, realStations); } } catch (InterruptedException e) { - e.printStackTrace(); Thread.currentThread().interrupt(); } - redisTemplate.opsForValue().set(moniter_station_cache_final, realStations); } /**