feiyu02
2024-11-19 752e00503f672ddfe2066afb6c235721a3a912b5
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
package cn.flightfeather.supervision.common.risk
 
import cn.flightfeather.supervision.domain.mapper.*
import cn.flightfeather.supervision.lightshare.service.LedgerService
import org.junit.Test
import org.junit.jupiter.api.Assertions.*
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
import java.time.LocalDate
 
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@SpringBootTest
class RiskAnalysisTest {
 
    @Autowired
    lateinit var userinfoMapper: UserinfoMapper
 
    @Autowired
    lateinit var userConfigMapper: UserConfigMapper
 
    @Autowired
    lateinit var userLoginLogMapper: UserLoginLogMapper
 
    @Autowired
    lateinit var ledgerRecordMapper: LedgerRecordMapper
 
    @Autowired
    lateinit var ledgerSubTypeMapper: LedgerSubTypeMapper
 
    @Autowired
    lateinit var evaluationMapper: EvaluationMapper
 
    @Autowired
    lateinit var evaluationruleMapper: EvaluationruleMapper
 
    @Autowired
    lateinit var baseInfoMapper: BaseInfoMapper
 
    @Autowired
    lateinit var companyMapper: CompanyMapper
 
    @Autowired
    lateinit var commitmentMapper: CommitmentMapper
 
    @Autowired
    lateinit var riskEvaluationMapper: RiskEvaluationMapper
 
    @Autowired
    lateinit var personalInfoMapper: PersonalInfoMapper
 
    @Autowired
    lateinit var userInfoWxMapper: UserInfoWxMapper
 
    @Autowired
    lateinit var ledgerService: LedgerService
 
    @Autowired
    lateinit var dbMapper: DbMapper
 
    @Test
    fun riskAnalysis() {
        var startDate = LocalDate.of(2024, 8, 1)
        val endDate = LocalDate.of(2024, 9, 1)
        while (!startDate.isAfter(endDate)) {
            val year = startDate.year
            val month = startDate.monthValue
            val list = mutableListOf<DataSource>().apply {
                //医疗机构
                add(DataSource(DataSource.Config("静安区", "9", year, month, 2), dbMapper))
 
                //万达
//                add(DataSource(DataSource.Config("金山区", "1", year, month, 10), dbMapper))
//                add(DataSource(DataSource.Config("金山区", "2", year, month, 3), dbMapper))
//                //碳谷绿湾(工业企业)
//                add(DataSource(DataSource.Config("金山区", "6", year, month, 8), dbMapper))
//
//                //大融城
//                add(DataSource(DataSource.Config("静安区", "1", year, month, 16), dbMapper))
//                //大悦城
//                add(DataSource(DataSource.Config("静安区", "1", year, month, 17), dbMapper))
//                //久光
//                add(DataSource(DataSource.Config("静安区", "1", year, month, 9), dbMapper))
//                //889
//                add(DataSource(DataSource.Config("静安区", "1", year, month, 11), dbMapper))
//                //X88
//                add(DataSource(DataSource.Config("静安区", "1", year, month, 15), dbMapper))
//
//                //天钥桥
//                add(DataSource(DataSource.Config("徐汇区", "1", year, month, 13), dbMapper))
//                //田尚坊
//                add(DataSource(DataSource.Config("徐汇区", "1", year, month, 14), dbMapper))
//                //汽修
//                add(DataSource(DataSource.Config("徐汇区", "7", year, month, 1), dbMapper))
//
//                add(DataSource(DataSource.Config("长宁区", "2", year, month, 19), dbMapper))
            }
            list.forEach {
                val riskAnalysis = RiskAnalysis(it, toDatabase = true, toFile = false)
                riskAnalysis.execute()
            }
            startDate = startDate.plusMonths(1)
        }
    }
}