|
@@ -1,27 +1,35 @@
|
|
|
package com.persagy.proxy.relation.controller;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.excel.util.CollectionUtils;
|
|
|
+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.digital.entity.ObjectRelation;
|
|
|
import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
|
|
|
-import com.persagy.proxy.relation.model.FlInSyList;
|
|
|
-import com.persagy.proxy.relation.model.SyInFl;
|
|
|
-import com.persagy.proxy.relation.model.SyInFlList;
|
|
|
import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
import com.persagy.proxy.adm.service.IAdmRelationService;
|
|
|
import com.persagy.proxy.adm.utils.AdmContextUtil;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
import com.persagy.proxy.common.entity.RelationDTO;
|
|
|
+import com.persagy.proxy.relation.model.FlInSyList;
|
|
|
+import com.persagy.proxy.relation.model.SyInFl;
|
|
|
+import com.persagy.proxy.relation.model.SyInFlList;
|
|
|
+import javafx.scene.input.KeyCode;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author zhangwencheng
|
|
@@ -37,12 +45,13 @@ public class RelationSyInFlController {
|
|
|
|
|
|
@Value("${middleware.group.code}")
|
|
|
private String groupCode;
|
|
|
+ private KeyCode DigitalRelCode;
|
|
|
|
|
|
/**
|
|
|
* 创建系统所在楼层关系
|
|
|
*
|
|
|
* @param syInFl
|
|
|
- * @param projectId
|
|
|
+ * @param
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
@@ -73,7 +82,7 @@ public class RelationSyInFlController {
|
|
|
/**
|
|
|
* 创建所在系统和楼层的关系 系统楼层一对多
|
|
|
*
|
|
|
- * @param projectId
|
|
|
+ * @param
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
@@ -97,6 +106,22 @@ public class RelationSyInFlController {
|
|
|
RelationDTO relation = new RelationDTO(null, graphCode, relCode, null, sysId, floorId);
|
|
|
voList.add(relation);
|
|
|
}
|
|
|
+ //查询 floor所属的建筑 增加关系
|
|
|
+ QueryCriteria criteriaQuery = new QueryCriteria();
|
|
|
+ ObjectNode criteria = JsonNodeFactory.instance.objectNode();
|
|
|
+ criteria.put(ObjectRelation.REL_CODE_HUM, "Fl2Bd");
|
|
|
+ criteria.put(ObjectRelation.GRAPH_CODE_HUM, "ArchSubset");
|
|
|
+ ArrayNode arrayNode = criteria.putObject("objFrom").putArray("$in");
|
|
|
+ floorIdList.stream().forEach(floorId -> arrayNode.add(floorId));
|
|
|
+ criteriaQuery.setCriteria(criteria);
|
|
|
+ List<ObjectRelation> relationList = service.queryByCondition(AdmContextUtil.toDmpContext(), criteriaQuery);
|
|
|
+ if(CollUtil.isNotEmpty(relationList)){
|
|
|
+ Map<String,ObjectRelation> objectRelationMap = CollUtil.fieldValueMap(relationList, "objTo");
|
|
|
+ for (String buildingId : objectRelationMap.keySet()) {
|
|
|
+ RelationDTO relation = new RelationDTO(null, graphCode, "Sy2Bd", null, sysId, buildingId);
|
|
|
+ voList.add(relation);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = AdmContextUtil.toDmpContext();
|
|
|
service.doSave(context, voList);
|