Browse Source

字典相关接口开发

linhuili 3 years ago
parent
commit
bd168c32f5
23 changed files with 1434 additions and 4 deletions
  1. 4 1
      src/main/java/com/persagy/proxy/adm/constant/AdmCommonConstant.java
  2. 23 0
      src/main/java/com/persagy/proxy/adm/constant/AdmDictConstant.java
  3. 44 0
      src/main/java/com/persagy/proxy/adm/constant/enums/AdmDictCategoryEnum.java
  4. 39 0
      src/main/java/com/persagy/proxy/adm/constant/enums/ValidEnum.java
  5. 178 0
      src/main/java/com/persagy/proxy/adm/controller/AdmDictController.java
  6. 56 0
      src/main/java/com/persagy/proxy/adm/controller/AdmModelRelController.java
  7. 16 0
      src/main/java/com/persagy/proxy/adm/model/AdmDict.java
  8. 25 0
      src/main/java/com/persagy/proxy/adm/model/AdmDictBatch.java
  9. 18 0
      src/main/java/com/persagy/proxy/adm/model/AdmDictQueryCriteria.java
  10. 19 0
      src/main/java/com/persagy/proxy/adm/model/AdmEquipFamilyCategory.java
  11. 32 0
      src/main/java/com/persagy/proxy/adm/model/AdmModelRel.java
  12. 126 0
      src/main/java/com/persagy/proxy/adm/model/AdmObjectInfo.java
  13. 59 0
      src/main/java/com/persagy/proxy/adm/model/AdmObjectType.java
  14. 65 0
      src/main/java/com/persagy/proxy/adm/service/IAdmDictBaseService.java
  15. 49 0
      src/main/java/com/persagy/proxy/adm/service/IAdmDictService.java
  16. 13 0
      src/main/java/com/persagy/proxy/adm/service/IAdmModelRelService.java
  17. 254 0
      src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmDictBaseServiceImpl.java
  18. 302 0
      src/main/java/com/persagy/proxy/adm/service/impl/AdmDictServiceImpl.java
  19. 18 0
      src/main/java/com/persagy/proxy/adm/service/impl/AdmModelRelServiceImpl.java
  20. 3 3
      src/main/java/com/persagy/proxy/adm/utils/AdmQueryCriteriaHelper.java
  21. 36 0
      src/main/java/com/persagy/proxy/common/client/DmpDicClient.java
  22. 37 0
      src/main/java/com/persagy/proxy/common/client/DmpRwdClient.java
  23. 18 0
      src/main/java/com/persagy/proxy/common/constant/DmpUrlConstant.java

+ 4 - 1
src/main/java/com/persagy/proxy/adm/constant/AdmCommonConstant.java

@@ -27,5 +27,8 @@ public interface AdmCommonConstant {
     
     /** excel文件后缀*/
     String EXCEL_SUFFIX_XLSX = ".xlsx";
-    
+
+    /** 有效标示*/
+    String VALID = "valid";
+
 }

+ 23 - 0
src/main/java/com/persagy/proxy/adm/constant/AdmDictConstant.java

@@ -0,0 +1,23 @@
+package com.persagy.proxy.adm.constant;
+
+/**
+ * @ClassName AdmDictConstant
+ * @Description: 字典常量
+ * @Author linhuili
+ * @Date 2021/9/1 10:07
+ * @Version V1.0
+ **/
+public interface AdmDictConstant {
+
+    /** 类型编码 */
+    String CLASS_CODE ="classCode";
+
+    /** 信息点infos前缀 */
+    String INFOS_EX ="infos.";
+
+    /** 一级标签名称 */
+    String FIRST_BASE_TAG ="基本信息";
+
+    /** 一级标签历史名称 */
+    String HIS_FIRST_BASE_TAG="基础参数";
+}

+ 44 - 0
src/main/java/com/persagy/proxy/adm/constant/enums/AdmDictCategoryEnum.java

@@ -0,0 +1,44 @@
+package com.persagy.proxy.adm.constant.enums;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName DtTypeEnum
+ * @Description: 数据中台类型定义
+ * @Author linhuili
+ * @Date 2021/8/9 16:07
+ * @Version V1.0
+ **/
+public enum AdmDictCategoryEnum {
+    EQUIPMENT("equipment", "设备"),
+    COMPONENT("component", "组件"),
+    SYSTEM("system", "系统"),
+    MAJOR("major", "专业"),
+    SPACE("space", "空间"),
+    PROPRTY("property", "资产"),
+    EQUIPMENT_AND_COMPONENT("equipmentAndComponent", "设备和部件"),
+
+    MAJOR_SYSTEM("majorSystem", "专业下的系统"),
+    SYSTEM_EQUIP("systemEquip", "系统下的设备类"),
+    MAJOR_SYSTEM_EQUIP("majorSystemEquip", "专业下的系统,系统下的设备"),
+
+    EQUIPMENT_COMPONENT("equipmentComponent", "设备类型以及对应的部件"),
+    MAJOR_EQUIPMENT("majorEquipment", "专业下的设备类");
+
+    private String value;
+    private String desc;
+
+    AdmDictCategoryEnum(String value, String desc) {
+        this.value = value;
+        this.desc = desc;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+}

+ 39 - 0
src/main/java/com/persagy/proxy/adm/constant/enums/ValidEnum.java

@@ -0,0 +1,39 @@
+package com.persagy.proxy.adm.constant.enums;
+
+/**
+ * @ClassName ValidEnum
+ * @Description: 有效标示
+ * @Author linhuili
+ * @Date 2021/9/2 11:12
+ * @Version V1.0
+ **/
+
+public enum ValidEnum {
+    /** 有效标识 */
+    FALSE(0, false),
+    TRUE(1, true);
+
+    private Integer value;
+    private Boolean desc;
+
+    ValidEnum(Integer value, Boolean desc) {
+        this.value = value;
+        this.desc = desc;
+    }
+
+    public Integer getValue() {
+        return value;
+    }
+
+    public void setValue(Integer value) {
+        this.value = value;
+    }
+
+    public Boolean getDesc() {
+        return desc;
+    }
+
+    public void setDesc(Boolean desc) {
+        this.desc = desc;
+    }
+}

+ 178 - 0
src/main/java/com/persagy/proxy/adm/controller/AdmDictController.java

@@ -0,0 +1,178 @@
+package com.persagy.proxy.adm.controller;
+
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.constant.AdmDictConstant;
+import com.persagy.proxy.adm.model.*;
+import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.IAdmDictBaseService;
+import com.persagy.proxy.adm.service.IAdmDictService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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 javax.ws.rs.QueryParam;
+import java.util.ArrayList;
+
+/**
+ * @ClassName AdmDictController
+ * @Description: 字典查询
+ * @Author linhuili
+ * @Date 2021/8/31 18:21
+ * @Version V1.0
+ **/
+@RestController
+@RequestMapping("/dict")
+@Slf4j
+public class AdmDictController {
+
+    @Value("${middleware.group.code}")
+    private String groupCode;
+
+    @Autowired
+    private IAdmDictService service;
+
+    @Autowired
+    private IAdmDictBaseService baseService;
+
+    /**
+     * 字典类型查询:所有设备类型、部件类型、系统类型、专业类型
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/category")
+    public AdmResponse queryCategory(@QueryParam("projectId") String projectId,
+                                     @RequestBody AdmDict request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        if(StringUtils.isEmpty(request.getType())){
+            throw new Exception("type不能为空");
+        }
+        return service.queryCategory(context,request,AdmObjectType.class);
+    }
+
+
+    /**
+     * 批量处理字典信息操作:方案设定(BDTP暂不支持)
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/dict-batch")
+    public AdmResponse dictBatch(@QueryParam("projectId") String projectId,
+                                     @RequestBody AdmCreateRequest<AdmDictBatch> request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        //方案设定:方案id :全新设定(schemeZero)、方案1(schemeOne)、方案2(schemeTwo),
+        //"注意SchemeId为必填字段 ,优先级在列表中[R,S,M] ,一级标签[技术参数,基本参数] 列表为String类型
+        return AdmResponse.success(new ArrayList<>());
+    }
+
+    /**
+     * 查询项目下类型的信息点
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/query")
+    public AdmResponse query(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmDictQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        request.setName(request.getType());
+        return baseService.doQueryObjectInfo(context, request, AdmDictConstant.CLASS_CODE, AdmObjectInfo.class);
+    }
+
+    /**
+     * 查询设备对应的设备族(废弃)
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/family/query")
+    @Deprecated
+    public AdmResponse familyQuery(@QueryParam("projectId") String projectId,
+                             @RequestBody AdmQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        return AdmResponse.success(new ArrayList<>());
+    }
+
+    /**
+     * 重置项目下所有得定制信息点
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/reset-dic")
+    public AdmResponse resetDic(@QueryParam("projectId") String projectId,
+                                   @RequestBody AdmDictQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        return service.resetDic(context,request,null,AdmObjectInfo.class);
+    }
+
+
+    /**
+     * 根据类型,项目id重置信息点
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/reset-type")
+    public AdmResponse resetType(@QueryParam("projectId") String projectId,
+                                @RequestBody AdmDictQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        if(StringUtils.isEmpty(request.getType())){
+            throw new Exception("type不能为空");
+        }
+        request.setName(request.getType());
+        return service.resetDic(context,request,AdmDictConstant.CLASS_CODE,AdmObjectInfo.class);
+    }
+
+    /**
+     * 设置-项目定制化字典
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/setting-dic-project")
+    public AdmResponse settingDicProject(@QueryParam("projectId") String projectId,
+                                 @RequestBody AdmCreateRequest<AdmObjectInfo> request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        return service.settingDicProject(context,request,AdmObjectInfo.class);
+    }
+
+    /**
+     * 查询项目下已有的设备类型带系统(废弃:数据中心无此接口)
+     * @param projectId
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/system/equip/category")
+    @Deprecated
+    public AdmResponse querySystemEquipCategory(@QueryParam("projectId") String projectId,
+                                 @RequestBody AdmDictQueryCriteria request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        return AdmResponse.success(new ArrayList<>());
+    }
+}

+ 56 - 0
src/main/java/com/persagy/proxy/adm/controller/AdmModelRelController.java

@@ -0,0 +1,56 @@
+package com.persagy.proxy.adm.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.model.AdmLocationPoint;
+import com.persagy.proxy.adm.model.AdmModelRel;
+import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.IAdmModelRelService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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 javax.ws.rs.QueryParam;
+import java.util.List;
+
+/**
+ * @ClassName AdmModelRelController
+ * @Description: 模型修改设备元空间的建筑楼层信息
+ * @Author linhuili
+ * @Date 2021/8/31 14:30
+ * @Version V1.0
+ **/
+@RestController
+@RequestMapping("/rel/update")
+@Slf4j
+public class AdmModelRelController {
+
+    @Value("${middleware.group.code}")
+    private String groupCode;
+
+
+    @Autowired
+    private IAdmModelRelService service;
+
+    /**
+     * 模型修改设备元空间的建筑楼层信息
+     * @param createRequest
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/equip-ispace")
+    public AdmResponse update(@RequestBody AdmCreateRequest<AdmModelRel> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        List<AdmModelRel> vos = CollUtil.newArrayList(createRequest.getContent());
+       // vos = service.doUpdate(context, AdmModelRel.class, vos);
+        return AdmResponse.success(vos);
+    }
+
+}

+ 16 - 0
src/main/java/com/persagy/proxy/adm/model/AdmDict.java

@@ -0,0 +1,16 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+/**
+ * @ClassName AdmLocationPoint
+ * @Description: ADM字典查询
+ * @Author linhuili
+ * @Date 2021/8/31 18:34
+ * @Version V1.0
+ **/
+@Data
+public class AdmDict {
+
+  private String type;
+}

+ 25 - 0
src/main/java/com/persagy/proxy/adm/model/AdmDictBatch.java

@@ -0,0 +1,25 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @ClassName AdmDictBatch
+ * @Description: 批量处理字典信息操作:方案设定
+ * @Author linhuili
+ * @Date 2021/8/31 18:34
+ * @Version V1.0
+ **/
+@Data
+public class AdmDictBatch {
+
+    /** 方案 id */
+    private String schemeId;
+
+    /** 优先级列表 */
+    private String priorityList;
+
+    /** 一级标签名称列表 */
+    private List<String> firstNameList;
+}

+ 18 - 0
src/main/java/com/persagy/proxy/adm/model/AdmDictQueryCriteria.java

@@ -0,0 +1,18 @@
+package com.persagy.proxy.adm.model;
+
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import lombok.Data;
+
+/**
+ * @ClassName AdmEquipFamilyCategory
+ * @Description: 字典查询通用条件
+ * @Author linhuili
+ * @Date 2021/9/1 18:05
+ * @Version V1.0
+ **/
+@Data
+public class AdmDictQueryCriteria extends AdmQueryCriteria {
+
+    /** 查询类型 */
+    private String type;
+}

+ 19 - 0
src/main/java/com/persagy/proxy/adm/model/AdmEquipFamilyCategory.java

@@ -0,0 +1,19 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+/**
+ * @ClassName AdmEquipFamilyCategory
+ * @Description: ADM设备族
+ * @Author linhuili
+ * @Date 2021/9/1 14:05
+ * @Version V1.0
+ **/
+@Data
+public class AdmEquipFamilyCategory {
+  /** 族编码 */
+  private String family;
+
+  /** 族名称 */
+  private String familyName;
+}

+ 32 - 0
src/main/java/com/persagy/proxy/adm/model/AdmModelRel.java

@@ -0,0 +1,32 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+/**
+ * @ClassName AdmLocationPoint
+ * @Description: ADM点位坐标实体类
+ * @Author linhuili
+ * @Date 2021/8/31 14:34
+ * @Version V1.0
+ **/
+@Data
+public class AdmModelRel {
+
+    /** 旧的BIMID */
+    private String oldBimId;
+
+    /** BIMID */
+    private String bimId;
+
+    /** 楼层id */
+    private String floorId;
+
+    /** 楼层平面图地址 */
+    private String floorMap;
+
+    /** 模型id */
+    private String modelId;
+
+    /** 自定义属性 */
+    private String attributeMap;
+}

+ 126 - 0
src/main/java/com/persagy/proxy/adm/model/AdmObjectInfo.java

@@ -0,0 +1,126 @@
+package com.persagy.proxy.adm.model;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class AdmObjectInfo {
+
+    /** 全局id */
+    private String id;
+
+    /** 类型编码 */
+    private String classCode;
+
+    /** 动静分类:静态STATIC,脉冲PULSE,阶段GRADATION,时序SEQUENTIAL */
+    private String category;
+
+    /** 信息点编码 */
+    private String code;
+
+    /** 信息点名称 */
+    private String name;
+
+    /** 分类:commo平台级, group集团级, project项目级 */
+    private String type="project";
+
+    /** 集团id, 默认为"0" */
+    private String groupCode;
+
+    /** 项目id, 默认为"0" */
+    private String projectId;
+
+    /** 数据类型 */
+    private String dataType;
+
+    /** 数据格式 */
+    private String formater;
+
+    /** 数据格式 */
+    private ArrayList<JsonNode> dataSource;
+
+    /** 输入方式 */
+    private String inputMode;
+
+    /** 一级标签 */
+    private String firstTag;
+
+    /** 一级名称 */
+    private String firstName;
+
+    /** 二级标签 */
+    private String secondTag;
+
+    /** 二级名称 */
+    private String secondName;
+
+    /** 序列 */
+    private String idx;
+
+    /** 优先级,重要程度 */
+    private String priority;
+
+    /** 单位 */
+    private String unit;
+
+    /** 备注 */
+    private String note;
+
+    /** 输入类型 */
+    private String origDataType;
+
+    /** 旧信息点编码 */
+    private String origCode;
+
+    /** 别编码 */
+    private String aliasCode;
+
+    /** 别名称 */
+    private String aliasName;
+
+    /** 是否分类标签 */
+    private String canSub;
+
+    /** 是否复数 */
+    private Boolean isMultiple;
+
+    /** 是否复数-字段兼容 */
+    private Boolean multiple;
+
+    /** 是否区间 */
+    private Boolean isRegion;
+
+    /** 是否区间-字段兼容 */
+    private Boolean region;
+
+    /** 子分类标记 */
+    private Boolean subFlag;
+
+    /** 是否只读, 如果是则不允许对该信息点做变更 */
+    private Boolean readonly;
+
+    /** 排序 */
+    private Integer sort;
+
+    /** 是否显示 */
+   private Boolean visible;
+
+    /** 是否编辑 */
+    private Boolean editable;
+
+    /** 禁止操作 */
+    private Boolean unDisabled;
+
+    /** 关键信息点 */
+    private Boolean keyWord;
+
+    /**路径 :
+     * 若firstName == "基本信息"|| firstName.isNullOrEmpty()||firstName == "基本参数 path为code编码,否则,path为infos.$code */
+    private String path;
+
+    /** 字典内容 */
+    private List<AdmObjectInfo> content;
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/model/AdmObjectType.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName AdmObjectType
+ * @Description: ADM对象类型查询
+ * @Author linhuili
+ * @Date 2021/8/31 20:34
+ * @Version V1.0
+ **/
+@Data
+public class AdmObjectType {
+
+    /** 全局id */
+    private String id;
+
+    /** 编码 */
+    private String code;
+
+    /** 名称 */
+    private String name;
+
+    /** 别编码 */
+    private String aliasCode;
+
+    /** 别编名 */
+    private String aliasName;
+
+    /** 分类:common平台级, group集团级, project项目级 */
+    private String type;
+
+    /** 集团id, 默认为 '0' */
+    private String groupCode;
+
+    /** 项目id, 默认为 '0' */
+    private String projectId;
+
+    /** 上级类型编码 */
+    private String parentCode;
+
+    /** 专业编码 */
+    private String majorCode;
+
+    /** 系统编码 */
+    private String systemCode;
+
+    /** 部件所属的设备类型 */
+    private String equipmentCode;
+
+    /** 对象类型 */
+    private String objType;
+
+    /** 子列表 */
+    private List<AdmObjectType> children;
+}

+ 65 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmDictBaseService.java

@@ -0,0 +1,65 @@
+package com.persagy.proxy.adm.service;
+
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.proxy.adm.model.AdmDict;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+
+import java.util.List;
+
+/**
+ * @ClassName IAdmDictService
+ * @Description: 字典查询
+ * @Author linhuili
+ * @Date 2021/8/31 14:30
+ * @Version V1.0
+ **/
+public interface IAdmDictBaseService<T>{
+
+    /**
+     * 查询DMP字典数据
+     * @param context
+     * @param dmpRequest
+     * @param clazz
+     * @return
+     */
+    AdmResponse doQueryDictData(InstanceUrlParam context, QueryCriteria dmpRequest, Class<T> clazz);
+
+    /**
+     * 查询DMP对象类型
+     * @param context
+     * @param dmpRequest
+     * @param clazz
+     * @return
+     */
+    AdmResponse doQueryObjectType(InstanceUrlParam context, QueryCriteria dmpRequest, Class<T> clazz);
+
+
+    /**
+     * 查询DMP对象信息点
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     */
+    AdmResponse doQueryObjectInfo(InstanceUrlParam context, AdmQueryCriteria request,String fieldName, Class<T> clazz);
+
+
+    /**
+     * 修改信息点
+     * @param context
+     * @param clazz
+     * @param voList
+     * @return
+     */
+    List<T> doUpdateObjectInfo(InstanceUrlParam context, Class<T> clazz, List<T> voList);
+    /**
+     * 删除信息点
+     * @param context
+     * @param voList
+     */
+    void doDeleteObjectInfo(InstanceUrlParam context, List<T> voList);
+
+
+}

+ 49 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmDictService.java

@@ -0,0 +1,49 @@
+package com.persagy.proxy.adm.service;
+
+import com.persagy.proxy.adm.model.AdmDict;
+import com.persagy.proxy.adm.model.AdmDictQueryCriteria;
+import com.persagy.proxy.adm.model.AdmLocationPoint;
+import com.persagy.proxy.adm.model.AdmObjectInfo;
+import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+
+/**
+ * @ClassName IAdmDictService
+ * @Description: 字典查询
+ * @Author linhuili
+ * @Date 2021/8/31 14:30
+ * @Version V1.0
+ **/
+public interface IAdmDictService<T> {
+
+    /**
+     * 查询字典分类
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     * @throws Exception
+     */
+    AdmResponse queryCategory(InstanceUrlParam context , AdmDict request, Class<T> clazz) throws Exception;
+
+
+    /**
+     * 重置项目下的定制信息点
+     * @param context
+     * @param clazz
+     * @return
+     * @throws Exception
+     */
+    AdmResponse resetDic(InstanceUrlParam context , AdmDictQueryCriteria request ,String fieldName, Class<T> clazz) throws Exception;
+
+    /**
+     * 设置-项目定制化字典
+     * @param context
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    AdmResponse settingDicProject(InstanceUrlParam context , AdmCreateRequest<AdmObjectInfo> request, Class<T> clazz) throws Exception;
+
+}

+ 13 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmModelRelService.java

@@ -0,0 +1,13 @@
+package com.persagy.proxy.adm.service;
+
+import com.persagy.proxy.adm.model.AdmLocationPoint;
+
+/**
+ * @ClassName IAdmModelRelService
+ * @Description: 模型修改设备元空间的建筑楼层信息
+ * @Author linhuili
+ * @Date 2021/8/31 14:30
+ * @Version V1.0
+ **/
+public interface IAdmModelRelService extends IAdmBaseService<AdmLocationPoint>{
+}

+ 254 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmDictBaseServiceImpl.java

@@ -0,0 +1,254 @@
+package com.persagy.proxy.adm.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.basic.utils.JsonNodeUtils;
+import com.persagy.dmp.common.utils.JsonHelper;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.constant.AdmDictConstant;
+import com.persagy.proxy.adm.constant.enums.ValidEnum;
+import com.persagy.proxy.adm.model.AdmObjectInfo;
+import com.persagy.proxy.adm.model.AdmObjectType;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.IAdmDictBaseService;
+import com.persagy.proxy.adm.utils.AdmEntityTransferUtil;
+import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
+import com.persagy.proxy.common.client.DmpDicClient;
+import com.persagy.proxy.common.client.DmpRwdClient;
+import com.persagy.proxy.common.entity.DmpResult;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName AbstractAdmDictBaseServiceImpl
+ * @Description: 字典查询
+ * @Author linhuili
+ * @Date 2021/8/31 18:21
+ * @Version V1.0
+ **/
+@Slf4j
+public class AbstractAdmDictBaseServiceImpl<T> implements IAdmDictBaseService<T> {
+
+    @Autowired
+    private DmpRwdClient rwdClient;
+
+    @Autowired
+    private DmpDicClient dicClient;
+
+    /**
+     * 查询DMP字典数据
+     * @param context
+     * @param dmpRequest
+     * @param clazz
+     * @return
+     */
+    @Override
+    public AdmResponse doQueryDictData(InstanceUrlParam context,QueryCriteria dmpRequest, Class<T> clazz) {
+        // 转换参数
+        JSONObject para = null;
+        try {
+            para = JsonHelper.toJSONObject(dmpRequest);
+        } catch (IOException e) {
+            log.error(e.getMessage(), e);
+            return null;
+        }
+        // 调用中台查询
+        DmpResult<JSONArray> dmpResult = dicClient.queryDictData(context, para);
+        List<AdmObjectType> admVOs = dictDataVOTransfer(dmpResult.getData());
+        // 设置返回值
+        AdmResponse response = AdmResponse.success(admVOs);
+        Long total = dmpResult.getCount() == null ? null : dmpResult.getCount().longValue();
+        response.setTotal(total);
+        return response;
+    }
+
+
+    /**
+     * 查询DMP对象类型
+     * @param context
+     * @param dmpRequest
+     * @param clazz
+     * @return
+     */
+    @Override
+    public AdmResponse doQueryObjectType(InstanceUrlParam context,QueryCriteria dmpRequest, Class<T> clazz) {
+        // 转换参数
+        JSONObject para = null;
+        try {
+            para = JsonHelper.toJSONObject(dmpRequest);
+        } catch (IOException e) {
+            log.error(e.getMessage(), e);
+            return null;
+        }
+        // 调用中台查询
+        DmpResult<JSONArray> dmpResult = rwdClient.queryObjectType(context, para);
+        JSONArray data = dmpResult.getData();
+        List<T> admVOs = data.toJavaList(clazz);
+        // 设置返回值
+        AdmResponse response = AdmResponse.success(admVOs);
+        Long total = dmpResult.getCount() == null ? null : dmpResult.getCount().longValue();
+        response.setTotal(total);
+        return response;
+    }
+
+    /**
+     * 查询对象信息点
+     * @param request
+     * @return
+     */
+    @Override
+    public AdmResponse doQueryObjectInfo(InstanceUrlParam context, AdmQueryCriteria request,String fieldName, Class<T> clazz) {
+        // 转换为数据中台查询条件
+        QueryCriteria dmpRequest = toDmpCriteria(request,fieldName);
+        // 转换参数
+        JSONObject para = null;
+        try {
+            para = JsonHelper.toJSONObject(dmpRequest);
+        } catch (IOException e) {
+            log.error(e.getMessage(), e);
+            return null;
+        }
+        // 调用中台查询
+        DmpResult<JSONArray> dmpResult = rwdClient.queryObjectInfo(context, para);
+        List<T> admVOs = AdmEntityTransferUtil.toAdmMultiEntity(dmpResult.getData(), request.getProjection(), clazz);
+        // BDTP信息点格式与ADM兼容处理
+        handleObjectInfoResult((List<AdmObjectInfo>) admVOs);
+        // 设置返回值
+        AdmResponse response = AdmResponse.success(admVOs);
+        Long total = dmpResult.getCount() == null ? null : dmpResult.getCount().longValue();
+        response.setTotal(total);
+        response.setPageNumber(request.getPageNumber());
+        response.setPageSize(request.getPageSize());
+        return response;
+    }
+
+    /**
+     * 修改
+     * @param context
+     * @param clazz
+     * @param voList
+     * @return
+     */
+    @Override
+    public List<T> doUpdateObjectInfo(InstanceUrlParam context, Class<T> clazz, List<T> voList) {
+        if(CollUtil.isEmpty(voList)) {
+            return null;
+        }
+        ArrayNode vos = JsonNodeUtils.toArrayNode(voList, null, null);
+        // 调用中台修改
+        DmpResult<cn.hutool.json.JSONArray> response = rwdClient.batchUpdateObjectInfo(context, JSONArray.parseArray(vos.toString()));
+        if(!DmpResult.SUCCESS.equals(response.getResult())) {
+            throw new RuntimeException("调用中台查询接口出错:" + response.getMessage());
+        }
+        // 转换为结果
+        return AdmEntityTransferUtil.toAdmMultiEntity(response.getData(), null, clazz);
+    }
+
+    /**
+     * 删除信息点
+     * @param context
+     * @param voList
+     * @return
+     */
+    @Override
+    public void doDeleteObjectInfo(InstanceUrlParam context, List<T> voList) {
+        if(CollUtil.isEmpty(voList)) {
+            return;
+        }
+        List<String> idList = CollUtil.getFieldValues(voList, "id", String.class);
+        // 调用中台修改
+        DmpResult response = rwdClient.batchDeleteObjectInfo(context, idList);
+        if(!DmpResult.SUCCESS.equals(response.getResult())) {
+            throw new RuntimeException("调用中台查询接口出错:" + response.getMessage());
+        }
+    }
+
+    /**
+     * 信息点格式与ADM兼容处理
+     * @param admVOs
+     */
+    private void handleObjectInfoResult(List<AdmObjectInfo> admVOs){
+        for (AdmObjectInfo admVO : admVOs) {
+            admVO.setFirstName(admVO.getFirstTag());
+            admVO.setSecondName(admVO.getSecondTag());
+            admVO.setMultiple(admVO.getIsMultiple());
+            admVO.setRegion(admVO.getIsRegion());
+
+            //path路径处理
+            if(StringUtils.isEmpty(admVO.getFirstName()) || AdmDictConstant.FIRST_BASE_TAG.equals(admVO.getFirstName())
+                    || AdmDictConstant.HIS_FIRST_BASE_TAG.equals(admVO.getFirstName())){
+                admVO.setPath(admVO.getCode());
+            }else{
+                admVO.setPath(AdmDictConstant.INFOS_EX+admVO.getCode());
+            }
+        }
+    }
+
+    /**
+     * 字典数据格式与ADM兼容
+     * @param array
+     */
+    private List<AdmObjectType> dictDataVOTransfer(JSONArray array){
+        List<AdmObjectType> result = new ArrayList<>();
+        if(CollUtil.isEmpty(array)){
+            return result;
+        }
+        ArrayNode dataNode = JsonNodeUtils.toArrayNode(array, null, null);
+        for (JsonNode dicData : dataNode) {
+            AdmObjectType objectType = new AdmObjectType();
+            objectType.setCode(dicData.get("code").textValue());
+            objectType.setName(dicData.get("label").textValue());
+            objectType.setAliasCode(dicData.get("code").textValue());
+            objectType.setAliasName(dicData.get("label").textValue());
+            objectType.setObjType(dicData.get("type").textValue());
+            result.add(objectType);
+        }
+        return result;
+    }
+
+    /**
+     * 将ADM的查询条件转换为DMP的
+     * 调用前注意:
+     * - 调用前将name赋值,才会将条件中adm的属性替换为dmp的属性
+     * - 统计查询时将isOnlyCount设置为true
+     * 调用后注意(需要调用者自行处理的):
+     * - 不处理级联,级联应在调用者里处理级联调用转换后查询赋值
+     * - 不处理projection,查询后自行根据projection筛选返回属性。(dmp只能指定扩展属性,而adm的是针对所有属性的)
+     * @param admCriteria
+     * @return
+     */
+    public static QueryCriteria toDmpCriteria(AdmQueryCriteria admCriteria,String fieldName) {
+        QueryCriteria dmpCriteria = new QueryCriteria();
+        // 拷贝分页
+        AdmQueryCriteriaHelper.copyPageInfo(admCriteria, dmpCriteria);
+        // 处理filters
+        dmpCriteria.setCriteria(AdmQueryCriteriaHelper.toCriteria(admCriteria.getName(), admCriteria.getFilters()));
+        if(StrUtil.isNotEmpty(admCriteria.getName())){
+            // 处理name
+            dmpCriteria.getCriteria().put(fieldName, admCriteria.getName());
+        }
+        dmpCriteria.getCriteria().put(AdmCommonConstant.VALID,ValidEnum.TRUE.getValue());
+        // 处理排序
+        dmpCriteria.setOrders(AdmQueryCriteriaHelper.toOrderItem(admCriteria.getOrders()));
+        // 处理统计
+        dmpCriteria.setOnlyCount(admCriteria.isOnlyCount());
+        return dmpCriteria;
+    }
+
+}

+ 302 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AdmDictServiceImpl.java

@@ -0,0 +1,302 @@
+package com.persagy.proxy.adm.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+
+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.constant.enums.AdmDictCategoryEnum;
+import com.persagy.proxy.adm.model.*;
+import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.IAdmDictService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName AdmDictServiceImpl
+ * @Description: 字典查询
+ * @Author linhuili
+ * @Date 2021/8/31 18:21
+ * @Version V1.0
+ **/
+@Service
+@Slf4j
+public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> implements IAdmDictService<T> {
+
+    /**
+     * 字典类型查询:所有设备类型、部件类型、系统类型、专业类型
+     * 查询类型:输入设备类型:equipment,输入部件类型:component,输入系统类型:system,输入专业类型:major,业务空间类型 space ,资产 property,
+     *         专业和系统:majorSystem(树),设备和部件equipmentAndComponent,设备类型要以及对应的部件equipmentComponent(树),
+     *         专业下的设备类型 majorEquipment (树),专业下的系统,系统下的设备majorSystemEquip (树),systemEquip 系统下的设备类(树)
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public AdmResponse queryCategory(InstanceUrlParam context , AdmDict request, Class<T> clazz) throws Exception {
+        String type = request.getType();
+        QueryCriteria criteria = new QueryCriteria();
+        ObjectNode node = JsonNodeFactory.instance.objectNode();
+        if(AdmDictCategoryEnum.MAJOR.getValue().equals(type)){
+            //查询专业分类
+            node.put("type",AdmDictCategoryEnum.MAJOR.getValue());
+            criteria.setCriteria(node);
+            return doQueryDictData(context, criteria, clazz);
+        }
+
+        List<String> baseCategory = getDictBaseCategory();
+        if(baseCategory.contains(type)){
+            //查询设备类型:equipment,部件类型:component,输入系统类型:system,输入专业类型:major,业务空间类型 space ,资产 property
+            node.put("objType",type);
+            criteria.setCriteria(node);
+            return doQueryObjectType(context, criteria, clazz);
+        }
+
+        if(AdmDictCategoryEnum.EQUIPMENT_AND_COMPONENT.getValue().equals(type)){
+            //查询设备类型:equipment,部件类型:component,输入系统类型:system,输入专业类型:major,业务空间类型 space ,资产 property
+            List<String> objTypes = new ArrayList<>();
+            objTypes.add(AdmDictCategoryEnum.EQUIPMENT.getValue());
+            objTypes.add(AdmDictCategoryEnum.COMPONENT.getValue());
+            node.put("objType",objTypes.toString());
+            criteria.setCriteria(node);
+            return doQueryObjectType(context, criteria, clazz);
+        }
+        List<String> dictTreeCategory = getDictTreeCategory();
+        if(dictTreeCategory.contains(type)){
+            //查询树形结构:专业和系统:majorSystem(树),设备类型要以及对应的部件equipmentComponent(树),专业下的设备类型 majorEquipment(树),
+            //专业下的系统,系统下的设备majorSystemEquip (树),systemEquip 系统下的设备类(树)
+            return queryDictObjectTypeTree(context ,type,clazz);
+        }
+        return null;
+    }
+
+
+    /**
+     * 查询字典树
+     * @param context
+     * @param type
+     * @param clazz
+     */
+    private AdmResponse queryDictObjectTypeTree(InstanceUrlParam context ,String type, Class<T> clazz){
+        //查询所有的专业
+        List<AdmObjectType> allMajor = getAllMajor(context, clazz);
+
+        //查询所有的类型
+        AdmResponse admResponse = doQueryObjectType(context, new QueryCriteria(), clazz);
+        List<AdmObjectType> objectTypes = (List<AdmObjectType>) admResponse.getContent();
+        Map<String, List<AdmObjectType>> objectTypeMap = objectTypes.stream().filter(k-> StringUtils.isNotEmpty(k.getObjType()))
+                                                         .collect(Collectors.groupingBy(AdmObjectType::getObjType));
+        //获取专业-设备类关系
+        List<AdmObjectType> equipments = objectTypeMap.get(AdmDictCategoryEnum.EQUIPMENT.getValue());
+        Map<String,List<AdmObjectType>> majorEquipMap = equipments.stream().collect(Collectors.groupingBy(item -> item.getMajorCode()));
+
+        //获取专业-系统类关系
+        List<AdmObjectType> systems = objectTypeMap.get(AdmDictCategoryEnum.SYSTEM.getValue());
+        Map<String, List<AdmObjectType>> majorSystemMap = systems.stream().collect(Collectors.groupingBy(item -> item.getMajorCode()));
+
+        //获取系统-设备类关系
+        Map<String, List<AdmObjectType>> systemEquipMap = equipments.stream().collect(Collectors.groupingBy(item -> item.getSystemCode()));
+
+        //获取设备类-部件关系
+        List<AdmObjectType> components = objectTypeMap.get(AdmDictCategoryEnum.COMPONENT.getValue());
+        Map<String, List<AdmObjectType>> equipComponentMap = components.stream().collect(Collectors.groupingBy(item -> item.getEquipmentCode()));
+
+        List<AdmObjectType> content = new ArrayList<>();
+        if(AdmDictCategoryEnum.MAJOR_SYSTEM.getValue().equals(type)){
+            //查询专业下的系统
+            content = buildDictTree(allMajor,majorSystemMap,null);
+        }
+        if(AdmDictCategoryEnum.SYSTEM_EQUIP.getValue().equals(type)){
+            //查询系统下的设备类
+            content = buildDictTree(systems,systemEquipMap,null);
+        }
+        if(AdmDictCategoryEnum.MAJOR_SYSTEM_EQUIP.getValue().equals(type)){
+            //专业下的系统,系统下的设备
+            content = buildDictTree(allMajor,majorSystemMap,systemEquipMap);
+        }
+        if(AdmDictCategoryEnum.MAJOR_EQUIPMENT.getValue().equals(type)){
+            //查询专业下的设备类
+            content = buildDictTree(allMajor,majorEquipMap,null);
+        }
+        if(AdmDictCategoryEnum.EQUIPMENT_COMPONENT.getValue().equals(type)){
+            //查询设备类下的部件
+            content = buildDictTree(equipments,equipComponentMap,null);
+        }
+        // 设置返回值
+        AdmResponse response = AdmResponse.success(content);
+        response.setTotal(Long.valueOf(content.size()));
+        return response;
+    }
+
+    /**
+     * 构建专业-系统-设备类树形结构
+     * @param allMajor
+     * @param majorSystemMap
+     * @param systemEquipMap
+     * @return
+     */
+    private ArrayList<AdmObjectType> buildDictTree(List<AdmObjectType> allMajor,Map<String, List<AdmObjectType>> majorSystemMap,Map<String, List<AdmObjectType>> systemEquipMap){
+        ArrayList<AdmObjectType> result = new ArrayList<>();
+        if(CollUtil.isEmpty(allMajor)){
+            return result;
+        }
+        //构建专业-系统-设备类树形结构
+        for (AdmObjectType major : allMajor) {
+             //设置专业
+            if(CollUtil.isNotEmpty(majorSystemMap)){
+                //专业下的系统
+                List<AdmObjectType> systemCodes = majorSystemMap.get(major.getCode());
+                major.setChildren(systemCodes);
+                //系统下的设备类
+                if(CollUtil.isNotEmpty(systemEquipMap) && CollUtil.isNotEmpty(systemCodes)){
+                    for (AdmObjectType systemType : systemCodes) {
+                        systemType.setChildren(systemEquipMap.get(systemType.getCode()));
+                    }
+                }
+            }
+            result.add(major);
+        }
+        return result;
+    }
+
+    /**
+     * 获取所有的专业
+     * @param context
+     * @param clazz
+     * @return
+     */
+    private List<AdmObjectType> getAllMajor(InstanceUrlParam context, Class<T> clazz){
+        //查询专业分类
+        QueryCriteria criteria = new QueryCriteria();
+        ObjectNode node = JsonNodeFactory.instance.objectNode();
+        node.put("type",AdmDictCategoryEnum.MAJOR.getValue());
+        criteria.setCriteria(node);
+        AdmResponse admResponse = doQueryDictData(context, criteria, clazz);
+        List<AdmObjectType> content = (List<AdmObjectType>) admResponse.getContent();
+        return content;
+    }
+
+    /**
+     * 基础数据类型
+     * @return
+     */
+    private List<String> getDictBaseCategory(){
+        List<String> category = new ArrayList<>();
+        category.add(AdmDictCategoryEnum.EQUIPMENT.getValue());
+        category.add(AdmDictCategoryEnum.COMPONENT.getValue());
+        category.add(AdmDictCategoryEnum.SYSTEM.getValue());
+        category.add(AdmDictCategoryEnum.SPACE.getValue());
+        category.add(AdmDictCategoryEnum.PROPRTY.getValue());
+        return category;
+    }
+
+    /**
+     * 查询字典树形结构
+     * @return
+     */
+    private List<String> getDictTreeCategory(){
+        List<String> category = new ArrayList<>();
+        category.add(AdmDictCategoryEnum.MAJOR_SYSTEM.getValue());
+        category.add(AdmDictCategoryEnum.MAJOR_EQUIPMENT.getValue());
+        category.add(AdmDictCategoryEnum.MAJOR_SYSTEM_EQUIP.getValue());
+        category.add(AdmDictCategoryEnum.EQUIPMENT_COMPONENT.getValue());
+        category.add(AdmDictCategoryEnum.SYSTEM_EQUIP.getValue());
+        return category;
+    }
+
+    /**
+     * 重置项目下的信息点
+     * @param context
+     * @param clazz
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public AdmResponse resetDic(InstanceUrlParam context, AdmDictQueryCriteria request, String fieldName, Class<T> clazz) throws Exception {
+
+        //查询项目下点所有信息点
+        AdmResponse admResponse = doQueryObjectInfo(context, request, fieldName, clazz);
+        List<AdmObjectInfo> content = (List<AdmObjectInfo>) admResponse.getContent();
+        if(CollUtil.isEmpty(content)){
+            AdmResponse response = AdmResponse.success(new ArrayList<>());
+            response.setTotal(Long.valueOf(0));
+            return response;
+        }
+        //因BDTP根据项目查询信息点时返回的包含集团+通用信息点,需手动过滤除项目级的信息点
+        String projectId = context.getProjectId();
+
+        Iterator<AdmObjectInfo> infoIterator = content.iterator();
+        while (infoIterator.hasNext()){
+            String admProjectId = infoIterator.next().getProjectId();
+            if(StringUtils.isEmpty(admProjectId) || !projectId.equals(admProjectId)){
+                infoIterator.remove();
+            }
+        }
+        //删除信息点
+        doDeleteObjectInfo(context,(List<T>)content);
+        // 设置返回值
+        AdmResponse response = AdmResponse.success(content);
+        response.setTotal(Long.valueOf(content.size()));
+        return response;
+    }
+
+    /**
+     * 设置-项目定制化字典
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public AdmResponse settingDicProject(InstanceUrlParam context, AdmCreateRequest<AdmObjectInfo> request, Class<T> clazz) throws Exception {
+        List<AdmObjectInfo> content = request.getContent();
+        //信息点转换为中台格式
+        List<AdmObjectInfo> dmpObjectInfo = new ArrayList<>();
+        objectInfosTransforDmp(content, dmpObjectInfo ,context.getProjectId());
+        request.setContent(dmpObjectInfo);
+
+        //修改项目级信息点
+        List<T> vos = doUpdateObjectInfo(context, clazz, (List<T>) dmpObjectInfo);
+        return AdmResponse.success(vos);
+    }
+
+    /**
+     * 信息点转换为中台格式
+     * @param content
+     * @param dmpObjectInfos
+     */
+    private void objectInfosTransforDmp(List<AdmObjectInfo> content,List<AdmObjectInfo> dmpObjectInfos,String projectId){
+        if(CollUtil.isEmpty(content)){
+            return;
+        }
+        for (AdmObjectInfo admObjectInfo : content) {
+            admObjectInfo.setProjectId(projectId);
+            if(admObjectInfo.getMultiple() != null){
+                admObjectInfo.setIsMultiple(admObjectInfo.getMultiple());
+            }
+            if(admObjectInfo.getIsRegion() != null){
+                admObjectInfo.setIsRegion(admObjectInfo.getRegion());
+            }
+            if(StringUtils.isNotEmpty(admObjectInfo.getFirstName())){
+                admObjectInfo.setFirstTag(admObjectInfo.getFirstName());
+            }
+            if(StringUtils.isNotEmpty(admObjectInfo.getSecondName())){
+                admObjectInfo.setSecondTag(admObjectInfo.getSecondName());
+            }
+            admObjectInfo.setType(null);
+            dmpObjectInfos.add(admObjectInfo);
+            //处理子级
+            List<AdmObjectInfo> sencondContent = admObjectInfo.getContent();
+            if(CollUtil.isNotEmpty(sencondContent)){
+                objectInfosTransforDmp(sencondContent,dmpObjectInfos,projectId);
+            }
+        }
+    }
+}

+ 18 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AdmModelRelServiceImpl.java

@@ -0,0 +1,18 @@
+package com.persagy.proxy.adm.service.impl;
+
+import com.persagy.proxy.adm.model.AdmLocationPoint;
+import com.persagy.proxy.adm.service.IAdmLocationPointService;
+import com.persagy.proxy.adm.service.IAdmModelRelService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @ClassName AdmModelRelServiceImpl
+ * @Description: 模型修改设备元空间的建筑楼层信息
+ * @Author linhuili
+ * @Date 2021/8/31 14:31
+ * @Version V1.0
+ **/
+@Service
+public class AdmModelRelServiceImpl extends AbstractAdmBaseServiceImpl<AdmLocationPoint> implements IAdmModelRelService {
+
+}

+ 3 - 3
src/main/java/com/persagy/proxy/adm/utils/AdmQueryCriteriaHelper.java

@@ -76,7 +76,7 @@ public class AdmQueryCriteriaHelper {
      * @param admCriteria
      * @param dmpCriteria
      */
-    private static void copyPageInfo(AdmQueryCriteria admCriteria, QueryCriteria dmpCriteria) {
+    public static void copyPageInfo(AdmQueryCriteria admCriteria, QueryCriteria dmpCriteria) {
         // 页码
         Integer pageNumber = admCriteria.getPageNumber();
         if(pageNumber == null || pageNumber < 1) {
@@ -95,7 +95,7 @@ public class AdmQueryCriteriaHelper {
      * 排序字符串转换为对象
      * @param orderStr
      */
-    private static List<OrderItem> toOrderItem(String orderStr) {
+    public static List<OrderItem> toOrderItem(String orderStr) {
         if(StrUtil.isBlank(orderStr)) {
             return null;
         }
@@ -126,7 +126,7 @@ public class AdmQueryCriteriaHelper {
      * @param filters
      * @return
      */
-    private static ObjectNode toCriteria(String name, String filters) {
+    public static ObjectNode toCriteria(String name, String filters) {
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
         // filters格式参考:http://doc.sagacloud.cn/doc/service/dev/lib/web/filters.html#%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6
         if(StrUtil.isBlank(filters)) {

+ 36 - 0
src/main/java/com/persagy/proxy/common/client/DmpDicClient.java

@@ -0,0 +1,36 @@
+package com.persagy.proxy.common.client;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.basic.config.DigitalFeignConfig;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.proxy.common.constant.DmpUrlConstant;
+import com.persagy.proxy.common.entity.DmpResult;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.common.entity.ObjRelationDTO;
+import com.persagy.proxy.common.entity.RelationDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+
+/**
+ *@description:数据中台dmp-dic 数据字典 接口feign
+ *@author:lgy
+ *@data:2021/8/11 14:56
+ */
+@FeignClient(name = "dmp-dic", configuration = DigitalFeignConfig.class)
+public interface DmpDicClient {
+
+     /**
+     * @description: 查询字典数据
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     */
+    @PostMapping(DmpUrlConstant.DIC_DATA_QUERY)
+    DmpResult<JSONArray> queryDictData(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONObject criteria);
+
+}

+ 37 - 0
src/main/java/com/persagy/proxy/common/client/DmpRwdClient.java

@@ -84,4 +84,41 @@ public interface DmpRwdClient {
      */
     @PostMapping(DmpUrlConstant.RELATION_CREATE)
     DmpResult createRelation(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody List<RelationDTO> createRelationList);
+
+    /**
+     * @description: 查询对象类型
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     */
+    @PostMapping(DmpUrlConstant.DEF_CLASS)
+    DmpResult<JSONArray> queryObjectType(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONObject criteria);
+
+    /**
+     * @description: 查询信息点
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     */
+    @PostMapping(DmpUrlConstant.DEF_FUNCID)
+    DmpResult<JSONArray> queryObjectInfo(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONObject criteria);
+
+    /**
+     * @description: 批量修改信息点
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     */
+    @PostMapping(DmpUrlConstant.DEF_FUNCID_UPDATE_BATCH)
+    DmpResult batchUpdateObjectInfo(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONArray objectArr);
+
+    /**
+     * @description: 批量删除信息点
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     */
+    @PostMapping(DmpUrlConstant.DEF_FUNCID_DEL_BATCH)
+    DmpResult<JSONArray> batchDeleteObjectInfo(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody List<String> objectIdList);
+
 }

+ 18 - 0
src/main/java/com/persagy/proxy/common/constant/DmpUrlConstant.java

@@ -76,6 +76,17 @@ public class DmpUrlConstant {
     public final static String DEF_FUNCID_CREATE = "/rwd/def/funcid/create";
 
     /**
+     * 批量修改信息点
+     */
+    public final static String DEF_FUNCID_UPDATE_BATCH = "/rwd/def/funcid/updateBatch";
+
+
+    /**
+     * 批量删除信息点
+     */
+    public final static String DEF_FUNCID_DEL_BATCH = "/rwd/def/funcid/deleteBatch";
+
+    /**
      * 类型查询
      */
     public final static String DEF_CLASS = "/rwd/def/class";
@@ -100,4 +111,11 @@ public class DmpUrlConstant {
     /**批量查询项目接口URI*/
     public static final  String OBJECT_BATCH_QUERY_PROJECT_BY_IDS = "/rwd/instance/object/batchQueryProjectByIds";
 
+    // ==================中台知识库=========================================================================
+
+    /**
+     * 字典数据查询
+     */
+    public static final String DIC_DATA_QUERY = "/dic/dt/data/query";
+
 }