|
@@ -4,7 +4,9 @@ import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
+import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.persagy.bdtp.adm.client.RwdClient;
|
|
|
import com.persagy.bdtp.adm.common.AdmConst;
|
|
@@ -318,4 +320,38 @@ public class ToolController {
|
|
|
return AdmResult.success(null);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/bdAndFls")
|
|
|
+ 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");
|
|
|
+
|
|
|
+ List<ObjectNode> bds = new ArrayList<>();
|
|
|
+ Iterator<ObjectNode> iter = bdAndFls.iterator();
|
|
|
+ while (iter.hasNext()){
|
|
|
+ ObjectNode node = iter.next();
|
|
|
+ if(AdmConst.OBJ_TYPE_BUILDING.equals(node.get("objType").asText())) {
|
|
|
+ bds.add(node);
|
|
|
+ iter.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for(ObjectNode bd : bds) {
|
|
|
+ String id = bd.get("id").asText();
|
|
|
+ for(ObjectNode fl : bdAndFls) {
|
|
|
+ JsonNode node = fl.get("buildingId");
|
|
|
+ if(node != null){
|
|
|
+ String bdId = node.asText();
|
|
|
+ if(bdId.equals(id)){
|
|
|
+ ArrayNode children = (ArrayNode)bd.get("children");
|
|
|
+ if(children == null)
|
|
|
+ children = bd.putArray("children");
|
|
|
+ children.add(fl);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return AdmResult.success(bds);
|
|
|
+ }
|
|
|
+
|
|
|
}
|