| | |
| | | |
| | | 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> { |
| | | ): String { |
| | | if (action !in 0..5) { |
| | | return BaseResponse(false, "非法的操作指令") |
| | | 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 = "" |
| | |
| | | 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 { |
| | |
| | | } |
| | | |
| | | |
| | | 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 { |