feiyu02
2024-10-12 7cd8d2a1e96de3d173bf5af64b4adc29c497db2a
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
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(
            "9jqhywmfvpgvxrT2"
        )
        sId.forEach {
            val scene = sceneRep.findScene(sceneId = it) ?: return@forEach
            val userInfo = userInfoSVRep.findUser(it) ?: return@forEach
            scenseService.createTZUserInfo(userInfo, scene)
        }
    }
}