feiyu02
2022-07-14 4c7e2d8f8d4a93f318ada0e728dbc370e7504e92
src/main/kotlin/cn/flightfeather/supervision/business/ScoreItem.kt
@@ -84,13 +84,13 @@
        evaluationsubruleList.forEach {
            if (it.fatherid == id) {
                // 根据规则对应的相关问题id,查找用户在当前时间段内是否有发生该问题,有则扣除相应的分数
                it.problemlist?.let {pId ->
                    problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
                        createCriteria().andEqualTo("sguid", info.sceneId)
                            .andEqualTo("ptguid", pId)
                            .andGreaterThanOrEqualTo("time", info.sTime)
                            .andLessThan("time", info.eTime)
                    })?.takeIf { p-> p.isNotEmpty() }?.run {
                val pList = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
                    createCriteria().andEqualTo("sguid", info.sceneId)
                        .andGreaterThanOrEqualTo("time", info.sTime)
                        .andLessThan("time", info.eTime)
                }).map { p-> p.ptguid }
                it.problemlist?.split(",")?.forEach {pId ->
                    if (pList.contains(pId)) {
                        it.extension1 = (0 - (it.maxscore ?: 0)).toString()
                    }
                }