|
|
@ -4,6 +4,7 @@ import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.archives.domain.ArchiveRecordInfo; |
|
|
|
import com.ruoyi.archives.domain.ArchiveRecordInfo; |
|
|
|
|
|
|
|
import com.ruoyi.archives.domain.CategoryDict; |
|
|
|
import com.ruoyi.archives.domain.TreeSelect2; |
|
|
|
import com.ruoyi.archives.domain.TreeSelect2; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
@ -110,39 +111,36 @@ public class ArchiveCategoryInfoServiceImpl implements IArchiveCategoryInfoServi |
|
|
|
public List<ArchiveCategoryInfo> selectDeptListAndYear(ArchiveCategoryInfo archiveCategoryInfo) { |
|
|
|
public List<ArchiveCategoryInfo> selectDeptListAndYear(ArchiveCategoryInfo archiveCategoryInfo) { |
|
|
|
List<ArchiveCategoryInfo> archiveCategoryInfos = archiveCategoryInfoMapper.selectDeptList(archiveCategoryInfo); |
|
|
|
List<ArchiveCategoryInfo> archiveCategoryInfos = archiveCategoryInfoMapper.selectDeptList(archiveCategoryInfo); |
|
|
|
List<ArchiveRecordInfo> map=archiveCategoryInfoMapper.selectYearGroupByCategory(); |
|
|
|
List<ArchiveRecordInfo> map=archiveCategoryInfoMapper.selectYearGroupByCategory(); |
|
|
|
List<ArchiveRecordInfo> fileNumMap = archiveCategoryInfoMapper.selectFileNumGroupByCategory(); |
|
|
|
List<ArchiveRecordInfo> fileNumMap = archiveCategoryInfoMapper.selectFileNumGroupByCategory("1",CategoryDict.JJ_RECORD); |
|
|
|
List<ArchiveCategoryInfo> result=new ArrayList<>(); |
|
|
|
List<ArchiveCategoryInfo> result=new ArrayList<>(); |
|
|
|
for (ArchiveCategoryInfo item : archiveCategoryInfos) { |
|
|
|
for (ArchiveCategoryInfo item : archiveCategoryInfos) { |
|
|
|
Iterator<ArchiveRecordInfo> it = map.iterator();//使用迭代器
|
|
|
|
//如果是基建档案
|
|
|
|
while(it.hasNext()){ |
|
|
|
if (CategoryDict.JJ_RECORD.equals(item.getCode())){ |
|
|
|
ArchiveRecordInfo next = it.next(); |
|
|
|
fileNumMap.stream().forEach(record->{ |
|
|
|
if(!next.getArchiveCategory().equals("JJ")&& next.getArchiveCategory().equals(item.getCode())&&next.getYear()!=null){ |
|
|
|
|
|
|
|
ArchiveCategoryInfo son=new ArchiveCategoryInfo(); |
|
|
|
ArchiveCategoryInfo son=new ArchiveCategoryInfo(); |
|
|
|
son.setParentId(item.getId()); |
|
|
|
son.setParentId(item.getId()); |
|
|
|
son.setCode(item.getCode()+"-"+next.getYear()); |
|
|
|
son.setCode(item.getCode()+"-"+record.getFileNum()); |
|
|
|
son.setId(new Random().nextLong()+100000L); |
|
|
|
son.setId(new Random().nextLong()+100000L); |
|
|
|
son.setSort(1l); |
|
|
|
son.setSort(1l); |
|
|
|
son.setName(next.getYear()); |
|
|
|
son.setName(record.getFileNum()); |
|
|
|
it.remove();//相同则添加,添加后删除
|
|
|
|
|
|
|
|
result.add(son); |
|
|
|
result.add(son); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
Iterator<ArchiveRecordInfo> infoIterator = fileNumMap.iterator(); |
|
|
|
Iterator<ArchiveRecordInfo> it = map.iterator();//使用迭代器
|
|
|
|
while (infoIterator.hasNext()){ |
|
|
|
while(it.hasNext()){ |
|
|
|
ArchiveRecordInfo next = infoIterator.next(); |
|
|
|
ArchiveRecordInfo next = it.next(); |
|
|
|
if( next.getArchiveCategory().equals(item.getCode())&&next.getYear()!=null){ |
|
|
|
if(next.getArchiveCategory().equals(item.getCode())&&next.getYear()!=null){ |
|
|
|
ArchiveCategoryInfo son=new ArchiveCategoryInfo(); |
|
|
|
ArchiveCategoryInfo son=new ArchiveCategoryInfo(); |
|
|
|
son.setParentId(item.getId()); |
|
|
|
son.setParentId(item.getId()); |
|
|
|
son.setCode(item.getCode()+"-"+next.getYear()); |
|
|
|
son.setCode(item.getCode()+"-"+next.getYear()); |
|
|
|
son.setId(new Random().nextLong()+100000L); |
|
|
|
son.setId(new Random().nextLong()+100000L); |
|
|
|
son.setSort(1l); |
|
|
|
son.setSort(1l); |
|
|
|
son.setName(next.getYear()); |
|
|
|
son.setName(next.getYear()); |
|
|
|
infoIterator.remove();//相同则添加,添加后删除
|
|
|
|
it.remove();//相同则添加,添加后删除
|
|
|
|
result.add(son); |
|
|
|
result.add(son); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
archiveCategoryInfos.addAll(result); |
|
|
|
archiveCategoryInfos.addAll(result); |
|
|
|
return archiveCategoryInfos; |
|
|
|
return archiveCategoryInfos; |
|
|
|