| | |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.MediafileService |
| | | import cn.flightfeather.supervision.lightshare.service.ProblemlistService |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.service.TaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import com.fasterxml.jackson.core.type.TypeReference |
| | |
| | | } |
| | | } |
| | | return problemListVolistTemp1 |
| | | } |
| | | |
| | | override fun getBySceneMonth(sceneId: String, year: Int?, month: Int?): List<ProblemListVo> { |
| | | var _year = year |
| | | var _month = month |
| | | if (year == null) { |
| | | PageHelper.startPage<Problemlist>(1, 1) |
| | | val lastProblem = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("sguid", sceneId) |
| | | orderBy("time").desc() |
| | | }).takeIf { it.isNotEmpty() }?.get(0) |
| | | if (lastProblem == null) { |
| | | return emptyList() |
| | | } else { |
| | | val lt = LocalDateTime.ofInstant(lastProblem.time?.toInstant(), ZoneId.systemDefault()) |
| | | _year = lt.year |
| | | _month = lt.monthValue |
| | | } |
| | | } |
| | | val sT = LocalDateTime.of(_year!!, _month!!, 1, 0, 0, 0, 0) |
| | | val eT = sT.plusMonths(1).minusSeconds(1) |
| | | return problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andBetween("time", sT,eT) |
| | | .andEqualTo("sguid", sceneId) |
| | | orderBy("time").desc() |
| | | }).map { |
| | | val problemVo = ProblemListVo(); |
| | | BeanUtils.copyProperties(it, problemVo) |
| | | problemVo |
| | | } |
| | | } |
| | | |
| | | //获取某顶层任务下,某个场景下的问题整改情况 |
| | |
| | | |
| | | override fun delete(id: String): Int = problemlistMapper.deleteByPrimaryKey(id) |
| | | |
| | | override fun setDeleteStatus(id: String): BaseResponse<Int> { |
| | | override fun setDeleteStatus(id: String): Int { |
| | | val p = problemlistMapper.selectByPrimaryKey(id) |
| | | |
| | | return when { |
| | | p.ischanged == true -> BaseResponse(false, "问题已整改,无法删除", data = 0) |
| | | p.extension3 != Constant.PROBLEM_UNCHECKED -> BaseResponse(false, "问题已审核,无法删除", data = 0) |
| | | p.ischanged == true -> throw BizException("问题已整改,无法删除") |
| | | p.extension3 != Constant.PROBLEM_UNCHECKED -> throw BizException("问题已审核,无法删除") |
| | | else -> { |
| | | // 2021/4/25 将原来的添加删除状态改为直接删除 |
| | | // p.remark = Constant.PROBLEM_DELETED |
| | |
| | | inspection.problemcount = inspection.problemcount!! - 1 |
| | | inspectionMapper.updateByPrimaryKey(inspection) |
| | | } |
| | | BaseResponse(true, "问题删除成功", data = i) |
| | | i |
| | | } |
| | | } |
| | | } |
| | |
| | | remark: String, |
| | | userId: String, |
| | | userName: String, |
| | | ): BaseResponse<String> { |
| | | if (action !in 0..3) { |
| | | return BaseResponse(false, "非法的操作指令") |
| | | ): String { |
| | | if (action !in 0..5) { |
| | | throw BizException("非法的操作指令") |
| | | } |
| | | val p = problemlistMapper.selectByPrimaryKey(pId) ?: return BaseResponse(false, "问题不存在") |
| | | val p = problemlistMapper.selectByPrimaryKey(pId) ?: throw BizException("问题不存在") |
| | | val subtask = p.stguid?.let { subTaskRep.findOne(it) } |
| | | val response = BaseResponse<String>(true) |
| | | var event = "" |
| | |
| | | -> { |
| | | response.success = false |
| | | response.message = "问题提交还未审核,无法进行整改审核!" |
| | | } |
| | | 4.toByte() -> { |
| | | response.success = false |
| | | response.message = "问题提交还未审核,无法进行撤回审核!" |
| | | } |
| | | 5.toByte() -> { |
| | | response.success = false |
| | | response.message = "问题整改还未提交,无法进行撤回审核!" |
| | | } |
| | | } |
| | | } else if (extension3 == Constant.PROBLEM_CHECK_PASS || extension3 == Constant.PROBLEM_CHECK_FAIL) { |
| | |
| | | response.message = "问题还未整改,无法进行整改审核!操作无效" |
| | | } |
| | | } |
| | | 4.toByte() -> { |
| | | extension3 = Constant.PROBLEM_UNCHECKED |
| | | } |
| | | 5.toByte() -> { |
| | | response.success = false |
| | | response.message = "问题整改还未审核,无法进行整改审核撤回操作!操作无效" |
| | | } |
| | | } |
| | | } else if (extension3 == Constant.CHANGE_UNCHECKED) { |
| | | event = "在${subtask?.scensename}审核了一个整改" |
| | |
| | | } |
| | | 2.toByte() -> extension3 = Constant.CHANGE_CHECK_PASS |
| | | 3.toByte() -> extension3 = Constant.CHANGE_CHECK_FAIL |
| | | 4.toByte() -> { |
| | | response.success = false |
| | | response.message = "问题整改还未审核,无法进行撤回审核!" |
| | | } |
| | | 5.toByte() -> { |
| | | response.success = false |
| | | response.message = "问题提交已审核,并且已被整改。操作无效" |
| | | } |
| | | } |
| | | } else if (extension3 == Constant.CHANGE_CHECK_PASS || extension3 == Constant.CHANGE_CHECK_FAIL) { |
| | | when (action) { |
| | |
| | | } |
| | | 2.toByte() -> extension3 = Constant.CHANGE_CHECK_PASS |
| | | 3.toByte() -> extension3 = Constant.CHANGE_CHECK_FAIL |
| | | 4.toByte() -> { |
| | | response.success = false |
| | | response.message = "问题提交已审核,并且已被整改,无法进行问题审核撤销操作。操作无效" |
| | | } |
| | | 5.toByte() -> { |
| | | extension3 = Constant.CHANGE_UNCHECKED |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | bizLog.info(WorkStreamLogInfo(userId, userName, event)) |
| | | } |
| | | } |
| | | return response |
| | | return if (response.success) "问题审核成功" else throw BizException(response.message) |
| | | } |
| | | |
| | | override fun newProblem(problem: String, files: Array<MultipartFile>): BaseResponse<String> { |
| | | override fun newProblem(problem: String, files: Array<MultipartFile>): String { |
| | | //json转object |
| | | val problemVo = ObjectMapper().readValue(problem, object : TypeReference<ProblemVo>() {}) |
| | | |
| | | val inspection = inspectionMapper.selectByPrimaryKey(problemVo.insGuid) ?: return BaseResponse(false, "巡查记录不存在") |
| | | val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: return BaseResponse(false, "巡查记录对应场景不存在") |
| | | val inspection = inspectionMapper.selectByPrimaryKey(problemVo.insGuid) ?: throw BizException("巡查记录不存在") |
| | | val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: throw BizException("巡查记录对应场景不存在") |
| | | // 保存问题 |
| | | val problemlist = ProblemListVo.newPro(inspection, problemVo, scene) |
| | | problemlistMapper.insert(problemlist) |
| | |
| | | bizLog.info(WorkStreamLogInfo(subtask?.executorguids, subtask?.executorrealtimes, event)) |
| | | } |
| | | |
| | | return BaseResponse(true) |
| | | return "success" |
| | | } |
| | | |
| | | override fun updateProblem(problem: ProblemListVo, deleteImg: List<String>, files: Array<MultipartFile>): String { |
| | |
| | | return "success" |
| | | } |
| | | |
| | | override fun changeProblem(problemId: String, files: Array<MultipartFile>): BaseResponse<String> { |
| | | |
| | | override fun changeProblem(problemId: String, files: Array<MultipartFile>): String { |
| | | // 问题和问题图片合法性检查 |
| | | val p = problemlistMapper.selectByPrimaryKey(problemId) ?: return BaseResponse(false, "问题不存在") |
| | | val p = problemlistMapper.selectByPrimaryKey(problemId) ?: throw BizException("问题不存在") |
| | | val mediaFiles = mediafileMapper.selectByExample(Example(Mediafile::class.java).apply { |
| | | createCriteria().andEqualTo("businessguid", p.guid) |
| | | .andEqualTo("businesstypeid", 1) |
| | | .andEqualTo("ischanged", false) |
| | | }) |
| | | if (mediaFiles.isEmpty()) return BaseResponse(false, "问题不存在或已整改,无法重复整改") |
| | | if (mediaFiles.isEmpty()) throw BizException("问题不存在或已整改,无法重复整改") |
| | | |
| | | // 更新问题 |
| | | p.apply { |
| | |
| | | } |
| | | } |
| | | |
| | | return BaseResponse(true) |
| | | return "success" |
| | | } |
| | | |
| | | override fun updateChange(problemId: String, deleteImg: List<String>, files: Array<MultipartFile>): String { |