From 9de446b0b83610055437fbc5172d216bb374900f Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 21 十一月 2024 09:22:19 +0800 Subject: [PATCH] 1. 2024.11.21 修复部分bug --- src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt | 54 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt index a19472f..e8f9e4e 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt @@ -7,6 +7,9 @@ import cn.flightfeather.supervision.domain.ds2.entity.LedgerSubType import cn.flightfeather.supervision.domain.ds2.entity.UserMap import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ +import cn.flightfeather.supervision.lightshare.vo.AreaVo +import cn.flightfeather.supervision.lightshare.vo.EvaluationSubRuleVo +import org.springframework.beans.BeanUtils import tk.mybatis.mapper.entity.Example import java.time.LocalDateTime import java.time.ZoneId @@ -36,6 +39,12 @@ initUserSource(config) } } + +// fun setResource(areaVo: AreaVo) { +// val task = taskRep.findOneTask(areaVo) +// val taskId = task?.tguid +// val sceneType = areaVo.scensetypeid?.toInt() ?: throw BizException("鍦烘櫙绫诲瀷鏈缃紝鏃犳硶璇勪及") +// } fun setResource(config: AopDataConfig) { config.sceneType ?: return @@ -73,6 +82,31 @@ do { callback(i, evaluationScene) } while (evaluationScene.gotoNextSubTask()) + } + } + 1 -> { + userSourceList.forEachIndexed { i, user -> + evaluationScene.clear() + evaluationScene.index = i + evaluationScene.setDefaultUserTZ(user) + callback(i, evaluationScene) + } + } + } + } + + /** + * 鏍规嵁瀛愪换鍔″彧杞涓�娆� + * 褰撴暟鎹簮鏄�氳繃[setResource]浼犲叆[Subtask]鏃跺喅瀹氭椂 + */ + fun runBySubTask(callback: (index: Int, evaluationScene: EvaluationScene) -> Unit) { + when (mode) { + 0 -> { + sceneSourceList.forEachIndexed { i, scene -> + evaluationScene.clear() + evaluationScene.index = i + evaluationScene.setDefaultScene(scene) + callback(i, evaluationScene) } } 1 -> { @@ -248,9 +282,9 @@ val totalScore = InfoProxy<Int>() //鑷姩璇勫垎瑙勫垯涓�绾у垎绫� - val topItems = InfoProxy<MutableList<Evaluationsubrule2>>(config?.sceneType.toString()) { _, cacheMap -> - val _topItems = mutableListOf<Evaluationsubrule2>() - val _rules = mutableListOf<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>>() + val topRules = InfoProxy<MutableList<EvaluationSubRuleVo>>(config?.sceneType.toString()) { _, cacheMap -> + val _topItems = mutableListOf<EvaluationSubRuleVo>() + val _rules = mutableListOf<Pair<EvaluationSubRuleVo, MutableList<EvaluationSubRuleVo>>>() val rule = aopDbMapper.evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { createCriteria() .andEqualTo("tasktypeid", 99) @@ -264,7 +298,11 @@ val rules = aopDbMapper.evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule2::class.java).apply { createCriteria().andEqualTo("erguid", ruleId) - }) + }).map { + val vo = EvaluationSubRuleVo() + BeanUtils.copyProperties(it, vo) + vo + } rules.forEach { if (it.ertype == 2) { _topItems.add(it) @@ -275,7 +313,7 @@ var t = 0 _topItems.forEach { t += it.maxscore ?: 0 - val tempRules = mutableListOf<Evaluationsubrule2>() + val tempRules = mutableListOf<EvaluationSubRuleVo>() for (i in rules) { if (i.fatherid == it.guid && i.ertype == 3) { tempRules.add(i) @@ -287,7 +325,7 @@ } tempRules.sortBy { t -> t.displayid } tempRules.forEach { temp -> - val tempSubRules = mutableListOf<Evaluationsubrule2>() + val tempSubRules = mutableListOf<EvaluationSubRuleVo>() for (i in rules) { if (i.fatherid == temp.guid && i.ertype == 4) { tempSubRules.add(i) @@ -308,7 +346,7 @@ // FIXME: 2023/8/9 瀛愯鍒欑殑鑾峰彇蹇呴』鍦╗topItems]璋冪敤涔嬪悗锛屽惁鍒欎负绌� //鑷姩璇勫垎瑙勫垯浜岀骇鍜屼笁绾у垎绫� - val rules = InfoProxy<MutableList<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>>>() + val rules = InfoProxy<MutableList<Pair<EvaluationSubRuleVo, MutableList<EvaluationSubRuleVo>>>>() //蹇呭~鍙拌处鏁伴噺 val ledgerCount = InfoProxy<Int>(config?.sceneType.toString()) {_, cacheMap -> @@ -374,7 +412,7 @@ evaluation.clear() itemevaluationList.clear() totalScore.clear() - topItems.clear() + topRules.clear() baseRule.clear() rules.clear() } -- Gitblit v1.9.3