From fe031e01cc1737c2f05a133fde7c36c7a2a7b4b4 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 21 一月 2026 17:38:32 +0800
Subject: [PATCH] 2026.1.21 1. 新增完善台账复制逻辑
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt
index 199bea0..7abce00 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt
@@ -4,14 +4,17 @@
import cn.flightfeather.supervision.domain.entity.Evaluationrule
import cn.flightfeather.supervision.domain.entity.Evaluationsubrule
import cn.flightfeather.supervision.domain.entity.Itemevaluation
+import cn.flightfeather.supervision.domain.enumeration.AssessmentRuleType
import cn.flightfeather.supervision.domain.enumeration.SceneType
import cn.flightfeather.supervision.domain.mapper.*
+import cn.flightfeather.supervision.infrastructure.utils.DateUtil
import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService
import cn.flightfeather.supervision.lightshare.vo.EvaluationVo
import cn.flightfeather.supervision.lightshare.vo.SubEvaluationVo
import cn.flightfeather.supervision.lightshare.vo.ThirdEvaluationVo
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
+import java.time.LocalDateTime
@Service
class EvaluationsubruleServiceImpl(
@@ -40,6 +43,14 @@
}
override fun getScore(userId: String, time: String, platform:String?): List<EvaluationVo> {
+ val list = time.split("-")
+ var endM = list[1].toInt()
+ val list2 = list[0].split("/")
+ val year = list2[0].toInt()
+ var startM = list2[1].toInt()
+ var st = LocalDateTime.of(year, startM, 1, 0, 0, 0, 0)
+ var et = LocalDateTime.of(year, endM, 1, 0, 0, 0, 0).plusMonths(1)
+
val userinfo = userinfoMapper.selectByPrimaryKey(userId) ?: return emptyList()
var sceneType = userinfo.extension2
// FIXME: 2022/11/8 涓存椂娣诲姞杩囧害鍔熻兘锛屾彁渚涘井淇″皬绋嬪簭鍓嶇姹戒慨绫诲瀷鐨勫満鏅崟鐙殑璇勪及娓呭崟 锛屽満鏅被鍨嬩负 -7
@@ -56,6 +67,16 @@
val rIdList = mutableListOf<String?>()
rules.forEach {
+ // 鎵惧埌鎬昏鍒�
+ if (it.ruletype == AssessmentRuleType.Total.value.toString()) {
+ val rulePeriod = it.scensesubtypeid?.toInt() ?: 1
+ DateUtil.getStartMonthByPeriod(startM, rulePeriod)?.let {s ->
+ startM = s
+ endM = startM + rulePeriod - 1
+ st = LocalDateTime.of(year, startM, 1, 0, 0, 0, 0)
+ et = LocalDateTime.of(year, endM, 1, 0, 0, 0, 0).plusMonths(1)
+ }
+ }
rIdList.add(it.guid)
}
@@ -72,7 +93,11 @@
val ruleScore = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
createCriteria().andIn("stguid", rIdList)//瑙勫垯id
.andEqualTo("evaluatorguid", userId)//鐢ㄦ埛id
- .andEqualTo("scensename", time)//璇勪及鍛ㄦ湡锛屼緥锛�2020/6-6
+ and(
+ createCriteria().orEqualTo("scensename", time)//璇勪及鍛ㄦ湡锛屼緥锛�2020/6-6
+ .orBetween("createdate", st, et)
+ )
+ orderBy("createdate").desc()
})
//瀛愯鍒欓�愭潯寰楀垎
val subRuleScores = if (ruleScore.isEmpty()) {
--
Gitblit v1.9.3