parent
db2ca61f83
commit
d34a368310
|
|
@ -19,6 +19,7 @@ import org.springframework.context.annotation.Profile;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -28,6 +29,9 @@ import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
|
import java.util.concurrent.RejectedExecutionHandler;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -51,8 +55,7 @@ public class AlarmTask {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StRiverRRealService stRiverRRealService;
|
private StRiverRRealService stRiverRRealService;
|
||||||
|
|
||||||
// @Async
|
//@Scheduled(fixedRate = 10, timeUnit = TimeUnit.SECONDS)
|
||||||
@Scheduled(fixedRate = 10, timeUnit = TimeUnit.SECONDS)
|
|
||||||
public void updateAlarmSet(){
|
public void updateAlarmSet(){
|
||||||
//查询告警设置中所有的配置的站点
|
//查询告警设置中所有的配置的站点
|
||||||
List<AlarmSet> alarmSets = alarmSetMapper.selectList(null);
|
List<AlarmSet> alarmSets = alarmSetMapper.selectList(null);
|
||||||
|
|
@ -63,7 +66,7 @@ public class AlarmTask {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Async
|
//@Async
|
||||||
//@Scheduled(fixedRate = 30, timeUnit = TimeUnit.SECONDS)
|
//@Scheduled(fixedRate = 30, timeUnit = TimeUnit.SECONDS)
|
||||||
public void updateWaterAlarm(){
|
public void updateWaterAlarm(){
|
||||||
List<AttResBaseVo> attResBaseVos = attResBaseMapper.queryList();
|
List<AttResBaseVo> attResBaseVos = attResBaseMapper.queryList();
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,12 @@ import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供水整编定时任务
|
||||||
|
*/
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
//@EnableScheduling
|
//@EnableScheduling
|
||||||
|
|
@ -59,6 +62,7 @@ public class WaterRTask {
|
||||||
calendar.add(Calendar.HOUR_OF_DAY, 1); // 加一个小时
|
calendar.add(Calendar.HOUR_OF_DAY, 1); // 加一个小时
|
||||||
Date newDatePlusOneHour = calendar.getTime();
|
Date newDatePlusOneHour = calendar.getTime();
|
||||||
// 站点配置
|
// 站点配置
|
||||||
|
//TODO 站点编号待定。
|
||||||
String ecoStcd = "1114";
|
String ecoStcd = "1114";
|
||||||
String stcd1 = "1112";
|
String stcd1 = "1112";
|
||||||
String stcd2 = "1113";
|
String stcd2 = "1113";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue