From ae464f50b1d699d7d568215a9b1915ec5d477098 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Wed, 10 Apr 2024 10:02:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9Asoe=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java | 32 +-- .../source/service/impl/SoeAlarmServiceImpl.java | 18 +- .../hzims-alarm/src/main/resources/db/1.0.0.sql | 250 --------------------- .../hzims-alarm/src/main/resources/db/1.0.0.sql.1 | 250 +++++++++++++++++++++ .../hzims-alarm/src/main/resources/db/2.0.0.sql | 25 --- .../hzims-alarm/src/main/resources/db/2.0.0.sql.1 | 25 +++ 6 files changed, 304 insertions(+), 296 deletions(-) delete mode 100644 hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql create mode 100644 hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1 delete mode 100644 hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql create mode 100644 hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1 diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java index 209ef6d..0220db3 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java @@ -15,22 +15,28 @@ public class SoeAlarmVo { private static final long serialVersionUID = 1L; - private String ts; + private Date ts; - private String station; + private String deviceCode; - private String sid; - private String id; - private String realId; - private String type; - private String kind; private String level; - private String state; - private String stateLabel; + + private String type; + + private String deviceName; + + private String tenantId; + + private String name; + private String context; - private String opvalue; - private String trace; - private String duration; - private String traceCount; + + private String signage; + + private String projectId; + + private String currentValue; + + } \ No newline at end of file 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 a3b44fe..1b18030 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 @@ -66,19 +66,21 @@ 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()); entity.setAlarmSource(LEVEL_ALARM); entity.setAlarmType(ONE_LEVEL); - entity.setAlarmContext(item.getContext()); - Date date = new Date(Long.valueOf(item.getTs())); - entity.setAlarmTime(date); - entity.setAlarmValue(item.getOpvalue()); - entity.setAlarmSignage(item.getSid()); + entity.setAlarmContext(item.getName()); + entity.setAlarmTime(item.getTs()); + entity.setAlarmValue(item.getCurrentValue()); + entity.setAlarmSignage(item.getSignage()); entity.setAlarmLevel(Integer.valueOf(item.getLevel())); - entity.setAlarmCount(Integer.valueOf(item.getTraceCount())); entity.setAlarmStatus(1); - entity.setDeviceCode(item.getRealId()); + entity.setDeviceCode(item.getDeviceCode()); entity.setTenantId("200000"); - R stationByCode = stationClient.getStationByCode(item.getStation()); + entity.setStationId(item.getProjectId()); + R stationByCode = stationClient.getStationByCode(item.getProjectId()); if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){ entity.setCreateDept(stationByCode.getData().getCreateDept()); entity.setStationName(stationByCode.getData().getName()); diff --git a/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql b/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql deleted file mode 100644 index 53d58e0..0000000 --- a/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql +++ /dev/null @@ -1,250 +0,0 @@ - -DROP TABLE IF EXISTS `BLADE_MODULE_VERSION`; -CREATE TABLE `BLADE_MODULE_VERSION` ( - `MODULE_NAME` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL, - `VERSION` VARCHAR(8) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL, - `HISTORY` VARCHAR(300) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL, - PRIMARY KEY (`MODULE_NAME`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- TABLE STRUCTURE FOR HZIMS_ALARM --- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_ALARM`; -CREATE TABLE `HZIMS_ALARM` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键ID', - `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '站点编码', - `STATION_NAME` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', - `DEVICE_CODE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备编码', - `DEVICE_NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备名称', - `ALARM_ID` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警ID', - `ALARM_SOURCE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警类型 :0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警', - `ALARM_TYPE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警子类', - `ALARM_SIGNAGE` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警属性标识', - `ALARM_CONTEXT` VARCHAR(1024) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警内容', - `ALARM_STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '告警状态', - `ALARM_LEVEL` TINYINT(4) NULL DEFAULT NULL COMMENT '告警等级', - `ALARM_VALUE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警动作数值', - `ALARM_COUNT` TINYINT(10) NULL DEFAULT NULL COMMENT '告警数量', - `ALARM_TIME` DATETIME NULL DEFAULT NULL COMMENT '告警时间', - `DIAG_REASON` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '初步分析原因', - `DIAG_SOLUTION` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '建议处置方式', - `REAL_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '监测点', - `IS_RIGHT_TABULATION` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控右侧列表展示 : 0-展示 1-不展示', - `IS_SHOW_ALERT` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控弹窗展示 : 0-展示 1-不展示', - `IS_SMALL_BELL` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控铃铛展示 : 0-展示 1-不展示', - `IS_MASK` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控遮罩展示 : 0-展示 1-不展示', - `IS_BROADCAST` TINYINT(4) NULL DEFAULT NULL COMMENT '是否语音播报 : 0-播报 1-不播报', - `IS_PLATFORM_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否进行平台消息推送 : 0-推送 1-不推送', - `IS_SHORT_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否短信推送 :0-推送 1-不推送', - `IS_WX_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否微信公众号消息推送 :0-推送 1-不推送', - `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', - `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', - `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- TABLE STRUCTURE FOR HZIMS_ALARM_CONFIG --- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_ALARM_CONFIG`; -CREATE TABLE `HZIMS_ALARM_CONFIG` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键ID', - `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点编码', - `STATION_NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', - `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', - `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', - `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- TABLE STRUCTURE FOR HZIMS_ALARM_CONFIG_DETAIL --- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_ALARM_CONFIG_DETAIL`; -CREATE TABLE `HZIMS_ALARM_CONFIG_DETAIL` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键ID', - `STRATEGY_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '告警配置ID', - `ALARM_TYPE` BIGINT(4) NULL DEFAULT NULL COMMENT '告警类型', - `ALARM_CHILED_TYPE` BIGINT(4) NULL DEFAULT NULL COMMENT '告警子类', - `ALARM_CONTEXT` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警内容', - `ALARM_POINT` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警监测点', - `IS_RIGHT_TABULATION` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控右侧列表展示 : 0-展示 1-不展示', - `IS_SHOW_ALERT` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控弹窗展示 : 0-展示 1-不展示', - `IS_SMALL_BELL` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控铃铛展示 : 0-展示 1-不展示', - `IS_MASK` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控遮罩展示 : 0-展示 1-不展示', - `IS_BROADCAST` TINYINT(4) NULL DEFAULT NULL COMMENT '是否语音播报 : 0-播报 1-不播报', - `IS_PLATFORM_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否进行平台消息推送 : 0-推送 1-不推送', - `IS_SHORT_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否短信推送 :0-推送 1-不推送', - `IS_WX_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否微信公众号消息推送 :0-推送 1-不推送', - `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', - `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', - `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- TABLE STRUCTURE FOR HZIMS_ALARM_HANDLE --- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_ALARM_HANDLE`; -CREATE TABLE `HZIMS_ALARM_HANDLE` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `ALARM_ID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警主键ID', - `STATION_CODE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', - `ALARM_TYPE` smallint(6) NULL DEFAULT NULL COMMENT '告警类型', - `ALARM_TIME` datetime(0) NULL DEFAULT NULL COMMENT '告警时间', - `ALARM_CONTENT` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警内容', - `TYPE` tinyint(1) NULL DEFAULT NULL COMMENT '类型:0-系统告警 1-智能告警', - `HANDLE_WAY` smallint(6) NULL DEFAULT NULL COMMENT '处理方式', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - `HANDLE_USER` bigint(20) NULL DEFAULT NULL COMMENT '通知处理人', - `PHENOMENON_ID` bigint(20) NULL DEFAULT NULL COMMENT '现象ID', - `ACCESS_ID` bigint(20) NULL DEFAULT NULL COMMENT '检修ID', - `DELAY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '延后时间', - `DELAY_CAUSE` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '延后原因', - `FALSE_ALARM_DESC` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '误报描述', - `FILE_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件路径', - `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建用户姓名', - `CREATE_DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建机构名称', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- TABLE STRUCTURE FOR HZIMS_ALARM_HISTORY --- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_ALARM_HISTORY`; -CREATE TABLE `HZIMS_ALARM_HISTORY` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键ID', - `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '站点编码', - `STATION_NAME` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', - `DEVICE_CODE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备编码', - `DEVICE_NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备名称', - `ALARM_ID` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警ID', - `ALARM_SOURCE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警类型 :0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警', - `ALARM_TYPE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警子类', - `ALARM_SIGNAGE` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警属性标识', - `ALARM_CONTEXT` VARCHAR(1024) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警内容', - `ALARM_STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '告警状态', - `ALARM_LEVEL` TINYINT(4) NULL DEFAULT NULL COMMENT '告警等级', - `ALARM_VALUE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警动作数值', - `ALARM_COUNT` TINYINT(10) NULL DEFAULT NULL COMMENT '告警数量', - `ALARM_TIME` DATETIME NULL DEFAULT NULL COMMENT '告警时间', - `REAL_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '监测点', - `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', - `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', - `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- TABLE STRUCTURE FOR HZIMS_BUSINESS_EARLY --- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_BUSINESS_EARLY`; -CREATE TABLE `HZIMS_BUSINESS_EARLY` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键ID', - `TASK_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '任务ID', - `BUSINESS_TYPE` TINYINT(1) NULL DEFAULT NULL COMMENT '业务类型 :0 - 固定资产 1 - 日常维护 2 - 安全工器- 具 3 - 巡检 4 - 检修 5 - 缺陷 6 - 值班', - `CONTENT` VARCHAR(1024) CHARACTER SET UTF8MB4 COLLATE UTF8MB4_GENERAL_CI NULL DEFAULT NULL COMMENT '预警内容', - `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', - `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', - `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8MB4 COLLATE = UTF8MB4_GENERAL_CI ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- TABLE STRUCTURE FOR HZIMS_INTERRUPTION_ALARM --- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_INTERRUPTION_ALARM`; -CREATE TABLE `HZIMS_INTERRUPTION_ALARM` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键ID', - `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点ID', - `STATION_NAME` VARCHAR(168) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', - `ALARM_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '告警编号', - `REAL_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警点位', - `ALARM_TIME` DATETIME NULL DEFAULT NULL COMMENT '告警时间', - `TYPE` VARCHAR(16) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警类型 13-连接中断 14-数据异常', - `SOE_EXPLAIN` VARCHAR(500) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警原因', - `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '租户ID', - `STATUS` BIGINT(1) NULL DEFAULT NULL COMMENT '状态', - `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建单位', - `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '修改人', - `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', - `IS_DELETED` TINYINT(4) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; - -DROP TABLE IF EXISTS `hzims_alarm_handle_flow`; -CREATE TABLE `hzims_alarm_handle_flow` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `ALARM_ID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警主键ID', - `STATION_CODE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', - `ALARM_TYPE` smallint(6) NULL DEFAULT NULL COMMENT '告警类型', - `ALARM_TIME` datetime(0) NULL DEFAULT NULL COMMENT '告警时间', - `ALARM_CONTENT` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警内容', - `TYPE` tinyint(1) NULL DEFAULT NULL COMMENT '类型:0-系统告警 1-智能告警', - `HANDLE_WAY` smallint(6) NULL DEFAULT NULL COMMENT '告警状态 1L,2L,3L,4L,5L 误报 、延后、缺陷 、检修、处理', - `HANDLE_USER` bigint(20) NULL DEFAULT NULL COMMENT '通知处理人', - `PHENOMENON_ID` bigint(20) NULL DEFAULT NULL COMMENT '现象ID', - `ACCESS_ID` bigint(20) NULL DEFAULT NULL COMMENT '检修ID', - `DELAY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '延后时间', - `DELAY_CAUSE` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '延后原因', - `FALSE_ALARM_DESC` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '误报描述', - `FILE_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件路径', - `DEAL_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理方式', - `DEAL_RESULT` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理结果', - `DEAL_DESC` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理描述', - `DEAL_PATH` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理附件', - `CHECK_FLAG` tinyint(4) NULL DEFAULT NULL COMMENT '审批结果 0,不通过;1为通过', - `CHECK_DESC` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批说明', - `CURRENT_OPERATOR` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当前处理环节', - `CURRENT_LINK_HANDLER` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当前环节处理人', - `PROCESS_INSTANCE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程实例', - `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建用户姓名', - `HANDLE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理人姓名', - `APPROVAL_USER` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人', - `APPROVAL_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人姓名', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - `STATUS` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - `CREATE_DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建机构名称', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1 b/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1 new file mode 100644 index 0000000..53d58e0 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1 @@ -0,0 +1,250 @@ + +DROP TABLE IF EXISTS `BLADE_MODULE_VERSION`; +CREATE TABLE `BLADE_MODULE_VERSION` ( + `MODULE_NAME` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL, + `VERSION` VARCHAR(8) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL, + `HISTORY` VARCHAR(300) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL, + PRIMARY KEY (`MODULE_NAME`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- TABLE STRUCTURE FOR HZIMS_ALARM +-- ---------------------------- +DROP TABLE IF EXISTS `HZIMS_ALARM`; +CREATE TABLE `HZIMS_ALARM` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键ID', + `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '站点编码', + `STATION_NAME` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', + `DEVICE_CODE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备编码', + `DEVICE_NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备名称', + `ALARM_ID` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警ID', + `ALARM_SOURCE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警类型 :0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警', + `ALARM_TYPE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警子类', + `ALARM_SIGNAGE` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警属性标识', + `ALARM_CONTEXT` VARCHAR(1024) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警内容', + `ALARM_STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '告警状态', + `ALARM_LEVEL` TINYINT(4) NULL DEFAULT NULL COMMENT '告警等级', + `ALARM_VALUE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警动作数值', + `ALARM_COUNT` TINYINT(10) NULL DEFAULT NULL COMMENT '告警数量', + `ALARM_TIME` DATETIME NULL DEFAULT NULL COMMENT '告警时间', + `DIAG_REASON` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '初步分析原因', + `DIAG_SOLUTION` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '建议处置方式', + `REAL_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '监测点', + `IS_RIGHT_TABULATION` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控右侧列表展示 : 0-展示 1-不展示', + `IS_SHOW_ALERT` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控弹窗展示 : 0-展示 1-不展示', + `IS_SMALL_BELL` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控铃铛展示 : 0-展示 1-不展示', + `IS_MASK` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控遮罩展示 : 0-展示 1-不展示', + `IS_BROADCAST` TINYINT(4) NULL DEFAULT NULL COMMENT '是否语音播报 : 0-播报 1-不播报', + `IS_PLATFORM_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否进行平台消息推送 : 0-推送 1-不推送', + `IS_SHORT_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否短信推送 :0-推送 1-不推送', + `IS_WX_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否微信公众号消息推送 :0-推送 1-不推送', + `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', + `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', + `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- TABLE STRUCTURE FOR HZIMS_ALARM_CONFIG +-- ---------------------------- +DROP TABLE IF EXISTS `HZIMS_ALARM_CONFIG`; +CREATE TABLE `HZIMS_ALARM_CONFIG` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键ID', + `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点编码', + `STATION_NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', + `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', + `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', + `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- TABLE STRUCTURE FOR HZIMS_ALARM_CONFIG_DETAIL +-- ---------------------------- +DROP TABLE IF EXISTS `HZIMS_ALARM_CONFIG_DETAIL`; +CREATE TABLE `HZIMS_ALARM_CONFIG_DETAIL` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键ID', + `STRATEGY_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '告警配置ID', + `ALARM_TYPE` BIGINT(4) NULL DEFAULT NULL COMMENT '告警类型', + `ALARM_CHILED_TYPE` BIGINT(4) NULL DEFAULT NULL COMMENT '告警子类', + `ALARM_CONTEXT` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警内容', + `ALARM_POINT` VARCHAR(2048) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警监测点', + `IS_RIGHT_TABULATION` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控右侧列表展示 : 0-展示 1-不展示', + `IS_SHOW_ALERT` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控弹窗展示 : 0-展示 1-不展示', + `IS_SMALL_BELL` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控铃铛展示 : 0-展示 1-不展示', + `IS_MASK` TINYINT(4) NULL DEFAULT NULL COMMENT '是否集中监控遮罩展示 : 0-展示 1-不展示', + `IS_BROADCAST` TINYINT(4) NULL DEFAULT NULL COMMENT '是否语音播报 : 0-播报 1-不播报', + `IS_PLATFORM_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否进行平台消息推送 : 0-推送 1-不推送', + `IS_SHORT_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否短信推送 :0-推送 1-不推送', + `IS_WX_MESSAGE` TINYINT(4) NULL DEFAULT NULL COMMENT '是否微信公众号消息推送 :0-推送 1-不推送', + `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', + `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', + `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- TABLE STRUCTURE FOR HZIMS_ALARM_HANDLE +-- ---------------------------- +DROP TABLE IF EXISTS `HZIMS_ALARM_HANDLE`; +CREATE TABLE `HZIMS_ALARM_HANDLE` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `ALARM_ID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警主键ID', + `STATION_CODE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', + `ALARM_TYPE` smallint(6) NULL DEFAULT NULL COMMENT '告警类型', + `ALARM_TIME` datetime(0) NULL DEFAULT NULL COMMENT '告警时间', + `ALARM_CONTENT` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警内容', + `TYPE` tinyint(1) NULL DEFAULT NULL COMMENT '类型:0-系统告警 1-智能告警', + `HANDLE_WAY` smallint(6) NULL DEFAULT NULL COMMENT '处理方式', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `STATUS` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `HANDLE_USER` bigint(20) NULL DEFAULT NULL COMMENT '通知处理人', + `PHENOMENON_ID` bigint(20) NULL DEFAULT NULL COMMENT '现象ID', + `ACCESS_ID` bigint(20) NULL DEFAULT NULL COMMENT '检修ID', + `DELAY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '延后时间', + `DELAY_CAUSE` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '延后原因', + `FALSE_ALARM_DESC` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '误报描述', + `FILE_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件路径', + `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建用户姓名', + `CREATE_DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建机构名称', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- TABLE STRUCTURE FOR HZIMS_ALARM_HISTORY +-- ---------------------------- +DROP TABLE IF EXISTS `HZIMS_ALARM_HISTORY`; +CREATE TABLE `HZIMS_ALARM_HISTORY` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键ID', + `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '站点编码', + `STATION_NAME` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', + `DEVICE_CODE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备编码', + `DEVICE_NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '设备名称', + `ALARM_ID` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警ID', + `ALARM_SOURCE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警类型 :0- HZ3000告警 1 -等级告警 2 -条件告警 3-FDP智能预警', + `ALARM_TYPE` TINYINT(4) NULL DEFAULT NULL COMMENT '告警子类', + `ALARM_SIGNAGE` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警属性标识', + `ALARM_CONTEXT` VARCHAR(1024) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警内容', + `ALARM_STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '告警状态', + `ALARM_LEVEL` TINYINT(4) NULL DEFAULT NULL COMMENT '告警等级', + `ALARM_VALUE` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警动作数值', + `ALARM_COUNT` TINYINT(10) NULL DEFAULT NULL COMMENT '告警数量', + `ALARM_TIME` DATETIME NULL DEFAULT NULL COMMENT '告警时间', + `REAL_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '监测点', + `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', + `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', + `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- TABLE STRUCTURE FOR HZIMS_BUSINESS_EARLY +-- ---------------------------- +DROP TABLE IF EXISTS `HZIMS_BUSINESS_EARLY`; +CREATE TABLE `HZIMS_BUSINESS_EARLY` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键ID', + `TASK_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '任务ID', + `BUSINESS_TYPE` TINYINT(1) NULL DEFAULT NULL COMMENT '业务类型 :0 - 固定资产 1 - 日常维护 2 - 安全工器- 具 3 - 巡检 4 - 检修 5 - 缺陷 6 - 值班', + `CONTENT` VARCHAR(1024) CHARACTER SET UTF8MB4 COLLATE UTF8MB4_GENERAL_CI NULL DEFAULT NULL COMMENT '预警内容', + `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', + `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门ID', + `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8MB4 COLLATE = UTF8MB4_GENERAL_CI ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- TABLE STRUCTURE FOR HZIMS_INTERRUPTION_ALARM +-- ---------------------------- +DROP TABLE IF EXISTS `HZIMS_INTERRUPTION_ALARM`; +CREATE TABLE `HZIMS_INTERRUPTION_ALARM` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键ID', + `STATION_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点ID', + `STATION_NAME` VARCHAR(168) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '站点名称', + `ALARM_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '告警编号', + `REAL_ID` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警点位', + `ALARM_TIME` DATETIME NULL DEFAULT NULL COMMENT '告警时间', + `TYPE` VARCHAR(16) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警类型 13-连接中断 14-数据异常', + `SOE_EXPLAIN` VARCHAR(500) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '告警原因', + `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` BIGINT(1) NULL DEFAULT NULL COMMENT '状态', + `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` BIGINT(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` DATETIME NULL DEFAULT NULL COMMENT '更新时间', + `IS_DELETED` TINYINT(4) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + +DROP TABLE IF EXISTS `hzims_alarm_handle_flow`; +CREATE TABLE `hzims_alarm_handle_flow` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `ALARM_ID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警主键ID', + `STATION_CODE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', + `ALARM_TYPE` smallint(6) NULL DEFAULT NULL COMMENT '告警类型', + `ALARM_TIME` datetime(0) NULL DEFAULT NULL COMMENT '告警时间', + `ALARM_CONTENT` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警内容', + `TYPE` tinyint(1) NULL DEFAULT NULL COMMENT '类型:0-系统告警 1-智能告警', + `HANDLE_WAY` smallint(6) NULL DEFAULT NULL COMMENT '告警状态 1L,2L,3L,4L,5L 误报 、延后、缺陷 、检修、处理', + `HANDLE_USER` bigint(20) NULL DEFAULT NULL COMMENT '通知处理人', + `PHENOMENON_ID` bigint(20) NULL DEFAULT NULL COMMENT '现象ID', + `ACCESS_ID` bigint(20) NULL DEFAULT NULL COMMENT '检修ID', + `DELAY_TIME` datetime(0) NULL DEFAULT NULL COMMENT '延后时间', + `DELAY_CAUSE` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '延后原因', + `FALSE_ALARM_DESC` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '误报描述', + `FILE_PATH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件路径', + `DEAL_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理方式', + `DEAL_RESULT` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理结果', + `DEAL_DESC` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理描述', + `DEAL_PATH` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理附件', + `CHECK_FLAG` tinyint(4) NULL DEFAULT NULL COMMENT '审批结果 0,不通过;1为通过', + `CHECK_DESC` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批说明', + `CURRENT_OPERATOR` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当前处理环节', + `CURRENT_LINK_HANDLER` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当前环节处理人', + `PROCESS_INSTANCE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程实例', + `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建用户姓名', + `HANDLE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理人姓名', + `APPROVAL_USER` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人', + `APPROVAL_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人姓名', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `STATUS` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + `CREATE_DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建机构名称', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql b/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql deleted file mode 100644 index f149e2a..0000000 --- a/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql +++ /dev/null @@ -1,25 +0,0 @@ - -DROP TABLE IF EXISTS `BLADE_MODULE_VERSION`; -CREATE TABLE `hzims_alarm_defaul_config` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `SOURCE` bigint(4) DEFAULT NULL COMMENT '告警来源', - `ALARM_CHILED_TYPE` bigint(4) DEFAULT NULL COMMENT '告警子类', - `IS_RIGHT_TABULATION` tinyint(4) DEFAULT NULL COMMENT '是否集中监控右侧列表展示 : 0-展示 1-不展示', - `IS_SHOW_ALERT` tinyint(4) DEFAULT NULL COMMENT '是否集中监控弹窗展示 : 0-展示 1-不展示', - `IS_SMALL_BELL` tinyint(4) DEFAULT NULL COMMENT '是否集中监控铃铛展示 : 0-展示 1-不展示', - `IS_MASK` tinyint(4) DEFAULT NULL COMMENT '是否集中监控遮罩展示 : 0-展示 1-不展示', - `IS_BROADCAST` tinyint(4) DEFAULT NULL COMMENT '是否语音播报 : 0-播报 1-不播报', - `IS_PLATFORM_MESSAGE` tinyint(4) DEFAULT NULL COMMENT '是否进行平台消息推送 : 0-推送 1-不推送', - `IS_SHORT_MESSAGE` tinyint(4) DEFAULT NULL COMMENT '是否短信推送 :0-推送 1-不推送', - `IS_WX_MESSAGE` tinyint(4) DEFAULT NULL COMMENT '是否微信公众号消息推送 :0-推送 1-不推送', - `TENANT_ID` varchar(12) NOT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) DEFAULT NULL COMMENT '创建部门ID', - `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除', - `STATUS` tinyint(4) DEFAULT NULL COMMENT '状态', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - diff --git a/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1 b/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1 new file mode 100644 index 0000000..f149e2a --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1 @@ -0,0 +1,25 @@ + +DROP TABLE IF EXISTS `BLADE_MODULE_VERSION`; +CREATE TABLE `hzims_alarm_defaul_config` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `SOURCE` bigint(4) DEFAULT NULL COMMENT '告警来源', + `ALARM_CHILED_TYPE` bigint(4) DEFAULT NULL COMMENT '告警子类', + `IS_RIGHT_TABULATION` tinyint(4) DEFAULT NULL COMMENT '是否集中监控右侧列表展示 : 0-展示 1-不展示', + `IS_SHOW_ALERT` tinyint(4) DEFAULT NULL COMMENT '是否集中监控弹窗展示 : 0-展示 1-不展示', + `IS_SMALL_BELL` tinyint(4) DEFAULT NULL COMMENT '是否集中监控铃铛展示 : 0-展示 1-不展示', + `IS_MASK` tinyint(4) DEFAULT NULL COMMENT '是否集中监控遮罩展示 : 0-展示 1-不展示', + `IS_BROADCAST` tinyint(4) DEFAULT NULL COMMENT '是否语音播报 : 0-播报 1-不播报', + `IS_PLATFORM_MESSAGE` tinyint(4) DEFAULT NULL COMMENT '是否进行平台消息推送 : 0-推送 1-不推送', + `IS_SHORT_MESSAGE` tinyint(4) DEFAULT NULL COMMENT '是否短信推送 :0-推送 1-不推送', + `IS_WX_MESSAGE` tinyint(4) DEFAULT NULL COMMENT '是否微信公众号消息推送 :0-推送 1-不推送', + `TENANT_ID` varchar(12) NOT NULL COMMENT '租户ID', + `CREATE_DEPT` bigint(20) DEFAULT NULL COMMENT '创建部门ID', + `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除', + `STATUS` tinyint(4) DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +