Browse Source

fix bug:query-outline接口返回的infos为空

lijie 3 years ago
parent
commit
4ccba6ad36

+ 1 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmBaseServiceImpl.java

@@ -68,6 +68,7 @@ public class AbstractAdmBaseServiceImpl<T> implements IAdmBaseService<T> {
         // 调用中台查询
         DmpResult<JSONArray> dmpResult = rwdClient.queryObject(context, para);
         List<T> admVOs = AdmEntityTransferUtil.toAdmMultiEntity(dmpResult.getData(), request.getProjection(), clazz);
+        //List<T> admVOs = AdmEntityTransferUtil.toAdmMultiEntityExtra(dmpResult.getData(), request.getProjection(), clazz);
         // 级联查询
         processCascade(context, admVOs, request.getName(), request.getCascade());
         // 设置返回值

+ 4 - 0
src/main/java/com/persagy/proxy/object/model/AdmFloor.java

@@ -7,6 +7,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * ADM 楼层 实体
@@ -85,4 +86,7 @@ public class AdmFloor extends AdmBaseEntity<AdmFloor> {
     /** 楼层平面图地址 */
     //private String floorMap;
 
+    /** 信息点 */
+    //private Map<String, Object> infos;
+
 }

+ 14 - 0
src/main/java/com/persagy/proxy/object/service/impl/AdmFloorServiceImpl.java

@@ -1,6 +1,7 @@
 package com.persagy.proxy.object.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -16,7 +17,9 @@ import org.springframework.stereotype.Service;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * ADM 楼层 实现类
@@ -46,15 +49,26 @@ public class AdmFloorServiceImpl extends AbstractAdmBaseServiceImpl<AdmFloor> im
         list.add("name");
         list.add("localId");
         list.add("localName");
+        list.add("classCode");
         list.add("outline");
         list.add("floorSequenceId");
         list.add("modelId");
+        list.add("floorElevation");
+        list.add("floorMap");
+        list.add("floorSequenceID");
+        list.add("height");
         list.add("infos");
         list.add("properties");
         request.setProjection(list);
         AdmResponse rs = doQuery(context, request, clazz);
         List<AdmFloor> vos = (List<AdmFloor>) rs.getContent();
         ensureSpecialValues(context, vos, QUERY);
+        vos.forEach(vo->{
+            Map<String, Object> objectMap = MapUtil.defaultIfEmpty(vo.getInfos(), new HashMap<>());
+            objectMap.put("floorSequenceID",vo.getFloorSequenceID());
+            vo.setFloorSequenceID(null);
+            vo.setInfos(objectMap);
+        });
         rs.setContent(vos);
         return rs;
     }