|
@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
@@ -39,6 +40,7 @@ import org.springblade.business.entity.ArchiveFile;
|
|
|
import org.springblade.business.feign.ArchiveFileClient;
|
|
|
import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
+import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
@@ -242,9 +244,21 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
public List<Map<String,List<Map<String,String>>>> getArchivesCabinet(ArchivesAutoVO archivesAuto) {
|
|
|
//获取单位首节点
|
|
|
ArchiveTreeContract contract = archiveTreeContractClient.getFirstNodeByTreeCode(archivesAuto.getProjectId(),archivesAuto.getArchiveType());
|
|
|
+ if (contract == null){
|
|
|
+ throw new ServiceException("归档树节点错误");
|
|
|
+ }
|
|
|
+ //如果没有获取到对应单位,则提示
|
|
|
archivesAuto.setNodeId(contract.getId());
|
|
|
//根据单位查询所有档案
|
|
|
List<ArchivesAutoVO> archivesAutos = baseMapper.getArchivesCabinet(archivesAuto);
|
|
|
+ //根据选择条件查询所有档案
|
|
|
+ List<ArchivesAutoVO> selectAutos = baseMapper.getArchivesCabinet2(archivesAuto);
|
|
|
+ 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) {
|
|
|
List<List<ArchivesAutoVO>> listList = CommonUtil.splitList(archivesAutos, 160);
|
|
|
//所有页,所有柜子
|
|
@@ -254,6 +268,13 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
int CabinetTotal = 1;
|
|
|
//把所有档案分成柜子
|
|
|
for (List<ArchivesAutoVO> list : listList) {
|
|
|
+ String status = "0";
|
|
|
+ for (ArchivesAutoVO vo : list) {
|
|
|
+ if (ids.contains(vo.getId())){
|
|
|
+ status = "1";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
//一个柜子
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("id",CabinetTotal+"");
|
|
@@ -262,9 +283,11 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}else {
|
|
|
map.put("name",CabinetTotal+"");
|
|
|
}
|
|
|
+ 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]);
|
|
|
+ map.put("status",status);
|
|
|
//把每一个柜子都添加
|
|
|
allCabinet.add(map);
|
|
|
}
|