ludc
2024-01-18 296f034c06ca8542b39878f860ffa5b909914338
数据授权查询接口更改
已修改11个文件
65 ■■■■■ 文件已修改
Source/UBCS-WEB/src/components/Master/MasterTree.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -106,6 +106,7 @@
      let conditionMaps = {};
      conditionMaps["conditionMap[id]"] = this.idData;
      conditionMaps["conditionMap[authType]"] = "data_auth";
      conditionMaps["conditionMap[buttonCode]"] = this.idData;
      // 数据授权中是否具备查看权限
      conditionMaps["conditionMap[menuCode]"] = "data_view";
      getTreeList(conditionMaps).then(res => {
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -113,6 +113,11 @@
      currentRow: {}
    };
  },
  computed: {},
  mounted() {
  },
  created() {
  },
  watch: {
    // 监听父组件传的窗口显示隐藏的值
    visible() {
@@ -177,18 +182,13 @@
                this.classifyAuthData.push(item);
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, 'create', index)
                console.log('index', index)
                // console.log('index', index)
              })
            }
          });
        });
      }
    },
  },
  computed: {},
  mounted() {
  },
  created() {
  },
  methods: {
    roleHandlerMethods(id, type, index) {
@@ -201,8 +201,8 @@
        const filteredItems = this.classifyAuthButton.filter(item => {
          return !res.data.data.find(x => x.id === item.id);
        });
        console.log('禁用按钮',filteredItems)
        console.log('不禁用按钮',res.data.data)
        // console.log('禁用按钮',filteredItems)
        // console.log('不禁用按钮',res.data.data)
        //拿表格列头循环和没有对应的属性进行比较
        this.classifyAuthHeader.forEach((item) => {
          const isMatched = filteredItems.some(x => x.id === item.prop);
@@ -243,7 +243,7 @@
            this.classifyAuthData[classIndex].allDisabled = false;
          }
        });
        console.log('classifyAuthData',this.classifyAuthData)
        // console.log('classifyAuthData',this.classifyAuthData)
        //强制刷新表格
        this.itemKey = uuidv4();
      })
@@ -295,7 +295,7 @@
        this.$message.warning("当前租户不存在角色信息!");
        return;
      }
      console.log('this.roleList', this.roleList)
      // console.log('this.roleList', this.roleList)
      this.addIndex++; //自定义生成添加行下标
      let item = {
        roleData: this.roleList[0].id,
@@ -307,7 +307,6 @@
      this.classifyAuthButton.forEach(data => {
        Vue.set(item, data.id, false);
      })
      //console.log(item)
      this.classifyAuthData.push(item);
      this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex)
    },
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -879,6 +879,7 @@
      return new Promise((resolve, reject) => {
        let conditionMaps = {};
        conditionMaps["conditionMap[authType]"] = "classify_auth";
        conditionMaps["conditionMap[buttonCode]"] = "classifyTree";
        // 分类授权中是否具备查看权限
        conditionMaps["conditionMap[menuCode]"] = "classify_view";
        getAtrrList(conditionMaps)
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java
@@ -392,6 +392,6 @@
    R<List<String>> getRegexByList(@RequestBody List<String> combinationIds);
    @GetMapping(GETVIEWCLASSIFY)
    R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("menuCode") String menuCode);
    R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("buttonCode") String buttonCode,@RequestParam("menuCode") String menuCode);
}
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java
@@ -200,7 +200,7 @@
    }
    @Override
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) {
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) {
        return R.fail("获取数据失败");
    }
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -119,11 +119,6 @@
    private CodeBasicSecMapper codeBasicSecMapper;
    /**
     * 自定义并发ForkJoinPool
     */
    private static final ForkJoinPool customForkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()-1);
    /**
     * 上级节点的属性名称
     */
    public static  final String PARENT_FIELD_NAME = "parentCodeClassifyOid";
@@ -593,7 +588,12 @@
        // 非超管过滤未授权的分类
        if(!VciBaseUtil.checkAdminTenant()){
            // 那些分类具备查看权限
            R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(",")),treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"),treeQueryObject.getConditionMap().getOrDefault("menuCode","classify_view"));
            R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(
                Arrays.asList(AuthUtil.getUser().getRoleId().split(",")),
                treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"),
                treeQueryObject.getConditionMap().getOrDefault("buttonCode","classify_view"),
                treeQueryObject.getConditionMap().getOrDefault("menuCode","classifyTree")
            );
            // 请求失败或者请求得到的具备查看权限的分类id集合为空
            if(!viewClassByRoleIds.isSuccess() && viewClassByRoleIds.getData().isEmpty()){
                throw new ServiceException("主数据查看权限未配置,或配置有误!");
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java
@@ -264,8 +264,8 @@
        return R.data(mdmCountConfigService.getMdmCountConfig(userId));
    }
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode){
        return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,menuCode));
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode){
        return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,buttonCode,menuCode));
    }
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java
@@ -15,6 +15,6 @@
    List<ClassifyAuth> getClassifyAuthList(@Param("classifyId") String classifyId);
    List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("menuCode") String menuCode);
    List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("buttonCode") String buttonCode,@Param("menuCode") String menuCode);
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java
@@ -53,6 +53,6 @@
     * @param roleIds
     * @return
     */
    List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode);
    List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode);
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java
@@ -183,11 +183,11 @@
     * @return
     */
    @Override
    public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) {
    public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) {
        if(roleIds.isEmpty()){
            return new ArrayList<>();
        }
        return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,menuCode);
        return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,buttonCode,menuCode);
    }
}
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml
@@ -26,9 +26,17 @@
            </foreach>
        </if>
          AND AUTH_TYPE = #{authType}
          AND BUTTON_IDS LIKE CONCAT('%', CONCAT((SELECT ID
                                      FROM PL_SYS_MENU
                                      WHERE CODE = #{menuCode}), '%'))
          AND BUTTON_IDS LIKE CONCAT('%', CONCAT((
            SELECT
                pm.ID
            FROM
                PL_SYS_MENU ps,
                PL_SYS_MENU pm
            WHERE
                ps.CODE = #{buttonCode}
                AND ps.ID = pm.PARENT_ID
                AND pm.CODE = #{menuCode}
        ), '%'))
    </select>