|
|
@@ -7,7 +7,13 @@ import lombok.AllArgsConstructor;
|
|
|
import lombok.Data;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springblade.archive.entity.ArchivesAuto;
|
|
|
+import org.springblade.archive.feign.ArchiveAutoClient;
|
|
|
import org.springblade.archive.feign.ArchiveInspectionInfoClient;
|
|
|
+import org.springblade.business.dto.VolumeDto1;
|
|
|
+import org.springblade.business.dto.VolumeDto2;
|
|
|
+import org.springblade.business.dto.VolumeDto3;
|
|
|
+import org.springblade.business.dto.VolumeDto4;
|
|
|
import org.springblade.business.entity.ArchiveFile;
|
|
|
import org.springblade.business.entity.Task;
|
|
|
import org.springblade.business.entity.TaskParallel;
|
|
|
@@ -24,6 +30,7 @@ import org.springblade.manager.feign.ArchiveTreeContractClient;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.entity.DictBiz;
|
|
|
import org.springblade.system.feign.IDictBizClient;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
@@ -53,6 +60,7 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
|
|
|
private final ArchiveInspectionInfoClient archiveInspectionInfoClient;
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
private final ArchiveTreeContractClient archiveTreeContractClient;
|
|
|
+ private final ArchiveAutoClient archiveAutoClient;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -425,4 +433,64 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
|
|
|
}
|
|
|
System.out.println("归档文件排序成功");
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<VolumeDto1> selectVolumeAfter(Long archiveId) {
|
|
|
+ List<VolumeDto1> list = new ArrayList<>();
|
|
|
+ ArchivesAuto archivesAuto = archiveAutoClient.getArchiveById(archiveId);
|
|
|
+ if(archivesAuto.getIsVolume()==1&&StringUtils.isEmpty(archivesAuto.getVolumeIds())){
|
|
|
+ String volumeIds = archivesAuto.getVolumeIds();
|
|
|
+ String[] archivesAutoIds = volumeIds.split(",");
|
|
|
+ for (String autoId : archivesAutoIds) {
|
|
|
+ VolumeDto1 dto = new VolumeDto1();
|
|
|
+ ArchivesAuto auto = archiveAutoClient.getArchiveById(Long.parseLong(autoId));
|
|
|
+ if (auto != null) {
|
|
|
+ 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";
|
|
|
+ List<VolumeDto2> dto2s = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VolumeDto2.class));
|
|
|
+ dto.setList(dto2s);
|
|
|
+ if(!dto2s.isEmpty()){
|
|
|
+ dto.setTotal(dto2s.stream().mapToInt(dto2 -> dto2.getFilePage() != null ? dto2.getFilePage() : 0).sum());
|
|
|
+ }else {
|
|
|
+ dto.setTotal(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }else {
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public VolumeDto3 selectVolumeBefore(Long archiveId) {
|
|
|
+ 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(",");
|
|
|
+ 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);
|
|
|
+ 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());
|
|
|
+ }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";
|
|
|
+ List<VolumeDto4> dto2s = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VolumeDto4.class));
|
|
|
+ dto.setList(dto2s);
|
|
|
+ dto.setTotal(auto.getPageN());
|
|
|
+ }
|
|
|
+ return dto;
|
|
|
+ }
|
|
|
}
|