|
@@ -45,6 +45,7 @@ import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.secure.BladeUser;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.manager.entity.ArchiveTreeContract;
|
|
@@ -156,6 +157,82 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
return page.setRecords(archivesAutos);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R pageByArchivesAuto2(ArchivesAutoVO vo) {
|
|
|
+ IPage<ArchivesAutoVO> page = new Page<>(vo.getCurrent(),vo.getSize());
|
|
|
+ if (StringUtils.isNotBlank(vo.getStorageTime())) {
|
|
|
+ vo.setStorageTimes(Arrays.asList(vo.getStorageTime().split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(vo.getSecretLevel())){
|
|
|
+ vo.setSecretLevels(Arrays.asList(vo.getSecretLevel().split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(vo.getCarrierType())) {
|
|
|
+ vo.setCarrierTypes(Arrays.asList(vo.getCarrierType().split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(vo.getYear())) {
|
|
|
+ vo.setYears(Arrays.asList(vo.getYear().split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(vo.getMonth())) {
|
|
|
+ vo.setMonths(Arrays.asList(vo.getMonth().split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(vo.getCarrierType())) {
|
|
|
+ vo.setCarrierTypes(Arrays.asList(vo.getCarrierType().split(",")));
|
|
|
+ }
|
|
|
+ //获取单位首节点
|
|
|
+ ArchiveTreeContract contract = archiveTreeContractClient.getFirstNodeByTreeCode(vo.getProjectId(),vo.getArchiveType());
|
|
|
+ vo.setNodeId(contract.getId());
|
|
|
+ //根据单位查询出当前箱子所有档案,最大为160条
|
|
|
+ List<ArchivesAutoVO> archivesAutos = baseMapper.pageByArchivesAuto3(page, vo);
|
|
|
+ //根据条件筛选
|
|
|
+ if (vo.getInnerSearch() != null){
|
|
|
+ vo.setQueryValue(vo.getInnerSearch());
|
|
|
+ vo.setSearchType(1);
|
|
|
+ vo.setStorageTimes(null);
|
|
|
+ vo.setSecretLevels(null);
|
|
|
+ vo.setCarrierTypes(null);
|
|
|
+ vo.setYears(null);
|
|
|
+ vo.setMonths(null);
|
|
|
+ }
|
|
|
+ List<ArchivesAutoVO> selectAutos = baseMapper.pageByArchivesAuto4(vo);
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ if (selectAutos != null && selectAutos.size() > 0) {
|
|
|
+ ids = selectAutos.stream().map(l -> l.getId()).collect(Collectors.toList());
|
|
|
+ }else {
|
|
|
+ ids.add(-1L);
|
|
|
+ }
|
|
|
+ if (archivesAutos != null && archivesAutos.size() >0) {
|
|
|
+ for (ArchivesAutoVO aa : archivesAutos) {
|
|
|
+ if (ids.contains(aa.getId())){
|
|
|
+ aa.setIsSelect(1);
|
|
|
+ }else {
|
|
|
+ aa.setIsSelect(0);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(aa.getStorageTime())) {
|
|
|
+ aa.setStorageTimeValue("3".equals(aa.getStorageTime()) ? "永久" : ("2".equals(aa.getStorageTime()) ? "30年" : "10年"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(aa.getSecretLevel())) {
|
|
|
+ aa.setSecretLevelValue("1".equals(aa.getSecretLevel()) ? "机密" : ("2".equals(aa.getSecretLevel()) ? "绝密" : "秘密"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //格式
|
|
|
+ List<List<ArchivesAutoVO>> listList = CommonUtil.splitList(archivesAutos, 8);
|
|
|
+ //一页,所有格子
|
|
|
+ List<Map<String, List<ArchivesAutoVO>>> allCell = new ArrayList<>();
|
|
|
+ //
|
|
|
+ for (List<ArchivesAutoVO> list : listList) {
|
|
|
+ //一个格子
|
|
|
+ List<ArchivesAutoVO> oneCell = new ArrayList<>();
|
|
|
+ oneCell.addAll(list);
|
|
|
+ Map<String, List<ArchivesAutoVO>> map = new HashMap<>();
|
|
|
+ map.put("children",oneCell);
|
|
|
+ allCell.add(map);
|
|
|
+ }
|
|
|
+ return R.data(allCell);
|
|
|
+ }else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据搜索获取档案柜
|
|
|
* @param archivesAuto
|
|
@@ -180,10 +257,14 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//一个柜子
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("id",CabinetTotal+"");
|
|
|
- map.put("name",CabinetTotal+"");
|
|
|
- String[] min = list.get(0).getFileNumber().split("-");
|
|
|
- String[] max = list.get(list.size()-1).getFileNumber().split("-");
|
|
|
- map.put("content",min[min.length-1]+"~"+max[max.length-1]);
|
|
|
+ if (CabinetTotal < 10){
|
|
|
+ map.put("name","0"+CabinetTotal);
|
|
|
+ }else {
|
|
|
+ map.put("name",CabinetTotal+"");
|
|
|
+ }
|
|
|
+ String[] min = list.get(0).getFileNumber().split("_");
|
|
|
+ String[] max = list.get(list.size()-1).getFileNumber().split("_");
|
|
|
+ map.put("content","档号"+min[min.length-1]+"~"+"档号"+max[max.length-1]);
|
|
|
//把每一个柜子都添加
|
|
|
allCabinet.add(map);
|
|
|
}
|
|
@@ -1723,13 +1804,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
log.info("[自动组卷]{}","开始对未锁定案卷拆卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
splitArchvies(projectId,contractId,nodeId);
|
|
|
//设置完成度10%
|
|
|
- projectClient.updateIsArchivesAutoById(projectId,10);
|
|
|
+ contractClient.updateIsArchivesAutoById(contractId,10);
|
|
|
|
|
|
//项目自动组卷入口
|
|
|
log.info("[自动组卷]{}","开始自动组卷。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
archiveAutoMethod(projectId,contractId,nodeId);
|
|
|
//设置完成度80%
|
|
|
- projectClient.updateIsArchivesAutoById(projectId,80);
|
|
|
+ contractClient.updateIsArchivesAutoById(contractId,80);
|
|
|
|
|
|
//刷新项目档号
|
|
|
log.info("[自动组卷]{}","开始刷新组卷档号。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
@@ -1737,13 +1818,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
|
|
|
|
|
|
//设置自动组卷结束
|
|
|
- projectClient.updateIsArchivesAutoById(projectId,0);
|
|
|
+ contractClient.updateIsArchivesAutoById(contractId,0);
|
|
|
log.info("[自动组卷]{}","自动组卷完成。projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
log.error("自动组卷报错。"+e.getMessage()+"--projectId:"+projectId+"-contractId:"+contractId+"-nodeId:"+nodeId);
|
|
|
//设置自动组卷结束
|
|
|
- projectClient.updateIsArchivesAutoById(projectId,0);
|
|
|
+ contractClient.updateIsArchivesAutoById(contractId,0);
|
|
|
}
|
|
|
});
|
|
|
}
|