feiyu02
2025-03-28 7d74f3fd087d4a8192ed556a6c2e3a2ea3c81cff
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
package cn.flightfeather.supervision.business.autooutput
 
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JACsDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSCsDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSMpDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.XHFuDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSWhDataAnalysis
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
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.SpringRunner
 
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@SpringBootTest
class AopEvaluationTest {
 
    @Autowired
    lateinit var aopEvaluation: AopEvaluation
 
    @Autowired
    lateinit var aopCreditCode: AopCreditCode
 
    @Autowired
    lateinit var searchService: SearchService
 
    @Autowired
    lateinit var jaCsDataAnalysis: JACsDataAnalysis
 
    @Autowired
    lateinit var xhFuDataAnalysis: XHFuDataAnalysis
 
    @Autowired
    lateinit var jsCsDataAnalysis: JSCsDataAnalysis
 
    @Autowired
    lateinit var jsMpDataAnalysis: JSMpDataAnalysis
 
    @Autowired
    lateinit var jsWhDataAnalysis: JSWhDataAnalysis
 
    @Autowired
    lateinit var subTaskRep: SubTaskRep
 
    /**
     * 静安工地自评
     */
    @Test
    fun test1() {
        val taskId = "P7hsgDedyN9XLrbt"
        val districtCode = "310106"
        val year = 2024
        val month = 6
        val sceneType = Constant.SceneType.TYPE1.value.toInt()
        jaCsDataAnalysis.setResource(taskId, sceneType, year, month)
        jaCsDataAnalysis.execute()
 
        aopEvaluation.executeByTopTask(taskId, sceneType)
 
        val mode = 9
        searchService.writeToFile(ExcelConfigVo(
            taskId,
            districtCode = districtCode,
            sceneType = sceneType), mode)
    }
 
    /**
     * 徐汇餐饮自评
     */
    @Test
    fun test() {
//        val taskId = "88wgq9l5gm9cUMg1"
//        val districtCode = "310104"
        val districtName = "徐汇区"
        val year = 2024
        val month = 11
        val sceneType = Constant.SceneType.TYPE5.value.toInt()
//        xhFuDataAnalysis.setResource(taskId, sceneType, year, month)
//        xhFuDataAnalysis.execute()
//
//        aopEvaluation.executeByTopTask(taskId, sceneType)
//
//        val mode = 9
//        searchService.writeToFile(ExcelConfigVo(
//            taskId,
//            districtCode = districtCode,
//            sceneType = sceneType), mode)
        aopCreditCode.execute(AopDataConfig(
            year = year,
            month = month,
            districtName = districtName,
            sceneType = sceneType,
            period = 1
        ))
    }
 
    /**
     * 金山工地、码头、搅拌站自评
     */
    @Test
    fun test2() {
        val taskId = "rXtm0AozZYJqoEpW"
        val districtCode = "310116"
        val year = 2023
        val month = 11
//        val sceneType = Constant.SceneType.TYPE1.value.toInt()
//        val sceneType = Constant.SceneType.TYPE2.value.toInt()
        val sceneType = Constant.SceneType.TYPE3.value.toInt()
//        val sceneType = Constant.SceneType.TYPE14.value.toInt()
 
        when (sceneType) {
            Constant.SceneType.TYPE1.value.toInt()->{
                jsCsDataAnalysis.setResource(taskId, sceneType, year, month)
                jsCsDataAnalysis.execute()
            }
            Constant.SceneType.TYPE2.value.toInt()->{
                jsWhDataAnalysis.setResource(taskId, sceneType, year, month)
                jsWhDataAnalysis.execute()
            }
            Constant.SceneType.TYPE3.value.toInt()->{
                jsMpDataAnalysis.setResource(taskId, sceneType, year, month)
                jsMpDataAnalysis.execute()
            }
        }
 
        aopEvaluation.executeByTopTask(taskId, sceneType)
 
        val mode = 9
        searchService.writeToFile(ExcelConfigVo(
            taskId,
            districtCode = districtCode,
            sceneType = sceneType), mode)
    }
 
    @Test
    fun aopSubtask() {
        val s = subTaskRep.findOne("B6kyaAjJRoGJ2Yur")
        aopEvaluation.executeBySubTask(s!!)
    }
}