|
@@ -26,6 +26,7 @@ import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.archive.entity.ArchivesAuto;
|
|
|
import org.springblade.archive.service.IArchiveAutoPdfService;
|
|
|
+import org.springblade.archive.utils.ArchiveTreeUtil;
|
|
|
import org.springblade.archive.vo.ArchivesAutoVO;
|
|
|
import org.springblade.archive.mapper.ArchivesAutoMapper;
|
|
|
import org.springblade.archive.service.IArchivesAutoService;
|
|
@@ -35,6 +36,7 @@ import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.manager.entity.ArchiveTreeContract;
|
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
|
import org.springblade.manager.entity.ProjectInfo;
|
|
@@ -42,6 +44,7 @@ import org.springblade.manager.feign.ArchiveTreeContractClient;
|
|
|
import org.springblade.manager.feign.ContractClient;
|
|
|
import org.springblade.manager.feign.ProjectClient;
|
|
|
import org.springblade.manager.feign.WbsInfoClient;
|
|
|
+import org.springblade.manager.vo.ArchiveTreeContractVO2;
|
|
|
import org.springblade.system.entity.DictBiz;
|
|
|
import org.springblade.system.feign.IDictBizClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -329,6 +332,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//archivesAuto.setIscheck(0);
|
|
|
archivesAuto.setIsAutoFile(0);//是否案卷收集上传的案卷
|
|
|
archivesAuto.setIsLock(0);//案卷锁定状态
|
|
|
+ archivesAuto.setIsDeleted(0);
|
|
|
baseMapper.insert(archivesAuto);
|
|
|
return archivesAuto;
|
|
|
}
|
|
@@ -769,11 +773,53 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
public List<ArchivesAuto> findArchivesAutosByIds(List<Long> ids) {
|
|
|
QueryWrapper<ArchivesAuto> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.in("node_id", ids)
|
|
|
- .orderByDesc("tree_sort")
|
|
|
+ .eq("is_deleted",0)
|
|
|
+ .eq("is_archive",1)
|
|
|
+ .orderByAsc("tree_sort")
|
|
|
.orderByAsc("auto_file_sort");
|
|
|
|
|
|
return this.list(queryWrapper);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 不重组的情况下刷新档号
|
|
|
+ * @param archiveTreeContracts
|
|
|
+ */
|
|
|
+ public void refreshFileNumberNoSlipt(List<ArchiveTreeContract> archiveTreeContracts) {
|
|
|
+
|
|
|
+ List<ArchiveTreeContractVO2> subTreeList = new ArrayList<>();
|
|
|
+ List<List<ArchiveTreeContract>> subGroupedList = new ArrayList<>();
|
|
|
+ ArchiveTreeUtil.getGroupedList(archiveTreeContracts,subTreeList,subGroupedList);
|
|
|
+ Integer index = 1;
|
|
|
+
|
|
|
+ List<ArchivesAuto> changeList = new ArrayList<>();
|
|
|
+
|
|
|
+ //分组,分程 建设单位,各个合同段,电子单位等
|
|
|
+ for (List<ArchiveTreeContract> subList: subGroupedList) {
|
|
|
+ List<Long> ids = subList.stream()
|
|
|
+ .map(ArchiveTreeContract::getId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ index =1;
|
|
|
+ List<ArchivesAuto> archivesAutos = findArchivesAutosByIds(ids);
|
|
|
+ if (archivesAutos == null || archivesAutos.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String fileNumberPrefix=subList.get(0).getFileNumberPrefix();
|
|
|
+ String archiveNameSuffix=subList.get(0).getArchiveNameSuffix();
|
|
|
+ if (StringUtils.isEmpty(archiveNameSuffix)) {
|
|
|
+ archiveNameSuffix = "";
|
|
|
+ }
|
|
|
+ for (ArchivesAuto archivesAuto: archivesAutos) {
|
|
|
+ String fileNumber = fileNumberPrefix + index + archiveNameSuffix;
|
|
|
+ if (archiveAutoPdfService.refreshFileNumber(archivesAuto,fileNumber)){
|
|
|
+ changeList.add(archivesAuto);
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.updateBatchById(changeList);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|