feiyu02
2022-09-15 3e2159e45e12b2b8af058b68eafeaf082cf3fe85
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年MM月")
        result.updateTime = DateUtil().DateToString(overallEvaluation.oeUpdateTime, "YYYY年MM月")
        result.publishTime = DateUtil.DateToString(overallEvaluation.oePublishTime, "YYYY年MM月")
        result.updateTime = DateUtil.DateToString(overallEvaluation.oeUpdateTime, "YYYY年MM月")
        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
                                    }
                                }
                            }