Browse Source

fix bug:信息点(高度)无法显示成功

lijie 3 years ago
parent
commit
96c5333ea2

+ 1 - 1
src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -162,7 +162,7 @@ public class AdmSpaceController {
      */
     @PostMapping("/query")
     public ObjectNode query(@RequestBody AdmDCSQueryRequest request) throws Exception {
-        AdmResponse response = service.doQuerySpaces( AdmContextUtil.toDmpContext(), request);
+        AdmResponse response = service.doQuerySpaces(AdmContextUtil.toDmpContext(), request);
         ObjectNode objectNode = JsonNodeUtils.toObjectNode(response, null, null);
         if(StrUtil.isNotEmpty(request.getZoneType())){
             objectNode.put("zoneType", request.getZoneType());

+ 15 - 4
src/main/java/com/persagy/proxy/object/service/impl/AdmSpaceServiceImpl.java

@@ -2,6 +2,8 @@ package com.persagy.proxy.object.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.map.MapUtil;
+import cn.hutool.core.util.ReflectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONArray;
@@ -14,6 +16,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.collect.Sets;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.basic.utils.JsonNodeUtils;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.helper.SpringHelper;
 import com.persagy.dmp.common.model.response.CommonResult;
@@ -21,10 +24,7 @@ import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.dmp.simple.client.DigitalObjectSimpleFacade;
-import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
-import com.persagy.proxy.adm.constant.GraphCodeEnum;
-import com.persagy.proxy.adm.constant.RelCodeEnum;
+import com.persagy.proxy.adm.constant.*;
 import com.persagy.proxy.adm.request.AdmDCSQueryRequest;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
@@ -52,6 +52,7 @@ import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Field;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -213,6 +214,16 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
             }
             admSystemList.addAll(vo.getGeneralSystem());
         }
+        // 3.对部分infos值在infos中也放置一份
+        for (AdmSpace space : vos) {
+            Map<String, Object> infos = space.getInfos();
+            if (MapUtil.isEmpty(infos)){
+                infos = new HashMap<>();
+            }
+            // 重新放置一下height的值
+            infos.put(AdmDictConstant.HEIGHT,ReflectUtil.getFieldValue(space,AdmDictConstant.HEIGHT));
+            space.setInfos(infos);
+        }
         // 对象扩展属性赋值
         systemService.ensureSpecialValues(context, admSystemList);
     }