|
|
@@ -5729,6 +5729,9 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
baseMapper.insert(auto);
|
|
|
}else {
|
|
|
archiveId=saveVolumeDto1.getId();
|
|
|
+ ArchivesAuto auto = this.getById(archiveId);
|
|
|
+ auto.setName(saveVolumeDto1.getArchiveName());
|
|
|
+ baseMapper.updateById(auto);
|
|
|
}
|
|
|
updateIds.add(archiveId);
|
|
|
String update = "UPDATE u_archive_file SET archive_id = ?, old_archive_id = ?, is_volume = 1 WHERE id IN (" + saveVolumeDto1.getFileIds() + ")";
|
|
|
@@ -5740,12 +5743,16 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
.map(file -> Optional.ofNullable(file.getSort()).orElse(0))
|
|
|
.sorted()
|
|
|
.collect(Collectors.toList());
|
|
|
+ List<Integer> sorts1 = files1.stream()
|
|
|
+ .map(file -> Optional.ofNullable(file.getArchiveSort()).orElse(0))
|
|
|
+ .sorted()
|
|
|
+ .collect(Collectors.toList());
|
|
|
String[] fileIds = saveVolumeDto1.getFileIds().split(",");
|
|
|
if(sorts.size()==fileIds.length){
|
|
|
if(fileIds.length>0){
|
|
|
for (int i = 0; i < fileIds.length; i++) {
|
|
|
- String updateSql = "UPDATE u_archive_file SET sort = ? WHERE id = ?";
|
|
|
- jdbcTemplate.update(updateSql, sorts.get(i), fileIds[i]);
|
|
|
+ String updateSql = "UPDATE u_archive_file SET sort = ? ,archive_sort=? WHERE id = ?";
|
|
|
+ jdbcTemplate.update(updateSql, sorts.get(i), sorts1.get(i),fileIds[i]);
|
|
|
}
|
|
|
}
|
|
|
}
|