Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzrt
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzrt
提交
61e248c2
提交
61e248c2
编写于
5月 27, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
94ebb895
变更
10
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
1041 行增加
和
1 行删除
+1041
-1
sys-role-permissions.ts
.../mock/entity/sys-role-permissions/sys-role-permissions.ts
+271
-0
sys-user-roles.ts
app_Web/src/mock/entity/sys-user-roles/sys-user-roles.ts
+271
-0
router.ts
app_Web/src/pages/rt/index/router.ts
+81
-0
sys-user-role-grid-view-base.vue
.../sys-user-role-grid-view/sys-user-role-grid-view-base.vue
+6
-1
sys-role-permission-service-base.ts
...e/sys-role-permission/sys-role-permission-service-base.ts
+34
-0
sys-role-service-base.ts
app_Web/src/service/sys-role/sys-role-service-base.ts
+100
-0
sys-user-role-service-base.ts
...b/src/service/sys-user-role/sys-user-role-service-base.ts
+34
-0
main-form-base.vue
app_Web/src/widgets/sys-role/main-form/main-form-base.vue
+2
-0
SysRolePermissionResource.java
...n/java/cn/ibizlab/api/rest/SysRolePermissionResource.java
+121
-0
SysUserRoleResource.java
...rc/main/java/cn/ibizlab/api/rest/SysUserRoleResource.java
+121
-0
未找到文件。
app_Web/src/mock/entity/sys-role-permissions/sys-role-permissions.ts
浏览文件 @
61e248c2
此差异已折叠。
点击以展开。
app_Web/src/mock/entity/sys-user-roles/sys-user-roles.ts
浏览文件 @
61e248c2
此差异已折叠。
点击以展开。
app_Web/src/pages/rt/index/router.ts
浏览文件 @
61e248c2
...
...
@@ -190,6 +190,20 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzdepartment-pickup-grid-view/ibzdepartment-pickup-grid-view.vue'
),
},
{
path
:
'sysroles/:sysrole?/sysuserroles/:sysuserrole?/gridview/:gridview?'
,
meta
:
{
caption
:
'entities.sysuserrole.views.gridview.caption'
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'sysroles'
,
parameterName
:
'sysrole'
},
{
pathName
:
'sysuserroles'
,
parameterName
:
'sysuserrole'
},
{
pathName
:
'gridview'
,
parameterName
:
'gridview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-user-role-grid-view/sys-user-role-grid-view.vue'
),
},
{
path
:
'sysuserroles/:sysuserrole?/gridview/:gridview?'
,
meta
:
{
...
...
@@ -415,6 +429,20 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzdepartment-edit-view/ibzdepartment-edit-view.vue'
),
},
{
path
:
'sysroles/:sysrole?/sysuserroles/:sysuserrole?/editview/:editview?'
,
meta
:
{
caption
:
'entities.sysuserrole.views.editview.caption'
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'sysroles'
,
parameterName
:
'sysrole'
},
{
pathName
:
'sysuserroles'
,
parameterName
:
'sysuserrole'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-user-role-edit-view/sys-user-role-edit-view.vue'
),
},
{
path
:
'sysuserroles/:sysuserrole?/editview/:editview?'
,
meta
:
{
...
...
@@ -441,6 +469,20 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/workflow/wfgroup-edit-view/wfgroup-edit-view.vue'
),
},
{
path
:
'sysroles/:sysrole?/sysrolepermissions/:sysrolepermission?/customview/:customview?'
,
meta
:
{
caption
:
'entities.sysrolepermission.views.customview.caption'
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'sysroles'
,
parameterName
:
'sysrole'
},
{
pathName
:
'sysrolepermissions'
,
parameterName
:
'sysrolepermission'
},
{
pathName
:
'customview'
,
parameterName
:
'customview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-role-permission-custom-view/sys-role-permission-custom-view.vue'
),
},
{
path
:
'sysrolepermissions/:sysrolepermission?/customview/:customview?'
,
meta
:
{
...
...
@@ -781,6 +823,19 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzorganization-tree-exp-view/ibzorganization-tree-exp-view.vue'
),
},
{
path
:
'/sysroles/:sysrole?/sysuserroles/:sysuserrole?/gridview/:gridview?'
,
meta
:
{
caption
:
'entities.sysuserrole.views.gridview.caption'
,
parameters
:
[
{
pathName
:
'sysroles'
,
parameterName
:
'sysrole'
},
{
pathName
:
'sysuserroles'
,
parameterName
:
'sysuserrole'
},
{
pathName
:
'gridview'
,
parameterName
:
'gridview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-user-role-grid-view/sys-user-role-grid-view.vue'
),
},
{
path
:
'/sysuserroles/:sysuserrole?/gridview/:gridview?'
,
meta
:
{
...
...
@@ -903,6 +958,19 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzorganization-edit-view/ibzorganization-edit-view.vue'
),
},
{
path
:
'/sysroles/:sysrole?/sysrolepermissions/:sysrolepermission?/customview/:customview?'
,
meta
:
{
caption
:
'entities.sysrolepermission.views.customview.caption'
,
parameters
:
[
{
pathName
:
'sysroles'
,
parameterName
:
'sysrole'
},
{
pathName
:
'sysrolepermissions'
,
parameterName
:
'sysrolepermission'
},
{
pathName
:
'customview'
,
parameterName
:
'customview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-role-permission-custom-view/sys-role-permission-custom-view.vue'
),
},
{
path
:
'/sysrolepermissions/:sysrolepermission?/customview/:customview?'
,
meta
:
{
...
...
@@ -1071,6 +1139,19 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzdepartment-pickup-grid-view/ibzdepartment-pickup-grid-view.vue'
),
},
{
path
:
'/sysroles/:sysrole?/sysuserroles/:sysuserrole?/editview/:editview?'
,
meta
:
{
caption
:
'entities.sysuserrole.views.editview.caption'
,
parameters
:
[
{
pathName
:
'sysroles'
,
parameterName
:
'sysrole'
},
{
pathName
:
'sysuserroles'
,
parameterName
:
'sysuserrole'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/uaa/sys-user-role-edit-view/sys-user-role-edit-view.vue'
),
},
{
path
:
'/sysuserroles/:sysuserrole?/editview/:editview?'
,
meta
:
{
...
...
app_Web/src/pages/uaa/sys-user-role-grid-view/sys-user-role-grid-view-base.vue
浏览文件 @
61e248c2
...
...
@@ -1183,7 +1183,12 @@ export default class SysUserRoleGridViewBase extends Vue {
if
(
args
.
length
>
0
){
Object
.
assign
(
curViewParam
,
args
[
0
]);
}
const
deResParameters
:
any
[]
=
[];
let
deResParameters
:
any
[]
=
[];
if
(
curViewParam
.
sysrole
&&
true
){
deResParameters
=
[
{
pathName
:
'sysroles'
,
parameterName
:
'sysrole'
},
]
}
const
parameters
:
any
[]
=
[
{
pathName
:
'sysuserroles'
,
parameterName
:
'sysuserrole'
},
{
pathName
:
'editview'
,
parameterName
:
'editview'
},
...
...
app_Web/src/service/sys-role-permission/sys-role-permission-service-base.ts
浏览文件 @
61e248c2
...
...
@@ -48,6 +48,9 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysrolepermission
){
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/
${
context
.
sysrolepermission
}
/select`
,
isloading
);
}
return
Http
.
getInstance
().
get
(
`/sysrolepermissions/
${
context
.
sysrolepermission
}
/select`
,
isloading
);
}
...
...
@@ -61,6 +64,9 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysrolepermission
){
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/
${
context
.
sysrolepermission
}
`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysrolepermissions/
${
context
.
sysrolepermission
}
`
,
isloading
);
return
res
;
...
...
@@ -76,6 +82,9 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysrolepermission
){
return
Http
.
getInstance
().
delete
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/
${
context
.
sysrolepermission
}
`
,
isloading
);
}
return
Http
.
getInstance
().
delete
(
`/sysrolepermissions/
${
context
.
sysrolepermission
}
`
,
isloading
);
}
...
...
@@ -90,6 +99,9 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
true
){
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/getdraft`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysrolepermissions/getdraft`
,
isloading
);
res
.
data
.
sysrolepermission
=
data
.
sysrolepermission
;
return
res
;
...
...
@@ -105,6 +117,15 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
true
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
return
Http
.
getInstance
().
post
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
...
...
@@ -128,6 +149,9 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysrolepermission
){
return
Http
.
getInstance
().
post
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/
${
context
.
sysrolepermission
}
/checkkey`
,
data
,
isloading
);
}
return
Http
.
getInstance
().
post
(
`/sysrolepermissions/
${
context
.
sysrolepermission
}
/checkkey`
,
data
,
isloading
);
}
...
...
@@ -141,6 +165,9 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysrolepermission
){
return
Http
.
getInstance
().
post
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/
${
context
.
sysrolepermission
}
/save`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sysrolepermissions/
${
context
.
sysrolepermission
}
/save`
,
data
,
isloading
);
...
...
@@ -157,6 +184,9 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysrolepermission
){
return
Http
.
getInstance
().
put
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/
${
context
.
sysrolepermission
}
`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sysrolepermissions/
${
context
.
sysrolepermission
}
`
,
data
,
isloading
);
...
...
@@ -173,6 +203,10 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @memberof SysRolePermissionServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysrolepermissions/fetchdefault`
,
tempData
,
isloading
);
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sysrolepermissions/fetchdefault`
,
tempData
,
isloading
);
}
...
...
app_Web/src/service/sys-role/sys-role-service-base.ts
浏览文件 @
61e248c2
...
...
@@ -62,8 +62,40 @@ export default class SysRoleServiceBase extends EntityService {
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sysuserrolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysuserroles'
),
'undefined'
)){
sysuserrolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysuserroles'
)
as
any
);
if
(
sysuserrolesData
&&
sysuserrolesData
.
length
&&
sysuserrolesData
.
length
>
0
){
sysuserrolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sysuserroles
=
sysuserrolesData
;
let
sysrolepermissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
),
'undefined'
)){
sysrolepermissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
)
as
any
);
if
(
sysrolepermissionsData
&&
sysrolepermissionsData
.
length
&&
sysrolepermissionsData
.
length
>
0
){
sysrolepermissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sysrolepermissions
=
sysrolepermissionsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sysroles/
${
context
.
sysrole
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysuserroles'
,
JSON
.
stringify
(
res
.
data
.
sysuserroles
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
,
JSON
.
stringify
(
res
.
data
.
sysrolepermissions
));
return
res
;
}
...
...
@@ -78,8 +110,40 @@ export default class SysRoleServiceBase extends EntityService {
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sysuserrolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysuserroles'
),
'undefined'
)){
sysuserrolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysuserroles'
)
as
any
);
if
(
sysuserrolesData
&&
sysuserrolesData
.
length
&&
sysuserrolesData
.
length
>
0
){
sysuserrolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sysuserroles
=
sysuserrolesData
;
let
sysrolepermissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
),
'undefined'
)){
sysrolepermissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
)
as
any
);
if
(
sysrolepermissionsData
&&
sysrolepermissionsData
.
length
&&
sysrolepermissionsData
.
length
>
0
){
sysrolepermissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sysrolepermissions
=
sysrolepermissionsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sysroles/
${
context
.
sysrole
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysuserroles'
,
JSON
.
stringify
(
res
.
data
.
sysuserroles
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
,
JSON
.
stringify
(
res
.
data
.
sysrolepermissions
));
return
res
;
}
...
...
@@ -94,6 +158,36 @@ export default class SysRoleServiceBase extends EntityService {
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sysuserrolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysuserroles'
),
'undefined'
)){
sysuserrolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysuserroles'
)
as
any
);
if
(
sysuserrolesData
&&
sysuserrolesData
.
length
&&
sysuserrolesData
.
length
>
0
){
sysuserrolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sysuserroles
=
sysuserrolesData
;
let
sysrolepermissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
),
'undefined'
)){
sysrolepermissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
)
as
any
);
if
(
sysrolepermissionsData
&&
sysrolepermissionsData
.
length
&&
sysrolepermissionsData
.
length
>
0
){
sysrolepermissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sysrolepermissions
=
sysrolepermissionsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -103,6 +197,8 @@ export default class SysRoleServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sysroles`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_sysuserroles'
,
JSON
.
stringify
(
res
.
data
.
sysuserroles
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_sysrolepermissions'
,
JSON
.
stringify
(
res
.
data
.
sysrolepermissions
));
return
res
;
}
...
...
@@ -117,6 +213,8 @@ export default class SysRoleServiceBase extends EntityService {
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysuserroles'
,
JSON
.
stringify
(
res
.
data
.
sysuserroles
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
,
JSON
.
stringify
(
res
.
data
.
sysrolepermissions
));
return
res
;
}
...
...
@@ -147,6 +245,8 @@ export default class SysRoleServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysroles/getdraft`
,
isloading
);
res
.
data
.
sysrole
=
data
.
sysrole
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysuserroles'
,
JSON
.
stringify
(
res
.
data
.
sysuserroles
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sysrolepermissions'
,
JSON
.
stringify
(
res
.
data
.
sysrolepermissions
));
return
res
;
}
...
...
app_Web/src/service/sys-user-role/sys-user-role-service-base.ts
浏览文件 @
61e248c2
...
...
@@ -48,6 +48,9 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysuserrole
){
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/
${
context
.
sysuserrole
}
/select`
,
isloading
);
}
return
Http
.
getInstance
().
get
(
`/sysuserroles/
${
context
.
sysuserrole
}
/select`
,
isloading
);
}
...
...
@@ -61,6 +64,9 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysuserrole
){
return
Http
.
getInstance
().
post
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/
${
context
.
sysuserrole
}
/checkkey`
,
data
,
isloading
);
}
return
Http
.
getInstance
().
post
(
`/sysuserroles/
${
context
.
sysuserrole
}
/checkkey`
,
data
,
isloading
);
}
...
...
@@ -74,6 +80,9 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
true
){
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/getdraft`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysuserroles/getdraft`
,
isloading
);
res
.
data
.
sysuserrole
=
data
.
sysuserrole
;
return
res
;
...
...
@@ -89,6 +98,9 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysuserrole
){
return
Http
.
getInstance
().
put
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/
${
context
.
sysuserrole
}
`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sysuserroles/
${
context
.
sysuserrole
}
`
,
data
,
isloading
);
...
...
@@ -105,6 +117,9 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysuserrole
){
return
Http
.
getInstance
().
delete
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/
${
context
.
sysuserrole
}
`
,
isloading
);
}
return
Http
.
getInstance
().
delete
(
`/sysuserroles/
${
context
.
sysuserrole
}
`
,
isloading
);
}
...
...
@@ -119,6 +134,15 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
true
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
return
Http
.
getInstance
().
post
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
...
...
@@ -142,6 +166,9 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysuserrole
){
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/
${
context
.
sysuserrole
}
`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sysuserroles/
${
context
.
sysuserrole
}
`
,
isloading
);
return
res
;
...
...
@@ -157,6 +184,9 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
context
.
sysuserrole
){
return
Http
.
getInstance
().
post
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/
${
context
.
sysuserrole
}
/save`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sysuserroles/
${
context
.
sysuserrole
}
/save`
,
data
,
isloading
);
...
...
@@ -173,6 +203,10 @@ export default class SysUserRoleServiceBase extends EntityService {
* @memberof SysUserRoleServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sysrole
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sysroles/
${
context
.
sysrole
}
/sysuserroles/fetchdefault`
,
tempData
,
isloading
);
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sysuserroles/fetchdefault`
,
tempData
,
isloading
);
}
...
...
app_Web/src/widgets/sys-role/main-form/main-form-base.vue
浏览文件 @
61e248c2
...
...
@@ -43,6 +43,7 @@
paramItem=
'sysrole'
:parentdata=
'
{"srfparentdefname":"SYS_ROLEID","srfparentdename":"SYS_ROLE","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID","SRFDER1NID":"DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID"}'
:parameters="[
{ pathName: 'sysroles', parameterName: 'sysrole' },
]"
:context="context"
:viewparams="viewparams"
...
...
@@ -78,6 +79,7 @@
paramItem=
'sysrole'
:parentdata=
'
{"srfparentdefname":"SYS_ROLEID","srfparentdename":"SYS_ROLE","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_SYS_USER_ROLE_SYS_ROLE_SYS_ROLEID","SRFDER1NID":"DER1N_SYS_USER_ROLE_SYS_ROLE_SYS_ROLEID"}'
:parameters="[
{ pathName: 'sysroles', parameterName: 'sysrole' },
]"
:context="context"
:viewparams="viewparams"
...
...
ibzrt-provider/ibzrt-provider-api/src/main/java/cn/ibizlab/api/rest/SysRolePermissionResource.java
浏览文件 @
61e248c2
...
...
@@ -147,5 +147,126 @@ public class SysRolePermissionResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sysrolepermissionMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"GetBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"GetBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}"
)
public
ResponseEntity
<
SysRolePermissionDTO
>
getBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@PathVariable
(
"sysrolepermission_id"
)
String
sysrolepermission_id
)
{
SysRolePermission
domain
=
sysrolepermissionService
.
get
(
sysrolepermission_id
);
SysRolePermissionDTO
dto
=
sysrolepermissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"RemoveBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"RemoveBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}"
)
public
ResponseEntity
<
Boolean
>
removeBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@PathVariable
(
"sysrolepermission_id"
)
String
sysrolepermission_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysrolepermissionService
.
remove
(
sysrolepermission_id
));
}
@ApiOperation
(
value
=
"RemoveBatchBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"RemoveBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchBySysRole
(
@RequestBody
List
<
String
>
ids
)
{
sysrolepermissionService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetDraftBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"GetDraftBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/getdraft"
)
public
ResponseEntity
<
SysRolePermissionDTO
>
getDraftBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
)
{
SysRolePermission
domain
=
new
SysRolePermission
();
domain
.
setRoleid
(
sysrole_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysrolepermissionMapping
.
toDto
(
sysrolepermissionService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"CreateBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"CreateBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions"
)
public
ResponseEntity
<
SysRolePermissionDTO
>
createBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysRolePermissionDTO
sysrolepermissiondto
)
{
SysRolePermission
domain
=
sysrolepermissionMapping
.
toDomain
(
sysrolepermissiondto
);
domain
.
setRoleid
(
sysrole_id
);
sysrolepermissionService
.
create
(
domain
);
SysRolePermissionDTO
dto
=
sysrolepermissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"createBatchBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"createBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/batch"
)
public
ResponseEntity
<
Boolean
>
createBatchBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
List
<
SysRolePermissionDTO
>
sysrolepermissiondtos
)
{
List
<
SysRolePermission
>
domainlist
=
sysrolepermissionMapping
.
toDomain
(
sysrolepermissiondtos
);
for
(
SysRolePermission
domain:
domainlist
){
domain
.
setRoleid
(
sysrole_id
);
}
sysrolepermissionService
.
createBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CheckKeyBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"CheckKeyBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysRolePermissionDTO
sysrolepermissiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysrolepermissionService
.
checkKey
(
sysrolepermissionMapping
.
toDomain
(
sysrolepermissiondto
)));
}
@ApiOperation
(
value
=
"SaveBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"SaveBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/save"
)
public
ResponseEntity
<
Boolean
>
saveBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysRolePermissionDTO
sysrolepermissiondto
)
{
SysRolePermission
domain
=
sysrolepermissionMapping
.
toDomain
(
sysrolepermissiondto
);
domain
.
setRoleid
(
sysrole_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysrolepermissionService
.
save
(
domain
));
}
@ApiOperation
(
value
=
"SaveBatchBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"SaveBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
List
<
SysRolePermissionDTO
>
sysrolepermissiondtos
)
{
List
<
SysRolePermission
>
domainlist
=
sysrolepermissionMapping
.
toDomain
(
sysrolepermissiondtos
);
for
(
SysRolePermission
domain:
domainlist
){
domain
.
setRoleid
(
sysrole_id
);
}
sysrolepermissionService
.
saveBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"UpdateBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"UpdateBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}"
)
public
ResponseEntity
<
SysRolePermissionDTO
>
updateBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@PathVariable
(
"sysrolepermission_id"
)
String
sysrolepermission_id
,
@RequestBody
SysRolePermissionDTO
sysrolepermissiondto
)
{
SysRolePermission
domain
=
sysrolepermissionMapping
.
toDomain
(
sysrolepermissiondto
);
domain
.
setRoleid
(
sysrole_id
);
domain
.
setRolepermissionid
(
sysrolepermission_id
);
sysrolepermissionService
.
update
(
domain
);
SysRolePermissionDTO
dto
=
sysrolepermissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"UpdateBatchBySysRole"
,
tags
=
{
"SysRolePermission"
},
notes
=
"UpdateBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatchBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
List
<
SysRolePermissionDTO
>
sysrolepermissiondtos
)
{
List
<
SysRolePermission
>
domainlist
=
sysrolepermissionMapping
.
toDomain
(
sysrolepermissiondtos
);
for
(
SysRolePermission
domain:
domainlist
){
domain
.
setRoleid
(
sysrole_id
);
}
sysrolepermissionService
.
updateBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"fetchDEFAULTBySysRole"
,
tags
=
{
"SysRolePermission"
}
,
notes
=
"fetchDEFAULTBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/fetchdefault"
)
public
ResponseEntity
<
List
<
SysRolePermissionDTO
>>
fetchSysRolePermissionDefaultBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
SysRolePermissionSearchContext
context
)
{
context
.
setN_sys_roleid_eq
(
sysrole_id
);
Page
<
SysRolePermission
>
domains
=
sysrolepermissionService
.
searchDefault
(
context
)
;
List
<
SysRolePermissionDTO
>
list
=
sysrolepermissionMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"searchDEFAULTBySysRole"
,
tags
=
{
"SysRolePermission"
}
,
notes
=
"searchDEFAULTBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysrolepermissions/searchdefault"
)
public
ResponseEntity
<
Page
<
SysRolePermissionDTO
>>
searchSysRolePermissionDefaultBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysRolePermissionSearchContext
context
)
{
context
.
setN_sys_roleid_eq
(
sysrole_id
);
Page
<
SysRolePermission
>
domains
=
sysrolepermissionService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sysrolepermissionMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
ibzrt-provider/ibzrt-provider-api/src/main/java/cn/ibizlab/api/rest/SysUserRoleResource.java
浏览文件 @
61e248c2
...
...
@@ -147,5 +147,126 @@ public class SysUserRoleResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sysuserroleMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"CheckKeyBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"CheckKeyBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysUserRoleDTO
sysuserroledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysuserroleService
.
checkKey
(
sysuserroleMapping
.
toDomain
(
sysuserroledto
)));
}
@ApiOperation
(
value
=
"GetDraftBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"GetDraftBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/getdraft"
)
public
ResponseEntity
<
SysUserRoleDTO
>
getDraftBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
)
{
SysUserRole
domain
=
new
SysUserRole
();
domain
.
setUserid
(
sysrole_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysuserroleMapping
.
toDto
(
sysuserroleService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"UpdateBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"UpdateBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/{sysuserrole_id}"
)
public
ResponseEntity
<
SysUserRoleDTO
>
updateBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@PathVariable
(
"sysuserrole_id"
)
String
sysuserrole_id
,
@RequestBody
SysUserRoleDTO
sysuserroledto
)
{
SysUserRole
domain
=
sysuserroleMapping
.
toDomain
(
sysuserroledto
);
domain
.
setUserid
(
sysrole_id
);
domain
.
setUserroleid
(
sysuserrole_id
);
sysuserroleService
.
update
(
domain
);
SysUserRoleDTO
dto
=
sysuserroleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"UpdateBatchBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"UpdateBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatchBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
List
<
SysUserRoleDTO
>
sysuserroledtos
)
{
List
<
SysUserRole
>
domainlist
=
sysuserroleMapping
.
toDomain
(
sysuserroledtos
);
for
(
SysUserRole
domain:
domainlist
){
domain
.
setUserid
(
sysrole_id
);
}
sysuserroleService
.
updateBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"RemoveBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"RemoveBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/{sysuserrole_id}"
)
public
ResponseEntity
<
Boolean
>
removeBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@PathVariable
(
"sysuserrole_id"
)
String
sysuserrole_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysuserroleService
.
remove
(
sysuserrole_id
));
}
@ApiOperation
(
value
=
"RemoveBatchBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"RemoveBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchBySysRole
(
@RequestBody
List
<
String
>
ids
)
{
sysuserroleService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CreateBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"CreateBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysuserroles"
)
public
ResponseEntity
<
SysUserRoleDTO
>
createBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysUserRoleDTO
sysuserroledto
)
{
SysUserRole
domain
=
sysuserroleMapping
.
toDomain
(
sysuserroledto
);
domain
.
setUserid
(
sysrole_id
);
sysuserroleService
.
create
(
domain
);
SysUserRoleDTO
dto
=
sysuserroleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"createBatchBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"createBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/batch"
)
public
ResponseEntity
<
Boolean
>
createBatchBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
List
<
SysUserRoleDTO
>
sysuserroledtos
)
{
List
<
SysUserRole
>
domainlist
=
sysuserroleMapping
.
toDomain
(
sysuserroledtos
);
for
(
SysUserRole
domain:
domainlist
){
domain
.
setUserid
(
sysrole_id
);
}
sysuserroleService
.
createBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"GetBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/{sysuserrole_id}"
)
public
ResponseEntity
<
SysUserRoleDTO
>
getBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@PathVariable
(
"sysuserrole_id"
)
String
sysuserrole_id
)
{
SysUserRole
domain
=
sysuserroleService
.
get
(
sysuserrole_id
);
SysUserRoleDTO
dto
=
sysuserroleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"SaveBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"SaveBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/save"
)
public
ResponseEntity
<
Boolean
>
saveBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysUserRoleDTO
sysuserroledto
)
{
SysUserRole
domain
=
sysuserroleMapping
.
toDomain
(
sysuserroledto
);
domain
.
setUserid
(
sysrole_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sysuserroleService
.
save
(
domain
));
}
@ApiOperation
(
value
=
"SaveBatchBySysRole"
,
tags
=
{
"SysUserRole"
},
notes
=
"SaveBatchBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
List
<
SysUserRoleDTO
>
sysuserroledtos
)
{
List
<
SysUserRole
>
domainlist
=
sysuserroleMapping
.
toDomain
(
sysuserroledtos
);
for
(
SysUserRole
domain:
domainlist
){
domain
.
setUserid
(
sysrole_id
);
}
sysuserroleService
.
saveBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"fetchDEFAULTBySysRole"
,
tags
=
{
"SysUserRole"
}
,
notes
=
"fetchDEFAULTBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/fetchdefault"
)
public
ResponseEntity
<
List
<
SysUserRoleDTO
>>
fetchSysUserRoleDefaultBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
SysUserRoleSearchContext
context
)
{
context
.
setN_sys_userid_eq
(
sysrole_id
);
Page
<
SysUserRole
>
domains
=
sysuserroleService
.
searchDefault
(
context
)
;
List
<
SysUserRoleDTO
>
list
=
sysuserroleMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"searchDEFAULTBySysRole"
,
tags
=
{
"SysUserRole"
}
,
notes
=
"searchDEFAULTBySysRole"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sysroles/{sysrole_id}/sysuserroles/searchdefault"
)
public
ResponseEntity
<
Page
<
SysUserRoleDTO
>>
searchSysUserRoleDefaultBySysRole
(
@PathVariable
(
"sysrole_id"
)
String
sysrole_id
,
@RequestBody
SysUserRoleSearchContext
context
)
{
context
.
setN_sys_userid_eq
(
sysrole_id
);
Page
<
SysUserRole
>
domains
=
sysuserroleService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sysuserroleMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录