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/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt
index 4bfc770..ae7a4d5 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt
@@ -1,6 +1,7 @@
package cn.flightfeather.supervision.business.autooutput.score
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
+import cn.flightfeather.supervision.common.exception.BizException
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
@@ -9,6 +10,8 @@
import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep
import org.springframework.stereotype.Component
import java.time.LocalDate
+import java.time.ZoneId
+import java.util.*
/**
* 鏍规嵁鑷姩璇勪及[AopEvaluation]缁撴灉鐢熸垚鐜俊鐮�
@@ -22,7 +25,7 @@
) {
fun execute(config: AopDataConfig) {
- if (config.year == null || config.month == null) throw IllegalStateException("鐜俊鐮佽瘎浼版椂蹇呴』浼犻�掓椂闂存潯浠�!")
+ if (config.year == null || config.month == null) throw BizException("鐜俊鐮佽瘎浼版椂蹇呴』浼犻�掓椂闂存潯浠�!")
// 鎵惧埌椋炵窘鐜涓渶瑕佺敓鎴愮幆淇$爜鐨勬墍鏈夌珯鐐�
val sceneType = Constant.SceneType.getByValue(config.sceneType.toString())
val userList = findUsers(config.districtName, sceneType)
@@ -32,9 +35,19 @@
userMapRep.findFromSupervision(it)?.let { s ->
// 浠庨缇界洃绠$郴缁熶腑鏌ユ壘璇勫垎
val e = evaluationRep.findByScene(s.guid, date)
- e?.resultscorebef?.toInt()?.let {score ->
+ if (e.isNotEmpty()) {
// 鏍规嵁璇勫垎鐢熸垚瀵瑰簲鐨勭幆淇$爜
+ var score = 0
+ e.forEach {eva ->
+ val s = eva?.resultscorebef?.toInt() ?: 0
+ if (s > score) score = s
+ }
overallEvaluationRep.insertOrUpdateOne(it?.guid, score, sceneType, date, endDate)
+ } else {
+ // TODO: 2024/12/6 褰撴病鏈夋壘鍒拌嚜鍔ㄨ瘎鍒嗚褰曟椂锛岄噰鐢ㄥ巻鍙叉渶鏂扮殑鐜俊鐮佽褰曚綔涓烘湰鏈熻褰�
+ overallEvaluationRep.selectLatest(it?.guid)?.let {o ->
+ overallEvaluationRep.insertOrUpdateOne(o.biGuid, o.oeScore, sceneType, date, endDate)
+ }
}
}
}
--
Gitblit v1.9.3