Browse Source

配置工具建筑和楼层过滤

zhaoyk 2 years ago
parent
commit
29116a7a9e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/main/java/com/persagy/bdtp/adm/controller/ToolController.java

+ 3 - 0
src/main/java/com/persagy/bdtp/adm/controller/ToolController.java

@@ -20,6 +20,7 @@ import com.persagy.bdtp.adm.service.ISyncApp;
 import com.persagy.bdtp.adm.service.ServiceUtil;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.constant.ResponseCode;
+import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.common.exception.BusinessException;
 import com.persagy.dmp.define.entity.GraphDefine;
 import com.persagy.dmp.define.entity.RelationDefine;
@@ -29,6 +30,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @CrossOrigin
 @RestController
@@ -326,6 +328,7 @@ public class ToolController {
 	public AdmResult<List<ObjectNode>> bdAndFls(@RequestBody AdmRequest req){
 		Map<String, Object> data = syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId());
 		List<ObjectNode> bdAndFls = (List<ObjectNode>)data.get("buildingsAndFloors");
+		bdAndFls = bdAndFls.stream().filter(node -> node.get("valid") == null || node.get("valid").asInt() == ValidEnum.TRUE.getType()).collect(Collectors.toList());
 
 		List<ObjectNode> bds = new ArrayList<>();
 		Iterator<ObjectNode> iter = bdAndFls.iterator();