Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
03d34bd2
提交
03d34bd2
编写于
5月 19, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixed
上级
d7836032
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
23 行删除
+23
-23
PermissionFeignService.java
...n/ibizlab/api/rest/extensions/PermissionFeignService.java
+23
-23
未找到文件。
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/PermissionFeignService.java
浏览文件 @
03d34bd2
...
...
@@ -75,19 +75,19 @@ public class PermissionFeignService {
if
(
map
!=
null
){
permissionService
.
execute
(
sql
,
param
);
}
List
<
SYS_PSDEOPPRIV
>
opprivL
ist
=
new
ArrayList
<>();
//数据能力
List
<
SYS_PSDEOPPRIV
>
datarange_l
ist
=
new
ArrayList
<>();
//数据能力
List
<
SYS_PERMISSION
>
permission_list
=
new
ArrayList
<>();
//资源
List
<
SYS_PSSYSUNIRES
>
unires_list
=
new
ArrayList
<>();
//统一资源
List
<
SYS_PSAPPMENUITEM
>
menu_list
=
new
ArrayList
<>();
//资源-菜单项集合
if
(
map
.
containsKey
(
"permission"
)){
JSONObject
paramsObj
=
new
JSONObject
(
map
);
JSONObject
capabilityP
ermissionObj
=
paramsObj
.
getJSONObject
(
"permission"
);
parseD
ECapability
(
capabilityPermissionObj
,
systemId
,
permission_list
,
opprivL
ist
);
parseUniRes
(
capabilityP
ermissionObj
,
systemId
,
permission_list
,
unires_list
);
parseAppMenus
(
capabilityP
ermissionObj
,
systemId
,
permission_list
,
menu_list
);
JSONObject
p
ermissionObj
=
paramsObj
.
getJSONObject
(
"permission"
);
parseD
ataRange
(
permissionObj
,
systemId
,
permission_list
,
datarange_l
ist
);
parseUniRes
(
p
ermissionObj
,
systemId
,
permission_list
,
unires_list
);
parseAppMenus
(
p
ermissionObj
,
systemId
,
permission_list
,
menu_list
);
}
if
(
opprivL
ist
.
size
()>
0
){
opprivService
.
saveOrUpdateBatch
(
opprivL
ist
);
//批量保存数据能力
if
(
datarange_l
ist
.
size
()>
0
){
opprivService
.
saveOrUpdateBatch
(
datarange_l
ist
);
//批量保存数据能力
}
if
(
unires_list
.
size
()>
0
){
pssysuniresService
.
saveOrUpdateBatch
(
unires_list
);
//批量保存统一资源
...
...
@@ -250,44 +250,44 @@ public class PermissionFeignService {
* @param sysPermission
* @param opprivPermission
*/
public
void
parseD
ECapability
(
JSONObject
permission
,
String
systemId
,
List
<
SYS_PERMISSION
>
sysPermission
,
List
<
SYS_PSDEOPPRIV
>
opprivPermission
){
public
void
parseD
ataRange
(
JSONObject
permission
,
String
systemId
,
List
<
SYS_PERMISSION
>
sysPermission
,
List
<
SYS_PSDEOPPRIV
>
opprivPermission
){
JSONArray
preDefinedDataRange
=
permission
.
getJSONArray
(
"predefineddatarange"
);
JSONArray
entities
=
permission
.
getJSONArray
(
"entities"
);
for
(
int
a
=
0
;
a
<
entities
.
size
();
a
++){
JSONObject
entity
=
entities
.
getJSONObject
(
a
);
JSONArray
dataSetArray
=
entity
.
getJSONArray
(
"dedataset"
);
JSONArray
deActionArray
=
entity
.
getJSONArray
(
"deaction"
);
createDataRange
(
dataSetArray
,
preDefinedDataRange
,
entity
,
DataSetTag
,
systemId
,
sysPermission
,
opprivPermission
);
//存储数据集
createDataRange
(
deActionArray
,
preDefinedDataRange
,
entity
,
DEActionType
,
systemId
,
sysPermission
,
opprivPermission
);
//存储实体行为
JSONArray
dataScope
=
entity
.
getJSONArray
(
"datascope"
);
createDataScope
(
dataSetArray
,
dataScope
,
entity
,
DataSetTag
,
systemId
,
sysPermission
,
opprivPermission
);
//存储数据集
createDataScope
(
deActionArray
,
dataScope
,
entity
,
DEActionType
,
systemId
,
sysPermission
,
opprivPermission
);
//存储实体行为
}
}
/**
* 根据实体行为或数据集合结合预定于数据类型生成数据范围
* @param deActionArray
* @param
preDefinedDataRange
* @param
dataScopeArray
* @param entity
* @param permissionType
* @param systemId
* @param ability_list
* @param opprivList
*/
private
void
createData
Range
(
JSONArray
deActionArray
,
JSONArray
preDefinedDataRange
,
JSONObject
entity
,
String
permissionType
,
String
systemId
,
List
<
SYS_PERMISSION
>
ability_list
,
List
<
SYS_PSDEOPPRIV
>
opprivList
){
private
void
createData
Scope
(
JSONArray
deActionArray
,
JSONArray
dataScopeArray
,
JSONObject
entity
,
String
permissionType
,
String
systemId
,
List
<
SYS_PERMISSION
>
ability_list
,
List
<
SYS_PSDEOPPRIV
>
opprivList
){
for
(
int
b
=
0
;
b
<
deActionArray
.
size
();
b
++)
{
JSONObject
deSource
=
deActionArray
.
getJSONObject
(
b
);
String
deActionType
=
deSource
.
getString
(
"type"
);
//数据查询与自定义行为不生成预置范围相关数据
if
(
(
permissionType
.
equalsIgnoreCase
(
DEActionType
)
&&
!
deActionType
.
equalsIgnoreCase
(
"BUILTIN"
))
||
(
permissionType
.
equalsIgnoreCase
(
DataSetTag
))
)
{
JSONObject
data
Rang
e
=
new
JSONObject
();
createData
Range
(
entity
,
deSource
,
dataRang
e
,
permissionType
,
systemId
,
ability_list
,
opprivList
);
JSONObject
data
Scop
e
=
new
JSONObject
();
createData
Scope
(
entity
,
deSource
,
dataScop
e
,
permissionType
,
systemId
,
ability_list
,
opprivList
);
}
else
{
for
(
int
c
=
0
;
c
<
preDefinedDataRange
.
size
();
c
++){
JSONObject
data
Range
=
preDefinedDataRange
.
getJSONObject
(
c
);
createData
Range
(
entity
,
deSource
,
dataRang
e
,
permissionType
,
systemId
,
ability_list
,
opprivList
);
//实体预置行为及数据集
for
(
int
c
=
0
;
c
<
dataScopeArray
.
size
();
c
++){
JSONObject
data
Scope
=
dataScopeArray
.
getJSONObject
(
c
);
createData
Scope
(
entity
,
deSource
,
dataScop
e
,
permissionType
,
systemId
,
ability_list
,
opprivList
);
//实体预置行为及数据集
}
}
}
...
...
@@ -297,13 +297,13 @@ public class PermissionFeignService {
* 根据实体行为或数据集合结合预定于数据类型生成数据范围
* @param entity
* @param source
* @param data
Rang
e
* @param data
Scop
e
* @param permissionType
* @param systemId
* @param ability_list
* @param opprivList
*/
private
void
createData
Range
(
JSONObject
entity
,
JSONObject
source
,
JSONObject
dataRang
e
,
String
permissionType
,
String
systemId
,
List
<
SYS_PERMISSION
>
ability_list
,
List
<
SYS_PSDEOPPRIV
>
opprivList
)
{
private
void
createData
Scope
(
JSONObject
entity
,
JSONObject
source
,
JSONObject
dataScop
e
,
String
permissionType
,
String
systemId
,
List
<
SYS_PERMISSION
>
ability_list
,
List
<
SYS_PSDEOPPRIV
>
opprivList
)
{
String
deName
=
entity
.
getString
(
"dename"
);
String
deLogicName
=
entity
.
getString
(
"delogicname"
);
...
...
@@ -312,10 +312,10 @@ public class PermissionFeignService {
String
moduleName
=
module
.
getString
(
"name"
);
String
sourceId
=
source
.
getString
(
"id"
);
String
sourceName
=
source
.
getString
(
"name"
);
String
dataRangeId
=
data
Rang
e
.
getString
(
"id"
);
String
dataRangeName
=
data
Rang
e
.
getString
(
"name"
);
String
dataRangeId
=
data
Scop
e
.
getString
(
"id"
);
String
dataRangeName
=
data
Scop
e
.
getString
(
"name"
);
String
permissionId
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%s%s%s%s
%s"
,
systemId
,
module
Id
,
deName
,
sourceId
,
dataRangeId
).
getBytes
());
String
permissionId
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%s%s%s%s
"
,
system
Id
,
deName
,
sourceId
,
dataRangeId
).
getBytes
());
String
permissionName
;
if
(!
StringUtils
.
isEmpty
(
dataRangeName
)){
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录