Bladeren bron

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/adm-middleware.git into develop

zhangqiankun 3 jaren geleden
bovenliggende
commit
2c40eacd54

+ 2 - 0
src/main/java/com/persagy/proxy/adm/constant/SpaceTypeEnum.java

@@ -37,5 +37,7 @@ public enum SpaceTypeEnum {
         this.code = code;
         this.desc = desc;
     }
+
+
     
 }

+ 21 - 2
src/main/java/com/persagy/proxy/adm/controller/AdmRelCalController.java

@@ -259,8 +259,7 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"sign"})
-    public AdmResponse changeSign( @PathVariable("relType") String relType,
-                                   @RequestParam(value = "objectTypes",required = false) String objectTypeStr,
+    public AdmResponse changeSign( @RequestParam(value = "objectTypes",required = false) String objectTypeStr,
                                    @RequestParam(value = "relationType",required = false) String relationTypeStr) {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
@@ -268,6 +267,26 @@ public class AdmRelCalController {
         // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
         return AdmResponse.success(new ArrayList<>());
     }
+    /***
+     * Description: 其他计算接口,预留接口,用于处理其他的关系不存在接口会出现404问题
+     * @param relType : 关系类型
+     * @param objectTypeStr : 对象类型
+     * @param relationTypeStr : 关系类型
+     * @return : com.persagy.proxy.adm.request.AdmResponse
+     * @author : lijie
+     * @date :2021/10/15 19:58
+     * Update By lijie 2021/10/15 19:58
+     */
+    @PostMapping(value = "{relType}")
+    public AdmResponse otherCal( @PathVariable("relType") String relType,
+                                 @RequestParam(value = "objectTypes",required = false) String objectTypeStr,
+                                 @RequestParam(value = "relationType",required = false) String relationTypeStr) {
+        // 资产暂时未引入,直接返回成功
+        // 组装上下文条件
+        InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
+        return AdmResponse.success(new ArrayList<>());
+    }
 
     /***
      * Description: 获得关系枚举类型

+ 11 - 0
src/main/java/com/persagy/proxy/adm/service/impl/RelationReportService.java

@@ -11,6 +11,8 @@ import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import cn.hutool.core.util.EnumUtil;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -725,6 +727,15 @@ public class RelationReportService implements IRelationReportService {
 		result.put("createTime", creationTime == null ? null : new DateTime(creationTime).toString());
 		result.put("mainObject", relationDefine.getFromObjType());
 		result.put("fromObject", relationDefine.getToObjType());
+		// 空间分区
+		String zoneType = relationProject.has("zoneType") ? relationProject.get("zoneType").asText() : null;
+		if (StrUtil.isNotBlank(zoneType)){
+			SpaceTypeEnum spaceTypeEnum = EnumUtil.fromString(SpaceTypeEnum.class, zoneType);
+			if (null!=spaceTypeEnum){
+				result.put("zoneType",spaceTypeEnum.getCode());
+				result.put("relationTypeName",StrUtil.replace(result.getString("relationTypeName"),"业务空间",spaceTypeEnum.getDesc()));
+			}
+		}
 		return result;
 	}