From aed297a5fbc8df9dab01b28da21f872ee546b43c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 13 十月 2025 16:15:11 +0800
Subject: [PATCH] 2025.10.13 1. 统一调整controller层的返回类型,通过添加全局响应增强器GlobalResponseAdvice来管理返回结果; 2. 新增mybatis-generator自定义插件,实现给数据库实体entity自动添加swagger注解@ApiModel和@ApiModelProperty
---
src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt | 140 ++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 128 insertions(+), 12 deletions(-)
diff --git a/src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt b/src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt
index c5b741d..a904ee8 100644
--- a/src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt
+++ b/src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt
@@ -1,7 +1,17 @@
package cn.flightfeather.supervision.business.autooutput
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
-import cn.flightfeather.supervision.business.autooutput.score.construction.JADataAnalysis
+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.entity.Evaluationrule
+import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper
+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
@@ -11,6 +21,7 @@
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.test.context.junit4.SpringRunner
+import tk.mybatis.mapper.entity.Example
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@@ -21,38 +32,143 @@
lateinit var aopEvaluation: AopEvaluation
@Autowired
+ lateinit var aopCreditCode: AopCreditCode
+
+ @Autowired
lateinit var searchService: SearchService
@Autowired
- lateinit var jaDataAnalysis: JADataAnalysis
+ 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
+
+ @Autowired
+ lateinit var evaluationruleMapper: EvaluationruleMapper
/**
- * 缁熻鐩戞祴鏁版嵁缁撴灉
+ * 闈欏畨宸ュ湴鑷瘎
*/
@Test
fun test1() {
- jaDataAnalysis.setResource("VHXHS1dHsykTNUf2", 1, 2023, 8)
- jaDataAnalysis.execute()
+ val taskId = "qpou6fonNsye9WC1"
+ val districtCode = "310106"
+ val year = 2025
+ val month = 9
+ 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() {
- aopEvaluation.setResource("VHXHS1dHsykTNUf2", 1)
- aopEvaluation.execute()
+// 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(
- "VHXHS1dHsykTNUf2",
- districtCode = "310106",
- sceneType = 1), mode)
+ taskId,
+ districtCode = districtCode,
+ sceneType = sceneType), mode)
+ }
+
+ @Test
+ fun aopSubtask() {
+ val s = subTaskRep.findOne("B6kyaAjJRoGJ2Yur")
+ aopEvaluation.executeBySubTask(s!!)
+ }
+
+ @Test
+ fun test3() {
+ val result = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply {
+ createCriteria()
+ .andEqualTo("tasktypeid", 99)
+ .andEqualTo("scensetypeid", 1)
+ and(createCriteria().orEqualTo("provincecode", "31").orIsNull("provincecode"))
+ and(createCriteria().orEqualTo("citycode", "3100").orIsNull("citycode"))
+ and(createCriteria().orEqualTo("districtcode", "310104").orIsNull("districtcode"))
+ and(createCriteria().orEqualTo("towncode", "310104014").orIsNull("towncode"))
+ orderBy("towncode").desc()
+ .orderBy("districtcode").desc()
+ .orderBy("citycode").desc()
+ .orderBy("provincecode").desc()
+ })
+ println(result.map { it.rulename })
}
}
\ No newline at end of file
--
Gitblit v1.9.3