Browse Source

#开关机告警

zhongwei
yang_shj 11 months ago
parent
commit
1736f9b491
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  2. 41
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java
  3. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java
  4. 10
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -68,6 +68,9 @@ public interface MainConstants {
// 集中监控数据处理
String CENTRALIZED_MONITORING = "centralizedMonitoring";
// 开停机告警
String START_STOP_ALARM = "startStopAlarm";
// realId获取
String REAL_ID_DATA = "realIdData";

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

@ -0,0 +1,41 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService;
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.START_STOP_ALARM;
/**
* 告警定时任务
* @author ysj
*/
@Slf4j
@Component
public class AlarmScheduledTask {
@Autowired
private AlarmQueryService service;
/**
* 开停机告警
* @return ReturnT<String>
*/
@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");
}
service.startStopAlarm(param);
return new ReturnT<>("SUCCESS");
}
}

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java

@ -10,6 +10,9 @@ import java.util.List;
*/
public interface AlarmQueryService extends BaseService<AlarmEntity> {
// 开停机告警
void startStopAlarm(String param);
List<String> bells(List<String> codes);
List<String> aborts(List<String> codes);

10
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java

@ -1,6 +1,5 @@
package com.hnac.hzims.scheduled.service.alarm.impl;
import cn.hutool.core.stream.CollectorUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.alarm.constants.AlarmConstants;
@ -28,6 +27,15 @@ import java.util.stream.Collectors;
public class AlarmQueryServiceImpl extends BaseServiceImpl<AlarmQueryMapper, AlarmEntity> implements AlarmQueryService {
/**
* 开停机告警
* @param param
*/
@Override
public void startStopAlarm(String param) {
}
/**
* 查询站点铃铛
* @param codes
* @return

Loading…
Cancel
Save