feiyu02
2025-09-17 8c15c9cc0d6474ed77e313258f9b09f7f2d6366e
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ItemevaluationServiceImpl.kt
@@ -88,7 +88,7 @@
            }
            return true
        } catch (e: Exception) {
            throw BizException("出现系统内部错误")
            throw BizException(e.message, e.cause)
        }
    }
@@ -107,7 +107,7 @@
            }
            return true
        } catch (e: Exception) {
            throw BizException("出现系统内部错误")
            throw BizException(e.message, e.cause)
        }
    }
@@ -117,17 +117,22 @@
        val sceneType = evaVo.scensetypeid?.toInt() ?: throw BizException("场景类型未设置,无法更新分数")
        val source = AopDataSource(aopDbMapper, aopSceneTypeCheck)
        source.setResource(taskId, sceneType, null, null)
        try {
            source.loop() { _, evaluationScene ->
                if (evaluationScene.noRecord()) throw BizException("巡查任务不存在")
                // 将分数赋值到对应的评估规则下,并且自动计算其余规则的得分
                ScoreUtil.scoreAssign(evaluationScene, itemList)
                // 获取总分和子项得分数据库表结构体,并入库
                ScoreUtil.updateEvaRecord(evaluationScene)?.let { aopOutput.updateDbEvaluation(evaluationScene, it) }
                if (evaluationScene.noRecord()) return@loop
                evaVo.subTaskEvaList?.find {
                    it.subTaskId == evaluationScene.subTask.value?.stguid
                }?.let {stEva ->
                    // 将分数赋值到对应的评估规则下,并且自动计算其余规则的得分
                    ScoreUtil.scoreAssignSelected(evaluationScene, stEva.subRule)
                    // 获取总分和子项得分数据库表结构体,并入库
                    ScoreUtil.updateEvaRecord(evaluationScene)?.let { aopOutput.updateDbEvaluation(evaluationScene, it) }
                }
            }
            return true
        } catch (e: Exception) {
            throw BizException("出现系统内部错误")
            throw BizException(e.message, e.cause)
        }
    }
}