|
@@ -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,22 @@ 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);
|
|
|
// 转换参数
|
|
|
JSONObject paraEquip = null;
|
|
|
try {
|
|
@@ -92,7 +97,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();
|