|
@@ -10,15 +10,19 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
+import com.persagy.dmp.common.helper.SpringHelper;
|
|
|
import com.persagy.dmp.common.model.entity.BaseEntity;
|
|
|
import com.persagy.dmp.digital.client.DigitalRelationFacade;
|
|
|
import com.persagy.dmp.digital.entity.ObjectRelation;
|
|
|
import com.persagy.proxy.adm.constant.AdmCommonConstant;
|
|
|
+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.adm.utils.AdmEntityTransferUtil;
|
|
|
+import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
|
|
|
import com.persagy.proxy.common.client.DmpRwdClient;
|
|
|
import com.persagy.proxy.common.entity.DmpResult;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
@@ -110,7 +114,9 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
|
|
|
|
|
|
@Override
|
|
|
public AdmResponse doQuery(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmEquipment> clazz) {
|
|
|
- AdmResponse response = super.doQuery(context, request, clazz);
|
|
|
+ QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
|
|
|
+ processDmpCriteria(queryCriteria);
|
|
|
+ AdmResponse response = super.doQuery(context, queryCriteria, clazz);
|
|
|
// 系统需要补充分类名称属性
|
|
|
ensureSpecialValues(context, (List<AdmEquipment>) response.getContent());
|
|
|
return response;
|
|
@@ -143,6 +149,40 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设备按照楼层id建筑id查询
|
|
|
+ * @param dmpRequest : 中台查询参数
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void processDmpCriteria(QueryCriteria dmpRequest) {
|
|
|
+ ObjectNode criteria = dmpRequest.getCriteria();
|
|
|
+ if (null==criteria){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (criteria.has("floorId") && criteria.has("buildingId")){
|
|
|
+ // 有建筑id过滤
|
|
|
+ ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
+ ObjectNode relationFrom = objectMapper.createObjectNode();
|
|
|
+ relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
|
|
|
+ relationFrom.put("relCode", RelCodeEnum.Eq2Fl.name());
|
|
|
+ relationFrom.set("objTo",criteria.get("floorId"));
|
|
|
+ criteria.set("relationFrom",relationFrom);
|
|
|
+ criteria.remove("floorId");
|
|
|
+ criteria.remove("buildingId");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (criteria.has("buildingId")){
|
|
|
+ // 有建筑id过滤
|
|
|
+ ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
+ ObjectNode relationFrom = objectMapper.createObjectNode();
|
|
|
+ relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
|
|
|
+ relationFrom.put("relCode", RelCodeEnum.Eq2Bd.name());
|
|
|
+ relationFrom.set("objTo",criteria.get("buildingId"));
|
|
|
+ criteria.set("relationFrom",relationFrom);
|
|
|
+ criteria.remove("buildingId");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private DmpResult<List<ObjRelationDTO>> queryRelation(InstanceUrlParam context, Map<String, AdmEquipment> voMap){
|
|
|
QueryCriteria dmpRequest = new QueryCriteria();
|
|
|
ObjectNode criteria = JsonNodeFactory.instance.objectNode();
|