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, 6, 1)
|
val endDate = LocalDate.of(2024, 6, 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 = true)
|
riskAnalysis.execute()
|
}
|
startDate = startDate.plusMonths(1)
|
}
|
}
|
}
|