|
|
@@ -438,7 +438,7 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
|
|
|
public List<VolumeDto1> selectVolumeAfter(Long archiveId) {
|
|
|
List<VolumeDto1> list = new ArrayList<>();
|
|
|
ArchivesAuto archivesAuto = archiveAutoClient.getArchiveById(archiveId);
|
|
|
- if(archivesAuto.getIsVolume()==1&&StringUtils.isEmpty(archivesAuto.getVolumeIds())){
|
|
|
+ if(archivesAuto.getIsVolume()==1&&StringUtils.isNotEmpty(archivesAuto.getVolumeIds())){
|
|
|
String volumeIds = archivesAuto.getVolumeIds();
|
|
|
String[] archivesAutoIds = volumeIds.split(",");
|
|
|
for (String autoId : archivesAutoIds) {
|
|
|
@@ -468,30 +468,26 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
|
|
|
public VolumeDto3 selectVolumeBefore(Long archiveId,Integer type) {
|
|
|
ArchivesAuto auto = archiveAutoClient.getArchiveById(archiveId);
|
|
|
VolumeDto3 dto=new VolumeDto3();
|
|
|
- if(auto.getIsVolume()==1&&StringUtils.isEmpty(auto.getVolumeIds())){
|
|
|
- String volumeIds = auto.getVolumeIds();
|
|
|
- String[] archivesAutoIds = volumeIds.split(",");
|
|
|
+ //查询原案卷
|
|
|
+ if(type==1){
|
|
|
String sql="select id,file_number,file_name,file_time,duty_user,file_page from u_archive_file where archive_id="+auto.getId()+" and is_deleted=0 order by archive_sort,sort,sort_num,create_time";
|
|
|
List<VolumeDto4> dto2s = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VolumeDto4.class));
|
|
|
- dto.getList().addAll(dto2s);
|
|
|
- if(type==2){
|
|
|
- for (String autoId : archivesAutoIds) {
|
|
|
- String sql1="select id,file_number,file_name,file_time,duty_user,file_page from u_archive_file where archive_id="+autoId+" and is_deleted=0 order by archive_sort,sort,sort_num,create_time";
|
|
|
- List<VolumeDto4> dto2s1 = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(VolumeDto4.class));
|
|
|
- dto2s1.stream().forEach(dto2 -> dto2.setIsCheck(1));
|
|
|
- dto.getList().addAll(dto2s);
|
|
|
- }
|
|
|
- }
|
|
|
dto.setId(auto.getId());
|
|
|
dto.setName(auto.getName());
|
|
|
dto.setTotal(auto.getPageN());
|
|
|
+ dto.setList(dto2s);
|
|
|
}else {
|
|
|
- dto.setId(auto.getId());
|
|
|
- dto.setName(auto.getName());
|
|
|
- String sql="select id,file_number,file_name,file_time,duty_user,file_page from u_archive_file where archive_id="+auto.getId()+" and is_deleted=0 order by archive_sort,sort,sort_num,create_time";
|
|
|
+ String archiveIds=auto.getId().toString();
|
|
|
+ //查询所有案卷
|
|
|
+ if(StringUtils.isNotEmpty(auto.getVolumeIds())){
|
|
|
+ archiveIds=archiveIds+","+auto.getVolumeIds();
|
|
|
+ }
|
|
|
+ String sql="select id,file_number,file_name,file_time,duty_user,file_page,archive_id from u_archive_file where archive_id in ("+archiveIds+") and is_deleted=0 order by archive_sort,sort,sort_num,create_time";
|
|
|
List<VolumeDto4> dto2s = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VolumeDto4.class));
|
|
|
- dto.setList(dto2s);
|
|
|
- dto.setTotal(auto.getPageN());
|
|
|
+ if(StringUtils.isNotEmpty(auto.getVolumeIds())){
|
|
|
+ dto2s.stream().filter(item ->auto.getVolumeIds().contains(item.getArchiveId().toString())).forEach(item ->item.setIsCheck(1));
|
|
|
+ }
|
|
|
+ dto.setList(dto2s);
|
|
|
}
|
|
|
return dto;
|
|
|
}
|