From 6904763f0e74d9a9fa4dbc39f635d2aee39416c6 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 30 九月 2025 09:34:22 +0800 Subject: [PATCH] 2025.9.30 --- src/main/kotlin/cn/flightfeather/supervision/common/risk/RiskAssessment.kt | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/risk/RiskAssessment.kt b/src/main/kotlin/cn/flightfeather/supervision/common/risk/RiskAssessment.kt index 37c82ac..af18c99 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/common/risk/RiskAssessment.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/common/risk/RiskAssessment.kt @@ -2,6 +2,7 @@ import cn.flightfeather.supervision.common.score.EvaluationUtil import cn.flightfeather.supervision.domain.entity.Evaluation +import cn.flightfeather.supervision.domain.entity.Evaluationrule import cn.flightfeather.supervision.domain.entity.Userinfo import cn.flightfeather.supervision.infrastructure.utils.DateUtil import com.github.pagehelper.PageHelper @@ -33,24 +34,33 @@ fun getResult(user: Userinfo, config: DataSource.Config, dbMapper: DbMapper): Triple<Boolean, Int?, String> { reset() - val sTime = LocalDateTime.of(config.year, config.month, 1, 0, 0, 0, 0) - val eTime = sTime.plusMonths(1) + val rule = dbMapper.evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { + createCriteria().andEqualTo("scensetypeid", config.sceneType) + .andEqualTo("ruletype", 0) + }).takeIf { it.isNotEmpty() }?.get(0) + + // 鏍规嵁璇勪及鐨勬彁浜ゅ懆鏈燂紙鍗曚綅锛氭湀锛夛紝璁$畻瀵瑰簲鐨勬湀浠借寖鍥� + val period = rule?.scensesubtypeid?.toInt() ?: 1 + // 鎻愪氦鍛ㄦ湡涓嬬殑璧锋鏈堜唤 + val startM = DateUtil.getStartMonthByPeriod(config.month, period) + val endM = startM?.plus(period)?.minus(1) + + // 鏌ヨ寮�濮嬫椂闂翠负鍛ㄦ湡涓嬬殑棣栦釜鏈堜唤 + val sTime = LocalDateTime.of(config.year, startM ?: config.month, 1, 0, 0, 0, 0) + // 鏌ヨ缁撴潫鏃堕棿涓虹粺璁$殑鏈堜唤 + val eTime = LocalDateTime.of(config.year, config.month, 1, 0, 0, 0, 0) + .plusMonths(1).minusSeconds(1) PageHelper.startPage<Evaluation>(1, 1) val result = dbMapper.evaluationMapper.selectByExample((Example(Evaluation::class.java).apply { createCriteria().andEqualTo("evaluatorguid", user.guid) .andEqualTo("ertype", 0) -// .andBetween("createdate", sTime, eTime) + .andBetween("createdate", sTime, eTime) orderBy("createdate").desc() })) if (result.isEmpty()) { return Triple(false, null, "/") } else { - val rule = dbMapper.evaluationruleMapper.selectByPrimaryKey(result[0].stguid) - totalScore = rule.resultrange?.toInt() ?: 0 - // 鏍规嵁璇勪及鐨勬彁浜ゅ懆鏈燂紙鍗曚綅锛氭湀锛夛紝璁$畻瀵瑰簲鐨勬湀浠借寖鍥� - val period = rule.scensesubtypeid?.toInt() ?: 1 - val startM = DateUtil.getStartMonthByPeriod(config.month, period) - val endM = startM?.plus(period)?.minus(1) + totalScore = rule?.resultrange?.toInt() ?: 0 // 璁$畻璇勪及璁板綍瀵瑰簲鐨勫懆鏈燂紙鍝勾鐨勫嚑鏈堝埌鍑犳湀锛� val list1 = result[0].scensename?.split("/") ?: return Triple(false, null, "/") -- Gitblit v1.9.3