|
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springblade.archive.entity.ArchiveProjectConfig;
|
|
import org.springblade.archive.entity.ArchiveProjectConfig;
|
|
import org.springblade.archive.entity.ArchivesAuto;
|
|
import org.springblade.archive.entity.ArchivesAuto;
|
|
@@ -76,6 +77,7 @@ import java.util.stream.Collectors;
|
|
* @author BladeX
|
|
* @author BladeX
|
|
* @since 2023-02-17
|
|
* @since 2023-02-17
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper, ArchivesAuto> implements IArchivesAutoService {
|
|
public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper, ArchivesAuto> implements IArchivesAutoService {
|
|
@@ -260,6 +262,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
List<String> removeFiles = new ArrayList<>();
|
|
List<String> removeFiles = new ArrayList<>();
|
|
//没合同段的默认整个项目
|
|
//没合同段的默认整个项目
|
|
if (contractId == null) {
|
|
if (contractId == null) {
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","对全项目未锁定案卷拆卷");
|
|
//清除案卷封面等pdf
|
|
//清除案卷封面等pdf
|
|
List<String> archivesOutUrlList = baseMapper.getArchivesOutUrlList(projectId);
|
|
List<String> archivesOutUrlList = baseMapper.getArchivesOutUrlList(projectId);
|
|
if(archivesOutUrlList!=null && archivesOutUrlList.size()>0){
|
|
if(archivesOutUrlList!=null && archivesOutUrlList.size()>0){
|
|
@@ -282,8 +285,9 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
executorService.execute(()->{
|
|
executorService.execute(()->{
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","删除旧封面,页码文件开始"+removeFiles);
|
|
iossClient.removeFiles(removeFiles);
|
|
iossClient.removeFiles(removeFiles);
|
|
- log.debug("文件删完了");
|
|
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","删除旧封面,页码文件结束"+removeFiles);
|
|
});
|
|
});
|
|
|
|
|
|
//取消未锁定案卷文件关联
|
|
//取消未锁定案卷文件关联
|
|
@@ -292,6 +296,8 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
}else{
|
|
}else{
|
|
String treeCode = getAuthCode(contractId);
|
|
String treeCode = getAuthCode(contractId);
|
|
if (nodeId!= null) {
|
|
if (nodeId!= null) {
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","对选择节点下未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
|
+
|
|
//有节点的按节点
|
|
//有节点的按节点
|
|
String strNodeId = nodeId.toString();
|
|
String strNodeId = nodeId.toString();
|
|
ArchiveTreeContract archiveTreeContract = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
|
|
ArchiveTreeContract archiveTreeContract = archiveTreeContractClient.getArchiveTreeContractById(nodeId);
|
|
@@ -318,14 +324,17 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
executorService.execute(()->{
|
|
executorService.execute(()->{
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","删除旧封面,页码文件开始"+removeFiles);
|
|
iossClient.removeFiles(removeFiles);
|
|
iossClient.removeFiles(removeFiles);
|
|
- log.debug("文件删完了");
|
|
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","删除旧封面,页码文件结束"+removeFiles);
|
|
});
|
|
});
|
|
|
|
|
|
baseMapper.splitArchviesByNode(projectId,ancestors,strNodeId);
|
|
baseMapper.splitArchviesByNode(projectId,ancestors,strNodeId);
|
|
}else{
|
|
}else{
|
|
//没节点的按合同段
|
|
//没节点的按合同段
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","对合同段下未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-treeCode:"+treeCode);
|
|
//清除案卷封面等pdf
|
|
//清除案卷封面等pdf
|
|
List<String> archivesOutUrlList = baseMapper.getArchivesOutUrlListByContract(projectId,contractId,treeCode);
|
|
List<String> archivesOutUrlList = baseMapper.getArchivesOutUrlListByContract(projectId,contractId,treeCode);
|
|
if(archivesOutUrlList!=null && archivesOutUrlList.size()>0){
|
|
if(archivesOutUrlList!=null && archivesOutUrlList.size()>0){
|
|
@@ -347,9 +356,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
executorService.execute(()->{
|
|
executorService.execute(()->{
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","删除旧封面,页码文件开始"+removeFiles);
|
|
iossClient.removeFiles(removeFiles);
|
|
iossClient.removeFiles(removeFiles);
|
|
- log.debug("文件删完了");
|
|
|
|
|
|
+ log.info("[自动组卷-拆卷]{}","删除旧封面,页码文件结束"+removeFiles);
|
|
});
|
|
});
|
|
|
|
|
|
//没节点的按合同段
|
|
//没节点的按合同段
|
|
@@ -1299,7 +1310,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
if(StringUtils.isEmpty(fileNumberPrefix)){
|
|
if(StringUtils.isEmpty(fileNumberPrefix)){
|
|
//节点没有值,就从合同段获取,没有合同段id的 用业主的合同段
|
|
//节点没有值,就从合同段获取,没有合同段id的 用业主的合同段
|
|
Long nodeContractId = archivesAuto.getContractId();
|
|
Long nodeContractId = archivesAuto.getContractId();
|
|
- if(nodeContractId!=null){
|
|
|
|
|
|
+ if(nodeContractId!=null && nodeContractId!=-1){
|
|
ContractInfo nodeContract = contractClient.getContractById(nodeContractId);
|
|
ContractInfo nodeContract = contractClient.getContractById(nodeContractId);
|
|
fileNumberPrefix = nodeContract.getPrefix();
|
|
fileNumberPrefix = nodeContract.getPrefix();
|
|
}else{
|
|
}else{
|