|
@@ -1666,9 +1666,9 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* @param contractId
|
|
|
* @param nodeId
|
|
|
*/
|
|
|
- public void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId) {
|
|
|
+ public void refreshFileNumberNoSlipt(Long projectId,Long contractId,Long nodeId,boolean bforce) {
|
|
|
List<ArchiveTreeContract> list = archiveTreeContractClient.getListByProjectId(projectId);
|
|
|
- this.refreshFileNumberNoSlipt(list,contractId,nodeId);
|
|
|
+ this.refreshFileNumberNoSlipt(list,contractId,nodeId,bforce);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1677,7 +1677,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
* @param contractId
|
|
|
* @param nodeId
|
|
|
*/
|
|
|
- public void refreshFileNumberNoSlipt(List<ArchiveTreeContract> archiveTreeContracts,Long contractId,Long nodeId) {
|
|
|
+ public void refreshFileNumberNoSlipt(List<ArchiveTreeContract> archiveTreeContracts,Long contractId,Long nodeId,boolean bforce) {
|
|
|
|
|
|
List<ArchiveTreeContractVO2> subTreeList = new ArrayList<>();
|
|
|
List<List<ArchiveTreeContract>> subGroupedList = new ArrayList<>();
|
|
@@ -1734,9 +1734,16 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
|
|
|
String fileNumber = fileNumberPrefix +"_"+ index;
|
|
|
- if (archiveAutoPdfService.refreshFileNumberForce(archivesAuto,fileNumber)){
|
|
|
- changeList.add(archivesAuto);
|
|
|
+ if (bforce) {
|
|
|
+ if (archiveAutoPdfService.refreshFileNumberForce(archivesAuto,fileNumber)){
|
|
|
+ changeList.add(archivesAuto);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (archiveAutoPdfService.refreshFileNumber(archivesAuto,fileNumber)){
|
|
|
+ changeList.add(archivesAuto);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
index++;
|
|
|
}
|
|
|
}
|
|
@@ -1775,71 +1782,75 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
String back = "";
|
|
|
|
|
|
|
|
|
- if(frontUrls != null ) {
|
|
|
- for (String frontUrl : frontUrls) {
|
|
|
- if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[0]) && config.getFactorType().contains("1")) {
|
|
|
- front = frontUrl;
|
|
|
- } else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[1]) && config.getFactorType().contains("2")) {
|
|
|
- cataLog = frontUrl;
|
|
|
- } else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[2]) && config.getFactorType().contains("3")) {
|
|
|
- spare = frontUrl;
|
|
|
- } else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[3]) && config.getFactorType().contains("4")) {
|
|
|
- back = frontUrl;
|
|
|
+ try {
|
|
|
+ if(frontUrls != null ) {
|
|
|
+ for (String frontUrl : frontUrls) {
|
|
|
+ if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[0]) && config.getFactorType().contains("1")) {
|
|
|
+ front = frontUrl;
|
|
|
+ } else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[1]) && config.getFactorType().contains("2")) {
|
|
|
+ cataLog = frontUrl;
|
|
|
+ } else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[2]) && config.getFactorType().contains("3")) {
|
|
|
+ spare = frontUrl;
|
|
|
+ } else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[3]) && config.getFactorType().contains("4")) {
|
|
|
+ back = frontUrl;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- List<String> fileUrls =new ArrayList<>();
|
|
|
- //if (!archivesAuto.isMedia())
|
|
|
- if (true)
|
|
|
- {
|
|
|
- List<ArchiveFile> result = this.archiveFileClient.getArchiveFileByArchivesId(archivesAuto.getId().toString(),"");
|
|
|
- if(result != null && result.size() > 0){
|
|
|
- //循环访问result,如果pdfpageurl不为空则取出,否则取pdffileurl
|
|
|
- for (ArchiveFile archiveFile : result) {
|
|
|
- String pdfPageUrl = archiveFile.getPdfPageUrl();
|
|
|
- if (StringUtils.isEmpty(pdfPageUrl)) {
|
|
|
- pdfPageUrl = archiveFile.getPdfFileUrl();
|
|
|
- }else{
|
|
|
+ List<String> fileUrls =new ArrayList<>();
|
|
|
+ //if (!archivesAuto.isMedia())
|
|
|
+ if (true)
|
|
|
+ {
|
|
|
+ List<ArchiveFile> result = this.archiveFileClient.getArchiveFileByArchivesId(archivesAuto.getId().toString(),"");
|
|
|
+ if(result != null && result.size() > 0){
|
|
|
+ //循环访问result,如果pdfpageurl不为空则取出,否则取pdffileurl
|
|
|
+ for (ArchiveFile archiveFile : result) {
|
|
|
+ String pdfPageUrl = archiveFile.getPdfPageUrl();
|
|
|
+ if (StringUtils.isEmpty(pdfPageUrl)) {
|
|
|
+ pdfPageUrl = archiveFile.getPdfFileUrl();
|
|
|
+ }else{
|
|
|
+ fileUrls.add(pdfPageUrl);
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(pdfPageUrl) || !pdfPageUrl.contains("pdf")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
fileUrls.add(pdfPageUrl);
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(pdfPageUrl) || !pdfPageUrl.contains("pdf")) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- fileUrls.add(pdfPageUrl);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (fileUrls.size() > 0){
|
|
|
- //此处暂时这么处理,等oss上传接口里文件名可以区分后,再单独取
|
|
|
-// if (frontUrls != null && frontUrls.length > 3){
|
|
|
-//
|
|
|
-// urlList.add(frontUrls[0]);
|
|
|
-// urlList.add(frontUrls[1]);
|
|
|
-// }
|
|
|
- if (StringUtils.isNotEmpty(front)) {
|
|
|
- urlList.add(front);
|
|
|
- }
|
|
|
+ if (fileUrls.size() > 0){
|
|
|
+ //此处暂时这么处理,等oss上传接口里文件名可以区分后,再单独取
|
|
|
+ // if (frontUrls != null && frontUrls.length > 3){
|
|
|
+ //
|
|
|
+ // urlList.add(frontUrls[0]);
|
|
|
+ // urlList.add(frontUrls[1]);
|
|
|
+ // }
|
|
|
+ if (StringUtils.isNotEmpty(front)) {
|
|
|
+ urlList.add(front);
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(cataLog)) {
|
|
|
- urlList.add(cataLog);
|
|
|
- }
|
|
|
+ if (StringUtils.isNotEmpty(cataLog)) {
|
|
|
+ urlList.add(cataLog);
|
|
|
+ }
|
|
|
|
|
|
- urlList.addAll(fileUrls);
|
|
|
+ urlList.addAll(fileUrls);
|
|
|
|
|
|
-// if (frontUrls != null && frontUrls.length > 3){
|
|
|
-// urlList.add(frontUrls[2]);
|
|
|
-// urlList.add(frontUrls[3]);
|
|
|
-// }
|
|
|
- if (StringUtils.isNotEmpty(spare)) {
|
|
|
- urlList.add(spare);
|
|
|
- }
|
|
|
+ // if (frontUrls != null && frontUrls.length > 3){
|
|
|
+ // urlList.add(frontUrls[2]);
|
|
|
+ // urlList.add(frontUrls[3]);
|
|
|
+ // }
|
|
|
+ if (StringUtils.isNotEmpty(spare)) {
|
|
|
+ urlList.add(spare);
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(back)) {
|
|
|
- urlList.add(back);
|
|
|
+ if (StringUtils.isNotEmpty(back)) {
|
|
|
+ urlList.add(back);
|
|
|
+ }
|
|
|
+ String fileName = SnowFlakeUtil.getId().toString();
|
|
|
+ url = archiveAutoPdfService.MergePdfAndUpload(urlList,fileName,null,archivesAuto.getProjectId());
|
|
|
}
|
|
|
- String fileName = SnowFlakeUtil.getId().toString();
|
|
|
- url = archiveAutoPdfService.MergePdfAndUpload(urlList,fileName,null,archivesAuto.getProjectId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
return url;
|
|
|
}
|
|
@@ -2092,7 +2103,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
|
|
|
//刷新项目档号
|
|
|
log.info("[自动组卷]{}","开始刷新组卷档号。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
- refreshFileNumberNoSlipt(projectId,contractId,nodeId);
|
|
|
+ refreshFileNumberNoSlipt(projectId,contractId,nodeId,true);
|
|
|
|
|
|
|
|
|
//设置自动组卷结束
|