瀏覽代碼

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/digital-delivery

zhaoyk 2 年之前
父節點
當前提交
9d2d403bb2
共有 19 個文件被更改,包括 233 次插入79 次删除
  1. 2 2
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/calculation/model/AdmRelationAddRequest.java
  2. 10 7
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/calculation/service/impl/AdmManualRelCalServiceImpl.java
  3. 1 2
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AbstractAdmDictBaseServiceImpl.java
  4. 16 0
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java
  5. 2 1
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/constant/MiGrationRelCode.java
  6. 0 29
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/constant/MigrationObjType.java
  7. 1 2
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java
  8. 17 0
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationAbstractServiceImpl.java
  9. 13 16
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectDigitalMigration.java
  10. 2 0
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/model/AdmObjectInfo.java
  11. 6 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/constant/AdmServerConstant.java
  12. 35 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/constant/DeliveryWayEnum.java
  13. 26 6
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/controller/AdmModelController.java
  14. 1 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/domain/DeliverPlanVo.java
  15. 25 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/domain/QueryScopeOfDeliverVo.java
  16. 21 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/domain/ScopeOfDeliverVo.java
  17. 10 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/service/AdmModelService.java
  18. 41 14
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/service/impl/AdmModelServiceImpl.java
  19. 4 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/auth/domain/LoginVo.java

+ 2 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/calculation/model/AdmRelationAddRequest.java

@@ -34,7 +34,7 @@ public class AdmRelationAddRequest implements Serializable {
     @JSONField(name = "graphicType",alternateNames = {"parentCode","graphic_type"})
     private String graphicType;
 
-    /** 交付范围 0项目交付,1现场交付**/
-    private Integer deliveryType;
+    /** 是否仅查看项目交付范围内数据:0/null-否 1-是 **/
+    private Integer isDelivery;
 
 }

+ 10 - 7
adm-business/adm-middleware/src/main/java/com/persagy/proxy/calculation/service/impl/AdmManualRelCalServiceImpl.java

@@ -156,7 +156,7 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
             }
         }
         //验证 项目交付范围
-        Integer flag = validRelCollect(context, relationTypeEnum, request.getDeliveryType(), mainResultData, fromResultData);
+        Integer flag = validRelCollect(context, relationTypeEnum, request.getIsDelivery(), mainResultData, fromResultData);
         switch (flag){
             case 1 : return AdmCreateResponse.failure(mainResultData +":不存在","1");
             case 2 : return AdmCreateResponse.failure(fromResultData +":不存在","2");
@@ -518,22 +518,23 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
      * @param fromResultData 从对象
      * @return 0 成功; 1 主对象为空; 2 从对象为空; 3 不在项目交付范围内
      **/
-    private Integer validRelCollect(InstanceUrlParam context, AdmRelationTypeEnum relationTypeEnum , Integer deliveryType, List<ObjectNode> mainResultData, List<ObjectNode> fromResultData){
+    private Integer validRelCollect(InstanceUrlParam context, AdmRelationTypeEnum relationTypeEnum , Integer isDelivery, List<ObjectNode> mainResultData, List<ObjectNode> fromResultData){
         if(CollUtil.isEmpty(mainResultData)){
             return 1;
         }
         if(CollUtil.isEmpty(fromResultData)){
             return 2;
         }
-        if(deliveryType != null){
+        if(isDelivery != null && isDelivery == 1){
             QueryCriteria queryCriteria = new QueryCriteria();
             ObjectNode objectNode = JsonNodeFactory.instance.objectNode();
             objectNode.put("projectId", context.getProjectId());
             objectNode.put("relCode", relationTypeEnum.getRelCode());
             objectNode.put("graphCode", relationTypeEnum.getGraphCode());
-            objectNode.put("deliveryType",deliveryType);
+            objectNode.put("deliveryType",0);
+            objectNode.put("valid",1);
             queryCriteria.setCriteria(objectNode);
-            List<RelationDefineCollect> relationDefineCollects = relationReportService.doQueryRelationDefineCollectList(context, queryCriteria);
+             List<RelationDefineCollect> relationDefineCollects = relationReportService.doQueryRelationDefineCollectList(context, queryCriteria);
             if(CollUtil.isEmpty(relationDefineCollects)){
                 return 3;
             }
@@ -558,13 +559,15 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
                 ArrayNode endTypeCodes = collect.getEndTypeCodes();
                 Set<String> endTypeCodeSet = CollUtil.newHashSet();
                 endTypeCodes.forEach(classCode -> endTypeCodeSet.add(classCode.isTextual() ? classCode.asText() : ""));
-                if(sourceTypeCodeSet.contains(mainSet) && endTypeCodeSet.contains(endTypeCodeSet)){
+                if(sourceTypeCodeSet.containsAll(mainSet) && endTypeCodeSet.containsAll(fromSet)){
                     return 0;
                 }
-                if(sourceTypeCodeSet.contains(endTypeCodes) && endTypeCodeSet.contains(mainSet)){
+                if(sourceTypeCodeSet.containsAll(fromSet) && endTypeCodeSet.containsAll(mainSet)){
                     return 0;
                 }
             }
+        }else{
+            return 0;
         }
         return 3;
     }

+ 1 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AbstractAdmDictBaseServiceImpl.java

@@ -208,7 +208,7 @@ public class AbstractAdmDictBaseServiceImpl<T> implements IAdmDictBaseService<T>
             admVO.setRegion(admVO.getIsRegion());
             admVO.setGroupCode(AppContext.getContext().getGroupCode());
             admVO.setSort(admVO.getShowOrder());
-
+            admVO.setNote(admVO.getRemark() == null ? "" :admVO.getRemark());
             //path路径处理
             handleObjectInfoPath(admVO);
             //信息点是否可见设置默认值
@@ -411,7 +411,6 @@ public class AbstractAdmDictBaseServiceImpl<T> implements IAdmDictBaseService<T>
         for(AdmObjectType admObjectType : typeList){
             if(collectMap.containsKey(admObjectType.getId())){
                 ObjectTypeCollect collect = collectMap.get(admObjectType.getId());
-                admObjectType.setDeliveryType(collect.getDeliveryType());
                 admObjectType.setIsDelivery(collect.getIsDelivery());
             }
         }

+ 16 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java

@@ -91,6 +91,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         //获取交付范围内的设备
         QueryCriteria criteriaCollect = new QueryCriteria();
         ObjectNode nodeCol = JsonNodeFactory.instance.objectNode();
+        nodeCol.put("deliveryType", 0);
         nodeCol.put("objType", type);
         nodeCol.put("projectId", context.getProjectId());
         criteriaCollect.setCriteria(nodeCol);
@@ -403,6 +404,11 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         //查询类型下的所有信息点信息
         AdmResponse admResponse = doQueryObjectInfo(context, request, AdmDictConstant.CLASS_CODE, clazz);
         List<AdmObjectInfo> admObjectInfos = (List<AdmObjectInfo>) admResponse.getContent();
+        //项目信息点 进行定制过滤
+        if(request.getType().equals(AdmProject.OBJ_TYPE)){
+            admObjectInfos = filterInfosForProject(admObjectInfos);
+            admResponse.setTotal(admObjectInfos.size()*1L);
+        }
         admObjectInfos = sortFuncidForEdit(admObjectInfos);
         //查询平台级信息点采集信息
         List<ObjectInfoCollect> commonObjectInfoCollect = queryObjectInfoCollect(context, "common", request.getType(), clazz);
@@ -624,6 +630,16 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         return resultOrders;
     }
 
+    /** 项目需要展示的信息点**/
+    private List<AdmObjectInfo> filterInfosForProject(List<AdmObjectInfo> list){
+        if(CollUtil.isEmpty(list)){
+            return Collections.emptyList();
+        }
+        List<String> projectCodes = Arrays.asList("businessOpeningTime","owner","property","designer","constructor","longitude",
+                "latitude","sFI","address","projUnderfloorNum","fireResistanceLev","projNeighborLocationMap","projLogo","projIntro",
+                "projHeight","projFuncType","projCoverArea","projCityLocationMap","projArea","assetManager");
+        return list.stream().filter(info -> projectCodes.contains(info.getCode())).collect(Collectors.toList());
+    }
     /**
      * 统计类型下的非静态信息点
      * @param context

+ 2 - 1
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/constant/MiGrationRelCode.java

@@ -66,7 +66,8 @@ public enum MiGrationRelCode {
 	Pe2Bd("Pe2Bd"),
 	Pe2Fl("Pe2Fl"),
 	Pe2Sh("Pe2Sh"),
-	Pe2Sp("Pe2Sp");
+	Pe2Sp("Pe2Sp"),
+	Sp2Si("Sp2Si");
 
 	private String code;
 	public String getCode(){

+ 0 - 29
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/constant/MigrationObjType.java

@@ -1,29 +0,0 @@
-package com.persagy.proxy.migration.constant;
-
-/**
- * @author lvxianyun
- * @title: MigrationObjType
- * @projectName adm-middleware
- * @description: 
- * @date 2021/12/9 21:04
- */
-public enum MigrationObjType {
-
-     project("project") ,building("building") , floor("floor") ,component("component") , equipment("equipment") , shaft("shaft") , system("system") ,  /*ispace ,*/ space("space") ;
-
-     private String code;
-
-     public String getCode() {
-          return code;
-     }
-
-     MigrationObjType(String code) {
-          this.code = code;
-     }
-
-     @Override
-     public String toString() {
-          return this.code;
-     }
-
-}

+ 1 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java

@@ -20,7 +20,6 @@ import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import com.persagy.proxy.migration.constant.MigrationConstant;
-import com.persagy.proxy.migration.constant.MigrationObjType;
 import com.persagy.proxy.migration.handler.DataMigrationHandler;
 import com.persagy.proxy.migration.model.DataMigrationExcel;
 import com.persagy.proxy.migration.model.MigrationInfo;
@@ -245,7 +244,7 @@ public class DataMigrationController {
         queryCriteria.setOnlyCount(true);
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
         criteria.put("valid", 1);
-        criteria.put("objType", MigrationObjType.project.getCode());
+        criteria.put("objType", "project");
         queryCriteria.setCriteria(criteria);
 
         String requestBody = JsonHelper.toJsonStr(queryCriteria);

+ 17 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationAbstractServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.http.HttpException;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONUtil;
 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.basic.utils.JsonNodeUtils;
@@ -13,6 +14,8 @@ import com.persagy.dmp.common.constant.ResponseCode;
 import com.persagy.dmp.common.model.entity.AuditableEntity;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.utils.JsonHelper;
+import com.persagy.dmp.define.client.DigitalDefineFacade;
+import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.migrate.client.DigitalMigrateLogFacade;
 import com.persagy.dmp.rwd.migrate.entity.SyncData;
 import com.persagy.proxy.common.entity.DmpResult;
@@ -468,4 +471,18 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         }
         return targetsMap;
     }
+
+
+    public List<String> getObjTypes(InstanceUrlParam context){
+        QueryCriteria queryCriteria = new QueryCriteria();
+        ObjectNode criteria = JsonNodeFactory.instance.objectNode();
+        criteria.put("valid", 1);
+        queryCriteria.setCriteria(criteria);
+        List<ObjectTypeDefine> types = DigitalDefineFacade.queryObjectType(context.getGroupCode(),context.getProjectId(),context.getUserId(),context.getUserId(),queryCriteria);
+        if(CollUtil.isEmpty(types)){
+            return null;
+        }
+        Map<String,List<ObjectTypeDefine>> objType = types.stream().collect(Collectors.groupingBy(ObjectTypeDefine::getObjType));
+        return objType.keySet().stream().collect(Collectors.toList());
+    }
 }

+ 13 - 16
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectDigitalMigration.java

@@ -8,16 +8,12 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.basic.utils.JsonNodeUtils;
 import com.persagy.dmp.common.constant.ResponseCode;
-import com.persagy.dmp.common.model.entity.AuditableEntity;
-import com.persagy.dmp.common.model.entity.BaseEntity;
-import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.rwd.migrate.entity.SyncData;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import com.persagy.proxy.migration.constant.MigrationConstant;
-import com.persagy.proxy.migration.constant.MigrationObjType;
 import com.persagy.proxy.migration.constant.MigrationTable;
 import com.persagy.proxy.migration.constant.MigrationType;
 import com.persagy.proxy.migration.model.DataMigrationExcel;
@@ -25,7 +21,6 @@ import com.persagy.proxy.migration.model.DataMigrationResponse;
 import com.persagy.proxy.migration.model.MigrationInfo;
 import com.persagy.proxy.migration.service.IDataMigration;
 import com.persagy.proxy.migration.service.IDataMigrationProcess;
-import com.persagy.proxy.migration.service.Impl.MigrationAbstractServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -55,14 +50,14 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
         log.info("######################### dt_object 数据迁移内容获取开始 #########################");
         long start = System.currentTimeMillis();
         List<DataMigrationExcel> dataMigrationExcels = new ArrayList<>();
+        List<String> objTypes = getObjTypes(context);
+        for(String objType : objTypes){
+            log.info("######################### dt_object "+objType+"数据迁移内容获取开始 #########################");
 
-        for(MigrationObjType objType : MigrationObjType.values()){
-            log.info("######################### dt_object "+objType.getCode()+"数据迁移内容获取开始 #########################");
-
-            QueryCriteria queryCriteria = getQueryCriteria(objType.getCode());
+            QueryCriteria queryCriteria = getQueryCriteria(objType);
             dataMigrationExcels.addAll(startMigrateForExcel(context,migrationInfo,queryCriteria));
 
-            log.info("######################### dt_object "+objType.getCode()+"数据迁移内容获取结束 #########################");
+            log.info("######################### dt_object "+objType+"数据迁移内容获取结束 #########################");
         }
 
         long end = System.currentTimeMillis();
@@ -80,13 +75,14 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
     public AdmResponse migrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo) {
         log.info("######################### dt_object 同步开始 #########################");
         long start = System.currentTimeMillis();
-        for(MigrationObjType objType : MigrationObjType.values()){
-            log.info("######################### dt_object "+objType.getCode()+"同步开始 #########################");
+        List<String> objTypes = getObjTypes(context);
+        for(String objType : objTypes){
+            log.info("######################### dt_object "+objType+"同步开始 #########################");
 
-            QueryCriteria queryCriteria = getQueryCriteria(objType.getCode());
+            QueryCriteria queryCriteria = getQueryCriteria(objType);
             startMigrateForLog(context,migrationInfo,queryCriteria);
 
-            log.info("######################### dt_object "+objType.getCode()+"同步结束 #########################");
+            log.info("######################### dt_object "+objType+"同步结束 #########################");
         }
         long end = System.currentTimeMillis();
         log.info("######################### dt_object 数据迁移已结束 时间:"+(end-start)+" #########################");
@@ -104,8 +100,9 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
         StringBuffer sqls = new StringBuffer(" \n -- 数据迁移  dt_object ------ \n");
         //获取已经采集的数据
         String sqls_temp = "";
-        for(MigrationObjType objType : MigrationObjType.values()){
-            QueryCriteria queryCriteria = getQueryCriteria(objType.getCode());
+        List<String> objTypes = getObjTypes(context);
+        for(String objType : objTypes){
+            QueryCriteria queryCriteria = getQueryCriteria(objType);
             List<ObjectNode> admData = getAdmData(context,queryCriteria);
             if(CollUtil.isEmpty(admData)){
                 continue;

+ 2 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/model/AdmObjectInfo.java

@@ -68,6 +68,8 @@ public class AdmObjectInfo {
 
     /** 备注 */
     private String note;
+    /** 备注 */
+    private String remark;
 
     /** 输入类型 */
     private String origDataType;

+ 6 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/constant/AdmServerConstant.java

@@ -11,6 +11,12 @@ public interface AdmServerConstant {
     String BUILD_SEQUENCE_ID="buildSequenceID";
     /**建筑id的信息点key值*/
     String BUILDING_ID="buildingId";
+    /**正逆向交付方式,0-逆向,1-正向*/
+    String DELIVERY_WAY="deliveryWay";
+    /**交付类型:0-项目交付 1-现场交付*/
+    String DELIVERY_TYPE="deliveryType";
+    /**是否交付 0-否 1-是*/
+    String IS_DELIVERY="isDelivery";
 
 
 }

+ 35 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/constant/DeliveryWayEnum.java

@@ -0,0 +1,35 @@
+package com.persagy.adm.server.algorithm.constant;
+
+import lombok.Getter;
+
+/**
+ * 正逆向交付方式枚举类
+ * @author : lijie
+ * Update By 2022/1/20 16:05
+ */
+@Getter
+public enum DeliveryWayEnum {
+
+    /**逆向*/
+    REVERSE("0", "逆向"),
+    /**正向*/
+    POSITIVE("1", "正向");
+
+    private String value;
+    private String desc;
+
+    DeliveryWayEnum(String value, String desc) {
+        this.value = value;
+        this.desc = desc;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+
+}

+ 26 - 6
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/controller/AdmModelController.java

@@ -4,15 +4,15 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import com.persagy.adm.server.algorithm.constant.AdmServerConstant;
-import com.persagy.adm.server.algorithm.domain.BuildingVo;
-import com.persagy.adm.server.algorithm.domain.ModelFileVo;
-import com.persagy.adm.server.algorithm.domain.QueryModelFileVo;
+import com.persagy.adm.server.algorithm.domain.*;
 import com.persagy.adm.server.algorithm.entity.AdmModelFile;
 import com.persagy.adm.server.algorithm.service.AdmModelService;
 import com.persagy.dmp.common.constant.DigitalObjectType;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.utils.ResultHelper;
+import com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO;
+import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import lombok.RequiredArgsConstructor;
 import org.springframework.validation.annotation.Validated;
@@ -135,16 +135,36 @@ public class AdmModelController {
      */
     @PostMapping(value = "/saveModelFile")
     public CommonResult<List<Void>> saveModelFile(@Validated @RequestBody ModelFileVo modelFileVo) {
-        Map<String, AdmModelFile> modelFileMap = admModelService.queryCurrentModelFileByFloorIds(CollUtil.newArrayList(modelFileVo.getFloorId()));
-        AdmModelFile admModelFile = modelFileMap.get(modelFileVo.getFloorId());
         AdmModelFile modelFile = BeanUtil.copyProperties(modelFileVo, AdmModelFile.class);
         modelFile.setGroupCode(AppContext.getContext().getGroupCode());
         modelFile.setProjectId(AppContext.getContext().getProjectId());
         modelFile.setCreator(AppContext.getContext().getAccountId());
         modelFile.setModifier(AppContext.getContext().getAccountId());
         admModelService.saveModelFile(modelFile);
-
         return ResultHelper.multi(new ArrayList<>());
     }
+    /**
+     * 010103-模型文件-查询正向/逆向交付范围
+     * @param queryVo : 查询条件
+     * @return : com.persagy.dmp.common.model.response.CommonResult<java.lang.Void>
+     * @author : lijie
+     * Update By 2022/1/12 16:54
+     * @undone
+     */
+    @PostMapping(value = "/queryScopeOfDeliver")
+    public CommonResult<List<ScopeOfDeliverVo>> queryScopeOfDeliver(@Validated @RequestBody QueryScopeOfDeliverVo queryVo) {
+        // 1.查询对象类型交付范围
+        List<ObjectTypeCollect> typeCollects = admModelService.queryObjectTypeCollectByDeliveryWay(queryVo.getDeliveryWay());
+        if (CollUtil.isEmpty(typeCollects)){
+            return ResultHelper.multi(new ArrayList<>());
+        }
+        List<ScopeOfDeliverVo> result = new ArrayList<>();
+        for (ObjectTypeCollect typeCollect : typeCollects) {
+            result.add(BeanUtil.toBean(typeCollect,ScopeOfDeliverVo.class));
+        }
+        // 2.查询对象信息点交付范围
+        // 3.查询对象关系交付范围
+        return ResultHelper.multi(result);
+    }
 
 }

+ 1 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/domain/DeliverPlanVo.java

@@ -33,6 +33,7 @@ public class DeliverPlanVo {
      * */
     @NotBlank
     private String deliverPlanName;
+
     /**商品编码集合*/
     @NotEmpty
     private Set<String> skuCodes;

+ 25 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/domain/QueryScopeOfDeliverVo.java

@@ -0,0 +1,25 @@
+package com.persagy.adm.server.algorithm.domain;
+
+import com.persagy.adm.server.algorithm.constant.DeliveryWayEnum;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 查询交付范围VO类
+ * @author : lijie
+ * Update By 2022/1/20 15:58
+ */
+@Data
+public class QueryScopeOfDeliverVo {
+    /**
+     * 正逆向交付方式
+     * @see DeliveryWayEnum#value
+     * @mock 1
+     */
+    @NotNull
+    private Integer deliveryWay;
+
+
+
+}

+ 21 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/domain/ScopeOfDeliverVo.java

@@ -0,0 +1,21 @@
+package com.persagy.adm.server.algorithm.domain;
+
+import com.persagy.dmp.delivery.dto.ObjectInfoCollectDTO;
+import com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO;
+import com.persagy.dmp.delivery.dto.RelationDefineCollectDTO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 交付范围VO类
+ * @author : lijie
+ * Update By 2022/1/14 16:26
+ */
+@Data
+public class ScopeOfDeliverVo extends ObjectTypeCollectDTO{
+    /**对象类型下需交付的信息点.暂无,后续根据业务再调整*/
+    List<ObjectInfoCollectDTO> objectInfoDefines;
+    /**对象类型下需交付的关系数据.暂无,后续根据业务再调整*/
+    List<RelationDefineCollectDTO> relationDefines;
+}

+ 10 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/service/AdmModelService.java

@@ -2,6 +2,8 @@ package com.persagy.adm.server.algorithm.service;
 
 import com.persagy.adm.server.algorithm.domain.DeliverPlanVo;
 import com.persagy.adm.server.algorithm.entity.AdmModelFile;
+import com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO;
+import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 
 import java.util.List;
@@ -37,4 +39,12 @@ public interface AdmModelService {
      * Update By 2022/1/19 17:54
      */
     void saveModelFile(AdmModelFile modelFile);
+    /**
+     * 根据正逆向交付查询对象类型交付范围
+     * @param deliveryWay : 正逆向交付方式,0-逆向,1-正向
+     * @return : java.util.List<com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO>
+     * @author : lijie
+     * Update By 2022/1/20 18:26
+     */
+    List<ObjectTypeCollect> queryObjectTypeCollectByDeliveryWay(Integer deliveryWay);
 }

+ 41 - 14
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/service/impl/AdmModelServiceImpl.java

@@ -18,7 +18,11 @@ import com.persagy.dmp.common.constant.RelCodeEnum;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.exception.BusinessException;
 import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.common.model.entity.AuditableEntity;
 import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.delivery.client.DigitalObjectTypeCollectFacade;
+import com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO;
+import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -101,23 +105,46 @@ public class AdmModelServiceImpl implements AdmModelService {
     public void saveModelFile(AdmModelFile modelFile) {
         admModelFileMapper.insertEntity(modelFile);
     }
-
     /**
-     * 创建关系查询对象
-     * @param objectMapper : objectMapper
-     * @param graphCode : 图类型编码
-     * @param relCode : 边类型编码
-     * @param buildingIds : 建筑id
-     * @return : com.fasterxml.jackson.databind.node.ObjectNode
+     * 根据正逆向交付查询对象类型交付范围
+     * @param deliveryWay : 正逆向交付方式,0-逆向,1-正向
+     * @return : java.util.List<com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO>
      * @author : lijie
-     * Update By 2022/1/19 14:18
+     * Update By 2022/1/20 18:26
      */
-    private ObjectNode createRelationQueryNode(ObjectMapper objectMapper, String graphCode, String relCode,
-                                               Set<String> buildingIds) {
+    @Override
+    public List<ObjectTypeCollect> queryObjectTypeCollectByDeliveryWay(Integer deliveryWay) {
+        if (null==deliveryWay){
+            return new ArrayList<>();
+        }
+        QueryCriteria queryCriteria = new QueryCriteria();
+        ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
         ObjectNode objectNode = objectMapper.createObjectNode();
-        objectNode.put(ObjectRelation.GRAPH_CODE_HUM,graphCode);
-        objectNode.put(ObjectRelation.REL_CODE_HUM,relCode);
-        objectNode.putPOJO(ObjectRelation.OBJ_FROM_HUM,buildingIds);
-        return objectNode;
+        objectNode.put(AuditableEntity.PROP_VALID,Boolean.TRUE);
+        objectNode.put(CommonConstant.QUERY_PROJECTID,AppContext.getContext().getProjectId());
+        objectNode.put(CommonConstant.QUERY_GROUPCODE,AppContext.getContext().getGroupCode());
+        objectNode.put(AdmServerConstant.DELIVERY_WAY,deliveryWay);
+        objectNode.put(AdmServerConstant.DELIVERY_TYPE,"0");
+        objectNode.put(AdmServerConstant.IS_DELIVERY,"1");
+        queryCriteria.setCriteria(objectNode);
+        CommonResult<List<ObjectTypeCollect>> commonResult = DigitalObjectTypeCollectFacade
+                .queryPrototype(AppContext.getContext().getGroupCode(), AppContext.getContext().getProjectId(),
+                        AppContext.getContext().getAppId(), AppContext.getContext().getAccountId(), queryCriteria);
+        if (!CommonConstant.QUERY_SUCCESS.equals(commonResult.getResult())){
+            throw new BusinessException(commonResult.getResult(),commonResult.getMessage());
+        }
+        if (CollUtil.isNotEmpty(commonResult.getData())){
+            return commonResult.getData();
+        }
+        // 暂时加个逻辑,如果没有就查询0
+        objectNode.put(CommonConstant.QUERY_PROJECTID,CommonConstant.DEFAULT_ID);
+        objectNode.put(CommonConstant.QUERY_GROUPCODE,CommonConstant.DEFAULT_ID);
+        CommonResult<List<ObjectTypeCollect>> zeroCommonResult = DigitalObjectTypeCollectFacade
+                .queryPrototype(AppContext.getContext().getGroupCode(), AppContext.getContext().getProjectId(),
+                        AppContext.getContext().getAppId(), AppContext.getContext().getAccountId(), queryCriteria);
+        if (!CommonConstant.QUERY_SUCCESS.equals(zeroCommonResult.getResult())){
+            throw new BusinessException(zeroCommonResult.getResult(),zeroCommonResult.getMessage());
+        }
+        return zeroCommonResult.getData();
     }
 }

+ 4 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/auth/domain/LoginVo.java

@@ -18,15 +18,18 @@ public class LoginVo {
     /**
      * 登录设备类型
      * @see DeviceTypeEnum#type
+     * @mock 1
      */
     private String loginDeviceType;
     /**
      * 登录方式
      * @see LoginTypeEnum#type
+     * @mock 2
      */
     private String loginType;
     /**
      * 登录密码
+     * @mock 123456
      */
     private String passWord;
     /**
@@ -35,6 +38,7 @@ public class LoginVo {
     private String dingdingCode;
     /**
      * 手机号
+     * @mock 17337681032
      */
     private String phone;
     /**