| | |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.lightshare.service.* |
| | | import cn.flightfeather.supervision.lightshare.vo.InspectionVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ProblemlistVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ProblemListVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ScenseVo |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Component |
| | |
| | | * @author riku |
| | | * Date: 2020/8/7 |
| | | */ |
| | | |
| | | @Deprecated("2024.9.25 此自动评分舍弃") |
| | | @Component |
| | | class AutoScore2 { |
| | | |
| | |
| | | @Autowired |
| | | lateinit var itemevaluationService: ItemevaluationService |
| | | |
| | | private var problems: ArrayList<ProblemlistVo> = ArrayList() |
| | | private var problems: ArrayList<ProblemListVo> = ArrayList() |
| | | |
| | | private var allRules: ArrayList<Evaluationsubrule> = ArrayList() |
| | | private var allRules = listOf<Evaluationsubrule2>() |
| | | |
| | | private var inspection = InspectionVo() |
| | | |
| | |
| | | if (evaluationrule === null) return |
| | | this.evaluationrule = evaluationrule |
| | | //获取对应的具体评分细则 |
| | | allRules = autoScore.evaluationsubruleService.findByRuleId(evaluationrule.guid!!) as ArrayList<Evaluationsubrule> |
| | | allRules = autoScore.evaluationsubruleService.findByRuleId(evaluationrule.guid!!) |
| | | //获取巡查信息 |
| | | inspection = autoScore.inspectionService.findBySubTaskID(subtask.stguid!!) |
| | | |
| | | |
| | | val titleRule = Evaluationsubrule() |
| | | val titleRule = Evaluationsubrule2() |
| | | val titleOptionRange = ArrayList<Int>() |
| | | val titleIsGood = true |
| | | |
| | |
| | | * @param rule 当前评分项 |
| | | * @param maxScore 父项的最大分 |
| | | */ |
| | | fun autoGeneration(rule: Evaluationsubrule, maxScore: Int): Int? { |
| | | fun autoGeneration(rule: Evaluationsubrule2, maxScore: Int): Int? { |
| | | |
| | | val nextSubRules = getSubRulesByFatherId(allRules, rule.guid) |
| | | //无子项的最小评分项,给出得分 |
| | |
| | | } |
| | | |
| | | //填写详细评分项的分数 |
| | | fun writeScore4th(rule: Evaluationsubrule, maxScore: Int): Pair<Int, Boolean> { |
| | | fun writeScore4th(rule: Evaluationsubrule2, maxScore: Int): Pair<Int, Boolean> { |
| | | |
| | | problems.forEach { |
| | | if (it.guid != null) { |
| | |
| | | } |
| | | |
| | | //按照父id查找子评分项 |
| | | fun getSubRulesByFatherId(rules: ArrayList<Evaluationsubrule>, fatherId: String?): List<Evaluationsubrule> { |
| | | val subRules = mutableListOf<Evaluationsubrule>() |
| | | fun getSubRulesByFatherId(rules: List<Evaluationsubrule2>, fatherId: String?): List<Evaluationsubrule2> { |
| | | val subRules = mutableListOf<Evaluationsubrule2>() |
| | | rules.forEach { |
| | | if (it.fatherid == fatherId |
| | | || (fatherId.isNullOrBlank() && it.fatherid.isNullOrBlank())) { |
| | |
| | | } |
| | | |
| | | //创建单项评分对象 |
| | | fun createNewChildScore(subRule: Evaluationsubrule, score: Int, isSelected: Boolean): Int? { |
| | | fun createNewChildScore(subRule: Evaluationsubrule2, score: Int, isSelected: Boolean): Int? { |
| | | val itemevaluation = Itemevaluation() |
| | | itemevaluation.ieguid = UUIDGenerator.generate16ShortUUID() |
| | | itemevaluation.iguid = inspection.guid |
| | |
| | | } |
| | | |
| | | //获取总分 |
| | | fun getTotalPoint(rules: ArrayList<Evaluationsubrule>, fatherId: String?): Int { |
| | | fun getTotalPoint(rules: List<Evaluationsubrule2>, fatherId: String?): Int { |
| | | val rules1 = getSubRulesByFatherId(rules, fatherId) |
| | | var point = 0 |
| | | rules1.forEach { |