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
65d90702
Commit
65d90702
authored
May 15, 2019
by
zjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user/role/tright 5.15
个体用户还需要增加Token 准备企业用户注册 user/role/tright修改完
parent
fd52bb0e
Changes
46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
780 additions
and
656 deletions
+780
-656
readme.md
readme.md
+1
-1
AuthorityController.java
...angding/web/authority/controller/AuthorityController.java
+22
-34
ComputerRegisterController.java
.../web/authority/controller/ComputerRegisterController.java
+0
-1
MobileRegisterController.java
...ng/web/authority/controller/MobileRegisterController.java
+0
-1
RoleController.java
...com/pangding/web/authority/controller/RoleController.java
+22
-61
UserController.java
...com/pangding/web/authority/controller/UserController.java
+18
-77
AuthorityDao.java
...ain/java/com/pangding/web/authority/dao/AuthorityDao.java
+8
-3
RoleAuthorityDao.java
...java/com/pangding/web/authority/dao/RoleAuthorityDao.java
+4
-12
RoleDao.java
src/main/java/com/pangding/web/authority/dao/RoleDao.java
+9
-8
UserDao.java
src/main/java/com/pangding/web/authority/dao/UserDao.java
+8
-11
UserRoleDao.java
...main/java/com/pangding/web/authority/dao/UserRoleDao.java
+4
-12
AuthorityDaoImpl.java
...com/pangding/web/authority/dao/impl/AuthorityDaoImpl.java
+18
-4
RoleAuthorityDaoImpl.java
...pangding/web/authority/dao/impl/RoleAuthorityDaoImpl.java
+5
-12
RoleDaoImpl.java
...java/com/pangding/web/authority/dao/impl/RoleDaoImpl.java
+11
-9
UserDaoImpl.java
...java/com/pangding/web/authority/dao/impl/UserDaoImpl.java
+9
-10
UserRoleDaoImpl.java
.../com/pangding/web/authority/dao/impl/UserRoleDaoImpl.java
+5
-10
GetRoleAuthorityListByRoleIdReqVo.java
...eb/authority/reqvo/GetRoleAuthorityListByRoleIdReqVo.java
+0
-21
GetUserByCompanyIdReqVo.java
...pangding/web/authority/reqvo/GetUserByCompanyIdReqVo.java
+0
-17
GetUserByIdReqVo.java
...va/com/pangding/web/authority/reqvo/GetUserByIdReqVo.java
+0
-17
GetUserByPhoneReqVo.java
...com/pangding/web/authority/reqvo/GetUserByPhoneReqVo.java
+0
-17
GetUserRoleListByUserIdReqVo.java
...ing/web/authority/reqvo/GetUserRoleListByUserIdReqVo.java
+0
-17
AuthorityService.java
.../com/pangding/web/authority/service/AuthorityService.java
+10
-16
RoleService.java
.../java/com/pangding/web/authority/service/RoleService.java
+20
-12
UserService.java
.../java/com/pangding/web/authority/service/UserService.java
+16
-19
AuthorityServiceImpl.java
...ding/web/authority/service/impl/AuthorityServiceImpl.java
+61
-23
MobileRegisterServiceImpl.java
...web/authority/service/impl/MobileRegisterServiceImpl.java
+0
-2
RoleServiceImpl.java
.../pangding/web/authority/service/impl/RoleServiceImpl.java
+125
-68
UserServiceImpl.java
.../pangding/web/authority/service/impl/UserServiceImpl.java
+156
-68
Md5AndSalt.java
...ain/java/com/pangding/web/authority/utils/Md5AndSalt.java
+0
-61
RoleAuthorityVo.java
...n/java/com/pangding/web/authority/vo/RoleAuthorityVo.java
+1
-1
UserRoleVo.java
src/main/java/com/pangding/web/authority/vo/UserRoleVo.java
+1
-1
AuthorityGetReqVo.java
...om/pangding/web/authority/vo/reqvo/AuthorityGetReqVo.java
+27
-0
ListAuthorityReqVo.java
...m/pangding/web/authority/vo/reqvo/ListAuthorityReqVo.java
+19
-0
ListRoleReqVo.java
...va/com/pangding/web/authority/vo/reqvo/ListRoleReqVo.java
+10
-0
ListUserReqVo.java
...va/com/pangding/web/authority/vo/reqvo/ListUserReqVo.java
+10
-0
RoleAuthorityGetReqVo.java
...angding/web/authority/vo/reqvo/RoleAuthorityGetReqVo.java
+12
-2
RoleGetReqVo.java
...ava/com/pangding/web/authority/vo/reqvo/RoleGetReqVo.java
+27
-0
UserGetReqVo.java
...ava/com/pangding/web/authority/vo/reqvo/UserGetReqVo.java
+50
-0
UserRoleGetReqVo.java
...com/pangding/web/authority/vo/reqvo/UserRoleGetReqVo.java
+27
-0
UserRoleRemoveReqVo.java
.../pangding/web/authority/vo/reqvo/UserRoleRemoveReqVo.java
+2
-2
WebAuthorityReqVo.java
...om/pangding/web/authority/vo/reqvo/WebAuthorityReqVo.java
+3
-3
WebAuthorityResVo.java
...om/pangding/web/authority/vo/reqvo/WebAuthorityResVo.java
+11
-0
WebRoleReqVo.java
...ava/com/pangding/web/authority/vo/reqvo/WebRoleReqVo.java
+2
-12
WebRoleResVo.java
...ava/com/pangding/web/authority/vo/reqvo/WebRoleResVo.java
+22
-0
WebUserReqVo.java
...ava/com/pangding/web/authority/vo/reqvo/WebUserReqVo.java
+2
-11
WebUserResVo.java
...ava/com/pangding/web/authority/vo/reqvo/WebUserResVo.java
+22
-0
No files found.
readme.md
View file @
65d90702
...
...
@@ -147,7 +147,7 @@ StringHelper.md5(from)
# 如下代码需要调换顺序
```
java
List
<
RoleVo
>
roleVoList
=
roleServiceImpl
.
getRoleVoList
();
List
<
RoleDto
>
roleDt
oList
=
new
ArrayList
(
roleVoList
.
size
());
// roleVoList有可能为null
List
<
RoleDto
>
webRoleReqV
oList
=
new
ArrayList
(
roleVoList
.
size
());
// roleVoList有可能为null
if
(
roleVoList
==
null
||
roleVoList
.
size
()
==
0
){
return
new
Result
(
0
,
"暂无角色信息"
,
null
);
}
...
...
src/main/java/com/pangding/web/authority/controller/AuthorityController.java
View file @
65d90702
...
...
@@ -4,6 +4,11 @@ package com.pangding.web.authority.controller;
import
com.pangding.web.authority.currency.Result
;
import
com.pangding.web.authority.service.AuthorityService
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebAuthorityReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebAuthorityResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -26,11 +31,9 @@ public class AuthorityController {
* @return
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
saveAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
authorityServiceImpl
.
checkValid
(
authorityVo
);
public
ResponseResult
saveAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
authorityServiceImpl
.
save
(
authorityVo
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
return
new
ResponseResult
();
}
/**
...
...
@@ -39,11 +42,9 @@ public class AuthorityController {
* @return
*/
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
updateAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
authorityServiceImpl
.
checkValid
(
authorityVo
);
public
ResponseResult
updateAuthority
(
@RequestBody
AuthorityVo
authorityVo
){
authorityServiceImpl
.
update
(
authorityVo
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
return
new
ResponseResult
();
}
/**
...
...
@@ -51,12 +52,8 @@ public class AuthorityController {
* @return
*/
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
listAuthoritys
(){
List
<
AuthorityVo
>
list
=
authorityServiceImpl
.
listAllAuthority
();
if
(
list
==
null
){
return
new
Result
(
4001
,
"暂无权限,请先添加"
,
null
);
}
return
new
Result
(
0
,
"SUCCESS"
,
list
);
public
ResponseResult
<
PageSizeData
<
WebAuthorityResVo
>>
listAuthoritys
(
ListAuthorityReqVo
reqVo
){
return
ResponseResult
.
result
(
authorityServiceImpl
.
getWebAuthorityResVoList
(
reqVo
));
}
/**
...
...
@@ -64,38 +61,29 @@ public class AuthorityController {
* @return
*/
@RequestMapping
(
value
=
"/firstLevel"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
parentAuthoritys
(){
List
<
AuthorityVo
>
list
=
authorityServiceImpl
.
listLevel1
();
if
(
list
==
null
){
return
new
Result
(
4001
,
"暂无一级权限,请先添加"
,
null
);
}
return
new
Result
(
0
,
"SUCCESS"
,
list
);
public
ResponseResult
<
PageSizeData
<
WebAuthorityResVo
>>
parentAuthoritys
(
ListAuthorityReqVo
reqVo
){
return
ResponseResult
.
result
(
authorityServiceImpl
.
getWebAuthorityResVoList
(
reqVo
));
}
/**
* 根据ID查询权限
* @param
id
* @param
reqVo
* @return
*/
@RequestMapping
(
value
=
"/role/{id}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
authority
(
@PathVariable
String
id
){
AuthorityVo
authorityVo
=
authorityServiceImpl
.
getAuthorityById
(
id
);
if
(
authorityVo
==
null
){
return
new
Result
(
4001
,
"未查询到该权限"
,
null
);
}
return
new
Result
(
0
,
"SUCCESS"
,
authorityVo
);
@RequestMapping
(
value
=
"/role"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
AuthorityVo
>
authority
(
@RequestBody
WebAuthorityReqVo
reqVo
){
return
ResponseResult
.
result
(
authorityServiceImpl
.
getAuthorityById
(
reqVo
));
}
/**
* 删除权限
* @param
id
* @param
reqVo
* @return
*/
@RequestMapping
(
value
=
"/delete/{id}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
delete
(
@PathVariable
String
id
){
authorityServiceImpl
.
deleteAuthorityById
(
id
);
return
new
Result
(
0
,
"SUCCESS"
,
null
);
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
delete
(
@RequestBody
WebAuthorityReqVo
reqVo
){
authorityServiceImpl
.
deleteAuthorityById
(
reqVo
);
return
new
ResponseResult
();
}
}
...
...
src/main/java/com/pangding/web/authority/controller/ComputerRegisterController.java
View file @
65d90702
...
...
@@ -7,7 +7,6 @@ import com.pangding.web.authority.dto.RegisterIndividualDto;
import
com.pangding.web.authority.dto.RegisterUserDto
;
import
com.pangding.web.authority.service.MobileRegisterService
;
import
com.pangding.web.authority.service.UserService
;
import
com.pangding.web.authority.utils.Md5AndSalt
;
import
com.pangding.web.authority.vo.CompanyVo
;
import
com.pangding.web.authority.vo.MobileLoginInfo
;
import
com.pangding.web.authority.vo.UserVo
;
...
...
src/main/java/com/pangding/web/authority/controller/MobileRegisterController.java
View file @
65d90702
...
...
@@ -6,7 +6,6 @@ import com.pangding.web.authority.dto.RegisterUserDto;
import
com.pangding.web.authority.cloudvo.MobileRegisterUserReturnVo
;
import
com.pangding.web.authority.service.MobileRegisterService
;
import
com.pangding.web.authority.service.UserService
;
import
com.pangding.web.authority.utils.Md5AndSalt
;
import
com.pangding.web.authority.vo.CompanyVo
;
import
com.pangding.web.authority.vo.MobileLoginInfo
;
import
com.pangding.web.authority.vo.UserVo
;
...
...
src/main/java/com/pangding/web/authority/controller/RoleController.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
controller
;
import
com.pangding.web.authority.
currency.Result
;
import
com.pangding.web.authority.
dto.RoleDt
o
;
import
com.pangding.web.authority.
vo.reqvo.ListRoleReqVo
;
import
com.pangding.web.authority.
vo.reqvo.WebRoleReqV
o
;
import
com.pangding.web.authority.service.RoleService
;
import
com.pangding.web.authority.vo.RoleVo
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.pangding.web.authority.vo.reqvo.WebRoleResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zhangjinyao
...
...
@@ -25,30 +24,24 @@ public class RoleController {
/**
* 新增角色
* @param
roleDt
o
* @param
webRoleReqV
o
* @return
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
saveRole
(
@RequestBody
RoleDto
roleDto
){
RoleVo
roleVo
=
roleDto
;
roleServiceImpl
.
checkNameExist
(
roleVo
);
roleDto
.
setId
(
StringHelper
.
getNewID
());
roleServiceImpl
.
saveRole
(
roleDto
);
return
new
Result
(
0
,
"SUCCESS"
,
null
);
public
ResponseResult
saveRole
(
@RequestBody
WebRoleReqVo
webRoleReqVo
){
roleServiceImpl
.
saveRole
(
webRoleReqVo
);
return
new
ResponseResult
();
}
/**
* 修改角色信息
* @param
roleDt
o
* @param
webRoleReqV
o
* @return
*/
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
updateRole
(
@RequestBody
RoleDto
roleDto
){
RoleVo
roleVo
=
roleDto
;
roleServiceImpl
.
checkNameExist
(
roleVo
);
roleServiceImpl
.
updateRole
(
roleDto
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
public
ResponseResult
updateRole
(
@RequestBody
WebRoleReqVo
webRoleReqVo
){
roleServiceImpl
.
updateRole
(
webRoleReqVo
);
return
new
ResponseResult
();
}
/**
...
...
@@ -56,48 +49,18 @@ public class RoleController {
* @return
*/
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
listRoles
(){
List
<
RoleVo
>
roleVoList
=
roleServiceImpl
.
getRoleVoList
();
List
<
RoleDto
>
roleDtoList
=
new
ArrayList
(
roleVoList
.
size
());
if
(
roleVoList
==
null
||
roleVoList
.
size
()
==
0
){
return
new
Result
(
0
,
"暂无角色信息"
,
null
);
}
for
(
RoleVo
roleVo:
roleVoList
)
{
List
<
String
>
authorityIdList
=
roleServiceImpl
.
getAuthorityIdListByRoleId
(
roleVo
.
getId
());
List
<
String
>
authorityNameList
=
new
ArrayList
(
authorityIdList
.
size
());
for
(
String
authorityId:
authorityIdList
)
{
String
authorityName
=
roleServiceImpl
.
getAuthorityNameByAuthorityId
(
authorityId
);
authorityNameList
.
add
(
authorityName
);
}
RoleDto
roleDto
=
roleServiceImpl
.
makeRoleDto
(
roleVo
,
authorityIdList
,
authorityNameList
);
roleDtoList
.
add
(
roleDto
);
}
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
roleDtoList
);
return
result
;
public
ResponseResult
<
PageSizeData
<
WebRoleResVo
>>
listRoles
(
@RequestBody
ListRoleReqVo
req
){
return
ResponseResult
.
result
(
roleServiceImpl
.
getWebRoleResVoList
(
req
));
}
/**
* 根据ID查询角色
* @param
* @return
*/
@RequestMapping
(
value
=
"/role/{roleId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
getRoleById
(
@PathVariable
String
roleId
){
RoleVo
roleVo
=
roleServiceImpl
.
getRoleById
(
roleId
);
if
(
roleVo
==
null
){
return
new
Result
(
4001
,
"未查询到该角色"
,
null
);
}
List
<
String
>
authorityIdList
=
roleServiceImpl
.
getAuthorityIdListByRoleId
(
roleId
);
List
<
String
>
authorityNameList
=
new
ArrayList
(
authorityIdList
.
size
());
for
(
String
authorityId:
authorityIdList
)
{
String
authorityName
=
roleServiceImpl
.
getAuthorityNameByAuthorityId
(
authorityId
);
authorityNameList
.
add
(
authorityName
);
}
RoleDto
roleDto
=
roleServiceImpl
.
makeRoleDto
(
roleVo
,
authorityIdList
,
authorityNameList
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
roleDto
);
return
result
;
@RequestMapping
(
value
=
"/role"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
WebRoleResVo
>
getRoleById
(
@RequestBody
WebRoleReqVo
webRoleReqVo
){
return
ResponseResult
.
result
(
roleServiceImpl
.
getRoleById
(
webRoleReqVo
));
}
/**
...
...
@@ -105,11 +68,9 @@ public class RoleController {
* @param
* @return
*/
@RequestMapping
(
value
=
"/delete/{roleId}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
delete
(
@PathVariable
String
roleId
){
RoleVo
roleVo
=
roleServiceImpl
.
getRoleById
(
roleId
);
roleServiceImpl
.
deleteRole
(
roleVo
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
delete
(
@RequestBody
WebRoleReqVo
webRoleReqVo
){
roleServiceImpl
.
delete
(
webRoleReqVo
);
return
new
ResponseResult
();
}
}
src/main/java/com/pangding/web/authority/controller/UserController.java
View file @
65d90702
...
...
@@ -2,12 +2,12 @@ package com.pangding.web.authority.controller;
import
com.pangding.web.authority.currency.Result
;
import
com.pangding.web.authority.dto.UserDto
;
import
com.pangding.web.authority.reqvo.GetRoleByRoleIdReqVo
;
import
com.pangding.web.authority.reqvo.GetUserRoleListByUserIdReqVo
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.service.UserService
;
import
com.pangding.web.authority.vo.*
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -27,24 +27,13 @@ public class UserController {
/**
* 新增用户
* @param
userDt
o
* @param
webUserReqV
o
* @return
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
saveUser
(
@RequestBody
UserDto
userDto
){
if
(!
userServiceImpl
.
isValid
(
userDto
.
getAccount
())){
return
new
Result
(
4001
,
"用户名由字母与数字组成,且不能为纯数字"
,
userDto
);
}
userServiceImpl
.
checkAccount
(
userDto
);
userServiceImpl
.
checkPhone
(
userDto
);
userDto
.
setRemark
(
userDto
.
getPassword
());
String
saltPassword
=
userServiceImpl
.
passwordEncoder
(
userDto
.
getPassword
());
userDto
.
setPassword
(
saltPassword
);
userDto
.
setId
(
StringHelper
.
getNewID
());
userServiceImpl
.
saveUser
(
userDto
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
public
ResponseResult
saveUser
(
@RequestBody
WebUserReqVo
webUserReqVo
){
userServiceImpl
.
saveUser
(
webUserReqVo
);
return
new
ResponseResult
();
}
/**
...
...
@@ -53,48 +42,20 @@ public class UserController {
* @return
*/
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
updateUser
(
@RequestBody
UserDto
userDto
){
userServiceImpl
.
checkAccount
(
userDto
);
userServiceImpl
.
checkPhone
(
userDto
);
userDto
.
setRemark
(
userDto
.
getPassword
());
userDto
.
setPassword
(
userServiceImpl
.
passwordEncoder
(
userDto
.
getPassword
()));
userServiceImpl
.
updateUser
(
userDto
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
public
ResponseResult
updateUser
(
@RequestBody
WebUserReqVo
webUserReqVo
){
userServiceImpl
.
updateUser
(
webUserReqVo
);
return
new
ResponseResult
();
}
/**
* 查询用户列表
* @return
*/
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
listUsers
(){
List
<
UserVo
>
userVoList
=
userServiceImpl
.
listUserVo
();
List
<
UserDto
>
userDtoList
=
new
ArrayList
(
userVoList
.
size
());
for
(
int
index1
=
0
;
index1
<
userVoList
.
size
();
index1
++){
UserVo
userVo
=
userVoList
.
get
(
index1
);
GetUserRoleListByUserIdReqVo
reqVo
=
new
GetUserRoleListByUserIdReqVo
();
reqVo
.
setUserId
(
userVo
.
getId
());
List
<
UserRoleRelation
>
userRole
=
userServiceImpl
.
listUserRoleListByUserId
(
reqVo
);
List
<
String
>
roleIdList
=
new
ArrayList
(
userRole
.
size
());
for
(
UserRoleRelation
userRoleRelation:
userRole
)
{
roleIdList
.
add
(
userRoleRelation
.
getRoleId
());
}
List
<
String
>
roleNameList
=
new
ArrayList
(
roleIdList
.
size
());
for
(
int
index2
=
0
;
index2
<
roleIdList
.
size
();
index2
++){
GetRoleByRoleIdReqVo
getRoleByRoleIdReqVo
=
new
GetRoleByRoleIdReqVo
();
getRoleByRoleIdReqVo
.
setId
(
roleIdList
.
get
(
index2
));
RoleVo
role
=
userServiceImpl
.
getRoleByRoleId
(
getRoleByRoleIdReqVo
);
roleNameList
.
add
(
role
.
getName
());
}
UserDto
userDto
=
userServiceImpl
.
makeUserDto
(
userVo
,
roleIdList
,
roleNameList
);
userDtoList
.
add
(
userDto
);
}
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
userDtoList
);
return
result
;
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
PageSizeData
<
WebUserResVo
>>
listUsers
(
ListUserReqVo
reqVo
){
return
ResponseResult
.
result
(
userServiceImpl
.
getWebUserResVoList
(
reqVo
));
}
/**
...
...
@@ -102,29 +63,9 @@ public class UserController {
* @param //id
* @return
*/
@RequestMapping
(
value
=
"/user/{userId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
user
(
@PathVariable
String
userId
){
UserVo
userVo
=
userServiceImpl
.
getUserById
(
userId
);
if
(
userVo
==
null
){
return
new
Result
(
4001
,
"该用户不存在"
,
null
);
}
GetUserRoleListByUserIdReqVo
reqVo
=
new
GetUserRoleListByUserIdReqVo
();
reqVo
.
setUserId
(
userVo
.
getId
());
List
<
UserRoleRelation
>
userRole
=
userServiceImpl
.
listUserRoleListByUserId
(
reqVo
);
List
<
String
>
roleIdList
=
new
ArrayList
(
userRole
.
size
());
for
(
UserRoleRelation
userRoleRelation:
userRole
)
{
roleIdList
.
add
(
userRoleRelation
.
getRoleId
());
}
List
<
String
>
roleNameList
=
new
ArrayList
(
roleIdList
.
size
());
for
(
int
index2
=
0
;
index2
<
roleIdList
.
size
();
index2
++){
GetRoleByRoleIdReqVo
getRoleByRoleIdReqVo
=
new
GetRoleByRoleIdReqVo
();
getRoleByRoleIdReqVo
.
setId
(
roleIdList
.
get
(
index2
));
RoleVo
role
=
userServiceImpl
.
getRoleByRoleId
(
getRoleByRoleIdReqVo
);
roleNameList
.
add
(
role
.
getName
());
}
UserDto
userDto
=
userServiceImpl
.
makeUserDto
(
userVo
,
roleIdList
,
roleNameList
);
return
new
Result
(
0
,
"SUCCESS"
,
userDto
);
@RequestMapping
(
value
=
"/user"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
WebUserResVo
>
user
(
@RequestBody
WebUserReqVo
webUserReqVo
){
return
ResponseResult
.
result
(
userServiceImpl
.
getUserById
(
webUserReqVo
.
getId
()));
}
}
src/main/java/com/pangding/web/authority/dao/AuthorityDao.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
;
import
com.pangding.web.authority.
reqvo.GetAuthorityById
ReqVo
;
import
com.pangding.web.authority.
vo.reqvo.AuthorityGet
ReqVo
;
import
com.pangding.web.authority.reqvo.ListLevel1ReqVo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
...
...
@@ -22,11 +24,14 @@ public interface AuthorityDao extends BaseDao {
/**
* 根据主键获取authorityVo对象
*
* @param
getAuthorityById
ReqVo 主键
* @param
authorityGet
ReqVo 主键
* @return authorityVo对象
*/
AuthorityVo
getAuthority
ById
(
GetAuthorityByIdReqVo
getAuthorityById
ReqVo
);
AuthorityVo
getAuthority
(
AuthorityGetReqVo
authorityGet
ReqVo
);
PageSizeData
<
AuthorityVo
>
getAuthorityList
(
ListAuthorityReqVo
reqVo
);
List
<
AuthorityVo
>
getAuthoritys
(
AuthorityGetReqVo
reqVo
);
/**
* 获取authorityVo对象列表
*
...
...
src/main/java/com/pangding/web/authority/dao/RoleAuthorityDao.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
;
import
com.pangding.web.authority.reqvo.GetRoleAuthorityListByRoleIdReqVo
;
import
com.pangding.web.authority.reqvo.GetRoleAuthorityListByAuthorityIdReqVo
;
import
com.pangding.web.authority.vo.RoleAuthorityRelation
;
import
com.pangding.web.authority.vo.reqvo.RoleAuthorityGetReqVo
;
import
com.pangding.web.authority.vo.RoleAuthorityVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
java.util.List
;
...
...
@@ -11,19 +10,12 @@ import java.util.List;
* @author zhangjinyao
*/
public
interface
RoleAuthorityDao
extends
BaseDao
{
/**
* 通过角色id获取角色权限关系表对象列表
*
* @param getRoleAuthorityListByRoleIdReqVo 角色id
* @return 角色权限关系表主键列表
*/
List
<
RoleAuthorityRelation
>
getRoleAuthorityListByRoleId
(
GetRoleAuthorityListByRoleIdReqVo
getRoleAuthorityListByRoleIdReqVo
);
/**
* 通过权限id获取角色权限关系表主键列表
*
* @param
getRoleAuthorityListByAuthorityId
ReqVo 封装权限id
* @param
roleAuthorityGet
ReqVo 封装权限id
* @return 角色权限关系表主键列表
*/
List
<
RoleAuthority
Relation
>
getRoleAuthorityListByAuthorityId
(
GetRoleAuthorityListByAuthorityIdReqVo
getRoleAuthorityListByAuthorityId
ReqVo
);
List
<
RoleAuthority
Vo
>
getRoleAuthorityList
(
RoleAuthorityGetReqVo
roleAuthorityGet
ReqVo
);
}
src/main/java/com/pangding/web/authority/dao/RoleDao.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
;
import
com.pangding.web.authority.
reqvo.GetRoleByRoleId
ReqVo
;
import
com.pangding.web.authority.
reqvo.GetRoleByRoleName
ReqVo
;
import
com.pangding.web.authority.
vo.reqvo.ListRole
ReqVo
;
import
com.pangding.web.authority.
vo.reqvo.RoleGet
ReqVo
;
import
com.pangding.web.authority.vo.RoleVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
...
...
@@ -15,10 +16,10 @@ public interface RoleDao extends BaseDao {
/**
* 通过主键id获取RoleVo对象
*
* @param
getRoleByRoleId
ReqVo getRoleByRoleIdReqVo对象
* @param
roleGet
ReqVo getRoleByRoleIdReqVo对象
* @return RoleVo对象
*/
RoleVo
getRoleById
(
GetRoleByRoleIdReqVo
getRoleByRoleId
ReqVo
);
RoleVo
getRoleById
(
RoleGetReqVo
roleGet
ReqVo
);
/**
* 通过角色名查询RoleVo对象
...
...
@@ -26,7 +27,7 @@ public interface RoleDao extends BaseDao {
* @param getRoleByRoleNameReqVo 角色名
* @return RoleVo对象
*/
RoleVo
getRoleByRoleName
(
GetRoleByRoleName
ReqVo
getRoleByRoleNameReqVo
);
RoleVo
getRoleByRoleName
(
RoleGet
ReqVo
getRoleByRoleNameReqVo
);
/**
* 检查用户名是否已存在
...
...
@@ -43,14 +44,14 @@ public interface RoleDao extends BaseDao {
*
* @return RoleVo对象列表
*/
List
<
RoleVo
>
getRoleVoList
(
);
PageSizeData
<
RoleVo
>
getRoleVoList
(
ListRoleReqVo
req
);
/**
* 通过角色id获取子角色列表
*
* @param
getRoleByRoleId
ReqVo 封装角色id
* @param
roleGet
ReqVo 封装角色id
* @return 角色列表
*/
List
<
RoleVo
>
getChild
(
GetRoleByRoleIdReqVo
getRoleByRoleId
ReqVo
);
List
<
RoleVo
>
getChild
(
RoleGetReqVo
roleGet
ReqVo
);
}
src/main/java/com/pangding/web/authority/dao/UserDao.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
;
import
com.pangding.web.authority.reqvo.GetUserByCompanyIdReqVo
;
import
com.pangding.web.authority.reqvo.GetUserByIdReqVo
;
import
com.pangding.web.authority.vo.UserVo
;
import
com.pangding.web.authority.vo.reqvo.ListUserReqVo
;
import
com.pangding.web.authority.vo.reqvo.UserGetReqVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
...
...
@@ -28,20 +29,14 @@ public interface UserDao extends BaseDao {
*/
void
checkPhone
(
UserVo
phone
);
/**
* 获取UserVo对象列表
*
* @return UserVo对象列表
*/
List
<
UserVo
>
listUserVo
();
/**
* 通过用户id查询UserVo对象
*
* @param
id
用户id
* @param
reqVo
用户id
* @return UserVo对象
*/
UserVo
getUser
ById
(
GetUserByIdReqVo
id
);
UserVo
getUser
(
UserGetReqVo
reqVo
);
/**
* 根据公司id获取UserVo对象
...
...
@@ -49,5 +44,7 @@ public interface UserDao extends BaseDao {
* @param companyId GetUserByCompanyIdReqVo请求对象,封装公司id
* @return UserVo对象
*/
UserVo
getUserByCompanyId
(
GetUserByCompanyIdReqVo
companyId
);
UserVo
getUserByCompanyId
(
UserGetReqVo
companyId
);
PageSizeData
<
UserVo
>
getUserVoList
(
ListUserReqVo
reqVo
);
}
src/main/java/com/pangding/web/authority/dao/UserRoleDao.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
;
import
com.pangding.web.authority.reqvo.GetUserRoleListByRoleIdReqVo
;
import
com.pangding.web.authority.reqvo.GetUserRoleListByUserIdReqVo
;
import
com.pangding.web.authority.vo.UserRoleRelation
;
import
com.pangding.web.authority.vo.reqvo.UserRoleGetReqVo
;
import
com.pangding.web.authority.vo.UserRoleVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
java.util.List
;
...
...
@@ -15,16 +14,9 @@ public interface UserRoleDao extends BaseDao {
/**
* 通过userId查询用户角色对应关系列表
*
* @param
userId
用户id
* @param
reqVo
用户id
* @return user和role对应关系对象列表
*/
List
<
UserRole
Relation
>
getUserRoleListByUserId
(
GetUserRoleListByUserIdReqVo
userId
);
List
<
UserRole
Vo
>
getUserRoleList
(
UserRoleGetReqVo
reqVo
);
/**
* 通过角色id获取用户和角色的对应关系对象列表
*
* @param roleId 封装角色id
* @return 用户和角色的对应关系对象列表
*/
List
<
UserRoleRelation
>
getUserRoleListByRoleId
(
GetUserRoleListByRoleIdReqVo
roleId
);
}
src/main/java/com/pangding/web/authority/dao/impl/AuthorityDaoImpl.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
.
impl
;
import
com.pangding.web.authority.dao.AuthorityDao
;
import
com.pangding.web.authority.
reqvo.GetAuthorityById
ReqVo
;
import
com.pangding.web.authority.
vo.reqvo.AuthorityGet
ReqVo
;
import
com.pangding.web.authority.reqvo.ListLevel1ReqVo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
...
...
@@ -25,7 +27,9 @@ public class AuthorityDaoImpl extends BaseDaoImpl implements AuthorityDao {
table
.
add
(
SELECT
,
"select * from pd_authority where 1=1"
)
.
add
(
"exist"
,
"and pid = '' "
)
.
add
(
"id"
,
"and pid = ?"
);
.
add
(
"id"
,
"and pid = ? "
)
.
add
(
"pid"
,
"and pid = ? "
)
.
add
(
"exist"
,
"and pid ? ''"
);
}
@Override
...
...
@@ -34,8 +38,18 @@ public class AuthorityDaoImpl extends BaseDaoImpl implements AuthorityDao {
}
@Override
public
AuthorityVo
getAuthorityById
(
GetAuthorityByIdReqVo
getAuthorityByIdReqVo
)
{
return
this
.
load
(
getAuthorityByIdReqVo
,
AuthorityVo
.
class
);
public
AuthorityVo
getAuthority
(
AuthorityGetReqVo
authorityGetReqVo
)
{
return
this
.
load
(
authorityGetReqVo
,
AuthorityVo
.
class
);
}
@Override
public
PageSizeData
<
AuthorityVo
>
getAuthorityList
(
ListAuthorityReqVo
reqVo
)
{
return
this
.
queryPage
(
AuthorityVo
.
class
,
reqVo
,
SELECT
,
reqVo
);
}
@Override
public
List
<
AuthorityVo
>
getAuthoritys
(
AuthorityGetReqVo
reqVo
)
{
return
this
.
query
(
AuthorityVo
.
class
,
SELECT
,
reqVo
);
}
@Override
...
...
src/main/java/com/pangding/web/authority/dao/impl/RoleAuthorityDaoImpl.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
.
impl
;
import
com.pangding.web.authority.dao.RoleAuthorityDao
;
import
com.pangding.web.authority.reqvo.GetRoleAuthorityListByRoleIdReqVo
;
import
com.pangding.web.authority.reqvo.GetRoleAuthorityListByAuthorityIdReqVo
;
import
com.pangding.web.authority.vo.RoleAuthorityRelation
;
import
com.pangding.web.authority.vo.reqvo.RoleAuthorityGetReqVo
;
import
com.pangding.web.authority.vo.RoleAuthorityVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -20,7 +19,7 @@ public class RoleAuthorityDaoImpl extends BaseDaoImpl implements RoleAuthorityDa
@Override
protected
void
init
()
{
register
(
RoleAuthority
Relation
.
class
);
register
(
RoleAuthority
Vo
.
class
);
table
.
add
(
SELECT
,
"select id,role_id,authority_id from pd_role_authority where 1=1 "
)
.
add
(
"roleId"
,
"and role_id = ?"
)
...
...
@@ -29,13 +28,7 @@ public class RoleAuthorityDaoImpl extends BaseDaoImpl implements RoleAuthorityDa
}
@Override
public
List
<
RoleAuthorityRelation
>
getRoleAuthorityListByRoleId
(
GetRoleAuthorityListByRoleIdReqVo
getRoleAuthorityListByRoleIdReqVo
)
{
return
this
.
query
(
RoleAuthorityRelation
.
class
,
SELECT
,
getRoleAuthorityListByRoleIdReqVo
);
}
@Override
public
List
<
RoleAuthorityRelation
>
getRoleAuthorityListByAuthorityId
(
GetRoleAuthorityListByAuthorityIdReqVo
getRoleAuthorityListByAuthorityIdReqVo
)
{
return
this
.
query
(
RoleAuthorityRelation
.
class
,
SELECT
,
getRoleAuthorityListByAuthorityIdReqVo
);
public
List
<
RoleAuthorityVo
>
getRoleAuthorityList
(
RoleAuthorityGetReqVo
roleAuthorityGetReqVo
)
{
return
this
.
query
(
RoleAuthorityVo
.
class
,
SELECT
,
roleAuthorityGetReqVo
);
}
}
src/main/java/com/pangding/web/authority/dao/impl/RoleDaoImpl.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
.
impl
;
import
com.pangding.web.authority.dao.RoleDao
;
import
com.pangding.web.authority.
reqvo.GetRoleByRoleId
ReqVo
;
import
com.pangding.web.authority.
reqvo.GetRoleByRoleName
ReqVo
;
import
com.pangding.web.authority.
vo.reqvo.ListRole
ReqVo
;
import
com.pangding.web.authority.
vo.reqvo.RoleGet
ReqVo
;
import
com.pangding.web.authority.vo.RoleVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
...
...
@@ -31,12 +32,12 @@ public class RoleDaoImpl extends BaseDaoImpl implements RoleDao {
}
@Override
public
RoleVo
getRoleById
(
GetRoleByRoleIdReqVo
getRoleByRoleId
ReqVo
)
{
return
this
.
load
(
getRoleByRoleId
ReqVo
,
RoleVo
.
class
);
public
RoleVo
getRoleById
(
RoleGetReqVo
roleGet
ReqVo
)
{
return
this
.
load
(
roleGet
ReqVo
,
RoleVo
.
class
);
}
@Override
public
RoleVo
getRoleByRoleName
(
GetRoleByRoleName
ReqVo
getRoleByRoleNameReqVo
)
{
public
RoleVo
getRoleByRoleName
(
RoleGet
ReqVo
getRoleByRoleNameReqVo
)
{
return
this
.
load
(
getRoleByRoleNameReqVo
,
RoleVo
.
class
);
}
...
...
@@ -46,12 +47,13 @@ public class RoleDaoImpl extends BaseDaoImpl implements RoleDao {
}
@Override
public
List
<
RoleVo
>
getRoleVoList
()
{
return
this
.
query
(
RoleVo
.
class
,
SELECT
,
null
);
public
PageSizeData
<
RoleVo
>
getRoleVoList
(
ListRoleReqVo
req
)
{
return
this
.
queryPage
(
RoleVo
.
class
,
req
,
SELECT
,
req
);
}
@Override
public
List
<
RoleVo
>
getChild
(
GetRoleByRoleIdReqVo
getRoleByRoleId
ReqVo
)
{
return
this
.
query
(
RoleVo
.
class
,
SELECT
,
getRoleByRoleId
ReqVo
);
public
List
<
RoleVo
>
getChild
(
RoleGetReqVo
roleGet
ReqVo
)
{
return
this
.
query
(
RoleVo
.
class
,
SELECT
,
roleGet
ReqVo
);
}
}
src/main/java/com/pangding/web/authority/dao/impl/UserDaoImpl.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
.
impl
;
import
com.pangding.web.authority.dao.UserDao
;
import
com.pangding.web.authority.reqvo.GetUserByCompanyIdReqVo
;
import
com.pangding.web.authority.reqvo.GetUserByIdReqVo
;
import
com.pangding.web.authority.vo.UserVo
;
import
com.pangding.web.authority.vo.reqvo.ListUserReqVo
;
import
com.pangding.web.authority.vo.reqvo.UserGetReqVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
...
...
@@ -43,19 +44,17 @@ public class UserDaoImpl extends BaseDaoImpl implements UserDao {
}
@Override
public
List
<
UserVo
>
listUserVo
()
{
return
this
.
query
(
UserVo
.
class
,
SELECT
,
null
);
public
UserVo
getUser
(
UserGetReqVo
reqVo
)
{
return
this
.
load
(
reqVo
,
UserVo
.
class
);
}
@Override
public
UserVo
getUserBy
Id
(
GetUserByIdReqVo
i
d
)
{
return
this
.
load
(
i
d
,
UserVo
.
class
);
public
UserVo
getUserBy
CompanyId
(
UserGetReqVo
companyI
d
)
{
return
this
.
load
(
companyI
d
,
UserVo
.
class
);
}
@Override
public
UserVo
getUserByCompanyId
(
GetUserByCompanyIdReqVo
companyId
)
{
return
this
.
load
(
companyId
,
UserVo
.
class
);
public
PageSizeData
<
UserVo
>
getUserVoList
(
ListUserReqVo
reqVo
)
{
return
this
.
queryPage
(
UserVo
.
class
,
reqVo
,
SELECT
,
reqVo
);
}
}
src/main/java/com/pangding/web/authority/dao/impl/UserRoleDaoImpl.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dao
.
impl
;
import
com.pangding.web.authority.dao.UserRoleDao
;
import
com.pangding.web.authority.reqvo.GetUserRoleListByRoleIdReqVo
;
import
com.pangding.web.authority.reqvo.GetUserRoleListByUserIdReqVo
;
import
com.pangding.web.authority.vo.UserRoleRelation
;
import
com.pangding.web.authority.vo.reqvo.UserRoleGetReqVo
;
import
com.pangding.web.authority.vo.UserRoleVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -20,7 +19,7 @@ public class UserRoleDaoImpl extends BaseDaoImpl implements UserRoleDao {
@Override
protected
void
init
()
{
register
(
UserRole
Relation
.
class
);
register
(
UserRole
Vo
.
class
);
table
.
add
(
GET_USER_ROLE_LIST
,
"select * from pd_user_role where 1=1 "
)
.
add
(
"userId"
,
"and user_id = ?"
)
...
...
@@ -29,12 +28,8 @@ public class UserRoleDaoImpl extends BaseDaoImpl implements UserRoleDao {
}
@Override
public
List
<
UserRole
Relation
>
getUserRoleListByUserId
(
GetUserRoleListByUserIdReqVo
userId
)
{
return
this
.
query
(
UserRole
Relation
.
class
,
GET_USER_ROLE_LIST
,
userId
);
public
List
<
UserRole
Vo
>
getUserRoleList
(
UserRoleGetReqVo
reqVo
)
{
return
this
.
query
(
UserRole
Vo
.
class
,
GET_USER_ROLE_LIST
,
reqVo
);
}
@Override
public
List
<
UserRoleRelation
>
getUserRoleListByRoleId
(
GetUserRoleListByRoleIdReqVo
roleId
)
{
return
this
.
query
(
UserRoleRelation
.
class
,
GET_USER_ROLE_LIST
,
roleId
);
}
}
src/main/java/com/pangding/web/authority/reqvo/GetRoleAuthorityListByRoleIdReqVo.java
deleted
100644 → 0
View file @
fd52bb0e
package
com
.
pangding
.
web
.
authority
.
reqvo
;
import
com.yanzuoguang.util.vo.BaseVo
;
import
java.io.Serializable
;
/**
* @Author zhangjinyao
* @create 2019/5/11 14:38
*/
public
class
GetRoleAuthorityListByRoleIdReqVo
implements
Serializable
{
private
String
roleId
;
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
}
src/main/java/com/pangding/web/authority/reqvo/GetUserByCompanyIdReqVo.java
deleted
100644 → 0
View file @
fd52bb0e
package
com
.
pangding
.
web
.
authority
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/14 11:24
*/
public
class
GetUserByCompanyIdReqVo
{
private
String
companyId
;
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
}
src/main/java/com/pangding/web/authority/reqvo/GetUserByIdReqVo.java
deleted
100644 → 0
View file @
fd52bb0e
package
com
.
pangding
.
web
.
authority
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/10 17:21
*/
public
class
GetUserByIdReqVo
{
private
String
id
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
}
src/main/java/com/pangding/web/authority/reqvo/GetUserByPhoneReqVo.java
deleted
100644 → 0
View file @
fd52bb0e
package
com
.
pangding
.
web
.
authority
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/14 15:48
*/
public
class
GetUserByPhoneReqVo
{
private
String
phone
;
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
}
src/main/java/com/pangding/web/authority/reqvo/GetUserRoleListByUserIdReqVo.java
deleted
100644 → 0
View file @
fd52bb0e
package
com
.
pangding
.
web
.
authority
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/10 19:34
*/
public
class
GetUserRoleListByUserIdReqVo
{
private
String
userId
;
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
}
src/main/java/com/pangding/web/authority/service/AuthorityService.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
service
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebAuthorityReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebAuthorityResVo
;
import
com.pangding.web.authority.vo.reqvo.WebUserResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
...
...
@@ -25,17 +30,17 @@ public interface AuthorityService {
/**
* 通过权限表主键获取authorityVo对象
*
* @param
id
主键
* @param
reqVo
主键
* @return authorityVo对象
*/
AuthorityVo
getAuthorityById
(
String
id
);
AuthorityVo
getAuthorityById
(
WebAuthorityReqVo
reqVo
);
/**
* 通过权限表主键删除authorityVo对象,并删除权限和角色的对应关系
*
* @param
id
主键
* @param
reqVo
主键
*/
void
deleteAuthorityById
(
String
id
);
void
deleteAuthorityById
(
WebAuthorityReqVo
reqVo
);
/**
* 检查新建、修改的authorityVo对象是否合法
...
...
@@ -45,18 +50,7 @@ public interface AuthorityService {
*/
void
checkValid
(
AuthorityVo
authorityVo
);
/**
* 获取authorityVo对象列表
*
* @return authorityVo对象列表
*/
List
<
AuthorityVo
>
listAllAuthority
();
/**
* 获取一级权限列表
*
* @return 一级权限列表
*/
List
<
AuthorityVo
>
listLevel1
();
PageSizeData
<
WebAuthorityResVo
>
getWebAuthorityResVoList
(
ListAuthorityReqVo
reqVo
);
}
src/main/java/com/pangding/web/authority/service/RoleService.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
service
;
import
com.pangding.web.authority.dto.RoleDto
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.reqvo.ListRoleReqVo
;
import
com.pangding.web.authority.vo.reqvo.WebRoleReqVo
;
import
com.pangding.web.authority.vo.RoleVo
;
import
com.pangding.web.authority.vo.reqvo.WebRoleResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
...
...
@@ -13,24 +17,24 @@ public interface RoleService {
/**
* 保存RoleDto对象,并保存角色权限的对应关系
*
* @param
roleDt
o RoleDto对象
* @param
webRoleReqV
o RoleDto对象
*/
void
saveRole
(
RoleDto
roleDt
o
);
void
saveRole
(
WebRoleReqVo
webRoleReqV
o
);
/**
* 更新RoleDto对象,并更新角色权限的对应关系
*
* @param
roleDt
o RoleDto对象
* @param
webRoleReqV
o RoleDto对象
*/
void
updateRole
(
RoleDto
roleDt
o
);
void
updateRole
(
WebRoleReqVo
webRoleReqV
o
);
/**
* 通过主键id查询RoleVo对象
*
* @param
id
主键
* @param
webRoleReqVo
主键
* @return RoleVo对象
*/
RoleVo
getRoleById
(
String
id
);
WebRoleResVo
getRoleById
(
WebRoleReqVo
webRoleReqVo
);
/**
* 通过角色名查询RoleVo对象
...
...
@@ -51,9 +55,12 @@ public interface RoleService {
/**
* 获取RoleVo对象列表
*
* @param req
* @return RoleVo对象列表
*/
List
<
RoleVo
>
getRoleVoList
();
PageSizeData
<
RoleVo
>
getRoleVoList
(
ListRoleReqVo
req
);
PageSizeData
<
WebRoleResVo
>
getWebRoleResVoList
(
ListRoleReqVo
req
);
/**
* 通过角色id查询该角色权限id列表
...
...
@@ -61,7 +68,7 @@ public interface RoleService {
* @param roleId 角色id
* @return 权限id列表
*/
List
<
String
>
getAuthorityId
ListByRoleId
(
String
roleId
);
List
<
AuthorityVo
>
getAuthority
ListByRoleId
(
String
roleId
);
/**
* 通过权限id查询权限名
...
...
@@ -75,11 +82,10 @@ public interface RoleService {
* 将RoleVo对象添加权限ID列表和权限名列表封装成RoleDto对象
*
* @param roleVo RoleVo对象
* @param authorityIdList 权限id列表
* @param authorityNameList 权限名列表
* @param authorityList 权限列表
* @return RoleDto对象
*/
RoleDto
makeRoleDto
(
RoleVo
roleVo
,
List
<
String
>
authorityIdList
,
List
<
String
>
authorityName
List
);
WebRoleResVo
makeResVo
(
RoleVo
roleVo
,
List
<
AuthorityVo
>
authority
List
);
/**
* 删除角色,并删除角色和用户的对应关系以及角色和权限的对应关系
...
...
@@ -88,4 +94,6 @@ public interface RoleService {
*/
void
deleteRole
(
RoleVo
roleVo
);
void
delete
(
WebRoleReqVo
webRoleReqVo
);
}
src/main/java/com/pangding/web/authority/service/UserService.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
service
;
import
com.pangding.web.authority.dto.UserDto
;
import
com.pangding.web.authority.reqvo.GetRoleByRoleIdReqVo
;
import
com.pangding.web.authority.reqvo.GetUserRoleListByUserIdReqVo
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.vo.*
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
java.util.List
;
...
...
@@ -17,14 +16,14 @@ public interface UserService {
*
* @param userDto UserDto对象
*/
void
saveUser
(
UserDt
o
userDto
);
void
saveUser
(
WebUserReqV
o
userDto
);
/**
* 保存更新后的用户信息,并更新用户和角色的对应关系
*
* @param userDto UserDto对象
*/
void
updateUser
(
UserDt
o
userDto
);
void
updateUser
(
WebUserReqV
o
userDto
);
/**
* 检查用户名是否存在
...
...
@@ -48,22 +47,14 @@ public interface UserService {
*/
String
passwordEncoder
(
String
password
);
/**
* 获取UserVo对象列表
*
* @return UserVo对象列表
*/
List
<
UserVo
>
listUserVo
();
/**
* 将UserVo对象添加角色id列表和角色名列表封装成UserDto对象
*
* @param userVo UserVo对象
* @param roleIdList 角色id列表
* @param roleNameList 角色名列表
* @return UserDto对象
*/
UserDto
makeUserDto
(
UserVo
userVo
,
List
<
String
>
roleIdList
,
List
<
String
>
roleNameList
);
WebUserResVo
makeResVo
(
UserVo
userVo
);
/**
* 通过用户id查询UserVo对象
...
...
@@ -71,7 +62,11 @@ public interface UserService {
* @param userId 用户id
* @return UserVo对象
*/
UserVo
getUserById
(
String
userId
);
WebUserResVo
getUserById
(
String
userId
);
PageSizeData
<
UserVo
>
getUserVoList
(
ListUserReqVo
reqVo
);
PageSizeData
<
WebUserResVo
>
getWebUserResVoList
(
ListUserReqVo
reqVo
);
/**
* 通过userId查询user和role对应关系对象列表
...
...
@@ -79,15 +74,15 @@ public interface UserService {
* @param reqVo GetUserRoleListByUserIdReqVo对象
* @return UserRole对应关系对象列表
*/
List
<
UserRole
Relation
>
listUserRoleListByUserId
(
GetUserRoleListByUserId
ReqVo
reqVo
);
List
<
UserRole
Vo
>
listUserRoleListByUserId
(
UserRoleGet
ReqVo
reqVo
);
/**
* 根据roleId查询RoleVo对象
*
* @param
getRoleByRoleId
ReqVo GetRoleByRoleIdReqVo对象
* @param
roleGet
ReqVo GetRoleByRoleIdReqVo对象
* @return RoleVo对象
*/
RoleVo
getRoleByRoleId
(
GetRoleByRoleIdReqVo
getRoleByRoleId
ReqVo
);
RoleVo
getRoleByRoleId
(
RoleGetReqVo
roleGet
ReqVo
);
/**
* 检查用户名是否合法
...
...
@@ -95,7 +90,7 @@ public interface UserService {
* @param account 用户名
* @return
*/
Boolean
isValid
(
String
account
);
void
isValid
(
String
account
);
/**
* 检查是否为纯数字,用来判断输入的是用户名还是手机号
...
...
@@ -120,4 +115,6 @@ public interface UserService {
* @return UserVo对象
*/
UserVo
getUserByAccount
(
String
account
);
List
<
RoleVo
>
getRoleListByUserId
(
String
userId
);
}
src/main/java/com/pangding/web/authority/service/impl/AuthorityServiceImpl.java
View file @
65d90702
...
...
@@ -2,16 +2,18 @@ package com.pangding.web.authority.service.impl;
import
com.pangding.web.authority.dao.RoleAuthorityDao
;
import
com.pangding.web.authority.dao.AuthorityDao
;
import
com.pangding.web.authority.reqvo.GetAuthorityByIdReqVo
;
import
com.pangding.web.authority.reqvo.GetRoleAuthorityListByAuthorityIdReqVo
;
import
com.pangding.web.authority.vo.reqvo.*
;
import
com.pangding.web.authority.reqvo.ListLevel1ReqVo
;
import
com.pangding.web.authority.service.AuthorityService
;
import
com.pangding.web.authority.vo.*
;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -28,12 +30,14 @@ public class AuthorityServiceImpl implements AuthorityService {
@Override
public
void
save
(
AuthorityVo
authorityVo
)
{
this
.
checkValid
(
authorityVo
);
authorityVo
.
setId
(
StringHelper
.
getNewID
());
authorityDao
.
create
(
authorityVo
);
}
@Override
public
void
update
(
AuthorityVo
authorityVo
)
{
this
.
checkValid
(
authorityVo
);
authorityDao
.
update
(
authorityVo
);
}
...
...
@@ -43,38 +47,72 @@ public class AuthorityServiceImpl implements AuthorityService {
}
@Override
public
AuthorityVo
getAuthorityById
(
String
id
)
{
GetAuthorityByIdReqVo
getAuthorityByIdReqVo
=
new
GetAuthorityByIdReqVo
();
getAuthorityByIdReqVo
.
setId
(
id
);
AuthorityVo
authorityVo
=
authorityDao
.
getAuthorityById
(
getAuthorityByIdReqVo
);
return
authorityVo
!=
null
?
authorityVo
:
null
;
public
AuthorityVo
getAuthorityById
(
WebAuthorityReqVo
reqVo
)
{
AuthorityGetReqVo
authorityGetReqVo
=
new
AuthorityGetReqVo
();
authorityGetReqVo
.
setId
(
reqVo
.
getId
());
AuthorityVo
authorityVo
=
authorityDao
.
getAuthority
(
authorityGetReqVo
);
if
(
authorityVo
==
null
){
throw
new
CodeException
(
"该权限不存在"
);
}
return
authorityVo
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteAuthorityById
(
String
id
)
{
public
void
deleteAuthorityById
(
WebAuthorityReqVo
reqVo
)
{
AuthorityVo
authorityVo
=
new
AuthorityVo
();
authorityVo
.
setId
(
id
);
authorityVo
.
setId
(
reqVo
.
getId
()
);
authorityDao
.
remove
(
authorityVo
);
GetRoleAuthorityListByAuthorityIdReqVo
getRoleAuthorityListByAuthorityIdReqVo
=
new
GetRoleAuthorityListByAuthorityIdReqVo
();
getRoleAuthorityListByAuthorityIdReqVo
.
setAuthorityId
(
id
);
List
<
RoleAuthorityRelation
>
roleAuthorityList
=
roleAuthorityDao
.
getRoleAuthorityListByAuthorityId
(
getRoleAuthorityListByAuthorityIdReqVo
);
for
(
RoleAuthorityRelation
roleAuthority:
roleAuthorityList
)
{
RoleAuthorityGetReqVo
roleAuthorityGetReqVo
=
new
RoleAuthorityGetReqVo
();
roleAuthorityGetReqVo
.
setAuthorityId
(
reqVo
.
getId
());
List
<
RoleAuthorityVo
>
roleAuthorityList
=
roleAuthorityDao
.
getRoleAuthorityList
(
roleAuthorityGetReqVo
);
for
(
RoleAuthorityVo
roleAuthority:
roleAuthorityList
)
{
roleAuthorityDao
.
remove
(
roleAuthority
);
}
}
@Override
public
List
<
AuthorityVo
>
listAllAuthority
()
{
List
<
AuthorityVo
>
list
=
authorityDao
.
listAll
();
return
(
list
!=
null
&&
list
.
size
()
!=
0
)
?
list
:
null
;
AuthorityGetReqVo
reqVo1
=
new
AuthorityGetReqVo
();
reqVo1
.
setPid
(
reqVo
.
getId
());
List
<
AuthorityVo
>
childList
=
authorityDao
.
getAuthoritys
(
reqVo1
);
if
(
childList
!=
null
&&
childList
.
size
()
!=
0
){
for
(
AuthorityVo
child:
childList
)
{
WebAuthorityReqVo
reqVo2
=
new
WebAuthorityReqVo
();
reqVo2
.
setId
(
child
.
getId
());
this
.
deleteAuthorityById
(
reqVo2
);
}
}
}
@Override
public
List
<
AuthorityVo
>
listLevel1
()
{
ListLevel1ReqVo
listLevel1ReqVo
=
new
ListLevel1ReqVo
();
listLevel1ReqVo
.
setExist
(
"exist"
);
List
<
AuthorityVo
>
list
=
authorityDao
.
listLevel1
(
listLevel1ReqVo
);
return
(
list
!=
null
&&
list
.
size
()
!=
0
)
?
list
:
null
;
public
PageSizeData
<
WebAuthorityResVo
>
getWebAuthorityResVoList
(
ListAuthorityReqVo
reqVo
)
{
reqVo
.
setExist
(
"exist"
);
PageSizeData
<
AuthorityVo
>
authorityVoPageSizeData
=
authorityDao
.
getAuthorityList
(
reqVo
);
PageSizeData
<
WebAuthorityResVo
>
webAuthorityResVoPageSizeData
=
new
PageSizeData
();
List
<
AuthorityVo
>
authorityVoList
=
authorityVoPageSizeData
.
getList
();
if
(
authorityVoList
==
null
||
authorityVoList
.
size
()
==
0
){
throw
new
CodeException
(
"没有更多权限"
);
}
List
<
WebAuthorityResVo
>
webAuthorityResVoList
=
new
ArrayList
(
authorityVoList
.
size
());
for
(
AuthorityVo
authorityVo:
authorityVoList
)
{
WebAuthorityResVo
resVo
=
new
WebAuthorityResVo
();
resVo
.
setUrl
(
authorityVo
.
getUrl
());
resVo
.
setType
(
authorityVo
.
getType
());
resVo
.
setRemark
(
authorityVo
.
getRemark
());
resVo
.
setPid
(
authorityVo
.
getPid
());
resVo
.
setOpenMode
(
authorityVo
.
getOpenMode
());
resVo
.
setName
(
authorityVo
.
getName
());
resVo
.
setId
(
authorityVo
.
getId
());
resVo
.
setCreateTime
(
authorityVo
.
getCreateTime
());
resVo
.
setAlias
(
authorityVo
.
getAlias
());
webAuthorityResVoList
.
add
(
resVo
);
}
webAuthorityResVoPageSizeData
.
setPageSize
(
authorityVoPageSizeData
.
getPageSize
());
webAuthorityResVoPageSizeData
.
setPageIndex
(
authorityVoPageSizeData
.
getPageIndex
());
webAuthorityResVoPageSizeData
.
setPageTotal
(
authorityVoPageSizeData
.
getPageTotal
());
webAuthorityResVoPageSizeData
.
setList
(
webAuthorityResVoList
);
return
webAuthorityResVoPageSizeData
;
}
}
src/main/java/com/pangding/web/authority/service/impl/MobileRegisterServiceImpl.java
View file @
65d90702
...
...
@@ -2,9 +2,7 @@ package com.pangding.web.authority.service.impl;
import
com.pangding.web.authority.dao.MobileRegisterDao
;
import
com.pangding.web.authority.dao.UserDao
;
import
com.pangding.web.authority.dto.RegisterIndividualDto
;
import
com.pangding.web.authority.reqvo.CheckMerchantIdReqVo
;
import
com.pangding.web.authority.reqvo.GetUserByCompanyIdReqVo
;
import
com.pangding.web.authority.service.MobileRegisterService
;
import
com.pangding.web.authority.vo.CompanyVo
;
import
com.pangding.web.authority.vo.UserVo
;
...
...
src/main/java/com/pangding/web/authority/service/impl/RoleServiceImpl.java
View file @
65d90702
This diff is collapsed.
Click to expand it.
src/main/java/com/pangding/web/authority/service/impl/UserServiceImpl.java
View file @
65d90702
This diff is collapsed.
Click to expand it.
src/main/java/com/pangding/web/authority/utils/Md5AndSalt.java
deleted
100644 → 0
View file @
fd52bb0e
package
com
.
pangding
.
web
.
authority
.
utils
;
import
org.apache.commons.codec.binary.Hex
;
import
java.security.MessageDigest
;
import
java.util.Random
;
/**
* @author 源自网络
*/
public
class
Md5AndSalt
{
public
static
String
generate
(
String
password
)
{
Random
r
=
new
Random
();
StringBuilder
sb
=
new
StringBuilder
(
16
);
sb
.
append
(
r
.
nextInt
(
99999999
)).
append
(
r
.
nextInt
(
99999999
));
int
len
=
sb
.
length
();
int
defaultLen
=
16
;
if
(
len
<
defaultLen
)
{
for
(
int
i
=
0
;
i
<
defaultLen
-
len
;
i
++)
{
sb
.
append
(
"0"
);
}
}
String
salt
=
sb
.
toString
();
password
=
md5Hex
(
password
+
salt
);
char
[]
cs
=
new
char
[
48
];
int
bound
=
48
;
int
step
=
3
;
for
(
int
i
=
0
;
i
<
bound
;
i
+=
step
)
{
cs
[
i
]
=
password
.
charAt
(
i
/
3
*
2
);
char
c
=
salt
.
charAt
(
i
/
3
);
cs
[
i
+
1
]
=
c
;
cs
[
i
+
2
]
=
password
.
charAt
(
i
/
3
*
2
+
1
);
}
return
new
String
(
cs
);
}
/**
* 获取十六进制字符串形式的MD5摘要
*/
private
static
String
md5Hex
(
String
src
)
{
try
{
MessageDigest
md5
=
MessageDigest
.
getInstance
(
"MD5"
);
byte
[]
bs
=
md5
.
digest
(
src
.
getBytes
());
return
new
String
(
new
Hex
().
encode
(
bs
));
}
catch
(
Exception
e
)
{
return
null
;
}
}
public
static
boolean
verify
(
String
password
,
String
md5
)
{
char
[]
cs1
=
new
char
[
32
];
char
[]
cs2
=
new
char
[
16
];
int
bound
=
48
;
int
step
=
3
;
for
(
int
i
=
0
;
i
<
bound
;
i
+=
step
)
{
cs1
[
i
/
3
*
2
]
=
md5
.
charAt
(
i
);
cs1
[
i
/
3
*
2
+
1
]
=
md5
.
charAt
(
i
+
2
);
cs2
[
i
/
3
]
=
md5
.
charAt
(
i
+
1
);
}
String
salt
=
new
String
(
cs2
);
return
md5Hex
(
password
+
salt
).
equals
(
new
String
(
cs1
));
}
}
src/main/java/com/pangding/web/authority/vo/RoleAuthority
Relation
.java
→
src/main/java/com/pangding/web/authority/vo/RoleAuthority
Vo
.java
View file @
65d90702
...
...
@@ -9,7 +9,7 @@ import java.io.Serializable;
* @author zhangjinyao
*/
@TableAnnotation
(
"pd_role_authority"
)
public
class
RoleAuthority
Relation
implements
Serializable
{
public
class
RoleAuthority
Vo
implements
Serializable
{
private
String
id
;
...
...
src/main/java/com/pangding/web/authority/vo/UserRole
Relation
.java
→
src/main/java/com/pangding/web/authority/vo/UserRole
Vo
.java
View file @
65d90702
...
...
@@ -8,7 +8,7 @@ import java.io.Serializable;
* @author zhangjinyao
*/
@TableAnnotation
(
"pd_user_role"
)
public
class
UserRole
Relation
implements
Serializable
{
public
class
UserRole
Vo
implements
Serializable
{
private
String
id
;
...
...
src/main/java/com/pangding/web/authority/
reqvo/GetAuthorityById
ReqVo.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/AuthorityGet
ReqVo.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
reqvo
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/11 15:05
*/
public
class
GetAuthorityById
ReqVo
{
public
class
AuthorityGet
ReqVo
{
private
String
id
;
private
String
pid
;
public
String
getPid
()
{
return
pid
;
}
public
void
setPid
(
String
pid
)
{
this
.
pid
=
pid
;
}
public
String
getId
()
{
return
id
;
}
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/ListAuthorityReqVo.java
0 → 100644
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
com.yanzuoguang.util.vo.PageSizeReqVo
;
/**
* @Author zhangjinyao
* @create 2019/5/15 20:03
*/
public
class
ListAuthorityReqVo
extends
PageSizeReqVo
{
private
String
exist
;
public
String
getExist
()
{
return
exist
;
}
public
void
setExist
(
String
exist
)
{
this
.
exist
=
exist
;
}
}
src/main/java/com/pangding/web/authority/vo/reqvo/ListRoleReqVo.java
0 → 100644
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
com.yanzuoguang.util.vo.PageSizeReqVo
;
/**
* @Author zhangjinyao
* @create 2019/5/15 17:54
*/
public
class
ListRoleReqVo
extends
PageSizeReqVo
{
}
src/main/java/com/pangding/web/authority/vo/reqvo/ListUserReqVo.java
0 → 100644
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
com.yanzuoguang.util.vo.PageSizeReqVo
;
/**
* @Author zhangjinyao
* @create 2019/5/15 19:17
*/
public
class
ListUserReqVo
extends
PageSizeReqVo
{
}
src/main/java/com/pangding/web/authority/
reqvo/GetRoleAuthorityListByAuthorityId
ReqVo.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/RoleAuthorityGet
ReqVo.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
reqvo
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/11 16:41
*/
public
class
GetRoleAuthorityListByAuthorityId
ReqVo
{
public
class
RoleAuthorityGet
ReqVo
{
private
String
authorityId
;
private
String
roleId
;
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getAuthorityId
()
{
return
authorityId
;
}
...
...
src/main/java/com/pangding/web/authority/
reqvo/GetRoleByRoleName
ReqVo.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/RoleGet
ReqVo.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
reqvo
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/10 20:
27
* @create 2019/5/10 20:
09
*/
public
class
GetRoleByRoleNameReqVo
{
public
class
RoleGetReqVo
{
private
String
id
;
private
String
name
;
public
String
getName
()
{
...
...
@@ -14,4 +16,12 @@ public class GetRoleByRoleNameReqVo {
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
}
src/main/java/com/pangding/web/authority/
reqvo/GetUserByAccoun
tReqVo.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/UserGe
tReqVo.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
reqvo
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -7,9 +7,39 @@ import org.springframework.context.annotation.Bean;
* @create 2019/5/10 17:17
*/
public
class
GetUserByAccoun
tReqVo
{
public
class
UserGe
tReqVo
{
private
String
account
;
private
String
companyId
;
private
String
id
;
private
String
phone
;
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getAccount
()
{
return
account
;
}
...
...
src/main/java/com/pangding/web/authority/
reqvo/GetUserRoleListByRoleId
ReqVo.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/UserRoleGet
ReqVo.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
reqvo
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/11 15:37
*/
public
class
GetUserRoleListByRoleId
ReqVo
{
public
class
UserRoleGet
ReqVo
{
private
String
roleId
;
private
String
userId
;
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getRoleId
()
{
return
roleId
;
}
...
...
src/main/java/com/pangding/web/authority/
reqvo/UserRoleDao
RemoveReqVo.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/UserRole
RemoveReqVo.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
reqvo
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/10 19:47
*/
public
class
UserRole
Dao
RemoveReqVo
{
public
class
UserRoleRemoveReqVo
{
private
String
id
;
public
String
getId
()
{
...
...
src/main/java/com/pangding/web/authority/
reqvo/GetRoleByRoleId
ReqVo.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/WebAuthority
ReqVo.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
reqvo
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/5/1
0 20:0
9
* @create 2019/5/1
5 15:5
9
*/
public
class
GetRoleByRoleId
ReqVo
{
public
class
WebAuthority
ReqVo
{
private
String
id
;
public
String
getId
()
{
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/WebAuthorityResVo.java
0 → 100644
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
/**
* @Author zhangjinyao
* @create 2019/5/15 20:06
*/
public
class
WebAuthorityResVo
extends
AuthorityVo
{
}
src/main/java/com/pangding/web/authority/
dto/RoleDt
o.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/WebRoleReqV
o.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dt
o
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqv
o
;
import
com.pangding.web.authority.vo.RoleVo
;
...
...
@@ -7,13 +7,10 @@ import java.util.List;
/**
* @author zhangjinyao
*/
public
class
RoleDt
o
extends
RoleVo
{
public
class
WebRoleReqV
o
extends
RoleVo
{
private
List
<
String
>
authorityIds
;
private
List
<
String
>
authorityNames
;
public
List
<
String
>
getAuthorityIds
()
{
return
authorityIds
;
}
...
...
@@ -22,11 +19,4 @@ public class RoleDto extends RoleVo {
this
.
authorityIds
=
authorityIds
;
}
public
List
<
String
>
getAuthorityNames
()
{
return
authorityNames
;
}
public
void
setAuthorityNames
(
List
<
String
>
authorityNames
)
{
this
.
authorityNames
=
authorityNames
;
}
}
src/main/java/com/pangding/web/authority/vo/reqvo/WebRoleResVo.java
0 → 100644
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
com.pangding.web.authority.vo.AuthorityVo
;
import
com.pangding.web.authority.vo.RoleVo
;
import
java.util.List
;
/**
* @author zhangjinyao
*/
public
class
WebRoleResVo
extends
RoleVo
{
private
List
<
AuthorityVo
>
authorityList
;
public
List
<
AuthorityVo
>
getAuthorityList
()
{
return
authorityList
;
}
public
void
setAuthorityList
(
List
<
AuthorityVo
>
authorityList
)
{
this
.
authorityList
=
authorityList
;
}
}
src/main/java/com/pangding/web/authority/
dto/UserDt
o.java
→
src/main/java/com/pangding/web/authority/
vo/reqvo/WebUserReqV
o.java
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
dt
o
;
package
com
.
pangding
.
web
.
authority
.
vo
.
reqv
o
;
import
com.pangding.web.authority.vo.UserVo
;
...
...
@@ -7,12 +7,10 @@ import java.util.List;
/**
* @author zhangjinyao
*/
public
class
UserDt
o
extends
UserVo
{
public
class
WebUserReqV
o
extends
UserVo
{
private
List
<
String
>
roleIds
;
private
List
<
String
>
roles
;
public
List
<
String
>
getRoleIds
()
{
return
roleIds
;
}
...
...
@@ -21,11 +19,4 @@ public class UserDto extends UserVo {
this
.
roleIds
=
roleIds
;
}
public
List
<
String
>
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
List
<
String
>
roles
)
{
this
.
roles
=
roles
;
}
}
src/main/java/com/pangding/web/authority/vo/reqvo/WebUserResVo.java
0 → 100644
View file @
65d90702
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
import
com.pangding.web.authority.vo.RoleVo
;
import
com.pangding.web.authority.vo.UserVo
;
import
java.util.List
;
/**
* @author zhangjinyao
*/
public
class
WebUserResVo
extends
UserVo
{
private
List
<
RoleVo
>
roleList
;
public
List
<
RoleVo
>
getRoleList
()
{
return
roleList
;
}
public
void
setRoleList
(
List
<
RoleVo
>
roleList
)
{
this
.
roleList
=
roleList
;
}
}
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