| | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation |
| | | import cn.flightfeather.supervision.lightshare.vo.EvaluationVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ItemEvaluationVo |
| | | import cn.flightfeather.supervision.lightshare.vo.SubRulePair |
| | | import java.util.* |
| | | |
| | | /** |
| | |
| | | |
| | | // 补充各最上级评分项的计分 |
| | | val fatherId = r.first.fatherid |
| | | for (t in (evaluationScene.topRules.value ?: emptyList())) { |
| | | for (t in (topRules ?: emptyList())) { |
| | | if (t.guid == fatherId) { |
| | | t.score += r.first.score |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据所选最深层评估选项,以原有评分为基础,给规则赋值对应分数及自动计算其余所有条目得分 |
| | | * @param evaluationScene 需要评估的对象 |
| | | * @param selected 评估表中选中的评估条目主键id集合(必须是最深一层的评估条目) |
| | | */ |
| | | fun scoreAssignSelected(evaluationScene: AopDataSource.EvaluationScene, selected: List<SubRulePair?>?) { |
| | | val topRules = evaluationScene.topRules.value |
| | | val subRules = evaluationScene.rules.value |
| | | val evaluation = evaluationScene.evaluation.value ?: return |
| | | val itemevaluationList = evaluationScene.itemevaluationList.value ?: return |
| | | subRules?.forEach { r -> |
| | | |
| | | r.second.forEach { e -> |
| | | // 首先将原有的分数赋值给对应规则 |
| | | val itemEva = itemevaluationList.find { it.esrguid == e.guid } |
| | | e.score = itemEva?.value?.toIntOrNull() ?: 0 |
| | | e.selected = itemEva?.extension1 == "true" |
| | | // 根据传入的选中评估条目主键id,修改其得分 |
| | | selected?.find { it?.id == e.guid }?.let {s -> |
| | | if (s.selected == true) { |
| | | e.setMaxScore() |
| | | } else { |
| | | e.clear() |
| | | } |
| | | } |
| | | } |
| | | // 根据子项的选择情况,自动计算该条评估的总得分 |
| | | subRuleCal(r) |
| | | |
| | | // 补充各最上级评分项的计分 |
| | | val fatherId = r.first.fatherid |
| | | for (t in (topRules ?: emptyList())) { |
| | | if (t.guid == fatherId) { |
| | | t.score += r.first.score |
| | | break |