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
44
package cn.flightfeather.supervision.lightshare.service.impl
 
import cn.flightfeather.supervision.SupervisionApplication
import cn.flightfeather.supervision.lightshare.service.SearchService
import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
import org.junit.Test
import org.junit.jupiter.api.extension.ExtendWith
 
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
import org.springframework.test.context.junit4.SpringRunner
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.*
 
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@SpringBootTest
class SearchServiceImplTest {
 
    @Autowired
    lateinit var searchService: SearchService
 
    @Test
    fun getExcel() {
        val localTimeS = LocalDateTime.of(2021, 3, 1, 0, 0, 0)
        val localTimeE = LocalDateTime.of(2021, 3, 31, 23, 59, 59)
        val sD = Date.from(localTimeS.atZone(ZoneId.systemDefault()).toInstant())
        val eD = Date.from(localTimeE.atZone(ZoneId.systemDefault()).toInstant())
 
        val mode = 10
        //金山2022年6月
        searchService.writeToFile(ExcelConfigVo(
            "8QN1VzftuhBJmrF8",
            districtCode = "310106",
//            townCode = "310116113",
            sceneType = 1), mode)
        //金山2021年3月
//        searchService.writeToFile(ExcelConfigVo("o7jdSzr79fe0NH3I", districtCode = "310116", sceneType = 1))
    }
}