فهرست منبع

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/adm-middleware.git into develop

zhangqiankun 3 سال پیش
والد
کامیت
1cb72bb9c2

+ 11 - 5
src/main/java/com/persagy/proxy/adm/service/impl/AdmModelKeyServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
@@ -69,18 +70,23 @@ public class AdmModelKeyServiceImpl implements IAdmModelKeyService {
         //拼接中台查询条件
         criteria.remove("floorId");
         criteria.put("objType", "equipment");
-        JSONObject relationFrom = new JSONObject();
+
+        JsonNodeFactory factory = JsonNodeFactory.instance;
+        ObjectNode relationFrom = factory.objectNode();
         relationFrom.put("objTo", objTo);
         relationFrom.put("relCode", "Eq2Fl");
         relationFrom.put("graphCode", "MechInArch");
-        criteria.put("relationFrom", relationFrom.toJSONString());
+        criteria.putPOJO("relationFrom", relationFrom);
+
 
         JSONObject jsonBimId = new JSONObject();
         jsonBimId.put("$null", false);
-        criteria.put("bimId",jsonBimId.toJSONString());
+        criteria.putPOJO("bimId",jsonBimId);
 
         dmpRequest.setCriteria(criteria);
-
+        dmpRequest.setSize(1L);
+        dmpRequest.setPage(1L);
+        dmpRequest.setWithoutCount(true);
         // 转换参数
         JSONObject paraEquip = null;
         try {
@@ -92,7 +98,7 @@ public class AdmModelKeyServiceImpl implements IAdmModelKeyService {
         }
         result = rwdClient.queryObject(context, paraEquip);
         //处理成目标对象
-        if(result.getCount() == 1){
+        if(result.getResult().equals(DmpResult.SUCCESS)){
             JSONArray jsonArray = result.getData();
             JSONObject object = result.getData().getJSONObject(0);
             JSONObject model = new JSONObject();

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8868
+  port: 8876
 spring:
   application:
     # 应用名称