Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhny
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王夏晖
zhny
Commits
94b1011b
Commit
94b1011b
authored
May 15, 2018
by
gaoliwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
维护角色菜单
parent
adff762a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
16 deletions
+35
-16
UserController.java
...isoft/business/system/user/controller/UserController.java
+16
-7
UserService.java
...org/rcisoft/business/system/user/service/UserService.java
+8
-6
UserServiceImpl.java
...ft/business/system/user/service/impl/UserServiceImpl.java
+6
-0
PersistModel.java
src/main/java/org/rcisoft/core/model/PersistModel.java
+2
-1
Result.java
src/main/java/org/rcisoft/core/result/Result.java
+3
-2
No files found.
src/main/java/org/rcisoft/business/system/user/controller/UserController.java
View file @
94b1011b
...
@@ -3,11 +3,7 @@ package org.rcisoft.business.system.user.controller;
...
@@ -3,11 +3,7 @@ package org.rcisoft.business.system.user.controller;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.manage.entity.BusProject
;
import
org.rcisoft.business.system.user.entity.*
;
import
org.rcisoft.business.system.user.entity.SysAdmins
;
import
org.rcisoft.business.system.user.entity.SysOwner
;
import
org.rcisoft.business.system.user.entity.SysPrincipal
;
import
org.rcisoft.business.system.user.entity.SysUser
;
import
org.rcisoft.business.system.user.service.UserService
;
import
org.rcisoft.business.system.user.service.UserService
;
import
org.rcisoft.business.system.user.vo.UserDto
;
import
org.rcisoft.business.system.user.vo.UserDto
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.constant.MessageConstant
;
...
@@ -74,7 +70,7 @@ public class UserController extends PaginationController<SysUser> {
...
@@ -74,7 +70,7 @@ public class UserController extends PaginationController<SysUser> {
@ApiOperation
(
value
=
"通过用户ID查找用户信息"
)
@ApiOperation
(
value
=
"通过用户ID查找用户信息"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"userId"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"varchar"
)
,
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"userId"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"varchar"
)
})
})
@ResponseBody
@ResponseBody
@GetMapping
(
value
=
"/getUser/{userId}"
)
@GetMapping
(
value
=
"/getUser/{userId}"
)
...
@@ -86,7 +82,7 @@ public class UserController extends PaginationController<SysUser> {
...
@@ -86,7 +82,7 @@ public class UserController extends PaginationController<SysUser> {
@ApiOperation
(
value
=
"通过用户ID查找用户可以看到的菜单"
)
@ApiOperation
(
value
=
"通过用户ID查找用户可以看到的菜单"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"userId"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"varchar"
)
,
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"userId"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"varchar"
)
})
})
@ResponseBody
@ResponseBody
@GetMapping
(
value
=
"/listMenu"
)
@GetMapping
(
value
=
"/listMenu"
)
...
@@ -96,6 +92,19 @@ public class UserController extends PaginationController<SysUser> {
...
@@ -96,6 +92,19 @@ public class UserController extends PaginationController<SysUser> {
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
data
);
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
data
);
}
}
@ApiOperation
(
value
=
"修改角色可以看到的菜单"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"relRoleMenu"
,
value
=
"用户id,菜单id"
,
required
=
true
,
paramType
=
"body"
,
dataType
=
"RelRoleMenu"
)
})
@ResponseBody
@PostMapping
(
value
=
"/updateRoleMenu"
)
public
Result
updateRoleMenu
(
@RequestBody
RelRoleMenu
relRoleMenu
){
int
flag
=
userService
.
updateRoleMenu
(
relRoleMenu
);
return
Result
.
builder
(
new
PersistModel
(
flag
));
}
@ApiOperation
(
value
=
"查詢所有菜單"
)
@ApiOperation
(
value
=
"查詢所有菜單"
)
@ResponseBody
@ResponseBody
@GetMapping
(
value
=
"/listMenuAll"
)
@GetMapping
(
value
=
"/listMenuAll"
)
...
...
src/main/java/org/rcisoft/business/system/user/service/UserService.java
View file @
94b1011b
package
org
.
rcisoft
.
business
.
system
.
user
.
service
;
package
org
.
rcisoft
.
business
.
system
.
user
.
service
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.system.user.entity.*
;
import
org.rcisoft.business.device.assets.entity.BusDevice
;
import
org.rcisoft.business.system.user.entity.SysAdmins
;
import
org.rcisoft.business.system.user.entity.SysOwner
;
import
org.rcisoft.business.system.user.entity.SysPrincipal
;
import
org.rcisoft.business.system.user.entity.SysUser
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
java.util.List
;
import
java.util.List
;
...
@@ -63,6 +58,13 @@ public interface UserService {
...
@@ -63,6 +58,13 @@ public interface UserService {
*/
*/
List
<
Map
<
String
,
Object
>>
listMenuBuUserId
(
String
userId
);
List
<
Map
<
String
,
Object
>>
listMenuBuUserId
(
String
userId
);
/** 维护角色可以看到的菜单
* @param relRoleMenu
* @return
*/
int
updateRoleMenu
(
RelRoleMenu
relRoleMenu
);
List
<
Map
<
String
,
Object
>>
listMenuAll
();
List
<
Map
<
String
,
Object
>>
listMenuAll
();
List
<
Map
<
String
,
Object
>>
listRoleAll
();
List
<
Map
<
String
,
Object
>>
listRoleAll
();
...
...
src/main/java/org/rcisoft/business/system/user/service/impl/UserServiceImpl.java
View file @
94b1011b
...
@@ -241,6 +241,12 @@ public class UserServiceImpl implements UserService {
...
@@ -241,6 +241,12 @@ public class UserServiceImpl implements UserService {
return
handleMenu
(
list
);
return
handleMenu
(
list
);
}
}
@Override
public
int
updateRoleMenu
(
RelRoleMenu
relRoleMenu
)
{
int
flag
=
relRoleMenuRepository
.
updateByPrimaryKeySelective
(
relRoleMenu
);
return
flag
;
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
listMenuAll
()
{
public
List
<
Map
<
String
,
Object
>>
listMenuAll
()
{
List
<
Map
<
String
,
Object
>>
list
=
relUserRoleRepository
.
listMenuAll
();
List
<
Map
<
String
,
Object
>>
list
=
relUserRoleRepository
.
listMenuAll
();
...
...
src/main/java/org/rcisoft/core/model/PersistModel.java
View file @
94b1011b
...
@@ -33,8 +33,9 @@ public class PersistModel {
...
@@ -33,8 +33,9 @@ public class PersistModel {
* @return 是否成功
* @return 是否成功
*/
*/
public
boolean
isSuccessBySinglePersist
(){
public
boolean
isSuccessBySinglePersist
(){
if
(
1
<=
influence
)
if
(
1
<=
influence
)
{
return
true
;
return
true
;
}
return
false
;
return
false
;
}
}
}
}
src/main/java/org/rcisoft/core/result/Result.java
View file @
94b1011b
...
@@ -23,10 +23,11 @@ public class Result {
...
@@ -23,10 +23,11 @@ public class Result {
*/
*/
public
static
Result
builder
(
PersistModel
dataModel
,
String
sucMessage
,
String
errMessage
,
Object
data
){
public
static
Result
builder
(
PersistModel
dataModel
,
String
sucMessage
,
String
errMessage
,
Object
data
){
Result
result
=
new
Result
();
Result
result
=
new
Result
();
if
(
dataModel
.
isSuccessBySinglePersist
())
if
(
dataModel
.
isSuccessBySinglePersist
())
{
result
.
setSucessMessage
(
sucMessage
,
data
);
result
.
setSucessMessage
(
sucMessage
,
data
);
else
}
else
{
result
.
setErrorMessage
(
errMessage
,
data
);
result
.
setErrorMessage
(
errMessage
,
data
);
}
return
result
;
return
result
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment