|
|
@@ -5618,6 +5618,54 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String jointNomination(List<String> authId) {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ //案卷信息 案卷名称
|
|
|
+ List<ArchivesAuto> archivesAutos = this.listByIds(authId);
|
|
|
+ if(CollectionUtils.isNotEmpty(archivesAutos)){
|
|
|
+ //案卷后缀
|
|
|
+ String suffix = "";
|
|
|
+
|
|
|
+ ArchivesAuto archivesAuto = archivesAutos.get(0);
|
|
|
+ //获取项目信息和合同段信息
|
|
|
+ ProjectInfo byId = projectClient.getById(archivesAuto.getProjectId().toString());
|
|
|
+ sb.append(byId.getProjectName());
|
|
|
+ ContractInfo contractById = contractClient.getContractById(archivesAuto.getContractId());
|
|
|
+ sb.append(contractById.getContractNumber());
|
|
|
+ //获取节点信息 文件后缀
|
|
|
+ List<Long> collect1 = archivesAutos.stream().map(ArchivesAuto::getNodeId).collect(Collectors.toList());
|
|
|
+ List<ArchiveTreeContract> archiveTreeContractListByList = archiveTreeContractClient.getArchiveTreeContractListByList(collect1);
|
|
|
+ //获取第一个文件后缀
|
|
|
+ archiveTreeContractListByList = archiveTreeContractListByList.stream().filter(f -> StringUtils.isNotEmpty(f.getArchiveNameSuffix())).collect(Collectors.toList());
|
|
|
+ //id 与 文件后缀的映射关系
|
|
|
+ Map<Long, String> map = archiveTreeContractListByList.stream().collect(Collectors.toMap(ArchiveTreeContract::getId, ArchiveTreeContract::getArchiveNameSuffix));
|
|
|
+ if(CollectionUtils.isNotEmpty(archiveTreeContractListByList)){
|
|
|
+ ArchiveTreeContract archiveTreeContract = archiveTreeContractListByList.get(0);
|
|
|
+ suffix = archiveTreeContract.getArchiveNameSuffix();
|
|
|
+ }
|
|
|
+ List<String> strings = new ArrayList<>();
|
|
|
+ archivesAutos.forEach(f->{
|
|
|
+ //当前案卷所属节点的文件后缀
|
|
|
+ String s = map.get(f.getNodeId());
|
|
|
+ //案卷名称
|
|
|
+ String name = f.getName();
|
|
|
+
|
|
|
+ String newName = name.replace(sb, "");
|
|
|
+ if(s != null){
|
|
|
+ newName = newName.replace(s,"");
|
|
|
+ }
|
|
|
+ strings.add(newName);
|
|
|
+ });
|
|
|
+ //名称去重
|
|
|
+ List<String> distinctList = strings.stream()
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ sb.append(StringUtils.join(distinctList,"、")).append(suffix);
|
|
|
+ }
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|