From f373bbf83d9d2a7e5f96118d7dcd658c9fea8bc8 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 14 八月 2025 17:27:44 +0800 Subject: [PATCH] 2025.8.14 1. 新增文件导入场景信息接口 2. 新增导出接口文档接口 --- 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