|
@@ -82,7 +82,6 @@ import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -422,17 +421,27 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
ArchiveProjectConfig config = archiveProjectConfigService.getByProjectIdOrNew(vo.getProjectId());
|
|
|
String[] frontUrls = outUrl.split(",");
|
|
|
for (String frontUrl : frontUrls) {
|
|
|
+ String fileUrl;
|
|
|
+ String fileId;
|
|
|
+ if(frontUrl.contains("@@@")){
|
|
|
+ fileUrl = frontUrl.substring(0,frontUrl.indexOf("@@@"));
|
|
|
+ }else {
|
|
|
+ fileUrl = frontUrl;
|
|
|
+ }
|
|
|
+ if (frontUrl.contains("$$$")) {
|
|
|
+ fileId = frontUrl.substring(frontUrl.indexOf("$$$") + 3);
|
|
|
+ } else {
|
|
|
+ fileId = SnowFlakeUtil.getId() + "";
|
|
|
+ outUrl = outUrl.replace(frontUrl, frontUrl + "$$$" + fileId);
|
|
|
+ }
|
|
|
// 封面(原r_Archives_front)增加中文"封面"匹配
|
|
|
if (front == null && (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[0])
|
|
|
|| frontUrl.contains("封面"))
|
|
|
&& config.getFactorType().contains("1")) {
|
|
|
front = new ArchivesAutoVO.ApprovalFile();
|
|
|
front.setFileName("封面");
|
|
|
- if(frontUrl.contains("@@@")){
|
|
|
- front.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
|
|
|
- }else {
|
|
|
- front.setFileUrl(frontUrl);
|
|
|
- }
|
|
|
+ front.setFileUrl(fileUrl);
|
|
|
+ front.setId(fileId);
|
|
|
}
|
|
|
// 卷内目录(原r_Archives_catalog)增加中文匹配
|
|
|
else if (cataLog == null && (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[1])
|
|
@@ -440,11 +449,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
&& config.getFactorType().contains("2")) {
|
|
|
cataLog = new ArchivesAutoVO.ApprovalFile();
|
|
|
cataLog.setFileName("卷内目录");
|
|
|
- if(frontUrl.contains("@@@")){
|
|
|
- cataLog.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
|
|
|
- }else {
|
|
|
- cataLog.setFileUrl(frontUrl);
|
|
|
- }
|
|
|
+ cataLog.setFileUrl(fileUrl);
|
|
|
+ cataLog.setId(fileId);
|
|
|
}
|
|
|
// 备考表(原r_Archives_spare)增加中文匹配
|
|
|
else if (spare == null && (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[2])
|
|
@@ -452,11 +458,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
&& config.getFactorType().contains("3")) {
|
|
|
spare = new ArchivesAutoVO.ApprovalFile();
|
|
|
spare.setFileName("备考表");
|
|
|
- if(frontUrl.contains("@@@")){
|
|
|
- spare.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
|
|
|
- }else {
|
|
|
- spare.setFileUrl(frontUrl);
|
|
|
- }
|
|
|
+ spare.setFileUrl(fileUrl);
|
|
|
+ spare.setId(fileId);
|
|
|
}
|
|
|
// 背脊(原r_Archives_back)增加中文匹配
|
|
|
else if (back == null && (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[3])
|
|
@@ -464,23 +467,19 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
&& config.getFactorType().contains("4")) {
|
|
|
back = new ArchivesAutoVO.ApprovalFile();
|
|
|
back.setFileName("背脊");
|
|
|
- if(frontUrl.contains("@@@")){
|
|
|
- back.setFileUrl(frontUrl.substring(0,frontUrl.indexOf("@@@")));
|
|
|
- }else {
|
|
|
- back.setFileUrl(frontUrl);
|
|
|
- }
|
|
|
+ back.setFileUrl(fileUrl);
|
|
|
+ back.setId(fileId);
|
|
|
}
|
|
|
}
|
|
|
+ if (!outUrl.equals(vo.getOutUrl())) {
|
|
|
+ this.update(Wrappers.<ArchivesAuto>lambdaUpdate().eq(ArchivesAuto::getId, vo.getId()).set(ArchivesAuto::getOutUrl, outUrl));
|
|
|
+ }
|
|
|
}
|
|
|
List<ArchivesAutoVO.ApprovalFile> files = vo.getApprovalFileList();;
|
|
|
if (files != null) {
|
|
|
- String tempId = null;
|
|
|
- if (!files.isEmpty()) {
|
|
|
- tempId = files.get(0).getId();
|
|
|
- }
|
|
|
if (front != null && front.getFileUrl() != null) {
|
|
|
- if (front.getId() == null && tempId != null) {
|
|
|
- front.setId(tempId + "_1");
|
|
|
+ if (front.getId() == null) {
|
|
|
+ front.setId(SnowFlakeUtil.getId() + "");
|
|
|
}
|
|
|
if (front.getId() != null) {
|
|
|
front.setPdfFileUrl(front.getFileUrl());
|
|
@@ -488,8 +487,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
if (cataLog != null && cataLog.getFileUrl() != null) {
|
|
|
- if (cataLog.getId() == null && tempId != null) {
|
|
|
- cataLog.setId(tempId + "_2");
|
|
|
+ if (cataLog.getId() == null) {
|
|
|
+ cataLog.setId(SnowFlakeUtil.getId() + "");
|
|
|
}
|
|
|
if (cataLog.getId() != null) {
|
|
|
cataLog.setPdfFileUrl(cataLog.getFileUrl());
|
|
@@ -501,8 +500,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
if (spare != null && spare.getFileUrl() != null) {
|
|
|
- if (spare.getId() == null && tempId != null) {
|
|
|
- spare.setId(tempId + "_3");
|
|
|
+ if (spare.getId() == null) {
|
|
|
+ spare.setId(SnowFlakeUtil.getId() + "");
|
|
|
}
|
|
|
if (spare.getId() != null) {
|
|
|
spare.setPdfFileUrl(spare.getFileUrl());
|
|
@@ -510,8 +509,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
if (back != null && back.getFileUrl() != null) {
|
|
|
- if (back.getId() == null && tempId != null) {
|
|
|
- back.setId(tempId + "_4");
|
|
|
+ if (back.getId() == null) {
|
|
|
+ back.setId(SnowFlakeUtil.getId() + "");
|
|
|
}
|
|
|
if (back.getId() != null) {
|
|
|
back.setPdfFileUrl(back.getFileUrl());
|
|
@@ -756,6 +755,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 删除四要素文件记录
|
|
|
+ baseMapper.deleteIsElementFileByProjectId(projectId);
|
|
|
}
|
|
|
//清除文件页面pdf
|
|
|
List<String> filePageUrlList = baseMapper.getFilePageUrlList(projectId);
|
|
@@ -796,6 +797,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 删除四要素文件记录
|
|
|
+ baseMapper.deleteIsElementFileByNode(projectId, ancestors, strNodeId);
|
|
|
}
|
|
|
//清除文件页面pdf
|
|
|
List<String> filePageUrlList = baseMapper.getFilePageUrlListByNode(projectId, ancestors, strNodeId);
|