Browse Source

#告警默认配置

zhongwei
yang_shj 7 months ago
parent
commit
d652d8f116
  1. 17
      hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql
  2. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java

17
hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql

@ -264,4 +264,19 @@ CREATE TABLE IF NOT EXISTS `hzims_interruption_alarm` (
`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;
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- 默认配置
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217346, 0, 2, 0, 1, 0, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217349, 0, 3, 0, 0, 0, 1, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217350, 0, 5, 0, 1, 0, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217351, 0, 13, 0, 0, 1, 0, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217356, 0, 14, 0, 0, 1, 0, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217357, 1, 21, 0, 0, 0, 1, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217359, 1, 22, 0, 1, 0, 1, 1, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217360, 1, 23, 0, 1, 1, 1, 1, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217361, 2, 40, 0, 0, 0, 0, 0, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217362, 3, 30, 0, 1, 1, 1, 1, 0, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217363, 4, 0, 0, 1, 1, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217365, 5, 50, 0, 1, 1, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);
INSERT INTO `hzims_alarm_defaul_config` (`ID`, `SOURCE`, `ALARM_CHILED_TYPE`, `IS_RIGHT_TABULATION`, `IS_SHOW_ALERT`, `IS_SMALL_BELL`, `IS_MASK`, `IS_BROADCAST`, `IS_PLATFORM_MESSAGE`, `IS_SHORT_MESSAGE`, `IS_WX_MESSAGE`, `TENANT_ID`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`, `IS_DELETED`, `STATUS`) VALUES (1767798439068217366, 5, 51, 0, 1, 1, 1, 1, 1, 1, 1, '200000', 200001, NULL, NULL, NULL, NULL, 0, NULL);

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java

@ -1,15 +1,12 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService;
import com.hnac.hzims.scheduled.service.alarm.AlarmService;
import com.hnac.hzims.scheduled.service.alarm.InterruptionAlarmService;
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.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
@ -49,6 +46,7 @@ public class AlarmScheduledTask {
*/
@XxlJob(START_STOP_ALARM)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> startStopAlarm(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");

Loading…
Cancel
Save