feiyu02
2024-07-19 4e20a1aaaba1bb843820fca844c20055a33febce
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -1,6 +1,8 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.common.exception.BizException
import cn.flightfeather.supervision.common.log.BizLog
import cn.flightfeather.supervision.common.log.WorkStreamLogInfo
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.common.utils.Constant
@@ -42,6 +44,7 @@
    private val taskRep: TaskRep,
    private val subTaskRep: SubTaskRep,
    private val problemRep: ProblemRep,
    private val bizLog: BizLog,
) : ProblemlistService {
    @Resource
@@ -374,14 +377,21 @@
            return BaseResponse(false, "非法的操作指令")
        }
        val p = problemlistMapper.selectByPrimaryKey(pId) ?: return BaseResponse(false, "问题不存在")
        val subtask = p.stguid?.let { subTaskRep.findOne(it) }
        val response = BaseResponse<String>(true)
        var event = ""
        p.apply {
            this.remark = userName
            if (extension3 == Constant.PROBLEM_UNCHECKED) {
                event = "在${subtask?.scensename}审核了一个问题"
                when (action) {
                    0.toByte() -> extension3 = Constant.PROBLEM_CHECK_PASS
                    1.toByte() -> extension3 = Constant.PROBLEM_CHECK_FAIL
                    0.toByte() -> {
                        extension3 = Constant.PROBLEM_CHECK_PASS
                    }
                    1.toByte() -> {
                        extension3 = Constant.PROBLEM_CHECK_FAIL
                    }
                    2.toByte(),
                    3.toByte(),
                    -> {
@@ -403,6 +413,7 @@
                            } else {
                                Constant.CHANGE_CHECK_FAIL
                            }
                            event = "在${subtask?.scensename}审核了一个整改"
                        } else {
                            response.success = false
                            response.message = "问题还未整改,无法进行整改审核!操作无效"
@@ -410,6 +421,7 @@
                    }
                }
            } else if (extension3 == Constant.CHANGE_UNCHECKED) {
                event = "在${subtask?.scensename}审核了一个整改"
                when (action) {
                    0.toByte(),
                    1.toByte(),
@@ -439,6 +451,8 @@
            if (r != 1) {
                response.success = false
                response.message = "问题更新失败!"
            } else {
                bizLog.info(WorkStreamLogInfo(subtask?.executorguids, subtask?.executorrealtimes, event))
            }
        }
        return response
@@ -518,6 +532,12 @@
            inspectionMapper.updateByPrimaryKey(inspection)
        }
        problemlist.stguid?.let {
            val subtask = subTaskRep.findOne(it)
            val event = "在${subtask?.scensename}新增一个问题"
            bizLog.info(WorkStreamLogInfo(subtask?.executorguids, subtask?.executorrealtimes, event))
        }
        return BaseResponse(true)
    }