From 497475defd5d0ebf90ae6a8e2b080a16d78043ab Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 23 九月 2022 17:49:34 +0800 Subject: [PATCH] 2022.9.23 --- src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt | 38 +++++++++++++++++++++++++++++++------- 1 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt index f7007b5..ebd565a 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt @@ -51,8 +51,8 @@ override fun getTotalPoints(userId: String, evaluatorType: Int, startTime: String, endTime: String, sceneTypeId: Int?, erGuid: String?, eId: String?): List<Evaluation> { val example = Example(Evaluation::class.java) val criteria = example.createCriteria() - val startDate = DateUtil().StringToDate(startTime) - val endDate = DateUtil().StringToDate(endTime) + val startDate = DateUtil.StringToDate(startTime) + val endDate = DateUtil.StringToDate(endTime) criteria.andEqualTo("iguid", userId) .andBetween("createdate", startDate, endDate) example.and(example.createCriteria().apply { @@ -206,8 +206,8 @@ else -> null } - result.publishTime = DateUtil().DateToString(overallEvaluation.oePublishTime, "YYYY骞碝M鏈�") - result.updateTime = DateUtil().DateToString(overallEvaluation.oeUpdateTime, "YYYY骞碝M鏈�") + result.publishTime = DateUtil.DateToString(overallEvaluation.oePublishTime, "YYYY骞碝M鏈�") + result.updateTime = DateUtil.DateToString(overallEvaluation.oeUpdateTime, "YYYY骞碝M鏈�") result.creditLevel = creditLevel result.creditLevelDes = creditLevelDes result.codeLevel = codeLevel @@ -435,6 +435,7 @@ } //鍒嗙被鍒殑寰楀垎(姣忎釜璇勫垎琛ㄧ殑璇勫垎澶ч」鐨勫緱鍒�)鍜屽け鍒嗘潯鐩� + val ruleMap = result.loseScore rule1List.forEach { val evaluation = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply { createCriteria().andEqualTo("iguid", userId) @@ -446,10 +447,11 @@ }) val itemEvaluations = itemevaluationService.getItemEvaluationList(e.guid!!) - itemEvaluations.forEach {item -> + itemEvaluations.sortedBy { it.ertype }.forEach {item -> when (item.ertype) { //鍒嗙被鍒殑寰楀垎 2 -> { + ruleMap[item.name] = mutableMapOf() for (s in subRules) { if (s.guid == item.esrguid) { val score = if ((item.value?.toInt() ?: 0) <= 0) { @@ -462,12 +464,25 @@ } } } + 3 -> { + if ((item.value?.toInt() ?: 0) != 0 && item.extension1 == "true") { + for (s in subRules) { + if (s.guid == item.esrguid) { + if (!ruleMap.containsKey(s.fathername)) { + ruleMap[s.fathername] = mutableMapOf() + } + ruleMap[s.fathername]?.put(item.name, mutableListOf()) + break + } + } + } + } //澶卞垎鏉$洰 4 -> { if ((item.value?.toInt() ?: 0) != 0 && item.extension1 == "true") { for (s in subRules) { if (s.guid == item.esrguid) { - result.loseScore.add( + val d = Triple( item.name ?: "", if ((item.value?.toInt() ?: 0) < 0) { @@ -477,7 +492,16 @@ }, s.remark ?: "" ) - ) + val rule3Name = s.fathername + for (s1 in subRules) { + if (s1.itemname == rule3Name) { + val rule2Name = s1.fathername + ruleMap[rule2Name]?.get(rule3Name)?.add(d) + break + } + } + + break } } } -- Gitblit v1.9.3