feiyu02
2024-04-25 0392c333ed3d987cb2ab3dac4e1a972cff405f21
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package cn.flightfeather.supervision.lightshare.service.impl
 
import cn.flightfeather.supervision.SupervisionApplication
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.repository.SceneRep
import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep
import cn.flightfeather.supervision.lightshare.service.ScenseService
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.SpringJUnit4ClassRunner
 
@RunWith(SpringJUnit4ClassRunner::class)
@SpringBootTest(classes = [SupervisionApplication::class])
class ScenseServiceImplTest {
 
    @Autowired
    lateinit var scenseService: ScenseService
 
    @Autowired
    lateinit var sceneRep: SceneRep
 
    @Autowired
    lateinit var userInfoSVRep: UserInfoSVRep
 
    @Test
    fun getSceneType() {
        scenseService.getSceneType().forEach {
            println("id:${it.sceneTypeId}     name:${it.sceneType}")
        }
    }
 
    @Test
    fun search() {
        val s = Scense().apply {
            provincecode = "31"
            citycode = "3100"
            districtcode = "310106"
        }
        val r = scenseService.search(s)
        println(r)
    }
 
    @Test
    fun createTZUserInfo() {
        val sId = listOf("lMqvVUjDrcAfb5l9",
            "iRn69RgMMJVCnvVy",
            "BHkeYXhWBIN7dpm4",
            "moT0gClykLAgTedp",
            "9tNfxmcUBspynqOB",
            "dXcHOIqFvFRSeKhg",
            "XNoilpfLZESw5DP0",
            "f4fOMCcBAtrmqDO7",
            "GyOZyyiouI15lfdZ",
            "k2FSexhq1Yj3GXAA",
            "K7FTWRkLFrfenq4G",
            "0nPo3EoR7K0JHq6d",
            "YHYxGucNfjkMjSLI",
            "ppzbVvgaqTbHLMFL",
            "eJcnnfg6joXLUlYN",
            "dSuH4hr66NAfflti",
            "Ba8jWakmIYexMxvK",
            "jYRzLMfB81qfOaec",
            "L5ABNgmzgqDLGWnw",
            "yYy88ocNnnZDreIK",
        )
        sId.forEach {
            val scene = sceneRep.findScene(sceneId = it) ?: return@forEach
            val userInfo = userInfoSVRep.findUser(it) ?: return@forEach
            scenseService.createTZUserInfo(userInfo, scene)
        }
    }
}