Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
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
TCM
tcm-system
Commits
d351b736
Commit
d351b736
authored
Jun 15, 2019
by
zjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user/role/tright 6.15
parent
afe32438
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
10 deletions
+71
-10
AuthorityController.java
...angding/web/authority/controller/AuthorityController.java
+4
-3
AuthorityService.java
.../com/pangding/web/authority/service/AuthorityService.java
+4
-3
AuthorityServiceImpl.java
...ding/web/authority/service/impl/AuthorityServiceImpl.java
+24
-4
AuthorityListReqVo.java
...m/pangding/web/authority/vo/reqvo/AuthorityListReqVo.java
+10
-0
AuthorityListResVo.java
...m/pangding/web/authority/vo/resvo/AuthorityListResVo.java
+29
-0
No files found.
src/main/java/com/pangding/web/authority/controller/AuthorityController.java
View file @
d351b736
...
@@ -5,6 +5,7 @@ import com.pangding.web.authority.service.AuthorityService;
...
@@ -5,6 +5,7 @@ import com.pangding.web.authority.service.AuthorityService;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.vo.resvo.AuthorityListByLevelResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityListByLevelResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityListResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.WebAuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.WebAuthorityResVo
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
...
@@ -34,7 +35,7 @@ public class AuthorityController {
...
@@ -34,7 +35,7 @@ public class AuthorityController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
List
<
AuthorityListByLevelResVo
>
>
saveAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
public
ResponseResult
<
AuthorityListResVo
>
saveAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
CheckerHelper
.
newInstance
()
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"authorityName"
,
authorityVo
.
getName
())
.
notBlankCheck
(
"authorityName"
,
authorityVo
.
getName
())
.
notBlankCheck
(
"type"
,
authorityVo
.
getType
())
.
notBlankCheck
(
"type"
,
authorityVo
.
getType
())
...
@@ -53,7 +54,7 @@ public class AuthorityController {
...
@@ -53,7 +54,7 @@ public class AuthorityController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
List
<
AuthorityListByLevelResVo
>
>
updateAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
public
ResponseResult
<
AuthorityListResVo
>
updateAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
CheckerHelper
.
newInstance
()
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"authorityName"
,
authorityVo
.
getName
())
.
notBlankCheck
(
"authorityName"
,
authorityVo
.
getName
())
.
notBlankCheck
(
"type"
,
authorityVo
.
getType
())
.
notBlankCheck
(
"type"
,
authorityVo
.
getType
())
...
@@ -89,7 +90,7 @@ public class AuthorityController {
...
@@ -89,7 +90,7 @@ public class AuthorityController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/listByLevel"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/listByLevel"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
List
<
AuthorityListByLevelResVo
>
>
listByLevel
(
@RequestBody
AuthorityListReqVo
reqVo
){
public
ResponseResult
<
AuthorityListResVo
>
listByLevel
(
@RequestBody
AuthorityListReqVo
reqVo
){
return
ResponseResult
.
result
(
authorityServiceImpl
.
getListByLevel
(
reqVo
));
return
ResponseResult
.
result
(
authorityServiceImpl
.
getListByLevel
(
reqVo
));
}
}
...
...
src/main/java/com/pangding/web/authority/service/AuthorityService.java
View file @
d351b736
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.service;
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.service;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.vo.resvo.AuthorityListByLevelResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityListByLevelResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityListResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.WebAuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.WebAuthorityResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.PageSizeData
;
...
@@ -19,7 +20,7 @@ public interface AuthorityService {
...
@@ -19,7 +20,7 @@ public interface AuthorityService {
* @param authorityVo authorityVo对象
* @param authorityVo authorityVo对象
* @return 用户id
* @return 用户id
*/
*/
List
<
AuthorityListByLevelResVo
>
save
(
AuthorityVo
authorityVo
);
AuthorityListResVo
save
(
AuthorityVo
authorityVo
);
/**
/**
* 更新authorityVo对象数据
* 更新authorityVo对象数据
...
@@ -27,7 +28,7 @@ public interface AuthorityService {
...
@@ -27,7 +28,7 @@ public interface AuthorityService {
* @param authorityVo authorityVo对象
* @param authorityVo authorityVo对象
* @return 用户id
* @return 用户id
*/
*/
List
<
AuthorityListByLevelResVo
>
update
(
AuthorityVo
authorityVo
);
AuthorityListResVo
update
(
AuthorityVo
authorityVo
);
/**
/**
* 通过权限表主键获取authorityVo对象
* 通过权限表主键获取authorityVo对象
...
@@ -68,7 +69,7 @@ public interface AuthorityService {
...
@@ -68,7 +69,7 @@ public interface AuthorityService {
*/
*/
List
<
AuthorityVo
>
getAuthorityList
(
AuthorityListReqVo
reqVo
);
List
<
AuthorityVo
>
getAuthorityList
(
AuthorityListReqVo
reqVo
);
List
<
AuthorityListByLevelResVo
>
getListByLevel
(
AuthorityListReqVo
reqVo
);
AuthorityListResVo
getListByLevel
(
AuthorityListReqVo
reqVo
);
List
<
AuthorityListByLevelResVo
>
getCompanyAuthority
(
CompanyAuthorityReqVo
reqVo
);
List
<
AuthorityListByLevelResVo
>
getCompanyAuthority
(
CompanyAuthorityReqVo
reqVo
);
...
...
src/main/java/com/pangding/web/authority/service/impl/AuthorityServiceImpl.java
View file @
d351b736
...
@@ -9,6 +9,7 @@ import com.pangding.web.authority.vo.reqvo.*;
...
@@ -9,6 +9,7 @@ import com.pangding.web.authority.vo.reqvo.*;
import
com.pangding.web.authority.service.AuthorityService
;
import
com.pangding.web.authority.service.AuthorityService
;
import
com.pangding.web.authority.vo.*
;
import
com.pangding.web.authority.vo.*
;
import
com.pangding.web.authority.vo.resvo.AuthorityListByLevelResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityListByLevelResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityListResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.AuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.WebAuthorityResVo
;
import
com.pangding.web.authority.vo.resvo.WebAuthorityResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.base.ObjectHelper
;
...
@@ -45,7 +46,7 @@ public class AuthorityServiceImpl implements AuthorityService {
...
@@ -45,7 +46,7 @@ public class AuthorityServiceImpl implements AuthorityService {
*/
*/
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
AuthorityListByLevelResVo
>
save
(
AuthorityVo
authorityVo
)
{
public
AuthorityListResVo
save
(
AuthorityVo
authorityVo
)
{
/*this.checkValid(authorityVo);*/
/*this.checkValid(authorityVo);*/
if
(
null
==
authorityVo
.
getPid
()
||
authorityVo
.
getPid
().
isEmpty
()){
if
(
null
==
authorityVo
.
getPid
()
||
authorityVo
.
getPid
().
isEmpty
()){
authorityVo
.
setPid
(
""
);
authorityVo
.
setPid
(
""
);
...
@@ -106,7 +107,7 @@ public class AuthorityServiceImpl implements AuthorityService {
...
@@ -106,7 +107,7 @@ public class AuthorityServiceImpl implements AuthorityService {
*/
*/
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
AuthorityListByLevelResVo
>
update
(
AuthorityVo
authorityVo
)
{
public
AuthorityListResVo
update
(
AuthorityVo
authorityVo
)
{
/*this.checkValid(authorityVo);*/
/*this.checkValid(authorityVo);*/
if
(
null
==
authorityVo
.
getPid
()
||
authorityVo
.
getPid
().
isEmpty
()){
if
(
null
==
authorityVo
.
getPid
()
||
authorityVo
.
getPid
().
isEmpty
()){
authorityVo
.
setPid
(
""
);
authorityVo
.
setPid
(
""
);
...
@@ -246,7 +247,7 @@ public class AuthorityServiceImpl implements AuthorityService {
...
@@ -246,7 +247,7 @@ public class AuthorityServiceImpl implements AuthorityService {
}
}
@Override
@Override
public
List
<
AuthorityListByLevelResVo
>
getListByLevel
(
AuthorityListReqVo
reqVo
)
{
public
AuthorityListResVo
getListByLevel
(
AuthorityListReqVo
reqVo
)
{
List
<
AuthorityVo
>
parentList
=
authorityDao
.
getLevelOne
(
reqVo
);
List
<
AuthorityVo
>
parentList
=
authorityDao
.
getLevelOne
(
reqVo
);
if
(
null
==
parentList
||
parentList
.
isEmpty
()){
if
(
null
==
parentList
||
parentList
.
isEmpty
()){
throw
new
CodeException
(
"暂无一级权限,请添加"
);
throw
new
CodeException
(
"暂无一级权限,请添加"
);
...
@@ -259,7 +260,26 @@ public class AuthorityServiceImpl implements AuthorityService {
...
@@ -259,7 +260,26 @@ public class AuthorityServiceImpl implements AuthorityService {
resVo
.
setChildList
(
childList
);
resVo
.
setChildList
(
childList
);
resVoList
.
add
(
resVo
);
resVoList
.
add
(
resVo
);
}
}
return
resVoList
;
/*返回对象*/
AuthorityListResVo
authorityListResVo
=
new
AuthorityListResVo
();
authorityListResVo
.
setAuthorityListByLevel
(
resVoList
);
/*若roleId存在,则需要返回该角色拥有的权限列表*/
if
(
null
!=
reqVo
.
getRoleId
()
&&
!
reqVo
.
getRoleId
().
isEmpty
()){
RoleAuthorityGetReqVo
roleAuthorityGetReqVo
=
new
RoleAuthorityGetReqVo
();
roleAuthorityGetReqVo
.
setRoleId
(
reqVo
.
getRoleId
());
List
<
RoleAuthorityVo
>
roleAuthorityVoList
=
roleAuthorityDao
.
loadList
(
roleAuthorityGetReqVo
,
RoleAuthorityVo
.
class
);
List
<
String
>
authorityIdList
=
new
ArrayList
<>();
if
(
null
!=
roleAuthorityVoList
&&
!
roleAuthorityVoList
.
isEmpty
()){
for
(
RoleAuthorityVo
roleAuthorityVo:
roleAuthorityVoList
)
{
authorityIdList
.
add
(
roleAuthorityVo
.
getAuthorityId
());
}
}
authorityListResVo
.
setAuthorityListByRole
(
authorityIdList
);
}
return
authorityListResVo
;
}
}
private
List
<
AuthorityListByLevelResVo
>
getChildList
(
String
id
){
private
List
<
AuthorityListByLevelResVo
>
getChildList
(
String
id
){
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/AuthorityListReqVo.java
View file @
d351b736
...
@@ -9,6 +9,16 @@ public class AuthorityListReqVo {
...
@@ -9,6 +9,16 @@ public class AuthorityListReqVo {
private
String
levelOne
;
private
String
levelOne
;
private
String
roleId
;
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getLevelOne
()
{
public
String
getLevelOne
()
{
return
levelOne
;
return
levelOne
;
}
}
...
...
src/main/java/com/pangding/web/authority/vo/resvo/AuthorityListResVo.java
0 → 100644
View file @
d351b736
package
com
.
pangding
.
web
.
authority
.
vo
.
resvo
;
import
java.util.List
;
/**
* @Author zhangjinyao
* @create 2019/6/15 17:43
*/
public
class
AuthorityListResVo
{
private
List
<
AuthorityListByLevelResVo
>
authorityListByLevel
;
private
List
<
String
>
authorityListByRole
;
public
List
<
AuthorityListByLevelResVo
>
getAuthorityListByLevel
()
{
return
authorityListByLevel
;
}
public
void
setAuthorityListByLevel
(
List
<
AuthorityListByLevelResVo
>
authorityListByLevel
)
{
this
.
authorityListByLevel
=
authorityListByLevel
;
}
public
List
<
String
>
getAuthorityListByRole
()
{
return
authorityListByRole
;
}
public
void
setAuthorityListByRole
(
List
<
String
>
authorityListByRole
)
{
this
.
authorityListByRole
=
authorityListByRole
;
}
}
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