|
@@ -3019,6 +3019,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
List orgIds = Func.toLongList(ids);
|
|
|
|
|
|
List<String> strIds = new ArrayList<>();
|
|
|
+ List<Long> emptyIds = new ArrayList<>();
|
|
|
List<Long> lIds = new ArrayList<>();
|
|
|
|
|
|
//排除锁定的和单文件案卷这种
|
|
@@ -3028,11 +3029,27 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
continue;
|
|
|
}
|
|
|
if (ar.getIsAutoFile() != null && ar.getIsAutoFile() == 1) {
|
|
|
+ emptyIds.add(ar.getId());
|
|
|
continue;
|
|
|
}
|
|
|
lIds.add(ar.getId());
|
|
|
strIds.add(ar.getId().toString());
|
|
|
}
|
|
|
+ if (!emptyIds.isEmpty()) {
|
|
|
+ List<ArchiveFile> files = archiveFileClient.getAllArchiveFileByArchiveIds(emptyIds.stream().map(id -> id + "").collect(Collectors.toList()));
|
|
|
+ if (files == null || files.isEmpty()) {
|
|
|
+ this.deleteLogic(emptyIds);
|
|
|
+ } else {
|
|
|
+ Map<Long, List<ArchiveFile>> groupArchiveFiles = files.stream().collect(Collectors.groupingBy(ArchiveFile::getArchiveId));
|
|
|
+ emptyIds.removeIf(groupArchiveFiles::containsKey);
|
|
|
+ if (!emptyIds.isEmpty()) {
|
|
|
+ this.deleteLogic(emptyIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (strIds.isEmpty()) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (strIds.size() == 0) {
|
|
|
return false;
|
|
@@ -5173,7 +5190,9 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
//查出所有案卷文件
|
|
|
List<ArchiveFile>archiveFileList=archiveFileClient.getArchiveFileByArchiveIds(id+"");
|
|
|
//设置案卷页码和四要素
|
|
|
- this.reCreateArchiveAuto(archivesAuto, archiveFileList);
|
|
|
+ if (archiveFileList != null && !archiveFileList.isEmpty()) {
|
|
|
+ this.reCreateArchiveAuto(archivesAuto, archiveFileList);
|
|
|
+ }
|
|
|
}
|
|
|
if (!idsSet.isEmpty()) {
|
|
|
this.update(Wrappers.<ArchivesAuto>lambdaUpdate().set(ArchivesAuto::getActionType, 0).in(ArchivesAuto::getId, idsSet));
|