|
@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -72,10 +73,16 @@ public class AreaController extends BaseController {
|
|
Set<String> facsAreaCodes = tagRels.stream().map(ObjTagRel::getObjCode).collect(Collectors.toSet());
|
|
Set<String> facsAreaCodes = tagRels.stream().map(ObjTagRel::getObjCode).collect(Collectors.toSet());
|
|
|
|
|
|
// 过滤树节点
|
|
// 过滤树节点
|
|
- areaTree = AreaUtils.filterTree(areaTree, facsAreaCodes);
|
|
|
|
- areaTree = AreaUtils.compressTree(areaTree);
|
|
|
|
|
|
+ List<Area> areaTargets = AreaUtils.compressTree(areaTree);
|
|
|
|
+
|
|
|
|
+ Iterator<Area> it = areaTargets.iterator();
|
|
|
|
+ while (it.hasNext()) {
|
|
|
|
+ if (!facsAreaCodes.contains(it.next().getAreaCode())) {
|
|
|
|
+ it.remove();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- return success(areaTree);
|
|
|
|
|
|
+ return success(areaTargets);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|