文件名从 src/test/kotlin/cn/flightfeather/supervision/timingtask/PushFumeTest.kt 修改 |
| | |
| | | package cn.flightfeather.supervision.timingtask |
| | | package cn.flightfeather.supervision.bgtask |
| | | |
| | | import cn.flightfeather.supervision.SupervisionApplication |
| | | import cn.flightfeather.supervision.domain.entity.AvgFumeMinuteValue |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.io.BufferedReader |
| | | import java.io.InputStreamReader |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import java.util.* |
| | | import java.util.concurrent.Executors |
| | | import java.util.concurrent.TimeUnit |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner::class) |
| | | @SpringBootTest(classes = [SupervisionApplication::class]) |
| | |
| | | |
| | | @Test |
| | | fun doTask() { |
| | | var time = LocalDateTime.of(2021, 4, 16, 10, 0) |
| | | val end = LocalDateTime.of(2024, 4, 25, 12, 40) |
| | | var startTime = LocalDateTime.of(2024, 1, 3, 0, 0, 0) |
| | | var endTime = LocalDateTime.of(2024, 1, 3, 23, 59, 59) |
| | | |
| | | val shecdule = Executors.newScheduledThreadPool(2) |
| | | shecdule.scheduleAtFixedRate({ |
| | | pushFume.doTask(time) |
| | | time = time.plusMinutes(1) |
| | | }, 0, 60, TimeUnit.SECONDS) |
| | | |
| | | val input = BufferedReader(InputStreamReader(System.`in`)) |
| | | val reader: String = input.readLine() |
| | | |
| | | pushFume.doTask(TaskPushFume.ZQ, mutableListOf(), startTime, endTime) |
| | | } |
| | | |
| | | fun getSection(date: Date):String { |