Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
ba57e004
提交
ba57e004
编写于
5月 18, 2020
作者:
laizhilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
权限树添加根节点“系统”,去掉“数据范围”所处的节点
上级
d6a23c76
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
106 行增加
和
77 行删除
+106
-77
sys-permissionmpickup-view.vue
...sys-permissionmpickup-view/sys-permissionmpickup-view.vue
+1
-1
UAACoreService.java
...va/cn/ibizlab/core/extensions/service/UAACoreService.java
+105
-76
未找到文件。
app_web/src/pages/uaa/sys-permissionmpickup-view/sys-permissionmpickup-view.vue
浏览文件 @
ba57e004
...
...
@@ -188,7 +188,7 @@
// 获取选中状态的节点
const
arr
=
CDtree
.
getCheckedNodes
().
concat
(
QXtree
.
getCheckedNodes
());
this
.
selectData
=
arr
;
console
.
log
(
"选中的node:"
+
arr
);
//
console.log("选中的node:" + arr);
}
/**
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/extensions/service/UAACoreService.java
浏览文件 @
ba57e004
...
...
@@ -255,8 +255,28 @@ public class UAACoreService {
permissionsSql
.
append
(
" INNER JOIN IBZPSDEOPPRIV t1 ON t.SYS_PERMISSIONID = t1.SYS_PSDEOPPRIVID"
);
List
<
JSONObject
>
permissions
=
isys_permissionService
.
select
(
permissionsSql
.
toString
(),
null
);
// 清空sql,获取权限所处系统
permissionsSql
.
delete
(
0
,
permissionsSql
.
length
());
permissionsSql
.
append
(
"select temp.systemid from ( "
);
permissionsSql
.
append
(
" select "
);
permissionsSql
.
append
(
" t.SYS_PERMISSIONID as sys_permissionid, "
);
permissionsSql
.
append
(
" t.SYS_PERMISSIONNAME as sys_permissionname, "
);
permissionsSql
.
append
(
" t1.PSSYSMODULEID as pssysmoduleid, "
);
permissionsSql
.
append
(
" t1.PSSYSMODULENAME as pssysmodulename, "
);
permissionsSql
.
append
(
" t1.PSDATAENTITYID as psdataentityid, "
);
permissionsSql
.
append
(
" t1.PSDATAENTITYNAME as psdataentityname, "
);
permissionsSql
.
append
(
" t1.Pssourceid as pssourceid, "
);
permissionsSql
.
append
(
" t1.Pssourcename as pssourcename,"
);
permissionsSql
.
append
(
" t1.PSDEDATARANGEID as psdedatarangeid, "
);
permissionsSql
.
append
(
" t1.PSDEDATARANGENAME as psdedatarangename,"
);
permissionsSql
.
append
(
" t1.PSSYSTEMID as systemid "
);
permissionsSql
.
append
(
" FROM IBZPERMISSION t"
);
permissionsSql
.
append
(
" INNER JOIN IBZPSDEOPPRIV t1 ON t.SYS_PERMISSIONID = t1.SYS_PSDEOPPRIVID"
);
permissionsSql
.
append
(
" )temp group by temp.SYSTEMID"
);
List
<
JSONObject
>
systems
=
isys_permissionService
.
select
(
permissionsSql
.
toString
(),
null
);
if
(
permissions
.
size
()
>
0
)
{
treeNode
=
this
.
transferDataCapabilityToELTree
(
permissions
);
treeNode
=
this
.
transferDataCapabilityToELTree
(
permissions
,
systems
);
}
return
treeNode
;
...
...
@@ -267,97 +287,106 @@ public class UAACoreService {
* 用于将资源表中数据能力数据转换成饿了么树格式数据
*
* @param deCapabilityDatas
* @param systems
* @return
*/
public
JSONArray
transferDataCapabilityToELTree
(
List
<
JSONObject
>
deCapabilityDatas
)
{
public
JSONArray
transferDataCapabilityToELTree
(
List
<
JSONObject
>
deCapabilityDatas
,
List
<
JSONObject
>
systems
)
{
Map
<
String
,
String
>
opprivTreeNameMap
=
new
HashMap
<>();
JSONObject
groupByMenuObj
=
groupByDataCapability
(
deCapabilityDatas
,
opprivTreeNameMap
);
//将数据库数据进行分组
JSONObject
groupByMenuObj
=
groupByDataCapability
(
deCapabilityDatas
,
systems
,
opprivTreeNameMap
);
//将数据库数据进行分组
JSONArray
elTreeObj
=
transferDataCapabilityToELTree
(
groupByMenuObj
,
opprivTreeNameMap
);
//将分组后的数据转换成饿了么树格式数据
return
elTreeObj
;
}
/**
* 将数据库中的数据能力数据进行分组
*
*
格式为:系统-模块-实体-数据集/实体行为-数据能力
* @param deCapabilityDatas
* @param systems
* @return
*/
private
JSONObject
groupByDataCapability
(
List
<
JSONObject
>
deCapabilityDatas
,
Map
<
String
,
String
>
opprivTreeNameMap
)
{
JSONObject
root_system
=
new
JSONObject
();
//顶级系统数据
JSONObject
permission_moudle
=
new
JSONObject
();
//次级模块数据
for
(
JSONObject
obj
:
deCapabilityDatas
)
{
JSONObject
jobj
=
new
JSONObject
();
jobj
.
putAll
(
obj
);
String
str_systemid
=
jobj
.
getString
(
"systemid"
);
String
str_moudle
=
jobj
.
getString
(
"pssysmoduleid"
);
String
str_moudle_name
=
jobj
.
getString
(
"pssysmodulename"
);
String
str_entity
=
jobj
.
getString
(
"psdataentityid"
);
String
str_entity_name
=
jobj
.
getString
(
"psdataentityname"
);
String
str_dataset
=
jobj
.
getString
(
"pssourceid"
);
String
str_dataset_name
=
jobj
.
getString
(
"pssourcename"
);
String
str_datarange
=
jobj
.
getString
(
"psdedatarangeid"
);
String
str_datarange_name
=
jobj
.
getString
(
"psdedatarangename"
);
String
str_permissionname
=
jobj
.
getString
(
"sys_permissionname"
);
String
str_permissionid
=
jobj
.
getString
(
"sys_permissionid"
);
JSONObject
cur_system
=
new
JSONObject
();
JSONObject
cur_moudle
=
new
JSONObject
();
JSONObject
cur_entity
=
new
JSONObject
();
JSONObject
cur_dataset
=
new
JSONObject
();
JSONArray
cur_data_range
=
new
JSONArray
();
if
(
root_system
.
containsKey
(
str_systemid
))
// 系统合并
cur_system
=
root_system
.
getJSONObject
(
str_systemid
);
if
(
permission_moudle
.
containsKey
(
str_moudle
))
//模块合并
cur_moudle
=
permission_moudle
.
getJSONObject
(
str_moudle
);
if
(
cur_moudle
.
containsKey
(
str_entity
))
//实体合并
cur_entity
=
cur_moudle
.
getJSONObject
(
str_entity
);
if
(
cur_entity
.
containsKey
(
str_dataset
))
//数据集合并
cur_dataset
=
cur_entity
.
getJSONObject
(
str_dataset
);
if
(
cur_dataset
.
containsKey
(
str_datarange
))
//数据范围合并
cur_data_range
=
cur_dataset
.
getJSONArray
(
str_datarange
);
JSONObject
permission
=
new
JSONObject
();
permission
.
put
(
"id"
,
str_permissionid
);
permission
.
put
(
"label"
,
str_permissionname
);
cur_data_range
.
add
(
permission
);
cur_dataset
.
put
(
str_datarange
,
cur_data_range
);
cur_entity
.
put
(
str_dataset
,
cur_dataset
);
cur_moudle
.
put
(
str_entity
,
cur_entity
);
permission_moudle
.
put
(
str_moudle
,
cur_moudle
);
private
JSONObject
groupByDataCapability
(
List
<
JSONObject
>
deCapabilityDatas
,
List
<
JSONObject
>
systems
,
Map
<
String
,
String
>
opprivTreeNameMap
)
{
JSONObject
permission_system
=
new
JSONObject
();
//顶级系统数据
for
(
JSONObject
system
:
systems
)
{
String
systemid
=
system
.
getString
(
"systemid"
);
JSONObject
permission_moudle
=
new
JSONObject
();
//次级模块数据
for
(
JSONObject
obj
:
deCapabilityDatas
)
{
JSONObject
jobj
=
new
JSONObject
();
jobj
.
putAll
(
obj
);
String
str_systemid
=
jobj
.
getString
(
"systemid"
);
// 系统标识
String
str_moudle
=
jobj
.
getString
(
"pssysmoduleid"
);
// 系统模块标识
String
str_moudle_name
=
jobj
.
getString
(
"pssysmodulename"
);
// 系统模块名称
String
str_entity
=
jobj
.
getString
(
"psdataentityid"
);
// 实体标识
String
str_entity_name
=
jobj
.
getString
(
"psdataentityname"
);
// 实体名称
String
str_dataset
=
jobj
.
getString
(
"pssourceid"
);
// 数据集,实体行为标识
String
str_dataset_name
=
jobj
.
getString
(
"pssourcename"
);
// 数据集,实体行为名称
String
str_datarange
=
jobj
.
getString
(
"psdedatarangeid"
);
// 实体数据范围标识
String
str_datarange_name
=
jobj
.
getString
(
"psdedatarangename"
);
// 实体数据范围名称
String
str_permissionid
=
jobj
.
getString
(
"sys_permissionid"
);
// 实体数据操作名称
String
str_permissionname
=
jobj
.
getString
(
"sys_permissionname"
);
// 实体数据操作标识
// 根据systemid进行操作
if
(
systemid
.
equals
(
str_systemid
)){
JSONObject
cur_system
=
new
JSONObject
();
JSONObject
cur_moudle
=
new
JSONObject
();
JSONObject
cur_entity
=
new
JSONObject
();
// JSONObject cur_dataset = new JSONObject();
JSONArray
cur_dataset
=
new
JSONArray
();
JSONArray
cur_data_range
=
new
JSONArray
();
if
(
permission_system
.
containsKey
(
str_systemid
))
// 系统合并
cur_system
=
permission_system
.
getJSONObject
(
str_systemid
);
if
(
permission_moudle
.
containsKey
(
str_moudle
))
//模块合并
cur_moudle
=
permission_moudle
.
getJSONObject
(
str_moudle
);
if
(
cur_moudle
.
containsKey
(
str_entity
))
//实体合并
cur_entity
=
cur_moudle
.
getJSONObject
(
str_entity
);
if
(
cur_entity
.
containsKey
(
str_dataset
))
//数据集,实体行为合并
cur_dataset
=
cur_entity
.
getJSONArray
(
str_dataset
);
// if (cur_dataset.containsKey(str_datarange))//数据范围合并
// cur_data_range = cur_dataset.getJSONArray(str_datarange);
JSONObject
permission
=
new
JSONObject
();
permission
.
put
(
"id"
,
str_permissionid
);
permission
.
put
(
"label"
,
str_permissionname
);
// cur_data_range.add(permission);
// cur_dataset.put(str_datarange, cur_data_range);
cur_dataset
.
add
(
permission
);
cur_entity
.
put
(
str_dataset
,
cur_dataset
);
cur_moudle
.
put
(
str_entity
,
cur_entity
);
cur_system
.
put
(
str_moudle
,
cur_moudle
);
permission_moudle
.
put
(
str_moudle
,
cur_moudle
);
permission_system
.
put
(
str_systemid
,
cur_system
);
//构造树节点名称集合
if
(!
opprivTreeNameMap
.
containsKey
(
str_systemid
))
{
// 系统
opprivTreeNameMap
.
put
(
str_systemid
,
str_systemid
);
}
if
(!
opprivTreeNameMap
.
containsKey
(
str_moudle
))
{
// 模块
opprivTreeNameMap
.
put
(
str_moudle
,
str_moudle_name
);
}
if
(!
opprivTreeNameMap
.
containsKey
(
str_entity
))
{
// 实体
opprivTreeNameMap
.
put
(
str_entity
,
str_entity_name
);
}
if
(!
opprivTreeNameMap
.
containsKey
(
str_dataset
))
{
// 数据集。实体行为
opprivTreeNameMap
.
put
(
str_dataset
,
str_dataset_name
);
}
// if (!opprivTreeNameMap.containsKey(str_datarange_name)) {// 数据范围
// opprivTreeNameMap.put(str_datarange, str_datarange_name);
// }
}
//构造树节点名称集合
if
(!
opprivTreeNameMap
.
containsKey
(
str_systemid
))
{
opprivTreeNameMap
.
put
(
str_systemid
,
"SYSTEM"
);
}
if
(!
opprivTreeNameMap
.
containsKey
(
str_moudle
))
{
opprivTreeNameMap
.
put
(
str_moudle
,
str_moudle_name
);
}
if
(!
opprivTreeNameMap
.
containsKey
(
str_entity
))
{
opprivTreeNameMap
.
put
(
str_entity
,
str_entity_name
);
}
if
(!
opprivTreeNameMap
.
containsKey
(
str_dataset
))
{
opprivTreeNameMap
.
put
(
str_dataset
,
str_dataset_name
);
}
if
(!
opprivTreeNameMap
.
containsKey
(
str_datarange_name
))
{
opprivTreeNameMap
.
put
(
str_datarange
,
str_datarange_name
);
}
}
return
permission_moudle
;
// return permission_moudle;
return
permission_system
;
}
/**
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录