yang_shj
11 months ago
4 changed files with 56 additions and 1 deletions
@ -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"); |
||||
} |
||||
} |
Loading…
Reference in new issue