|
@@ -75,7 +75,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
private ContractClient contractClient;
|
|
|
private ProjectClient projectClient;
|
|
|
|
|
|
- private Map<String,Integer> indexMap; //按立卷位区分和生成流水号
|
|
|
+ private Map<String,Integer> indexMap = new HashMap<>(); //按立卷位区分和生成流水号
|
|
|
private IArchiveAutoPdfService archiveAutoPdfService;
|
|
|
|
|
|
|
|
@@ -232,8 +232,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
|
|
|
@Override
|
|
|
public void archiveAutoMethod(Long projectId){
|
|
|
- //步骤一:把项目下未锁定的案卷拆卷。
|
|
|
-
|
|
|
+ //步骤一:把档号集合初始化
|
|
|
+ indexMap = new HashMap<>();
|
|
|
//步骤二:查询归档树节点。存在未归档文件的节点。
|
|
|
List<ArchiveTreeContract> list = archiveTreeContractClient.getHavedFileNodeByProjectID(projectId);
|
|
|
//步骤三:遍历归档树节点整理出 默认规则节点,分类并卷节点,单独组卷节点 三个集合。
|
|
@@ -257,7 +257,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//步骤四:按照单独,分类,默认,分盒的顺序执行组卷流程。
|
|
|
|
|
|
//分盒文件集合
|
|
|
- Map<Integer,List<ArchiveFile>> boxMap = new HashMap<>();
|
|
|
+ Map<Integer,List<ArchiveFile>> boxMap = new LinkedHashMap<>();
|
|
|
|
|
|
archiveAutoMethod3(list3,boxMap);//单独组卷
|
|
|
archiveAutoMethod2(list2,projectId,boxMap);//分类组卷
|
|
@@ -444,7 +444,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
if(isCrossNode){
|
|
|
archiveName=projectName;
|
|
|
//存在跨节点 项目名称+文件对应的所有节点名称
|
|
|
- Set<String> nodeIdSet = new HashSet<>();
|
|
|
+ Set<String> nodeIdSet = new LinkedHashSet<>();
|
|
|
for(ArchiveFile file:waitArchiveFiles){
|
|
|
String nodeId = file.getNodeId();
|
|
|
nodeIdSet.add(nodeId);
|
|
@@ -466,10 +466,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
return archiveName;
|
|
|
}
|
|
|
private String builtFilePageNo(ArchivesAuto archivesAuto,List<ArchiveFile> waitArchiveFiles){
|
|
|
- //TODO 生成文件对应的页码,返回url
|
|
|
-
|
|
|
+ //生成文件对应的页码,返回url
|
|
|
archiveAutoPdfService.builtFilePageNo(archivesAuto,waitArchiveFiles);
|
|
|
-
|
|
|
this.updateById(archivesAuto);
|
|
|
|
|
|
return "";
|
|
@@ -531,8 +529,6 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
for(ArchiveFile file:waitArchiveFiles){
|
|
|
pageN=pageN+file.getFilePage();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
//默认组卷存在跨节点组卷 注意案卷归属节点,案卷命名方式
|
|
|
//获取案卷题名
|
|
|
String archiveName=builtArchiveName(waitArchiveFiles,node,true);//获取案卷题名
|
|
@@ -648,14 +644,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
for(ArchiveTreeContract node:list){
|
|
|
//步骤2:获取当前节点的案卷规格
|
|
|
String specificationStr = node.getSpecification();
|
|
|
+ if(StringUtils.isEmpty(specificationStr)){
|
|
|
+ specificationStr="30";
|
|
|
+ }
|
|
|
int specification = Integer.parseInt(specificationStr);
|
|
|
int specificationSize=specification*10;
|
|
|
//步骤3:查询节点下的未组卷文件
|
|
|
- List<ArchiveFile> archiveFiles = archiveFileClient.listWrappers(Wrappers.<ArchiveFile>lambdaQuery()
|
|
|
- .eq(ArchiveFile::getNodeId, node)
|
|
|
- .eq(ArchiveFile::getIsArchive, 0)
|
|
|
- .eq(ArchiveFile::getIsDeleted,0)
|
|
|
- .orderByAsc(ArchiveFile::getSort));
|
|
|
+ List<ArchiveFile> archiveFiles = archiveFileClient.getListByNodeID(node.getId().toString(),0);
|
|
|
//步骤4:遍历未归档文件
|
|
|
//待组卷文件集合
|
|
|
List<ArchiveFile> waitArchiveFiles = new ArrayList<>();
|
|
@@ -666,7 +661,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
for(ArchiveFile file:archiveFiles){
|
|
|
archiveFilesSize++;
|
|
|
//步骤5:判断文件是否存在分盒设置
|
|
|
- if(file.getBoxNumber()!=null){
|
|
|
+ if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1){
|
|
|
//添加到分盒文件集合
|
|
|
addBoxMap(file,boxMap);
|
|
|
if(archiveFilesSize==archiveFiles.size() && waitArchiveFiles.size()>0){
|
|
@@ -704,7 +699,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//如果waitArchiveFiles集合size>0,先将集合中文件组卷。再将当前文件放入集合
|
|
|
if(waitArchiveFiles.size()>0){
|
|
|
//将waitArchiveFiles组卷,
|
|
|
- createArchive3(waitArchiveFiles,node,archivesSize);
|
|
|
+ createArchive3(waitArchiveFiles,node,archivesSize-filePage);
|
|
|
//然后将待组卷文件集合,总页数还原初始值,
|
|
|
waitArchiveFiles.clear();
|
|
|
//保存当前文件进入待组卷集合,待组卷页数=当前文件页数
|
|
@@ -827,22 +822,21 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
if(waitArchiveFiles.size()==0){
|
|
|
//waitArchiveFiles待组卷文件为空时,按当前节点的规格
|
|
|
String specificationStr = node.getSpecification();
|
|
|
+ if(StringUtils.isEmpty(specificationStr)){
|
|
|
+ specificationStr="30";
|
|
|
+ }
|
|
|
int specification = Integer.parseInt(specificationStr);
|
|
|
specificationSize=specification*10;
|
|
|
}
|
|
|
|
|
|
//步骤3.2:查询出当前节点未组卷的文件
|
|
|
- List<ArchiveFile> archiveFiles = archiveFileClient.listWrappers(Wrappers.<ArchiveFile>lambdaQuery()
|
|
|
- .eq(ArchiveFile::getNodeId, node)
|
|
|
- .eq(ArchiveFile::getIsArchive, 0)
|
|
|
- .eq(ArchiveFile::getIsDeleted,0)
|
|
|
- .orderByAsc(ArchiveFile::getSort));
|
|
|
+ List<ArchiveFile> archiveFiles = archiveFileClient.getListByNodeID(node.getId().toString(),0);
|
|
|
//步骤3.3:遍历未组卷文件
|
|
|
int archiveFilesSize=0;
|
|
|
for(ArchiveFile file:archiveFiles){
|
|
|
archiveFilesSize++;
|
|
|
//步骤3.4:判断文件是否存在分盒设置
|
|
|
- if(file.getBoxNumber()!=null) {
|
|
|
+ if(file.getBoxNumber()!=null && file.getBoxNumber()!=-1) {
|
|
|
//添加到分盒文件集合
|
|
|
addBoxMap(file,boxMap);
|
|
|
if(nodeSize==list.size() && archiveFilesSize==archiveFiles.size()){
|
|
@@ -878,6 +872,9 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
archivesSize=0;
|
|
|
|
|
|
String specificationStr = node.getSpecification();
|
|
|
+ if(StringUtils.isEmpty(specificationStr)){
|
|
|
+ specificationStr="30";
|
|
|
+ }
|
|
|
int specification = Integer.parseInt(specificationStr);
|
|
|
specificationSize=specification*10;//更新specificationSize待组卷规格为 当前节点的组卷规格
|
|
|
}
|
|
@@ -895,6 +892,9 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
archivesSize=filePage;
|
|
|
|
|
|
String specificationStr = node.getSpecification();
|
|
|
+ if(StringUtils.isEmpty(specificationStr)){
|
|
|
+ specificationStr="30";
|
|
|
+ }
|
|
|
int specification = Integer.parseInt(specificationStr);
|
|
|
specificationSize=specification*10;//更新specificationSize待组卷规格为 当前节点的组卷规格
|
|
|
|