|
|
@@ -5682,12 +5682,15 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
|
|
|
@Override
|
|
|
public String saveVolume(SaveVolumeDto dto) {
|
|
|
+ List<Long>updateIds=new ArrayList<>();
|
|
|
ArchivesAuto archivesAuto = this.getById(dto.getArchiveId());
|
|
|
archivesAuto.setName(dto.getArchiveName());
|
|
|
+ updateIds.add(archivesAuto.getId());
|
|
|
if(!dto.getList().isEmpty()){
|
|
|
archivesAuto.setIsVolume(1);
|
|
|
+ archivesAuto.setVolumeIds(null);
|
|
|
for (SaveVolumeDto1 saveVolumeDto1 : dto.getList()) {
|
|
|
- Long archiveId = null;
|
|
|
+ Long archiveId;
|
|
|
if(saveVolumeDto1.getId()==null){
|
|
|
ArchivesAuto auto = new ArchivesAuto();
|
|
|
BeanUtil.copy(archivesAuto,auto);
|
|
|
@@ -5699,11 +5702,16 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
}else {
|
|
|
archiveId=saveVolumeDto1.getId();
|
|
|
}
|
|
|
+ updateIds.add(archiveId);
|
|
|
String update = "UPDATE u_archive_file SET archive_id = ?, volume_id = ?, is_volume = 1 WHERE id IN (?)";
|
|
|
jdbcTemplate.update(update, archiveId, dto.getArchiveId(), saveVolumeDto1.getFileIds());
|
|
|
+ archivesAuto.setVolumeIds(archivesAuto.getVolumeIds()+archiveId+",");
|
|
|
}
|
|
|
+ archivesAuto.setVolumeIds(archivesAuto.getVolumeIds().substring(0,archivesAuto.getVolumeIds().length()-1));
|
|
|
}
|
|
|
- return "";
|
|
|
+ baseMapper.updateById(archivesAuto);
|
|
|
+ this.updateArchivePage(updateIds);
|
|
|
+ return "操作成功";
|
|
|
}
|
|
|
}
|
|
|
|