| | |
| | | return "success" |
| | | } |
| | | |
| | | override fun updateProblem(problem: ProblemListVo, deleteImg: List<String>, files: Array<MultipartFile>): String { |
| | | override fun updateProblem(problem: ProblemListVo, deleteImg: List<String>?, files: Array<MultipartFile>): String { |
| | | problemRep.findOne(problem.guid) ?: throw BizException("该问题不存在") |
| | | problemRep.update(problem) |
| | | val inspection = inspectionMapper.selectByPrimaryKey(problem.iguid) ?: throw BizException("巡查记录不存在") |
| | | val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: throw BizException("巡查记录对应场景不存在") |
| | | mediafileService.saveMediaFile(files) { MediaFileVo.newProFile(inspection, problem, scene) } |
| | | mediafileService.deleteList(deleteImg) |
| | | deleteImg?.let { mediafileService.deleteList(it) } |
| | | return "success" |
| | | } |
| | | |
| | |
| | | val mediaFiles = mediafileMapper.selectByExample(Example(Mediafile::class.java).apply { |
| | | createCriteria().andEqualTo("businessguid", problemId) |
| | | .andEqualTo("businesstypeid", 1) |
| | | .andEqualTo("ischanged", true) |
| | | // .andEqualTo("ischanged", true) |
| | | }) |
| | | if (mediaFiles.isEmpty()) throw BizException("问题还未整改,无法修改整改") |
| | | if (mediaFiles.isEmpty()) throw BizException("缺少问题和整改图片,无法修改") |
| | | if (p.ischanged != true) throw BizException("未整改问题无法修改") |
| | | |
| | | // 保存新的整改图片 |
| | | val m = mediaFiles[0] |
| | |
| | | m.apply { |
| | | guid = UUIDGenerator.generate16ShortUUID() |
| | | description = p.problemname + " " + p.location + " 整改 " + UUIDGenerator.generateUUID(4) + ".jpg" |
| | | ischanged = true |
| | | } |
| | | } |
| | | mediafileService.deleteList(deleteImg) |