From baf2cc2ce3dfd1235c012a3750132769fcd9ad2f Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 18 九月 2025 17:02:05 +0800
Subject: [PATCH] 2025.9.18 1. 联合前端调试数据产品接口(待完成)

---
 src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 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 6bff41d..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,7 +1,7 @@
 package cn.flightfeather.supervision.business.autooutput.score
 
 import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
-import cn.flightfeather.supervision.common.exception.ResponseErrorException
+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
@@ -10,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]缁撴灉鐢熸垚鐜俊鐮�
@@ -23,7 +25,7 @@
 ) {
 
     fun execute(config: AopDataConfig) {
-        if (config.year == null || config.month == null) throw ResponseErrorException("鐜俊鐮佽瘎浼版椂蹇呴』浼犻�掓椂闂存潯浠�!")
+        if (config.year == null || config.month == null) throw BizException("鐜俊鐮佽瘎浼版椂蹇呴』浼犻�掓椂闂存潯浠�!")
         // 鎵惧埌椋炵窘鐜涓渶瑕佺敓鎴愮幆淇$爜鐨勬墍鏈夌珯鐐�
         val sceneType = Constant.SceneType.getByValue(config.sceneType.toString())
         val userList = findUsers(config.districtName, sceneType)
@@ -33,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