| | |
| | | stScoreItem_1: StScoreItem_1, |
| | | whScoreItem_1: WhScoreItem_1, |
| | | whScoreItem_2: WhScoreItem_2, |
| | | val jinAnScore: JinAnScore, |
| | | var sceneType: Constant.ScenseType = Constant.ScenseType.TYPE1, ) |
| | | { |
| | | companion object { |
| | |
| | | |
| | | private fun sceneGradeP(subtask: Subtask) { |
| | | val info = itemGrade(subtask) |
| | | val result = totalGrade(info) ?: return |
| | | val result = totalGrade(info, subtask) ?: return |
| | | toDb(info, result) |
| | | // jinAnScore.toDb(result.first, info) |
| | | // addToFile(rows, info, result.first) |
| | | // toFile() |
| | | } |
| | |
| | | getScoreItem() |
| | | |
| | | val info = itemGrade(subtask) |
| | | val result = totalGrade(info) ?: return |
| | | val result = totalGrade(info, subtask) ?: return |
| | | addToFile(rows, info, result.first) |
| | | } |
| | | |
| | |
| | | val scene = scenseMapper.selectByPrimaryKey(subtask.scenseid) |
| | | |
| | | val info = |
| | | Info(userInfo?.guid, tzUserId, subtask.scenseid, subtask.scensename, sceneType, subTask = subtask, sceneIndex = scene.index) |
| | | Info(userInfo?.guid, |
| | | tzUserId, |
| | | subtask.scenseid, |
| | | subtask.scensename, |
| | | sceneType, |
| | | subTask = subtask, |
| | | sceneIndex = scene.index, |
| | | online = scene.extension1 != "0" |
| | | ) |
| | | |
| | | /** 1. 根据评分规则对应的问题自动判断是否扣分***************************************************************/ |
| | | // 获取该次巡查任务下的所有问题 |
| | |
| | | // 具体评分选项 |
| | | val subRule = r.second |
| | | subRule.forEach { sr -> |
| | | // 存在多个评分项和同一个问题关联,因此必须全部评分项都判定一遍 |
| | | sr.problemlist?.split(",")?.forEach { pId -> |
| | | if (pList.contains(pId)) { |
| | | sr.extension1 = (0 - (sr.maxscore ?: 0)).toString() |
| | |
| | | /** |
| | | * 计算总分 |
| | | */ |
| | | private fun totalGrade(info: Info): Pair<Evaluation, List<Itemevaluation>>? { |
| | | private fun totalGrade(info: Info, subtask: Subtask): Pair<Evaluation, List<Itemevaluation>>? { |
| | | /** 4. 计算总分*************************************************************************/ |
| | | val scene = scenseMapper.selectByPrimaryKey(info.subTask?.scenseid) ?: return null |
| | | val inspection = inspectionMapper.selectByExample(Example(Inspection::class.java).apply { |
| | |
| | | townname = scene.townname |
| | | scensename = scene.name |
| | | scenseaddress = scene.location |
| | | evaluatetime = Date() |
| | | evaluatetime = subtask.planstarttime |
| | | evaluatorguid = "admin" |
| | | evaluatorusername = "admin" |
| | | evaluatorrealname = "admin" |
| | | resultscorebef = (totalScore - abs(total)).toString() |
| | | createdate = Date() |
| | | createdate = subtask.planstarttime |
| | | updatedate = Date() |
| | | } |
| | | } |