修改saveStorageAttachmentByRecordTypeAndRecordId application传值逻辑
| | |
| | | } |
| | | |
| | | // 删除旧附件信息 |
| | | if (application == null) { |
| | | if (application == null || application.trim().isEmpty()) { |
| | | for (StorageBlobDTO storageBlobDTO : storageBlobDTOS) { |
| | | if (storageBlobDTO.getApplication() == null || storageBlobDTO.getApplication().trim().isEmpty()) { |
| | | throw new RuntimeException("文件用途不能为空"); |
| | | } |
| | | deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.getByType(storageBlobDTO.getApplication()), recordType, recordId); |
| | | } |
| | | } else { |
| | |
| | | public void savePlan(SavePlanVo savePlanVo) { |
| | | Plan plan = BeanUtil.copyProperties(savePlanVo, Plan.class); |
| | | // 附件处理 |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("", RecordTypeEnum.PLAN, savePlanVo.getId(), savePlanVo.getStorageBlobDTOs()); |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId(null, RecordTypeEnum.PLAN, savePlanVo.getId(), savePlanVo.getStorageBlobDTOs()); |
| | | if (savePlanVo.getId() == null) { |
| | | planMapper.insert(plan); |
| | | } else { |
| | |
| | | String attachmentIds = StrUtil.join(",", Optional.ofNullable(saveInfoStageVo.getAttachmentIds()).orElse(Collections.emptyList())); |
| | | infoStage.setAttachment(attachmentIds); |
| | | |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("", RecordTypeEnum.INFO_STAGE, infoStage.getProjectManagementInfoId(), saveInfoStageVo.getStorageBlobDTOs()); |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId(null, RecordTypeEnum.INFO_STAGE, infoStage.getProjectManagementInfoId(), saveInfoStageVo.getStorageBlobDTOs()); |
| | | |
| | | if (infoStage.getId() == null) { |
| | | infoStageMapper.insert(infoStage); |