|
@@ -256,7 +256,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void splitArchvies(Long projectId){
|
|
|
+ public void splitArchvies(Long projectId,Long contractId,Long nodeId){
|
|
|
List<String> removeFiles = new ArrayList<>();
|
|
|
//清除案卷封面等pdf
|
|
|
List<String> archivesOutUrlList = baseMapper.getArchivesOutUrlList(projectId);
|
|
@@ -289,16 +289,20 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void archiveAutoMethod(Long projectId){
|
|
|
+ public void archiveAutoMethod(Long projectId,Long contractId,Long nodeId){
|
|
|
//步骤一:把档号集合初始化
|
|
|
indexMap = new HashMap<>();
|
|
|
//步骤二:查询归档树节点。存在未归档文件的节点。
|
|
|
List<ArchiveTreeContract> list = archiveTreeContractClient.getHavedFileNodeByProjectID(projectId);
|
|
|
+
|
|
|
+ //按合同段过滤
|
|
|
+ List<ArchiveTreeContract> authlist = authFilter(list, contractId, nodeId);
|
|
|
+
|
|
|
//步骤三:遍历归档树节点整理出 默认规则节点,分类并卷节点,单独组卷节点 三个集合。
|
|
|
List<ArchiveTreeContract> list1= new ArrayList<>();
|
|
|
List<ArchiveTreeContract> list2= new ArrayList<>();
|
|
|
List<ArchiveTreeContract> list3= new ArrayList<>();
|
|
|
- for(ArchiveTreeContract treeContract:list){
|
|
|
+ for(ArchiveTreeContract treeContract:authlist){
|
|
|
Integer archiveAutoType = treeContract.getArchiveAutoType();
|
|
|
switch (archiveAutoType){
|
|
|
case 1:
|
|
@@ -520,11 +524,53 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
|
|
|
//立卷人 从节点规格获取
|
|
|
String rollor = node.getRollor();
|
|
|
- archivesAuto.setRollor(node.getRollor());
|
|
|
+ if(StringUtils.isEmpty(rollor)){
|
|
|
+ //节点没有值,就从合同段获取,没有合同段id的 用业主的合同段
|
|
|
+ Long nodeContractId = archivesAuto.getContractId();
|
|
|
+ if(nodeContractId!=null){
|
|
|
+ if(nodeContract==null){
|
|
|
+ nodeContract = contractClient.getContractById(nodeContractId);
|
|
|
+ }
|
|
|
+ rollor = nodeContract.getFiler();
|
|
|
+ }else{
|
|
|
+ List<Long> pids= new ArrayList<>();
|
|
|
+ pids.add(archivesAuto.getProjectId());
|
|
|
+ if(contracts==null){
|
|
|
+ contracts = contractClient.queryContractListByIds(pids);
|
|
|
+ }
|
|
|
+ for(ContractInfo c:contracts){
|
|
|
+ if(c.getContractType()==3){
|
|
|
+ rollor = c.getFiler();;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ archivesAuto.setRollor(rollor);
|
|
|
|
|
|
//审核人 从节点规格获取
|
|
|
String reviewer = node.getReviewer();
|
|
|
- archivesAuto.setReviewer(node.getReviewer());
|
|
|
+ if(StringUtils.isEmpty(reviewer)){
|
|
|
+ //节点没有值,就从合同段获取,没有合同段id的 用业主的合同段
|
|
|
+ Long nodeContractId = archivesAuto.getContractId();
|
|
|
+ if(nodeContractId!=null){
|
|
|
+ if(nodeContract==null){
|
|
|
+ nodeContract = contractClient.getContractById(nodeContractId);
|
|
|
+ }
|
|
|
+ reviewer = nodeContract.getReviewer();
|
|
|
+ }else{
|
|
|
+ List<Long> pids= new ArrayList<>();
|
|
|
+ pids.add(archivesAuto.getProjectId());
|
|
|
+ if(contracts==null){
|
|
|
+ contracts = contractClient.queryContractListByIds(pids);
|
|
|
+ }
|
|
|
+ for(ContractInfo c:contracts){
|
|
|
+ if(c.getContractType()==3){
|
|
|
+ reviewer = c.getReviewer();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ archivesAuto.setReviewer(reviewer);
|
|
|
|
|
|
//载体类型
|
|
|
if (node.getStorageType()!= null){
|
|
@@ -534,7 +580,10 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//archivesAuto.setStorageLocation();//存放位置
|
|
|
archivesAuto.setIsArchive(1);//已归档
|
|
|
//archivesAuto.setRemark();//备注
|
|
|
- archivesAuto.setRollDate(LocalDateTime.now());//立卷日期
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ LocalDateTime nextday = now.plusDays(1);
|
|
|
+ archivesAuto.setRollDate(now);//立卷日期
|
|
|
+ archivesAuto.setReviewDate(nextday);//审核日期
|
|
|
|
|
|
archivesAuto.setNodeId(node.getId());//归档树节点
|
|
|
archivesAuto.setOutUrl("");//TODO 生成案卷的封面 目录 备考表,背级
|
|
@@ -1163,7 +1212,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String fileNumber = fileNumberPrefix + index;
|
|
|
+ String fileNumber = fileNumberPrefix +"_"+ index;
|
|
|
if (archiveAutoPdfService.refreshFileNumber(archivesAuto,fileNumber)){
|
|
|
changeList.add(archivesAuto);
|
|
|
}
|