|
|
@@ -44,6 +44,7 @@ import org.springblade.archive.utils.CallBgrsjk;
|
|
|
import org.springblade.archive.vo.*;
|
|
|
import org.springblade.business.entity.ArchiveFile;
|
|
|
import org.springblade.business.feign.ArchiveFileClient;
|
|
|
+import org.springblade.business.vo.ArchiveFileVO;
|
|
|
import org.springblade.business.vo.NeiYeLedgerVO1;
|
|
|
//import org.springblade.common.utils.DeepSeekClient;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
@@ -1256,29 +1257,37 @@ public class ArchivesAutoController extends BladeController {
|
|
|
if ((vo.getSortFileList() == null || !vo.getSortFileList().contains(","))) {
|
|
|
return R.fail("参数错误");
|
|
|
}
|
|
|
- List<ArchiveFile> updateArchiveFileList = new ArrayList<>();
|
|
|
- int sort = 0;
|
|
|
+ List<ArchiveFileVO> updateArchiveFileList = new ArrayList<>();
|
|
|
String[] split1 = vo.getSortFileList().split(",");
|
|
|
- Map<Long, Integer> map = sourceArchiveFileList.stream().collect(Collectors.toMap(ArchiveFile::getId, ArchiveFile::getSort));
|
|
|
+ List<ArchiveFile> targetArchiveFileList = archiveFileClient.getArchiveFileByArchiveIds(target.getId() + "");
|
|
|
+ targetArchiveFileList.addAll(sourceArchiveFileList);
|
|
|
+ Map<Long, ArchiveFile> targetMap = targetArchiveFileList.stream().collect(Collectors.toMap(ArchiveFile::getId, item -> item, (k1, k2) -> k1));
|
|
|
+ Map<Long, ArchiveFile> map = sourceArchiveFileList.stream().collect(Collectors.toMap(ArchiveFile::getId, item -> item));
|
|
|
for (String s : split1) {
|
|
|
if (StringUtils.isNumeric(s)) {
|
|
|
- ArchiveFile file = new ArchiveFile();
|
|
|
- file.setId(Long.parseLong(s));
|
|
|
- updateArchiveFileList.add(file);
|
|
|
- file.setSort(sort);
|
|
|
- if (map.containsKey(file.getId())) {
|
|
|
- file.setPageNum("");
|
|
|
- file.setArchiveId(target.getId());
|
|
|
+ ArchiveFile tempFile = targetMap.get(Long.parseLong(s));
|
|
|
+ if (tempFile != null) {
|
|
|
+ ArchiveFileVO file = new ArchiveFileVO();
|
|
|
+ file.setId(tempFile.getId());
|
|
|
+ file.setSort(tempFile.getSort());
|
|
|
+ file.setArchiveSort(tempFile.getArchiveSort());
|
|
|
+ file.setNodeId(tempFile.getNodeId());
|
|
|
+ updateArchiveFileList.add(file);
|
|
|
+ if (map.containsKey(file.getId())) {
|
|
|
+ file.setPageNum("");
|
|
|
+ file.setArchiveId(target.getId());
|
|
|
+ }
|
|
|
}
|
|
|
- sort++;
|
|
|
}
|
|
|
}
|
|
|
// 修改标识
|
|
|
- archiveFileClient.updateArchiveFile(updateArchiveFileList);
|
|
|
boolean update = archivesAutoService.update(Wrappers.<ArchivesAuto>lambdaUpdate().in(ArchivesAuto::getId, vo.getTargetId(), vo.getSourceId()).set(ArchivesAuto::getActionType, 3).last("and (action_type is null or action_type in (0,3))"));
|
|
|
if (!update) {
|
|
|
return R.fail("案卷【" + target.getName() + "】或【" + source.getName() + "】正在被其他用户操作,请稍后再试");
|
|
|
}
|
|
|
+ ArchiveFileVO fileVO = new ArchiveFileVO();
|
|
|
+ fileVO.setList(updateArchiveFileList);
|
|
|
+ archiveFileClient.updateArchiveFileSort(fileVO);
|
|
|
return R.status(true);
|
|
|
}
|
|
|
|