|
@@ -1,16 +1,22 @@
|
|
|
package com.persagy.proxy.object.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
+import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
+import com.persagy.dmp.common.helper.SpringHelper;
|
|
|
+import com.persagy.proxy.adm.constant.GraphCodeEnum;
|
|
|
+import com.persagy.proxy.adm.constant.RelCodeEnum;
|
|
|
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
|
|
|
+import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
import com.persagy.proxy.adm.service.impl.AbstractAdmBaseServiceImpl;
|
|
|
+import com.persagy.proxy.adm.utils.AdmContextUtil;
|
|
|
+import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
import com.persagy.proxy.object.model.AdmEquipment;
|
|
|
import com.persagy.proxy.object.model.AdmShaft;
|
|
|
-import com.persagy.proxy.adm.request.AdmQueryCriteria;
|
|
|
-import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
import com.persagy.proxy.object.model.AdmSystem;
|
|
|
import com.persagy.proxy.object.service.IAdmEquipmentService;
|
|
|
import com.persagy.proxy.object.service.IAdmShaftService;
|
|
|
-import com.persagy.proxy.adm.utils.AdmContextUtil;
|
|
|
-import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
import com.persagy.proxy.object.service.IAdmSystemService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -49,6 +55,25 @@ public class AdmShaftServiceImpl extends AbstractAdmBaseServiceImpl<AdmShaft> im
|
|
|
equipmentService.ensureSpecialValues(AdmContextUtil.toDmpContext(), equipmentList);
|
|
|
systemService.ensureSpecialValues(AdmContextUtil.toDmpContext(), systemList);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void processDmpCriteria(QueryCriteria dmpRequest) {
|
|
|
+ ObjectNode criteria = dmpRequest.getCriteria();
|
|
|
+ if (null==criteria){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (criteria.has("buildingId")){
|
|
|
+ // 有建筑id过滤
|
|
|
+ ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
+ ObjectNode relationTo = objectMapper.createObjectNode();
|
|
|
+ relationTo.put("graphCode", GraphCodeEnum.ArchSubset.name());
|
|
|
+ relationTo.put("relCode", RelCodeEnum.Bd2Sh.name());
|
|
|
+ relationTo.set("objFrom",criteria.get("buildingId"));
|
|
|
+ criteria.set("relationTo",relationTo);
|
|
|
+ criteria.remove("buildingId");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public AdmResponse doQuery(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmShaft> clazz) {
|
|
|
AdmResponse response = super.doQuery(context, request, clazz);
|