Parcourir la source

信息点是否可见,可编辑,是否禁止使用等赋予默认值

linhuili il y a 3 ans
Parent
commit
03d368d4ef

+ 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;
     }

+ 0 - 3
src/main/java/com/persagy/proxy/adm/controller/AdmSystemController.java

@@ -252,9 +252,6 @@ public class AdmSystemController {
                                 @QueryParam("floorId") String floorId, @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
-        if (StrUtil.isEmpty(projectId)) {
-            return AdmResponse.failure("项目id为空");
-        }
         AdmResponse syses = new AdmResponse();
         if(StrUtil.isAllEmpty(buildingId,floorId)){
             //case one 查询全部系统,级联建筑,建筑级联楼层

+ 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.setEditable(false);
+                }else {
+                    admVO.setEditable(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
      */