|
@@ -3,6 +3,7 @@ package org.springblade.business.controller;
|
|
|
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.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -63,7 +64,7 @@ public class RecycleBinController extends BladeController {
|
|
|
if (vo.getRegainIds() != null && vo.getRegainIds().size() > 0) {
|
|
|
//获取数据
|
|
|
List<Long> longs = vo.getRegainIds().stream().map(i -> i.getId()).collect(Collectors.toList());
|
|
|
- List<RecycleBin> recycleBinList = this.recycleBinService.list(Wrappers.<RecycleBin>lambdaQuery().in(RecycleBin::getId, longs));
|
|
|
+ List<RecycleBin> recycleBinList = this.recycleBinService.list(Wrappers.<RecycleBin>lambdaQuery().eq(RecycleBin::getStatus,1).in(RecycleBin::getId, longs));
|
|
|
//恢复数据成功后删除回收站对应记录
|
|
|
List<String> recycleBinIds = new ArrayList<>();
|
|
|
//划分数据类型
|
|
@@ -71,12 +72,25 @@ public class RecycleBinController extends BladeController {
|
|
|
List<RecycleBin> nodeTypeList = recycleBinList.stream().filter(recycleBin -> new Integer("2").equals(recycleBin.getDelType())).distinct().collect(Collectors.toList());
|
|
|
boolean regainNode = false, regainFile = false;
|
|
|
if (nodeTypeList.size() > 0) {
|
|
|
+ List<RecycleBin> errorList = new ArrayList<>();
|
|
|
+ //筛选出项目级存在的节点
|
|
|
+ for (RecycleBin recycleBin : nodeTypeList) {
|
|
|
+ //当前是否有节点在项目级被删除了 如果是标记当前节点不可用
|
|
|
+ Integer count = this.wbsTreeContractClient.findIsExistTreeNode(Arrays.asList(recycleBin.getBusinessId().split(",")));
|
|
|
+ if (count > 0){
|
|
|
+ recycleBin.setStatus(2);
|
|
|
+ errorList.add(recycleBin);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isNotEmpty(errorList)){
|
|
|
+ recycleBinService.updateBatchById(errorList);
|
|
|
+ nodeTypeList.removeAll(errorList);
|
|
|
+ }
|
|
|
+
|
|
|
//恢复集合
|
|
|
List<String> processNodeList = new ArrayList<>();
|
|
|
this.foreachQueryData(nodeTypeList, recycleBinIds, processNodeList);
|
|
|
try {
|
|
|
- //筛选出项目级存在的节点
|
|
|
- processNodeList = this.wbsTreeContractClient.findIsExistTreeNode(processNodeList);
|
|
|
|
|
|
//恢复数据
|
|
|
if (processNodeList.size() > 0) {
|