| | |
| | | package cn.flightfeather.supervision.business.autooutput.score |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ProblemlistMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.EvaluationSubRuleVo |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import tk.mybatis.mapper.entity.Example |
| | | import kotlin.math.abs |
| | | |
| | | /** |
| | | * 自动评分条目 |
| | |
| | | |
| | | lateinit var evaluationScene: AopDataSource.EvaluationScene |
| | | |
| | | private var rulePair: Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>? = null |
| | | private var rulePair: Pair<EvaluationSubRuleVo, MutableList<EvaluationSubRuleVo>>? = null |
| | | |
| | | @Autowired |
| | | lateinit var problemlistMapper: ProblemlistMapper |
| | |
| | | fun execute(evaluationScene: AopDataSource.EvaluationScene) { |
| | | this.evaluationScene = evaluationScene |
| | | if (!exemption && !evaluationScene.noRecord()) { |
| | | val a = evaluationScene.topRules.value |
| | | getRule(evaluationScene.rules.value) |
| | | calScore() |
| | | } |
| | |
| | | /** |
| | | * 获取评分规则 |
| | | */ |
| | | private fun getRule(eList: MutableList<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>>?) { |
| | | private fun getRule(eList: MutableList<Pair<EvaluationSubRuleVo, MutableList<EvaluationSubRuleVo>>>?) { |
| | | if (eList == null) return |
| | | for (e in eList) { |
| | | if (e.first.guid == id) { |
| | |
| | | } |
| | | |
| | | otherProblem(rulePair?.second!!.size)?.let { it.forEach {i -> |
| | | rulePair?.second!![i].getScore() |
| | | rulePair?.second!![i].setMaxScore() |
| | | } } |
| | | |
| | | ScoreUtil.subRuleCal(rulePair) |
| | | } |
| | | |
| | | /** |
| | | * 减分模式下,计算具体选项的得分 |
| | | */ |
| | | fun Evaluationsubrule2.getScore() { |
| | | extension1 = (0 - (maxscore ?: 0)).toString() |
| | | } |
| | | } |