From dae160fd763d69c1846083c6aa855d1009cc5ed7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Mon, 22 May 2023 12:34:57 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=AE=9A=E6=97=B6=E4=BB=BB?=
=?UTF-8?q?=E5=8A=A1=E6=A8=A1=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hzims-service/hzims-scheduled/pom.xml | 242 +++++++
.../hnac/hzims/scheduled/ScheduledApplication.java | 31 +
.../hnac/hzims/scheduled/config/XxlJobConfig.java | 59 ++
.../scheduled/constants/ScheduledConstants.java | 12 +
.../mapper/operation/AbnormalAlarmMapper.java | 20 +
.../mapper/operation/AbnormalAlarmMapper.xml | 17 +
.../operation/HistoryAbnormalAlarmMapper.java | 21 +
.../operation/HistoryAbnormalAlarmMapper.xml | 10 +
.../operation/HzimsAnalyzeModelStationMapper.java | 13 +
.../mapper/operation/StAlarmRecordMapper.java | 14 +
.../mapper/operation/StAlarmRecordMapper.xml | 19 +
.../mapper/operation/StFocusPropertiesMapper.java | 13 +
.../mapper/operation/StationAttrConfigMapper.java | 13 +
.../mapper/operation/StationAttributeMapper.java | 13 +
.../scheduled/mapper/operation/StationMapper.java | 21 +
.../scheduled/mapper/operation/StationMapper.xml | 26 +
.../scheduled/scheduled/ScheduledCreateTask.java | 46 ++
.../scheduled/scheduled/StAlamRecordTask.java | 101 +++
.../scheduled/service/AbnormalAlarmService.java | 19 +
.../service/HistoryAbnormalAlarmService.java | 16 +
.../service/IHzimsAnalyzeModelStationService.java | 17 +
.../service/IMainSystemMonitoringService.java | 16 +
.../scheduled/service/IRealMonitorService.java | 13 +
.../service/IStationAttrConfigService.java | 16 +
.../service/IStationAttributeService.java | 13 +
.../hzims/scheduled/service/IStationService.java | 27 +
.../hzims/scheduled/service/IWaterService.java | 11 +
.../scheduled/service/StAlamRecordService.java | 14 +
.../service/StFocusPropertiesService.java | 14 +
.../service/impl/AbnormalAlarmServiceImpl.java | 242 +++++++
.../impl/HistoryAbnormalAlarmServiceImpl.java | 41 ++
.../impl/HzimsAnalyzeModelStationServiceImpl.java | 17 +
.../impl/MainSystemMonitoringServiceImpl.java | 51 ++
.../service/impl/RealMonitorServiceImpl.java | 713 +++++++++++++++++++++
.../service/impl/StAlamRecordServiceImpl.java | 42 ++
.../service/impl/StFocusPropertiesServiceImpl.java | 164 +++++
.../service/impl/StationAttrConfigServiceImpl.java | 42 ++
.../service/impl/StationAttributeServiceImpl.java | 22 +
.../scheduled/service/impl/StationServiceImpl.java | 60 ++
.../scheduled/service/impl/WaterServiceImpl.java | 201 ++++++
.../hnac/hzims/scheduled/vo/RealAttributeVo.java | 52 ++
.../com/hnac/hzims/scheduled/vo/RealDeviceVo.java | 33 +
.../com/hnac/hzims/scheduled/vo/RealStationVo.java | 54 ++
.../com/hnac/hzims/scheduled/vo/StationRealVo.java | 17 +
.../com/hnac/hzims/scheduled/vo/WeatherVo.java | 30 +
.../src/main/resources/application.yml | 193 ++++++
.../hzims/scheduled/ScheduledApplicationTest.java | 17 +
hzims-service/pom.xml | 1 +
48 files changed, 2859 insertions(+)
create mode 100644 hzims-service/hzims-scheduled/pom.xml
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/constants/ScheduledConstants.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HzimsAnalyzeModelStationMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StFocusPropertiesMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttrConfigMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttributeMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StAlamRecordTask.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/AbnormalAlarmService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/HistoryAbnormalAlarmService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IHzimsAnalyzeModelStationService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IMainSystemMonitoringService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IRealMonitorService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttrConfigService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttributeService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IWaterService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StAlamRecordService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StFocusPropertiesService.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/AbnormalAlarmServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HistoryAbnormalAlarmServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HzimsAnalyzeModelStationServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/MainSystemMonitoringServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/RealMonitorServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StAlamRecordServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StFocusPropertiesServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StationAttrConfigServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StationAttributeServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/StationServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/WaterServiceImpl.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/vo/RealAttributeVo.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/vo/RealDeviceVo.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/vo/RealStationVo.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/vo/StationRealVo.java
create mode 100644 hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/vo/WeatherVo.java
create mode 100644 hzims-service/hzims-scheduled/src/main/resources/application.yml
create mode 100644 hzims-service/hzims-scheduled/src/test/java/com/hnac/hzims/scheduled/ScheduledApplicationTest.java
diff --git a/hzims-service/hzims-scheduled/pom.xml b/hzims-service/hzims-scheduled/pom.xml
new file mode 100644
index 0000000..4183ad7
--- /dev/null
+++ b/hzims-service/hzims-scheduled/pom.xml
@@ -0,0 +1,242 @@
+
+
+ 4.0.0
+
+ com.hnac.hzims
+ hzims-service
+ 4.0.0-SNAPSHOT
+
+
+ hzims-scheduled
+
+
+ 8
+ 8
+ UTF-8
+
+
+
+ redis.clients
+ jedis
+ 2.9.3
+
+
+ org.springblade
+ blade-core-boot
+
+
+ org.springblade
+ blade-core-cloud
+
+
+
+
+ org.springblade
+ blade-core-cloud
+
+
+ io.github.openfeign
+ feign-okhttp
+
+
+
+
+
+ org.springblade
+ blade-common
+
+
+ org.springblade
+ blade-starter-swagger
+
+
+ com.hnac.hzims
+ hzims-operational-api
+
+
+ com.hnac.hzinfo
+ inspect-api
+
+
+ org.springblade
+ blade-core-test
+ test
+
+
+ org.springblade
+ blade-core-auto
+ provided
+
+
+ org.springblade
+ blade-dict-api
+
+
+ org.springblade
+ blade-flow-api
+
+
+ com.xuxueli
+ xxl-job-core
+
+
+
+
+ org.apache.poi
+ ooxml-schemas
+ 1.4
+
+
+ org.jfree
+ jcommon
+ 1.0.24
+
+
+ org.jfree
+ jfreechart
+ 1.5.0
+
+
+ com.hikvision.ga
+ artemis-http-client
+
+
+
+
+ org.apache.httpcomponents
+ httpclient
+
+
+
+
+
+ org.freemarker
+ freemarker
+
+
+
+
+ com.hnac.hzims
+ equipment-api
+
+
+
+ com.hnac.hzims
+ message-api
+
+
+
+ com.hnac.hzims
+ ticket-api
+
+
+
+ com.hnac.hzims
+ assets-api
+
+
+
+
+ com.google.zxing
+ core
+
+
+ com.google.zxing
+ javase
+
+
+
+ org.springblade
+ blade-user-api
+
+
+
+
+ org.apache.commons
+ commons-collections4
+
+
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+
+
+
+
+
+ cn.hutool
+ hutool-http
+
+
+
+
+ cn.hutool
+ hutool-core
+
+
+
+
+ org.java-websocket
+ Java-WebSocket
+
+
+
+ org.springblade
+ blade-resource-api
+
+
+ com.itextpdf
+ itextpdf
+
+
+ com.hnac.hzims
+ weather-api
+
+
+ com.alibaba
+ fastjson
+
+
+ org.springblade
+ blade-core-tool
+
+
+ org.springblade
+ blade-system-api
+
+
+ com.hnac.hzinfo.data
+ hzinfo-data-sdk
+
+
+
+
+
+ ${project.name}-${project.version}
+
+
+ com.spotify
+ dockerfile-maven-plugin
+
+ ${docker.username}
+ ${docker.password}
+ ${docker.registry.url}/${docker.namespace}/${project.artifactId}
+ ${project.version}
+ true
+
+ target/${project.build.finalName}.jar
+
+ false
+
+
+
+
+
+
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
new file mode 100644
index 0000000..d2772ca
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java
@@ -0,0 +1,31 @@
+package com.hnac.hzims.scheduled;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springblade.core.cloud.feign.EnableBladeFeign;
+import org.springframework.boot.Banner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.cloud.client.SpringCloudApplication;
+import org.springframework.context.annotation.ComponentScan;
+
+import javax.annotation.Resource;
+
+/**
+ * @Author dfy
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 9:05
+ */
+@EnableBladeFeign
+@SpringCloudApplication
+@MapperScan("com.hnac.hzims.scheduled.**.mapper.**")
+@ComponentScan(basePackages = {"com.hnac.*","org.springblade.core.*"})
+@Resource
+public class ScheduledApplication {
+ public static void main(String[] args) {
+ // BladeApplication.run(ScheduledConstants.APP_NAME, ScheduledApplication.class, args);
+ SpringApplication springApplication = new SpringApplication(ScheduledApplication.class);
+ springApplication.setBannerMode(Banner.Mode.OFF);
+ springApplication.run(args);
+ }
+
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java
new file mode 100644
index 0000000..b587329
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java
@@ -0,0 +1,59 @@
+package com.hnac.hzims.scheduled.config;
+
+import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2022/1/8 10:23
+ */
+@Slf4j
+@Configuration
+//指定任务Handler所在包路径
+public class XxlJobConfig {
+
+
+ @Value("${xxl.job.admin.addresses}")
+ private String adminAddresses;
+
+ @Value("${xxl.job.executor.appname}")
+ private String appName;
+
+ @Value("${xxl.job.executor.ip}")
+ private String ip;
+
+ @Value("${xxl.job.executor.port}")
+ private int port;
+
+ @Value("${xxl.job.accessToken}")
+ private String accessToken;
+
+ @Value("${xxl.job.executor.logpath}")
+ private String logPath;
+
+ @Value("${xxl.job.executor.logretentiondays}")
+ private int logRetentionDays;
+
+
+ @Bean(initMethod = "start", destroyMethod = "destroy")
+ public XxlJobSpringExecutor xxlJobExecutor() {
+ log.info("====xxl-job config init====");
+ XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
+ xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
+ xxlJobSpringExecutor.setAppName(appName);
+ xxlJobSpringExecutor.setIp(ip);
+ xxlJobSpringExecutor.setPort(port);
+ xxlJobSpringExecutor.setAccessToken(accessToken);
+ xxlJobSpringExecutor.setLogPath(logPath);
+ xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
+ return xxlJobSpringExecutor;
+ }
+
+}
+
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/constants/ScheduledConstants.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/constants/ScheduledConstants.java
new file mode 100644
index 0000000..037d967
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/constants/ScheduledConstants.java
@@ -0,0 +1,12 @@
+package com.hnac.hzims.scheduled.constants;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 9:06
+ */
+public class ScheduledConstants {
+
+ public final static String APP_NAME = "hzims-scheduled";
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.java
new file mode 100644
index 0000000..b677a4e
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.java
@@ -0,0 +1,20 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:30
+ */
+public interface AbnormalAlarmMapper extends UserDataScopeBaseMapper{
+
+ AbnormalAlarmEntity getAbnormalAlarm(@Param("stationId") String stationId, @Param("type") String type);
+
+ List getAbnormalAlarmList();
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml
new file mode 100644
index 0000000..49c1076
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.java
new file mode 100644
index 0000000..e680c53
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.java
@@ -0,0 +1,21 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 11:12
+ */
+public interface HistoryAbnormalAlarmMapper extends UserDataScopeBaseMapper {
+
+ List getHistoryAbnormalAlarm(@Param("stationId") String stationId, @Param("type") String type);
+
+
+
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml
new file mode 100644
index 0000000..fdbd02b
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HzimsAnalyzeModelStationMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HzimsAnalyzeModelStationMapper.java
new file mode 100644
index 0000000..41ad4ad
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HzimsAnalyzeModelStationMapper.java
@@ -0,0 +1,13 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/22 11:43
+ */
+public interface HzimsAnalyzeModelStationMapper extends BaseMapper {
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.java
new file mode 100644
index 0000000..8b3e211
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.java
@@ -0,0 +1,14 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 15:47
+ */
+public interface StAlarmRecordMapper extends BaseMapper {
+ Long insertReturnId(StAlarmRecordEntity record);
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml
new file mode 100644
index 0000000..cfe513d
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ SELECT LAST_INSERT_ID() AS id
+
+ insert into hy_st_alarm_record (id, station_id, real_id,
+ status, phone_record, process_desc,
+ create_time, processor, process_time
+ )
+ values (#{id,jdbcType=BIGINT}, #{stationId,jdbcType=VARCHAR}, #{realId,jdbcType=VARCHAR},
+ #{status,jdbcType=TINYINT}, #{phoneRecord,jdbcType=VARCHAR}, #{processDesc,jdbcType=VARCHAR},
+ #{createTime,jdbcType=TIMESTAMP}, #{processor,jdbcType=VARCHAR}, #{processTime,jdbcType=TIMESTAMP}
+ )
+
+
+
\ No newline at end of file
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StFocusPropertiesMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StFocusPropertiesMapper.java
new file mode 100644
index 0000000..68d7a3d
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StFocusPropertiesMapper.java
@@ -0,0 +1,13 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 11:28
+ */
+public interface StFocusPropertiesMapper extends BaseMapper {
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttrConfigMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttrConfigMapper.java
new file mode 100644
index 0000000..76a7952
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttrConfigMapper.java
@@ -0,0 +1,13 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hnac.hzims.operational.station.entity.StationAttrConfigEntity;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 16:09
+ */
+public interface StationAttrConfigMapper extends BaseMapper {
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttributeMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttributeMapper.java
new file mode 100644
index 0000000..89cf2a3
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationAttributeMapper.java
@@ -0,0 +1,13 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 11:39
+ */
+public interface StationAttributeMapper extends UserDataScopeBaseMapper {
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.java
new file mode 100644
index 0000000..3b81746
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.java
@@ -0,0 +1,21 @@
+package com.hnac.hzims.scheduled.mapper.operation;
+
+import com.hnac.hzims.operational.station.entity.StationEntity;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:36
+ */
+public interface StationMapper extends UserDataScopeBaseMapper {
+
+ List selectStationByType(Integer stationType, Integer serveType);
+
+ List selectAll();
+
+ List selectStationByInCode(List codes);
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml
new file mode 100644
index 0000000..e5e9daf
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java
new file mode 100644
index 0000000..280ab7e
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java
@@ -0,0 +1,46 @@
+package com.hnac.hzims.scheduled.scheduled;
+
+import com.hnac.hzims.scheduled.service.IWaterService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+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.stereotype.Component;
+
+import java.util.Date;
+
+import static com.hnac.hzims.operational.main.constant.MainConstants.LOAD_WATER_LEVEL;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/22 11:21
+ */
+@Slf4j
+@Component
+public class ScheduledCreateTask {
+
+ @Autowired
+ private IWaterService waterService;
+
+ /**
+ * 水利-站点水位数据
+ * @return ReturnT
+ */
+ @XxlJob(LOAD_WATER_LEVEL)
+ //@Scheduled(cron = "0/40 * * * * ? ")
+ public ReturnT loadWaterLevel(String param) throws Exception {
+ if (Func.isBlank(param)) {
+ param = DateUtil.format(new Date(), "yyyy-MM");
+ }
+ waterService.loadWaterLevel(param);
+ return new ReturnT<>("SUCCESS");
+ }
+
+
+
+
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StAlamRecordTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StAlamRecordTask.java
new file mode 100644
index 0000000..b253c41
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StAlamRecordTask.java
@@ -0,0 +1,101 @@
+package com.hnac.hzims.scheduled.scheduled;
+
+import com.hnac.hzims.scheduled.service.AbnormalAlarmService;
+import com.hnac.hzims.scheduled.service.IRealMonitorService;
+import com.hnac.hzims.scheduled.service.StFocusPropertiesService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+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.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+import static com.hnac.hzims.operational.main.constant.MainConstants.*;
+
+/**
+ * 集中监控
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:17
+ */
+@Slf4j
+@Component
+public class StAlamRecordTask {
+
+ @Value("${hzims.operation.comprehensiveD}")
+ public String path;
+
+ // @Autowired
+ private IRealMonitorService monitorService;
+
+ @Autowired
+ private AbnormalAlarmService abnormalAlarmService;
+
+ @Autowired
+ private StFocusPropertiesService stFocusPropertiesService;
+
+ /**
+ * 数据中断告警
+ * @return ReturnT
+ */
+ @XxlJob(ALARM_DATA_HANDLE)
+ public ReturnT alarmDataHandle(String param) throws Exception {
+ if (Func.isBlank(param)) {
+ param = DateUtil.format(new Date(), "yyyy-MM");
+ }
+ abnormalAlarmService.alarmDataHandle(param);
+ return new ReturnT<>("SUCCESS");
+ }
+
+
+
+ /**
+ * realId获取
+ * @return ReturnT
+ */
+ @XxlJob(REAL_ID_DATA)
+ public ReturnT realIdData(String param) throws Exception {
+ if (Func.isBlank(param)) {
+ param = DateUtil.format(new Date(), "yyyy-MM");
+ }
+ stFocusPropertiesService.getStationRealIds(param);
+ return new ReturnT<>("SUCCESS");
+ }
+
+ /**
+ * 站点实时数据
+ * @return ReturnT
+ */
+ @XxlJob(REAL_TIME_DATA)
+ //@Scheduled(cron = "0/40 * * * * ? ")
+ public ReturnT realTimeData(String param) throws Exception {
+ if (Func.isBlank(param)) {
+ param = DateUtil.format(new Date(), "yyyy-MM");
+ }
+ monitorService.realTimeData(param);
+ return new ReturnT<>("SUCCESS");
+ }
+
+
+
+ /**
+ * 集中监控数据处理
+ * @return ReturnT
+ */
+ @XxlJob(CENTRALIZED_MONITORING)
+ //@Scheduled(cron = "0/40 * * * * ? ")
+ public ReturnT centralizedMonitoring(String param) throws Exception {
+ if (Func.isBlank(param)) {
+ param = DateUtil.format(new Date(), "yyyy-MM");
+ }
+ monitorService.centralizedMonitoring(param);
+ return new ReturnT<>("SUCCESS");
+ }
+
+
+}
\ No newline at end of file
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/AbnormalAlarmService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/AbnormalAlarmService.java
new file mode 100644
index 0000000..180d275
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/AbnormalAlarmService.java
@@ -0,0 +1,19 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * 告警处理接口
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:20
+ */
+public interface AbnormalAlarmService extends BaseService {
+ void alarmDataHandle(String param);
+
+ List getAbnormalAlarmList();
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/HistoryAbnormalAlarmService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/HistoryAbnormalAlarmService.java
new file mode 100644
index 0000000..4c2816e
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/HistoryAbnormalAlarmService.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 11:09
+ */
+public interface HistoryAbnormalAlarmService extends BaseService {
+
+
+ HistoryAbnormalAlarmEntity getAbnormalAlarm(String station, String soeType);
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IHzimsAnalyzeModelStationService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IHzimsAnalyzeModelStationService.java
new file mode 100644
index 0000000..15c7b7a
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IHzimsAnalyzeModelStationService.java
@@ -0,0 +1,17 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/22 11:31
+ */
+public interface IHzimsAnalyzeModelStationService extends BaseService {
+
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IMainSystemMonitoringService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IMainSystemMonitoringService.java
new file mode 100644
index 0000000..d9b6c4e
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IMainSystemMonitoringService.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
+
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 14:00
+ */
+public interface IMainSystemMonitoringService {
+
+ List getEmInfoList();
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IRealMonitorService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IRealMonitorService.java
new file mode 100644
index 0000000..9de496f
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IRealMonitorService.java
@@ -0,0 +1,13 @@
+package com.hnac.hzims.scheduled.service;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:20
+ */
+public interface IRealMonitorService {
+ void realTimeData(String param);
+
+ void centralizedMonitoring(String param);
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttrConfigService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttrConfigService.java
new file mode 100644
index 0000000..747bcc4
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttrConfigService.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.operational.station.entity.StationAttrConfigEntity;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 16:06
+ */
+public interface IStationAttrConfigService extends BaseService {
+ List getHideList();
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttributeService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttributeService.java
new file mode 100644
index 0000000..0713bb1
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationAttributeService.java
@@ -0,0 +1,13 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 11:34
+ */
+public interface IStationAttributeService extends BaseService {
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationService.java
new file mode 100644
index 0000000..246d261
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IStationService.java
@@ -0,0 +1,27 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.operational.station.entity.StationEntity;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:33
+ */
+public interface IStationService extends BaseService {
+
+ List getStationByType(Integer stationType, Integer serveType);
+
+ List getAll();
+
+ List getStationByInCode(List strings);
+
+
+ List getStationType(Integer serveType,List typeList,List departIdList);
+
+
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IWaterService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IWaterService.java
new file mode 100644
index 0000000..e50d049
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/IWaterService.java
@@ -0,0 +1,11 @@
+package com.hnac.hzims.scheduled.service;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/22 11:22
+ */
+public interface IWaterService {
+ void loadWaterLevel(String param);
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StAlamRecordService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StAlamRecordService.java
new file mode 100644
index 0000000..cff89fd
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StAlamRecordService.java
@@ -0,0 +1,14 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 15:41
+ */
+public interface StAlamRecordService extends BaseService {
+ Long insertAlert(String stationId, String monitorId);
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StFocusPropertiesService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StFocusPropertiesService.java
new file mode 100644
index 0000000..479b4b3
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/StFocusPropertiesService.java
@@ -0,0 +1,14 @@
+package com.hnac.hzims.scheduled.service;
+
+import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:21
+ */
+public interface StFocusPropertiesService extends BaseService {
+ void getStationRealIds(String param);
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/AbnormalAlarmServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/AbnormalAlarmServiceImpl.java
new file mode 100644
index 0000000..9a57ee4
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/AbnormalAlarmServiceImpl.java
@@ -0,0 +1,242 @@
+package com.hnac.hzims.scheduled.service.impl;
+
+import com.hnac.hzims.message.MessageConstants;
+import com.hnac.hzims.message.dto.MessagePushRecordDto;
+import com.hnac.hzims.message.fegin.IMessageClient;
+import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
+import com.hnac.hzims.operational.alert.entity.AbnormalAlarmEntity;
+import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
+import com.hnac.hzims.operational.main.constant.HomePageConstant;
+import com.hnac.hzims.operational.station.entity.StationEntity;
+import com.hnac.hzims.scheduled.mapper.operation.AbnormalAlarmMapper;
+import com.hnac.hzims.scheduled.service.AbnormalAlarmService;
+import com.hnac.hzims.scheduled.service.HistoryAbnormalAlarmService;
+import com.hnac.hzims.scheduled.service.IStationService;
+import com.hnac.hzinfo.datasearch.soe.ISoeClient;
+import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
+import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation;
+import com.hnac.hzinfo.sdk.core.response.HzPage;
+import com.hnac.hzinfo.sdk.core.response.Result;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.system.feign.ISysClient;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 10:29
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class AbnormalAlarmServiceImpl extends BaseServiceImpl implements AbnormalAlarmService {
+
+
+ private final IStationService stationService;
+
+
+ private final HistoryAbnormalAlarmService historyAbnormalAlarmService;
+
+ private final ISysClient sysClient;
+
+ private final ISoeClient soeClient;
+
+ private final IUserClient userClient;
+
+ private final IMessageClient messageClient;
+
+
+ /**
+ * 数据中断、数据异常告警
+ * @param param
+ */
+ @Override
+ public void alarmDataHandle(String param) {
+ // 查询代运维站点
+ List stations = stationService.getStationByType(null, HomePageConstant.HYDROPOWER_SERVETYPE);
+ if(CollectionUtil.isEmpty(stations)){
+ return;
+ }
+ SoeQueryConditionByStation query = new SoeQueryConditionByStation();
+ query.setTypes(AbnormalAlarmConstant.SEND_MESSSAGE_TYPE_LIST);
+ query.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
+ Calendar calendar = Calendar.getInstance();
+ query.setEndTime(LocalDateTime.parse(DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
+ calendar.add(Calendar.MINUTE,-2);
+ query.setBeginTime(LocalDateTime.parse(DateUtil.format(calendar.getTime() , DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
+ query.setNeedPage(false);
+ log.error("alarm_data_handle_param : {}",query);
+ Result> result = soeClient.getByStationsAndTime(query);
+ // 未查询到告警信息
+ if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData().getRecords())){
+ return;
+ }
+ log.error("alarm_data_handle_begin_result : {}",result.getData().getRecords());
+ // 遍历告警信息
+ List list = new ArrayList<>(result.getData().getRecords().stream().sorted(Comparator.comparing(SoeData::getTs).reversed())
+ .collect(Collectors.toMap(o -> o.getStation() + o.getSoeType(), Function.identity(), (o1, o2) -> o1)).values());
+ log.error("alarm_data_handle_end_result : {}",list);
+ list.forEach(item -> {
+ AbnormalAlarmEntity queryEntity = this.baseMapper.getAbnormalAlarm(item.getStation(),item.getSoeType());
+ boolean flag = AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType());
+ String stationName = Optional.ofNullable(stations.stream().filter(o-> o.getCode().equals(item.getStation())).collect(Collectors.toList())).map(o->o.get(0).getName()).orElse(null);
+ if(ObjectUtil.isEmpty(queryEntity)){
+ AbnormalAlarmEntity entity = new AbnormalAlarmEntity();
+ entity.setStationId(item.getStation());
+ entity.setStationName(stationName);
+ entity.setRealId(item.getRealId());
+ entity.setSoeExplain(item.getSoeExplain());
+ entity.setType(item.getSoeType());
+ entity.setStartTime(item.getTs());
+ entity.setEndTime(null);
+ entity.setStatus(0);
+ if(flag){
+ entity.setStartTime(null);
+ entity.setEndTime(item.getTs());
+ entity.setStatus(1);
+ }
+ // 保存告警信息
+ this.save(entity);
+ return;
+ }
+ queryEntity.setSoeExplain(item.getSoeExplain());
+ queryEntity.setStationName(stationName);
+ queryEntity.setType(item.getSoeType());
+ queryEntity.setStartTime(queryEntity.getStartTime());
+ queryEntity.setUpdateTime(new Date());
+ queryEntity.setEndTime(null);
+ queryEntity.setStatus(0);
+ if(flag){
+ queryEntity.setEndTime(item.getTs());
+ queryEntity.setStatus(1);
+ }
+ this.updateById(queryEntity);
+ });
+
+ // 异步保存历史告警
+ CompletableFuture.supplyAsync(()-> this.saveHistoryAlarm(result.getData().getRecords(),stations));
+ }
+
+
+ /**
+ * 保存告警历史信息
+ * @param list
+ * @return
+ */
+ private String saveHistoryAlarm(List list,List stations) {
+ list.forEach(item -> {
+ Date ts = DateUtil.parse(DateUtil.format(item.getTs(),DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMAT);
+ // 历史数据异常查询
+ HistoryAbnormalAlarmEntity queryEntity = this.historyAbnormalAlarmService.getAbnormalAlarm(item.getStation(),item.getSoeType());
+ // 数据中断恢复
+ boolean flag = AbnormalAlarmConstant.ABNORMAL_STATUS.equals(item.getSoeAlarmType());
+ String stationName = Optional.ofNullable(stations.stream().filter(o-> o.getCode().equals(item.getStation())).collect(Collectors.toList())).map(o->o.get(0).getName()).orElse(null);
+ if(ObjectUtil.isEmpty(queryEntity) || !flag){
+ HistoryAbnormalAlarmEntity entity = new HistoryAbnormalAlarmEntity();
+ entity.setAlarmId(item.getId());
+ entity.setStationId(item.getStation());
+ entity.setStationName(stationName);
+ entity.setRealId(item.getRealId());
+ entity.setSoeExplain(item.getSoeExplain());
+ entity.setType(item.getSoeType());
+ entity.setStartTime(ts);
+ entity.setStatus(0);
+ this.historyAbnormalAlarmService.save(entity);
+ // 消息推送
+ this.sendAlarmMessage(Collections.singletonList(entity),stations);
+ return;
+ }
+ queryEntity.setSoeExplain(item.getSoeExplain());
+ queryEntity.setUpdateTime(new Date());
+ queryEntity.setEndTime(ts);
+ queryEntity.setStatus(1);
+ this.historyAbnormalAlarmService.updateById(queryEntity);
+ });
+ return "success";
+ }
+
+
+
+ /**
+ * 告警消息推送
+ * @param entitys
+ */
+ private void sendAlarmMessage(List entitys,List stations) {
+ if(CollectionUtil.isEmpty(entitys)){
+ return;
+ }
+ // 告警等级 :事故、数据中断
+ List alarms = entitys.stream().filter(entity -> AbnormalAlarmConstant.SEND_MESSSAGE_TYPE_LIST.contains(entity.getType())).collect(Collectors.toList());
+ if(CollectionUtil.isEmpty(alarms)){
+ return;
+ }
+ // 查询站点用户
+ entitys.forEach(entity->{
+ if(StringUtil.isEmpty(entity.getStationId())){
+ return;
+ }
+ List depts = stations.stream().filter(station -> station.getCode().equals(entity.getStationId())).map(StationEntity::getRefDept).collect(Collectors.toList());
+ if(CollectionUtil.isEmpty(depts)){
+ return;
+ }
+ // 获取站点用户
+ R> result = userClient.userListByDeptId(depts.get(0));
+ if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
+ return;
+ }
+ MessagePushRecordDto message = new MessagePushRecordDto();
+ message.setBusinessClassify("warning");
+ message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey());
+ message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription());
+ message.setTaskId(entity.getId());
+ message.setTenantId("200000");
+ message.setContent(entity.getSoeExplain());
+ message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
+ message.setPushType(MessageConstants.IMMEDIATELY);
+ message.setDeptId(depts.get(0));
+ R deptName = sysClient.getDeptName(depts.get(0));
+ if (deptName.isSuccess()) {
+ message.setDeptName(deptName.getData());
+ }
+ User admin = userClient.userByAccount("200000", "admin").getData();
+ message.setCreateDept(admin.getCreateDept());
+ message.setCreateUser(admin.getCreateUser());
+ result.getData().forEach(user->{
+ message.setPusher(String.valueOf(user.getId()));
+ message.setPusherName(user.getName());
+ message.setAccount(String.valueOf(user.getId()));
+ messageClient.sendMessage(message);
+ });
+ });
+ }
+
+
+ /**
+ * 查询实时告警数据
+ * @return
+ */
+ @Override
+ public List getAbnormalAlarmList() {
+ List alarmList = this.baseMapper.getAbnormalAlarmList();
+ if(CollectionUtil.isEmpty(alarmList)){
+ return new ArrayList<>();
+ }
+ return alarmList;
+ }
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HistoryAbnormalAlarmServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HistoryAbnormalAlarmServiceImpl.java
new file mode 100644
index 0000000..6824c7a
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HistoryAbnormalAlarmServiceImpl.java
@@ -0,0 +1,41 @@
+package com.hnac.hzims.scheduled.service.impl;
+
+import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
+import com.hnac.hzims.scheduled.mapper.operation.HistoryAbnormalAlarmMapper;
+import com.hnac.hzims.scheduled.service.HistoryAbnormalAlarmService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 11:12
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl implements HistoryAbnormalAlarmService {
+ /**
+ * 查询单条历史告警
+ *
+ * @param station
+ * @param soeType
+ * @return
+ */
+ @Override
+ public HistoryAbnormalAlarmEntity getAbnormalAlarm(String station, String soeType) {
+ List alarms = this.baseMapper.getHistoryAbnormalAlarm(station, soeType);
+ if(CollectionUtil.isEmpty(alarms)){
+ return null;
+ }
+ return alarms.stream().sorted(Comparator.comparing(HistoryAbnormalAlarmEntity::getStartTime)).collect(Collectors.toList()).get(0);
+ }
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HzimsAnalyzeModelStationServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HzimsAnalyzeModelStationServiceImpl.java
new file mode 100644
index 0000000..26c1e39
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/HzimsAnalyzeModelStationServiceImpl.java
@@ -0,0 +1,17 @@
+package com.hnac.hzims.scheduled.service.impl;
+
+import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
+import com.hnac.hzims.scheduled.mapper.operation.HzimsAnalyzeModelStationMapper;
+import com.hnac.hzims.scheduled.service.IHzimsAnalyzeModelStationService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/22 11:42
+ */
+@Service
+public class HzimsAnalyzeModelStationServiceImpl extends BaseServiceImpl implements IHzimsAnalyzeModelStationService {
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/MainSystemMonitoringServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/MainSystemMonitoringServiceImpl.java
new file mode 100644
index 0000000..2620394
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/MainSystemMonitoringServiceImpl.java
@@ -0,0 +1,51 @@
+package com.hnac.hzims.scheduled.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
+import com.hnac.hzims.scheduled.service.IMainSystemMonitoringService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 14:01
+ */
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringService {
+
+
+ private final RedisTemplate redisTemplate;
+
+
+ @Value("${hzims.equipment.emInfo.emInfoList}")
+ public String emInfoListPath;
+
+ /**
+ * 从Redis获取设备信息
+ *
+ * @return
+ */
+ @Override
+ public List getEmInfoList() {
+ List list = new ArrayList<>();
+ Object json = redisTemplate.opsForValue().get(emInfoListPath);
+ if (ObjectUtil.isNotEmpty(json)) {
+ list = JSONObject.parseObject(json.toString(), new TypeReference>() {
+ });
+ }
+ return list;
+ }
+
+}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/RealMonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/RealMonitorServiceImpl.java
new file mode 100644
index 0000000..4a595ad
--- /dev/null
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/impl/RealMonitorServiceImpl.java
@@ -0,0 +1,713 @@
+package com.hnac.hzims.scheduled.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
+import com.hnac.hzims.fdp.vo.FdpFaultStatusVo;
+import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
+import com.hnac.hzims.operational.config.enume.ConfigStatus;
+import com.hnac.hzims.operational.main.constant.HomePageConstant;
+import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
+import com.hnac.hzims.operational.station.entity.StationEntity;
+import com.hnac.hzims.scheduled.service.*;
+import com.hnac.hzims.scheduled.vo.RealAttributeVo;
+import com.hnac.hzims.scheduled.vo.RealDeviceVo;
+import com.hnac.hzims.scheduled.vo.RealStationVo;
+import com.hnac.hzims.scheduled.vo.StationRealVo;
+import com.hnac.hzinfo.sdk.v5.redis.RedisClient;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.MapUtils;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.system.entity.Dept;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+
+import javax.validation.constraints.NotNull;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/5/19 13:54
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class RealMonitorServiceImpl implements IRealMonitorService {
+
+ @NotNull
+ private final IStationAttributeService attbtService;
+
+
+ private final AbnormalAlarmService abnormalAlarmService;
+
+ private final StAlamRecordService alertService;
+
+ @NotNull
+ private final IStationService stationService;
+ @NotNull
+ private final IMainSystemMonitoringService maintenanceTaskService;
+ @NotNull
+ private final RedisTemplate redisTemplate;
+
+
+ private final IMainSystemMonitoringService systemMonitoringService;
+
+
+ private final RedisClient redisClient;
+
+ @NotNull
+ private final ISysClient sysClient;
+
+
+ private final IStationAttrConfigService stationAttrConfigService;
+
+ @Value("${hzims.operation.monitor.realId}")
+ public String moniter_realId_key;
+
+ @Value("${hzims.operation.monitor.station}")
+ public String moniter_station_key;
+
+ @Value("${hzims.equipment.fdp.redisData}")
+ public String fdp_fault_data_key;
+
+ @Value("${hzims.operation.homePage.activePowerKey}")
+ public String active_power_key;
+
+ @Value("${hzims.equipment.fdp.greaterThan}")
+ public Double greater_than;
+
+ @Value("${hzims.equipment.fdp.lessThan}")
+ public Double less_than;
+
+ @Value("${hzims.equipment.fdp.beEqualOrGreaterThan}")
+ public Double be_equal_or_greater_than;
+
+ @Value("${hzims.operation.region.deviceClassifyKey}")
+ private String device_classify_key;
+
+ @Value("${hzims.operation.realIdKeyGather}")
+ public String real_id_key_gather_path;
+
+ @Value("${hzims.operation.realIdKey}")
+ public String real_id_key_path;
+
+ @Value("${hzims.operation.homePage.jointRelayKey}")
+ public String joint_relay_key;
+
+ /**
+ * 10站点为一组数据
+ */
+ private static final Integer MAX_SEND = 5;
+
+ private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
+
+
+ @Override
+ public void realTimeData(String param) {
+ Long beginTime = System.currentTimeMillis();
+ // 获取设备
+ List devices = systemMonitoringService.getEmInfoList();
+ // 设备开关机集合监测点
+ List switchOnOff = devices.stream().map(o->{
+ Map points = o.getPoint();
+ if(CollectionUtil.isEmpty(points)){
+ return "";
+ }
+ String jointRelay = points.get(HomePageConstant.JOINT_RELAY);
+ if(!StringUtil.isEmpty(jointRelay)){
+ return jointRelay;
+ }
+ String onOff = points.get(HomePageConstant.SWITCH_ON_OFF);
+ if(!StringUtil.isEmpty(onOff)){
+ return onOff;
+ }
+ return "";
+ }).collect(Collectors.toList());
+ // 获取站点缓存数据
+ List stationRealVos = (List) redisTemplate.opsForValue().get(moniter_realId_key);
+ if(CollectionUtil.isEmpty(stationRealVos)){
+ return;
+ }
+ // 数据切割
+ int limit = countStep(stationRealVos.size());
+ List> list = Stream.iterate(0, n -> n + 1).limit(limit).parallel().map(a -> stationRealVos.stream().skip((long) a * MAX_SEND).limit(MAX_SEND).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 -> {
+ stations.forEach(stationReal -> {
+ String[] realIdArr = stationReal.getRealId();
+ List realIds = Stream.of(realIdArr).collect(Collectors.toList());
+ if(CollectionUtil.isEmpty(realIds)){
+ return;
+ }
+ log.error("real_time_data: {},{}",stationReal.getStation(),realIds);
+ List objects = redisClient.getBatchRealDataByRealId(stationReal.getStation(),realIds);
+ for(int i = 0; i < realIds.size() ;i++){
+ if(ObjectUtil.isEmpty(objects.get(i))){
+ log.error(realIds.get(i) + "is null");
+ }else{
+ Map attribute = (Map) JSONObject.parse(objects.get(i));
+ attribute.put("realId",attribute.get("k"));
+ attribute.put("value",attribute.get("v"));
+ attribute.put("time",attribute.get("t"));
+ attribute.remove("v");
+ attribute.remove("k");
+ attribute.remove("t");
+ this.getCheckMap(attribute,switchOnOff);
+ valueMap.put(realIdArr[i],attribute.get("value"));
+ keyMap.put(realIdArr[i],attribute);
+ }
+ }
+ });
+ countDownLatch.countDown();
+ }));
+ // 等待所有线程执行完成
+ try {
+ countDownLatch.await();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ Thread.currentThread().interrupt();
+ }
+ pool.shutdown();
+ // redis 存储
+ redisTemplate.opsForValue().set(real_id_key_path,JSONObject.toJSONString(valueMap));
+ redisTemplate.opsForValue().set(real_id_key_gather_path,JSONObject.toJSONString(keyMap));
+ Long endTime = System.currentTimeMillis();
+ Long time = endTime - beginTime;
+ log.error("处理redis实时数据 耗时 : {}",time);
+ }
+
+
+
+ /**
+ * 计算切分次数
+ */
+ private static Integer countStep(Integer size) {
+ return (size + MAX_SEND - 1) / MAX_SEND;
+ }
+
+
+ /**
+ * 监测点过期数据检查
+ * @param value
+ * @return
+ */
+ private void getCheckMap(Map value,List switchOnOff){
+ // 不处理开机状态监测点
+ if(switchOnOff.contains(value.get("realId"))){
+ return;
+ }
+ String time = value.get("time");
+ if(StringUtil.isEmpty(time)){
+ return;
+ }
+ Date date = DateUtil.parse(time,DateUtil.PATTERN_DATETIME);
+ // 实时数据超出10分钟未刷新,值置为 0 显示
+ if(System.currentTimeMillis() - date.getTime() > 10 * 60 * 1000L){
+ value.put("value","0");
+ }
+ }
+
+
+
+
+ /**
+ * 集中监控数据处理
+ * @param param
+ */
+ @Override
+ public void centralizedMonitoring(String param) {
+ long beginTime = System.currentTimeMillis();
+ Thread thread = Thread.currentThread();
+ Object json = redisTemplate.opsForValue().get(real_id_key_gather_path);
+ if (ObjectUtil.isEmpty(json)) {
+ return;
+ }
+ Map> map = JSONObject.parseObject(json.toString(), new TypeReference