Browse Source

Merge remote-tracking branch 'origin/develop' into develop

lvxianyun 3 years ago
parent
commit
600b6d8c82

+ 75 - 69
src/main/java/com/persagy/proxy/adm/controller/AdmRelCalController.java

@@ -47,12 +47,17 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"bd2sp","fl2sp","sh2bd"})
-    public AdmResponse archSubsetCalcRelation(@QueryParam("projectId") String projectId,
-                                              @QueryParam("objectTypes") String objectTypeStr,
-                                              @QueryParam("relationType") String relationTypeStr,
+    public AdmResponse archSubsetCalcRelation(@RequestParam("projectId") String projectId,
+                                              @RequestParam("groupCode") String groupCode,
+                                              @RequestParam("appId") String appId,
+                                              @RequestParam("userId") String userId,
+                                              @RequestParam("objectTypes") String objectTypeStr,
+                                              @RequestParam("relationType") String relationTypeStr,
                                               HttpServletRequest request) throws Exception {
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
         admRelCalService.calcRelation(context,CollUtil.newArrayList(getAdmRelationTypeEnum(request)),null);
         return AdmResponse.success(new ArrayList<>());
     }
@@ -76,19 +81,23 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"eq2bd","eq2fl","eq2sh","eq2sp_in","sy2bd","sy2fl","sy2sh","sy2sp"})
-    public AdmResponse mechInArchCalcRelation(@QueryParam("projectId") String projectId,
-                                              @QueryParam("objectTypes") String objectTypeStr,
-                                              @QueryParam("relationType") String relationTypeStr,
+    public AdmResponse mechInArchCalcRelation(@RequestParam("projectId") String projectId,
+                                              @RequestParam("groupCode") String groupCode,
+                                              @RequestParam("appId") String appId,
+                                              @RequestParam("userId") String userId,
+                                              @RequestParam("objectTypes") String objectTypeStr,
+                                              @RequestParam("relationType") String relationTypeStr,
                                               HttpServletRequest request) throws Exception {
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
         admRelCalService.calcRelation(context, CollUtil.newArrayList(getAdmRelationTypeEnum(request)),null);
         return AdmResponse.success(new ArrayList<>());
     }
 
     /***
      * Description: 添加关系(图类型关系为PropertyInArch)
-     * @param relType : 关系类型
      * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
      *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
      *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
@@ -102,19 +111,22 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"pe2bd","pe2fl","pe2sh","pe2sp"})
-    public AdmResponse propertyInArchCalcRelation( @PathVariable("relType") String relType,
-                                     @QueryParam("projectId") String projectId,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) throws Exception {
+    public AdmResponse propertyInArchCalcRelation(@RequestParam("projectId") String projectId,
+                                                  @RequestParam("groupCode") String groupCode,
+                                                  @RequestParam("appId") String appId,
+                                                  @RequestParam("userId") String userId,
+                                                  @RequestParam("objectTypes") String objectTypeStr,
+                                                  @RequestParam("relationType") String relationTypeStr) throws Exception {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
         // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
      * Description: 添加关系(图类型关系为MechForArch)
-     * @param relType : 关系类型
      * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
      *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
      *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
@@ -125,13 +137,17 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"eq2sp_for"})
-    public AdmResponse mechForArchCalcRelation( @PathVariable("relType") String relType,
-                                     @QueryParam("projectId") String projectId,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) throws Exception {
+    public AdmResponse mechForArchCalcRelation(@RequestParam("projectId") String projectId,
+                                               @RequestParam("groupCode") String groupCode,
+                                               @RequestParam("appId") String appId,
+                                               @RequestParam("userId") String userId,
+                                               @RequestParam("objectTypes") String objectTypeStr,
+                                               @RequestParam("relationType") String relationTypeStr) throws Exception {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
         // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
         return AdmResponse.success(new ArrayList<>());
     }
@@ -189,10 +205,6 @@ public class AdmRelCalController {
     }
     /***
      * Description: 添加关系(图类型关系为ConvectionNetwork)
-     * @param relType : 关系类型
-     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
-     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
-     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
      * sp2sp_ConvectionNetwork_1:Natural-空气自然对流
      * @return : com.persagy.proxy.adm.request.AdmCreateResponse
      * @author : lijie
@@ -200,22 +212,20 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"sp2sp_ConvectionNetwork_1"})
-    public AdmResponse convectionNetworkCalcRelation( @PathVariable("relType") String relType,
-                                     @QueryParam("projectId") String projectId,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) throws Exception {
+    public AdmResponse convectionNetworkCalcRelation(@RequestParam("projectId") String projectId,
+                                                     @RequestParam("groupCode") String groupCode,
+                                                     @RequestParam("appId") String appId,
+                                                     @RequestParam("userId") String userId) throws Exception {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
+        admRelCalService.calcRelation(context,CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_1),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
      * Description: 添加关系(图类型关系为RadiationNetwork)
-     * @param relType : 关系类型
-     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
-     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
-     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
      * sp2sp_RadiationNetwork_1:光照辐射网络-Connect-光照连通
      * @return : com.persagy.proxy.adm.request.AdmCreateResponse
      * @author : lijie
@@ -223,22 +233,20 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"sp2sp_RadiationNetwork_1"})
-    public AdmResponse radiationNetworkCalcRelation( @PathVariable("relType") String relType,
-                                     @QueryParam("projectId") String projectId,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) throws Exception {
+    public AdmResponse radiationNetworkCalcRelation(@RequestParam("projectId") String projectId,
+                                                    @RequestParam("groupCode") String groupCode,
+                                                    @RequestParam("appId") String appId,
+                                                    @RequestParam("userId") String userId) throws Exception {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
+        admRelCalService.calcRelation(context,CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_1),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
      * Description: 添加关系(图类型关系为SpaceNeighborhood)
-     * @param relType : 关系类型
-     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
-     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
-     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
      * sp2sp_SpaceNeighborhood_5:业务空间(同类)邻接关系-Connect-空间连通
      * @return : com.persagy.proxy.adm.request.AdmCreateResponse
      * @author : lijie
@@ -246,22 +254,20 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"sp2sp_SpaceNeighborhood_5"})
-    public AdmResponse spaceNeighborhoodCalcRelation( @PathVariable("relType") String relType,
-                                     @QueryParam("projectId") String projectId,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) throws Exception {
+    public AdmResponse spaceNeighborhoodCalcRelation(@RequestParam("projectId") String projectId,
+                                                     @RequestParam("groupCode") String groupCode,
+                                                     @RequestParam("appId") String appId,
+                                                     @RequestParam("userId") String userId) throws Exception {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
+        admRelCalService.calcRelation(context,CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_SPACENEIGHBORHOOD_5),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
      * Description: 添加关系(计算设备所在建筑,系统所在建筑,图类型关系为MechInArch)
-     * @param relType : 关系类型
-     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
-     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
-     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
      * syeq2bd:建筑下的系统设备部件,计算设备所在建筑(eq2bd),系统所在建筑(sy2bd)
      * @return : com.persagy.proxy.adm.request.AdmCreateResponse
      * @author : lijie
@@ -269,13 +275,15 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"syeq2bd"})
-    public AdmResponse syeq2bdCalcRelation( @PathVariable("relType") String relType,
-                                     @QueryParam("projectId") String projectId,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) throws Exception {
+    public AdmResponse syeq2bdCalcRelation(@RequestParam("projectId") String projectId,
+                                           @RequestParam("groupCode") String groupCode,
+                                           @RequestParam("appId") String appId,
+                                           @RequestParam("userId") String userId) throws Exception {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
         Map<String, AdmRelationTypeEnum> relationTypeMap = AdmRelationTypeEnum.getRelationTypeMap();
         if (!relationTypeMap.containsKey("eq2bd") || !relationTypeMap.containsKey("sy2bd")){
             throw new BusinessException(BusinessErrorRwdCode.A7201.getCode(),BusinessErrorRwdCode.A7201.getDesc());
@@ -287,10 +295,6 @@ public class AdmRelCalController {
     }
     /***
      * Description: 添加关系(图类型关系为TrafficNetwork)
-     * @param relType : 关系类型
-     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
-     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
-     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
      * sp2sp_TrafficNetwork_1:建筑交通网络(同类)-Normal-普通交通
      * @return : com.persagy.proxy.adm.request.AdmCreateResponse
      * @author : lijie
@@ -298,14 +302,16 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"sp2sp_TrafficNetwork_1"})
-    public AdmResponse trafficNetworkCalcRelation( @PathVariable("relType") String relType,
-                                     @QueryParam("projectId") String projectId,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) throws Exception {
+    public AdmResponse trafficNetworkCalcRelation(@RequestParam("projectId") String projectId,
+                                                  @RequestParam("groupCode") String groupCode,
+                                                  @RequestParam("appId") String appId,
+                                                  @RequestParam("userId") String userId) throws Exception {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
+        InstanceUrlParam context = new InstanceUrlParam(StrUtil.isNotBlank(groupCode)?groupCode:this.groupCode,
+                null, projectId, StrUtil.isNotBlank(appId)?appId:AdmCommonConstant.APP_ID,
+                StrUtil.isNotBlank(userId)?userId:AdmCommonConstant.USER_ID);
+        admRelCalService.calcRelation(context,CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_1),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***

+ 1 - 1
src/main/java/com/persagy/proxy/adm/controller/AdmRelationObjectController.java

@@ -43,7 +43,7 @@ public class AdmRelationObjectController {
         //组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
         AdmQueryCriteria criteria = new AdmQueryCriteria();
-        criteria.setFilters("projectId = "+projectId);
+        criteria.setFilters("projectId = "+context.getProjectId());
         AdmResponse admResponse = service.doQuery(context, criteria, AdmDtRelation.class);
         return admResponse;
     }

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

@@ -206,10 +206,72 @@ public class AbstractAdmDictBaseServiceImpl<T> implements IAdmDictBaseService<T>
             }else{
                 admVO.setPath(AdmDictConstant.INFOS_EX+admVO.getCode());
             }
+
+            //信息点是否可见
+            if(admVO.getVisible() == null){
+                if("localName".equals(admVO.getCode()) || "localId".equals(admVO.getCode())){
+                    admVO.setVisible(true);
+                }else{
+                    admVO.setVisible(false);
+                }
+            }
+            //信息点是否可编辑
+            if(admVO.getEditable() == null){
+                List<String> unEditableList = checkoutDefInfoUnEditable();
+                if(unEditableList.contains(admVO.getCode())){
+                    admVO.setEditable(false);
+                }else {
+                    admVO.setEditable(true);
+                }
+            }
+            //是否禁止操作
+            if(admVO.getUnDisabled() == null){
+                List<String> unDisableList = checkoutDefInfoUnDisable();
+                if(unDisableList.contains(admVO.getCode())){
+                    admVO.setUnDisabled(false);
+                }else {
+                    admVO.setUnDisabled(true);
+                }
+            }
+
         }
     }
 
     /**
+     * 校验信息点是否可编辑
+     * @return
+     */
+    public List<String> checkoutDefInfoUnEditable(){
+        List<String> list = new ArrayList<>();
+        list.add("id");
+        list.add("name");
+        list.add("qRCodePic");
+        list.add("defaultQRCode");
+        list.add("bimId");
+        list.add("bimFamilyName");
+        list.add("bimFamilySymbol");
+        return list;
+    }
+    
+    /**
+     * 校验信息点是否禁止使用
+     * @return
+     */
+    public List<String> checkoutDefInfoUnDisable(){
+        List<String> list = new ArrayList<>();
+        list.add("id");
+        list.add("name");
+        list.add("localId");
+        list.add("localName");
+        list.add("qRCodePic");
+        list.add("defaultQRCode");
+        list.add("bimId");
+        list.add("bimFamilyName");
+        list.add("bimFamilySymbol");
+        return list;
+    }
+
+    /**
      * 字典数据格式与ADM兼容
      * @param array
      */