feiyu02
2025-09-30 94fee0b511279679b43e210878d3d36e5a14384b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.flightfeather.uav.lightshare.service.impl
 
import com.flightfeather.uav.biz.FactorFilter
import com.flightfeather.uav.biz.report.MissionReport
import com.flightfeather.uav.domain.entity.Mission
import com.flightfeather.uav.domain.mapper.MissionMapper
import com.flightfeather.uav.lightshare.service.MissionService
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import tk.mybatis.mapper.entity.Example
 
@RunWith(SpringRunner::class)
@SpringBootTest
class MissionServiceImplTest {
 
    @Autowired
    lateinit var missionService: MissionService
 
    @Autowired
    lateinit var missionMapper: MissionMapper
 
    @Autowired
    lateinit var missionReport: MissionReport
 
    @Test
    fun getReport() {
        missionReport.execute("SH-CN-20240723-01", FactorFilter.default())
        missionReport.execute("SH-CN-20240723-02", FactorFilter.default())
    }
 
    @Test
    fun calMissionInfo() {
        missionMapper.selectByExample(Example(Mission::class.java).apply {
            createCriteria().andGreaterThanOrEqualTo("startTime", "2025-08-08 08:30:00")
        }).forEach {mission ->
            mission?.let { missionService.calMissionInfo(it.missionCode) }
            Thread.sleep(1000)
        }
    }
}