Browse Source

电子归档流程修改

user5 4 years atrás
parent
commit
5ae54c4932

+ 12 - 10
src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportRecordService.java

@@ -1058,6 +1058,12 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 								workattachmentService.insertOnWorkAttachment(workattachment);
 								//添加备考表附件id
 								projectReportRecord.setReferenceAttachmentId(workattachment.getId());
+
+								if (StringUtils.isNotBlank(projectReportRecord.getReferenceAttachmentId()) && StringUtils.isNotBlank(reportRecord.getReferenceAttachmentId())) {
+									if(!projectReportRecord.getReferenceAttachmentId().equals(reportRecord.getReferenceAttachmentId())){
+										workattachmentService.deleteById(reportRecord.getReferenceAttachmentId());
+									}
+								}
 							}
 							//生成文件目录
 							//获取上传阿里云盘文件地址
@@ -1077,6 +1083,12 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 								workattachmentService.insertOnWorkAttachment(workattachment);
 								//添加目录附件id
 								projectReportRecord.setCatalogueAttachmentId(workattachment.getId());
+
+								if (StringUtils.isNotBlank(projectReportRecord.getCatalogueAttachmentId()) && StringUtils.isNotBlank(reportRecord.getCatalogueAttachmentId())) {
+									if(!projectReportRecord.getCatalogueAttachmentId().equals(reportRecord.getCatalogueAttachmentId())){
+										workattachmentService.deleteById(reportRecord.getCatalogueAttachmentId());
+									}
+								}
 							}
 						}
 						notifyRole = "报告归档管理员审批";
@@ -1317,16 +1329,6 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 		if (1 == projectReportRecord.getType()){
 			dao.update(projectReportRecord);
 		}else if(2 == projectReportRecord.getType()){
-			if (StringUtils.isNotBlank(projectReportRecord.getReferenceAttachmentId()) && StringUtils.isNotBlank(reportRecord.getReferenceAttachmentId())) {
-				if(!projectReportRecord.getReferenceAttachmentId().equals(reportRecord.getReferenceAttachmentId())){
-					workattachmentService.deleteById(reportRecord.getReferenceAttachmentId());
-				}
-			}
-			if (StringUtils.isNotBlank(projectReportRecord.getCatalogueAttachmentId()) && StringUtils.isNotBlank(reportRecord.getCatalogueAttachmentId())) {
-				if(!projectReportRecord.getCatalogueAttachmentId().equals(reportRecord.getCatalogueAttachmentId())){
-					workattachmentService.deleteById(reportRecord.getCatalogueAttachmentId());
-				}
-			}
 			dao.updateRuralProjectReportRecord(projectReportRecord);
 		}
 		return "保存审核意见成功!";