分类授权数据授权界面编写与接口修改,分类数据查询接口修改
| | |
| | | import request from "@/router/axios"; |
| | | |
| | | //获取树形组件数据 |
| | | export const getAtrrList = () => { |
| | | export const getAtrrList = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/codeClassify/treeCodeClassify', |
| | | method: 'get', |
| | | params: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | //树节点添加 |
| | |
| | | const result = this.$route.query.id.substring(0, index); |
| | | this.idData = result; |
| | | this.removeList(); |
| | | getTreeList({'conditionMap[id]': this.idData}).then(res => { |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[id]"] = this.idData; |
| | | conditionMaps["conditionMap[authType]"] = "data_auth"; |
| | | // 数据授权中是否具备查看权限 |
| | | conditionMaps["conditionMap[menuCode]"] = "data_view"; |
| | | getTreeList(conditionMaps).then(res => { |
| | | if (res) { |
| | | if (res.data.length === 0) { |
| | | this.$message.error("主数据分类查询为空!"); |
| | |
| | | getAttr() { |
| | | this.loading = true; |
| | | return new Promise((resolve, reject) => { |
| | | getAtrrList() |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[authType]"] = "classify_auth"; |
| | | // 分类授权中是否具备查看权限 |
| | | conditionMaps["conditionMap[menuCode]"] = "classify_view"; |
| | | getAtrrList(conditionMaps) |
| | | .then(res => { |
| | | this.Treedata = res.data; |
| | | this.CloneTreedata = res.data; |
| | |
| | | R<List<String>> getRegexByList(@RequestBody List<String> combinationIds); |
| | | |
| | | @GetMapping(GETVIEWCLASSIFY) |
| | | R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds); |
| | | R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("menuCode") String menuCode); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds) { |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) { |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * @param treeQueryObject 树形查询对象 |
| | | * @return 主题库分类显示树 |
| | | */ |
| | | List<Tree> referTree(TreeQueryObject treeQueryObject); |
| | | List<Tree> referTree(TreeQueryObject treeQueryObject) throws ServiceException; |
| | | |
| | | /** |
| | | * 查询主题库分类 树 |
| | | * @param treeQueryObject 树查询对象 |
| | | * @return 主题库分类 显示树 |
| | | */ |
| | | List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject); |
| | | List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) throws ServiceException; |
| | | |
| | | /** |
| | | * 导出分类 |
| | |
| | | * @return 主题库分类显示树 |
| | | */ |
| | | @Override |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) { |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) throws ServiceException{ |
| | | if(treeQueryObject == null){ |
| | | treeQueryObject = new TreeQueryObject(); |
| | | } |
| | |
| | | * @return 主题库分类 显示树 |
| | | */ |
| | | @Override |
| | | public List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) { |
| | | public List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) throws ServiceException{ |
| | | List<CodeClassify> doList = null; |
| | | String id = null; |
| | | String lcStatus = null; |
| | |
| | | } |
| | | }else { |
| | | // 那些分类具备查看权限 |
| | | R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(","))); |
| | | R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(",")),treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"),treeQueryObject.getConditionMap().getOrDefault("menuCode","classify_view")); |
| | | // 请求失败或者请求得到的具备查看权限的分类id集合为空 |
| | | if(!viewClassByRoleIds.isSuccess() && !viewClassByRoleIds.getData().isEmpty()){ |
| | | return new ArrayList<>(); |
| | | if(!viewClassByRoleIds.isSuccess() && viewClassByRoleIds.getData().isEmpty()){ |
| | | throw new ServiceException("主数据查看权限未配置,或配置有误!"); |
| | | } |
| | | // 过滤 |
| | | filterTreeNodes(tree,viewClassByRoleIds.getData()); |
| | |
| | | /** |
| | | * 根据当前申请编码的分类,逐层往上校验是否符合属于配置的中的分类子节点的分 |
| | | * 类,如果符合,则该分类申请的编码为集团码返回true,反之则为企业编码返回false |
| | | * |
| | | * @param parameter 传入数据,classifyGroupCode:配置的中的分类顶节点,oid:选择节点的oid |
| | | */ |
| | | @Override |
| | |
| | | return createDataBZ(orderDTO,ruleVO,authUser); |
| | | } |
| | | } |
| | | |
| | | private String createDataBZ(CodeOrderDTO orderDTO, CodeRuleVO ruleVO,boolean authUser) throws Exception { |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); |
| | |
| | | return codeList.size() > 0 ? codeList.get(0) : ""; |
| | | |
| | | } |
| | | |
| | | /*** |
| | | * 根据编号获取码段码值 |
| | | * @param secDTOList |
| | |
| | | throw new Exception("根据原标准编号,在系统中未查询到相应的信息"); |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * 制定,则不需要产生更改单直接生成编码 |
| | | * @param codeBZApplyDTO |
| | |
| | | return ""; |
| | | |
| | | } |
| | | |
| | | /*** |
| | | * 集成可变码段申请接口 |
| | | * @param codeBZApplyDTO 申请的信息,需要包含属性的内容和码段相关的内容 |
| | |
| | | |
| | | /** |
| | | * 获取统计分析数据 |
| | | * |
| | | * @param btmNames 业务类型 |
| | | * @return 数据集 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 封装开关的内容,常用于导出 |
| | | * |
| | | * @param dataMap 数据的内容 |
| | | * @param templateVO 模板的显示 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 将referconfig转换为JSON格式的UIFormReferVO |
| | | * |
| | | * @param codeReferConfigVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 编码申请表单,隐藏、可输、只读转换 |
| | | * |
| | | * @param codeRuleVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 使用分类的主键获取表格的定义-ubcs后修改获取流程阶段熟悉获取方法 |
| | | * |
| | | * @param codeClassifyOid |
| | | * @param templateId |
| | | * @param taskId |
| | |
| | | |
| | | /** |
| | | * 多线程方式分批执行insert语句 |
| | | * |
| | | * @param tableName |
| | | * @param maps |
| | | * @throws ServiceException |
| | |
| | | |
| | | /** |
| | | * 单线程方式分批执行 |
| | | * |
| | | * @param tableName |
| | | * @param maps |
| | | */ |
| | |
| | | |
| | | return R.success("更新成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 更新业务数据同时对码值表数据操作接口 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 流程中变更状态值 |
| | | * |
| | | * @param flowDTO |
| | | * @return |
| | | */ |
| | |
| | | return R.data(mdmCountConfigService.getMdmCountConfig(userId)); |
| | | } |
| | | |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds){ |
| | | return R.data(classifyAuthService.getViewClassByRoleIds(roleIds)); |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode){ |
| | | return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,menuCode)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | List<ClassifyAuth> getClassifyAuthList(@Param("classifyId") String classifyId); |
| | | |
| | | List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds); |
| | | List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("menuCode") String menuCode); |
| | | |
| | | } |
| | |
| | | * @param roleIds |
| | | * @return |
| | | */ |
| | | List<String> getViewClassByRoleIds(List<String> roleIds); |
| | | List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getViewClassByRoleIds(List<String> roleIds) { |
| | | public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) { |
| | | if(roleIds.isEmpty()){ |
| | | return new ArrayList<>(); |
| | | } |
| | | return this.classifyAuthMapper.getViewClassByRoleIds(roleIds); |
| | | return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,menuCode); |
| | | } |
| | | |
| | | } |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND AUTH_TYPE = #{authType} |
| | | AND BUTTON_IDS LIKE CONCAT('%', CONCAT((SELECT ID |
| | | FROM PL_SYS_MENU |
| | | WHERE CODE = 'classify_view'), '%')) |
| | | |
| | | WHERE CODE = #{menuCode}), '%')) |
| | | </select> |
| | | |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="tree" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where is_deleted = 0 and category = 1 |
| | | select id, parent_id, name as title, id as "value", id as "key" |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | and category = 1 |
| | | </select> |
| | | |
| | | <select id="allMenu" resultMap="menuResultMap"> |
| | | select * from pl_sys_menu where is_deleted = 0 and category = 1 |
| | | select * |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | and category = 1 |
| | | </select> |
| | | |
| | | <select id="roleMenu" resultMap="menuResultMap"> |
| | |
| | | </select> |
| | | |
| | | <select id="roleMenuByTopMenuId" resultMap="menuResultMap"> |
| | | select * from pl_sys_menu where is_deleted = 0 and id IN |
| | | select * |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | and id IN |
| | | ( |
| | | SELECT menu_id FROM pl_sys_top_menu_setting WHERE top_menu_id = #{param1} |
| | | SELECT menu_id |
| | | FROM pl_sys_top_menu_setting |
| | | WHERE top_menu_id = #{param1} |
| | | ) |
| | | </select> |
| | | |
| | |
| | | and id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | </select> |
| | | |
| | | <select id="allButtons" resultMap="menuResultMap"> |
| | | SELECT |
| | | id, |
| | | SELECT id, |
| | | parent_id, |
| | | CODE, |
| | | NAME, |
| | |
| | | pl_sys_menu |
| | | WHERE |
| | | ( |
| | | category = 2 OR id IN ( SELECT parent_id FROM pl_sys_menu WHERE is_deleted = 0 AND category = 2 ) |
| | | category = 2 |
| | | OR id IN ( SELECT parent_id FROM pl_sys_menu WHERE is_deleted = 0 |
| | | AND category = 2 ) |
| | | ) |
| | | AND is_deleted = 0 |
| | | ORDER BY sort |
| | |
| | | <select id="getButtonsByRoleIdAndCode" resultMap="menuResultMap"> |
| | | SELECT pm.* |
| | | FROM PL_SYS_MENU ps, |
| | | PL_SYS_MENU pm, |
| | | PL_ORG_ROLE_MENU prom |
| | | WHERE ps.ID = prom.MENU_ID |
| | | PL_SYS_MENU pm |
| | | <if test="roleId != null and roleId != ''"> |
| | | ,PL_ORG_ROLE_MENU prom |
| | | </if> |
| | | WHERE |
| | | ps."CATEGORY" = 1 |
| | | <if test="roleId != null and roleId != ''"> |
| | | AND ps.ID = prom.MENU_ID |
| | | AND prom.ROLE_ID = #{roleId} |
| | | </if> |
| | | AND ps."CATEGORY" = 1 |
| | | AND pm.IS_DELETED = 0 |
| | | <if test="code != null and code != ''"> |
| | | AND ps.ID = pm.PARENT_ID |
| | |
| | | </select> |
| | | |
| | | <select id="grantTree" resultMap="treeNodeResultMap"> |
| | | select |
| | | id, |
| | | select id, |
| | | parent_id, |
| | | name as title, |
| | | id as "value", |
| | | id as "key" |
| | | from pl_sys_menu where is_deleted = 0 order by sort |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantTreeByRole" resultMap="treeNodeResultMap"> |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | or id in ( |
| | | select parent_id from pl_sys_menu where is_deleted = 0 |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantTopTree" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and is_deleted = 0 order by sort |
| | | select id, parent_id, name as title, id as "value", id as "key" |
| | | from pl_sys_menu |
| | | where category = 1 |
| | | and is_deleted = 0 |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantTopTreeByRole" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and is_deleted = 0 |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and |
| | | is_deleted = 0 |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | or id in ( |
| | | select parent_id from pl_sys_menu where is_deleted = 0 |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantDataScopeTree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | ( |
| | | SELECT |
| | | id, |
| | | SELECT * |
| | | FROM ( |
| | | SELECT id, |
| | | parent_id, |
| | | NAME AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_sys_menu |
| | | WHERE |
| | | category = 1 |
| | | FROM pl_sys_menu |
| | | WHERE category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | ) menu |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | id, |
| | | SELECT id, |
| | | menu_id AS parent_id, |
| | | scope_name AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_auth_scope_data |
| | | WHERE |
| | | is_deleted = 0 |
| | | FROM pl_auth_scope_data |
| | | WHERE is_deleted = 0 |
| | | AND menu_id IS NOT NULL |
| | | </select> |
| | | |
| | | <select id="grantApiScopeTree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | ( |
| | | SELECT |
| | | id, |
| | | SELECT * |
| | | FROM ( |
| | | SELECT id, |
| | | parent_id, |
| | | NAME AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_sys_menu |
| | | WHERE |
| | | category = 1 |
| | | FROM pl_sys_menu |
| | | WHERE category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | ) menu |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | id, |
| | | SELECT id, |
| | | menu_id AS parent_id, |
| | | scope_name AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_auth_scope_api |
| | | WHERE |
| | | is_deleted = 0 |
| | | FROM pl_auth_scope_api |
| | | WHERE is_deleted = 0 |
| | | AND menu_id IS NOT NULL |
| | | </select> |
| | | |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | ) menu |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | AND menu_id IS NOT NULL |
| | |
| | | select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | ) menu |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | AND menu_id IS NOT NULL |
| | |
| | | and ps.CODE = #{btmType} |
| | | and ps.ID = pm.PARENT_ID |
| | | <if test="roleIds != null and roleIds != ''"> |
| | | and ps.ID in ( |
| | | and ps.ID in |
| | | SELECT menu_id FROM pl_org_role_menu WHERE role_id IN |
| | | <foreach collection="roleIds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | order by pm.sort asc |
| | | </select> |
| | | |
| | | <select id="getButtonByIdsOrByParentCode" resultMap="menuResultMap"> |
| | | SELECT pm.* |
| | | FROM PL_SYS_MENU ps, |
| | | PL_SYS_MENU pm, |
| | | PL_ORG_ROLE_MENU prom |
| | | WHERE ps.ID = prom.MENU_ID |
| | | <if test="roleIds != null and roleIds != ''"> |
| | | AND prom.ROLE_ID in (#{roleIds}) |
| | | </if> |
| | | AND ps."CATEGORY" = 1 |
| | | AND pm.IS_DELETED = 0 |
| | | SELECT |
| | | pm.* |
| | | FROM |
| | | PL_SYS_MENU pm |
| | | <if test="code != null and code != ''"> |
| | | ,PL_SYS_MENU ps |
| | | </if> |
| | | <if test="roleIds != null and roleIds != ''"> |
| | | ,PL_ORG_ROLE_MENU prom |
| | | </if> |
| | | WHERE |
| | | pm.IS_DELETED = 0 |
| | | AND pm."CATEGORY" = 2 |
| | | <if test="code != null and code != ''"> |
| | | AND ps."CATEGORY" = 1 |
| | | AND ps.ID = pm.PARENT_ID |
| | | AND ps.CODE = #{code} |
| | | </if> |
| | | <if test="roleIds != null and roleIds != ''"> |
| | | AND pm.ID = prom.MENU_ID |
| | | AND prom.ROLE_ID in (#{roleIds}) |
| | | </if> |
| | | <if test="ids != null and ids != ''"> |
| | | AND ps.ID IN ( |
| | | AND pm.ID IN |
| | | <foreach collection="ids" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ORDER BY pm.SORT ASC |
| | | ORDER BY SORT ASC |
| | | </select> |
| | | |
| | | </mapper> |