Commit c0dab376 authored by zhoushiguang's avatar zhoushiguang

定时器时长搓开

parent 200df50a
...@@ -20,7 +20,7 @@ public class AnalysisGreenCongestionPeriodWeekTask { ...@@ -20,7 +20,7 @@ public class AnalysisGreenCongestionPeriodWeekTask {
@Autowired @Autowired
private AnalysisGreenCongestionPeriodService analysisGreenCongestionPeriodService; private AnalysisGreenCongestionPeriodService analysisGreenCongestionPeriodService;
@Scheduled(cron = "0 0 2 ? * 1") @Scheduled(cron = "0 30 2 ? * 1")
public void task() throws ParseException { public void task() throws ParseException {
analysisGreenCongestionPeriodService.selectCountByCongestionPeriod(); analysisGreenCongestionPeriodService.selectCountByCongestionPeriod();
......
...@@ -31,7 +31,7 @@ public class GreenWaveWeekDataTask implements ApplicationRunner { ...@@ -31,7 +31,7 @@ public class GreenWaveWeekDataTask implements ApplicationRunner {
/** /**
* 每周一凌晨 0:30 执行的任务 * 每周一凌晨 0:30 执行的任务
*/ */
@Scheduled(cron = "0 30 0 ? * MON") @Scheduled(cron = "0 45 0 ? * MON")
public void executeWeeklyTask() { public void executeWeeklyTask() {
//周总体拥堵概况更新 //周总体拥堵概况更新
log.info("定时任务--周总体拥堵概况更新--执行开始时间:" + LocalDateTime.now()); log.info("定时任务--周总体拥堵概况更新--执行开始时间:" + LocalDateTime.now());
......
package net.wanji.opt.task;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.enums.CrossStatusEnum;
import net.wanji.common.framework.Constants;
import net.wanji.databus.dao.mapper.CrossDataRealtimeMapper;
import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.opt.kafka.ConsumerHandler;
import net.wanji.opt.service.CrossOptimizeService;
import net.wanji.opt.service.impl.LaneInfoServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
* 路口、干线事件问题趋势统计
*/
@Component
@Configurable
@EnableScheduling
@Slf4j
@Profile("!dev")
public class ProblemTrendMonitorTask {
@Scheduled(cron = "0 1/5 * * * * ")
public void task(){
}
}
\ No newline at end of file
...@@ -64,7 +64,7 @@ import java.util.stream.Collectors; ...@@ -64,7 +64,7 @@ import java.util.stream.Collectors;
@EnableScheduling @EnableScheduling
@Slf4j @Slf4j
@Profile("!dev") @Profile("!dev")
public class OptimizeStatisticTask { public class ReportGreenAndCrossOptimizeStatisticTask {
@Resource @Resource
StrategyGreenOptHistMapper strategyGreenOptHistMapper; StrategyGreenOptHistMapper strategyGreenOptHistMapper;
......
...@@ -2,12 +2,8 @@ ...@@ -2,12 +2,8 @@
* *
*/ */
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import net.wanji.opt.SignalOptimizeApplication; import net.wanji.opt.SignalOptimizeApplication;
import net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemCrossDayMapper; import net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemCrossDayMapper;
import net.wanji.opt.task.AnalysisProblemDayTask;
import net.wanji.opt.task.OptimizeStatisticTask;
import org.junit.FixMethodOrder; import org.junit.FixMethodOrder;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -16,8 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -16,8 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
/** /**
* @author fengyi * @author fengyi
* @date * @date
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import net.wanji.opt.SignalOptimizeApplication; import net.wanji.opt.SignalOptimizeApplication;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemCrossDayService; import net.wanji.opt.task.ReportGreenAndCrossOptimizeStatisticTask;
import net.wanji.opt.task.OptimizeStatisticTask;
import org.junit.FixMethodOrder; import org.junit.FixMethodOrder;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -26,7 +25,7 @@ import javax.annotation.Resource; ...@@ -26,7 +25,7 @@ import javax.annotation.Resource;
public class OptimizeStatisticTaskTest { public class OptimizeStatisticTaskTest {
@Resource @Resource
OptimizeStatisticTask optimizeStatisticTask; ReportGreenAndCrossOptimizeStatisticTask optimizeStatisticTask;
@Test @Test
public void testProducerTrack() { public void testProducerTrack() {
DateTime dateTime = DateUtil.lastWeek(); DateTime dateTime = DateUtil.lastWeek();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment