|
@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -1061,5 +1062,45 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
return url;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 拆卷
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public boolean slipt(String ids) {
|
|
|
+
|
|
|
+ List orgIds = Func.toLongList(ids);
|
|
|
+
|
|
|
+ List<String> strIds = new ArrayList<>();
|
|
|
+ List<Long> lIds = new ArrayList<>();
|
|
|
+
|
|
|
+ //排除锁定的和单文件案卷这种
|
|
|
+ List<ArchivesAuto> archivesAutos = this.listByIds(orgIds);
|
|
|
+ for (ArchivesAuto ar: archivesAutos) {
|
|
|
+ if (ar.getIsLock() == 1) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (ar.getIsAutoFile() == 1) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ lIds.add(ar.getId());
|
|
|
+ strIds.add(ar.getId().toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新
|
|
|
+ List<ArchiveFile> files = archiveFileClient.getAllArchiveFileByArchiveIds(strIds);
|
|
|
+ if (files != null && files.size() > 0) {
|
|
|
+ for (ArchiveFile f: files) {
|
|
|
+ f.setIsArchive(0);
|
|
|
+ f.setArchiveId(null);
|
|
|
+ LambdaUpdateWrapper<ArchiveFile> wrappers = Wrappers.lambdaUpdate();
|
|
|
+ this.archiveFileClient.updateWrappers(wrappers.eq(ArchiveFile::getId, f.getId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //删除案卷
|
|
|
+ return this.deleteLogic(lIds);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|