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
661946b8
Commit
661946b8
authored
May 08, 2019
by
zjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user/role
parent
e45e826a
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
692 additions
and
361 deletions
+692
-361
RoleController.java
...va/com/pangding/web/tright/controller/RoleController.java
+51
-11
TrightController.java
.../com/pangding/web/tright/controller/TrightController.java
+7
-0
UserController.java
...va/com/pangding/web/tright/controller/UserController.java
+44
-23
RoleDao.java
src/main/java/com/pangding/web/tright/dao/RoleDao.java
+11
-10
RoleTrightDao.java
src/main/java/com/pangding/web/tright/dao/RoleTrightDao.java
+7
-0
TrightDao.java
src/main/java/com/pangding/web/tright/dao/TrightDao.java
+3
-4
UserDao.java
src/main/java/com/pangding/web/tright/dao/UserDao.java
+8
-3
UserRoleDao.java
src/main/java/com/pangding/web/tright/dao/UserRoleDao.java
+8
-0
RoleDaoImpl.java
...in/java/com/pangding/web/tright/dao/impl/RoleDaoImpl.java
+42
-19
RoleTrightDaoImpl.java
...a/com/pangding/web/tright/dao/impl/RoleTrightDaoImpl.java
+26
-0
TrightDaoImpl.java
.../java/com/pangding/web/tright/dao/impl/TrightDaoImpl.java
+12
-7
UserDaoImpl.java
...in/java/com/pangding/web/tright/dao/impl/UserDaoImpl.java
+41
-49
UserRoleDaoImpl.java
...ava/com/pangding/web/tright/dao/impl/UserRoleDaoImpl.java
+27
-0
RoleDto.java
src/main/java/com/pangding/web/tright/dto/RoleDto.java
+14
-3
UserDto.java
src/main/java/com/pangding/web/tright/dto/UserDto.java
+13
-3
RoleService.java
...ain/java/com/pangding/web/tright/service/RoleService.java
+29
-2
TrightService.java
...n/java/com/pangding/web/tright/service/TrightService.java
+2
-0
UserService.java
...ain/java/com/pangding/web/tright/service/UserService.java
+14
-3
RoleServiceImpl.java
...com/pangding/web/tright/service/impl/RoleServiceImpl.java
+89
-24
TrightServiceImpl.java
...m/pangding/web/tright/service/impl/TrightServiceImpl.java
+8
-1
UserServiceImpl.java
...com/pangding/web/tright/service/impl/UserServiceImpl.java
+38
-30
RoleTrightRelation.java
...n/java/com/pangding/web/tright/vo/RoleTrightRelation.java
+41
-0
RoleVo.java
src/main/java/com/pangding/web/tright/vo/RoleVo.java
+23
-27
TrightVo.java
src/main/java/com/pangding/web/tright/vo/TrightVo.java
+62
-77
UserRoleRelation.java
...ain/java/com/pangding/web/tright/vo/UserRoleRelation.java
+25
-21
UserVo.java
src/main/java/com/pangding/web/tright/vo/UserVo.java
+47
-44
No files found.
src/main/java/com/pangding/web/tright/controller/RoleController.java
View file @
661946b8
...
@@ -6,10 +6,14 @@ import com.pangding.web.tright.dao.RoleDao;
...
@@ -6,10 +6,14 @@ import com.pangding.web.tright.dao.RoleDao;
import
com.pangding.web.tright.dto.RoleDto
;
import
com.pangding.web.tright.dto.RoleDto
;
import
com.pangding.web.tright.service.RoleService
;
import
com.pangding.web.tright.service.RoleService
;
import
com.pangding.web.tright.vo.RoleVo
;
import
com.pangding.web.tright.vo.RoleVo
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
@RestController
@RestController
@RequestMapping
(
"/roles"
)
@RequestMapping
(
"/roles"
)
public
class
RoleController
{
public
class
RoleController
{
...
@@ -25,9 +29,17 @@ public class RoleController {
...
@@ -25,9 +29,17 @@ public class RoleController {
*/
*/
@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
Object
saveRole
(
@RequestBody
RoleDto
roleDto
){
public
Object
saveRole
(
@RequestBody
RoleDto
roleDto
){
roleServiceImpl
.
saveRole
(
roleDto
);
String
id
=
roleDto
.
getId
();
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
String
name
=
roleDto
.
getName
();
return
result
;
if
(
roleServiceImpl
.
getRoleById
(
id
)
!=
null
){
return
new
Result
(
4001
,
"该角色ID已存在"
,
null
);
}
if
(
roleServiceImpl
.
getRoleByName
(
name
)
!=
null
){
return
new
Result
(
4001
,
"该角色名已存在"
,
null
);
}
roleServiceImpl
.
saveRole
((
RoleVo
)
roleDto
);
roleServiceImpl
.
roleAndTright
(
roleDto
);
return
new
Result
(
0
,
"SUCCESS"
,
null
);
}
}
/**
/**
...
@@ -37,7 +49,12 @@ public class RoleController {
...
@@ -37,7 +49,12 @@ public class RoleController {
*/
*/
@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
Object
updateRole
(
@RequestBody
RoleDto
roleDto
){
public
Object
updateRole
(
@RequestBody
RoleDto
roleDto
){
roleServiceImpl
.
saveRole
(
roleDto
);
RoleVo
roleVo
=
roleDto
;
if
(!
roleServiceImpl
.
checkNameExist
(
roleVo
)){
return
new
Result
(
4001
,
"该角色名已存在"
,
null
);
}
roleServiceImpl
.
saveRole
(
roleVo
);
roleServiceImpl
.
roleAndTright
(
roleDto
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
return
result
;
}
}
...
@@ -48,8 +65,22 @@ public class RoleController {
...
@@ -48,8 +65,22 @@ public class RoleController {
*/
*/
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
listRoles
(){
public
Object
listRoles
(){
List
<
RoleVo
>
roleVoList
=
roleServiceImpl
.
getRoleVoList
();
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
List
<
RoleDto
>
roleDtoList
=
new
ArrayList
(
roleVoList
.
size
());
if
(
roleVoList
==
null
||
roleVoList
.
size
()
==
0
){
return
new
Result
(
0
,
"暂无角色信息"
,
null
);
}
for
(
RoleVo
roleVo:
roleVoList
)
{
List
<
String
>
trightIdList
=
roleServiceImpl
.
getTrightIdList
(
roleVo
.
getId
());
List
<
String
>
trightNameList
=
new
ArrayList
(
trightIdList
.
size
());
for
(
String
trightId:
trightIdList
)
{
String
trightName
=
roleServiceImpl
.
getTrightNameByTrightId
(
trightId
);
trightNameList
.
add
(
trightName
);
}
RoleDto
roleDto
=
roleServiceImpl
.
makeRoleDto
(
roleVo
,
trightIdList
,
trightNameList
);
roleDtoList
.
add
(
roleDto
);
}
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
roleDtoList
);
return
result
;
return
result
;
}
}
...
@@ -61,9 +92,16 @@ public class RoleController {
...
@@ -61,9 +92,16 @@ public class RoleController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/role"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/role"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
role
(
@PathVariable
Long
id
){
public
Object
role
(
@PathVariable
String
roleId
){
RoleVo
roleVo
=
roleDao
.
getById
(
id
);
RoleVo
roleVo
=
roleServiceImpl
.
getRoleById
(
roleId
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
roleVo
);
List
<
String
>
trightIdList
=
roleServiceImpl
.
getTrightIdList
(
roleId
);
List
<
String
>
trightNameList
=
new
ArrayList
(
trightIdList
.
size
());
for
(
String
trightId:
trightIdList
)
{
String
trightName
=
roleServiceImpl
.
getTrightNameByTrightId
(
trightId
);
trightNameList
.
add
(
trightName
);
}
RoleDto
roleDto
=
roleServiceImpl
.
makeRoleDto
(
roleVo
,
trightIdList
,
trightNameList
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
roleDto
);
return
result
;
return
result
;
}
}
...
@@ -73,8 +111,10 @@ public class RoleController {
...
@@ -73,8 +111,10 @@ public class RoleController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
delete
(
@PathVariable
Long
id
){
public
Object
delete
(
@PathVariable
String
roleId
){
roleServiceImpl
.
deleteRole
(
id
);
roleServiceImpl
.
deleteRole
(
roleId
);
roleServiceImpl
.
deleteRoleUser
(
roleServiceImpl
.
getRoleUserPKByRoleId
(
roleId
));
roleServiceImpl
.
deleteRoleTright
(
roleServiceImpl
.
getRoleTrightPKByRoleId
(
roleId
));
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
return
result
;
}
}
...
...
src/main/java/com/pangding/web/tright/controller/TrightController.java
View file @
661946b8
...
@@ -8,6 +8,7 @@ import com.pangding.web.tright.currency.Result;
...
@@ -8,6 +8,7 @@ import com.pangding.web.tright.currency.Result;
import
com.pangding.web.tright.dao.TrightDao
;
import
com.pangding.web.tright.dao.TrightDao
;
import
com.pangding.web.tright.service.TrightService
;
import
com.pangding.web.tright.service.TrightService
;
import
com.pangding.web.tright.vo.TrightVo
;
import
com.pangding.web.tright.vo.TrightVo
;
import
org.bouncycastle.jcajce.provider.digest.MD5
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -30,6 +31,9 @@ public class TrightController {
...
@@ -30,6 +31,9 @@ public class TrightController {
*/
*/
@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
Object
saveTright
(
@RequestBody
TrightVo
trightVo
){
public
Object
saveTright
(
@RequestBody
TrightVo
trightVo
){
if
(!
trightServiceImpl
.
checkValid
(
trightVo
)){
return
new
Result
(
4001
,
"该权限不合法,请修改权限名或权限url"
,
null
);
}
trightServiceImpl
.
save
(
trightVo
);
trightServiceImpl
.
save
(
trightVo
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
return
result
;
...
@@ -42,6 +46,9 @@ public class TrightController {
...
@@ -42,6 +46,9 @@ public class TrightController {
*/
*/
@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
Object
updateTright
(
@RequestBody
TrightVo
trightVo
){
public
Object
updateTright
(
@RequestBody
TrightVo
trightVo
){
if
(!
trightServiceImpl
.
checkValid
(
trightVo
)){
return
new
Result
(
4001
,
"该权限不合法,请修改权限名或权限url"
,
null
);
}
trightServiceImpl
.
update
(
trightVo
);
trightServiceImpl
.
update
(
trightVo
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
return
result
;
...
...
src/main/java/com/pangding/web/tright/controller/UserController.java
View file @
661946b8
...
@@ -16,7 +16,7 @@ import java.util.Date;
...
@@ -16,7 +16,7 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
@RestController
@RestController
@RequestMapping
(
"/user"
)
@RequestMapping
(
value
=
"/user"
)
public
class
UserController
{
public
class
UserController
{
@Autowired
@Autowired
...
@@ -30,13 +30,22 @@ public class UserController {
...
@@ -30,13 +30,22 @@ public class UserController {
*/
*/
@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
Object
saveUser
(
@RequestBody
UserDto
userDto
){
public
Object
saveUser
(
@RequestBody
UserDto
userDto
){
//userDto.setPassword();
//检查用户是否存在
UserVo
u
=
userServiceImpl
.
getUser
(
userDto
);
UserVo
u
=
userServiceImpl
.
getUser
(
userDto
);
//存在,直接返回
if
(
u
!=
null
)
{
if
(
u
!=
null
)
{
return
new
Result
(
4001
,
"该用户已存在"
,
null
);
return
new
Result
(
4001
,
"该用户已存在"
,
null
);
//throw new IllegalArgumentException(userDto.getUserName() + "已存在");
//throw new IllegalArgumentException(userDto.getUserName() + "已存在");
}
}
UserVo
userVo
=
userServiceImpl
.
saveUser
(
userDto
);
//不存在,保存用户信息
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
userVo
);
userDao
.
create
(
userDto
);
if
(
userDto
.
getRoleIds
()!=
null
&&
userDto
.
getRoleIds
().
size
()!=
0
){
userServiceImpl
.
userAndRole
(
userDto
);
}
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
return
result
;
return
result
;
}
}
...
@@ -46,21 +55,11 @@ public class UserController {
...
@@ -46,21 +55,11 @@ public class UserController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
updateUser
(){
//@RequestBody UserDto userDto
public
Object
updateUser
(
@RequestBody
UserDto
userDto
){
UserDto
userDto
=
new
UserDto
();
UserVo
u
=
userDto
;
userDto
.
setTuId
(
11
l
);
userDao
.
update
(
u
);
List
<
Long
>
longs
=
new
ArrayList
<>();
userServiceImpl
.
userAndRole
(
userDto
);
longs
.
add
(
1
l
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
longs
.
add
(
11
l
);
longs
.
add
(
111
l
);
userDto
.
setRoleIds
(
longs
);
userDto
.
setUserName
(
"test11234111"
);
userDto
.
setPassword
(
"12345612"
);
userDto
.
setPhoneNumber
(
"123456789110"
);
userDto
.
setCreateTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
()));
userDto
.
setCount
(
0
);
UserVo
userVo
=
userServiceImpl
.
updateUser
(
userDto
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
userVo
);
return
result
;
return
result
;
}
}
...
@@ -71,9 +70,22 @@ public class UserController {
...
@@ -71,9 +70,22 @@ public class UserController {
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
listUsers
(){
public
Object
listUsers
(){
List
<
UserVo
>
userVoList
=
userServiceImpl
.
listUserVo
();
List
<
UserDto
>
userDtoList
=
new
ArrayList
(
userVoList
.
size
());
for
(
int
var1
=
0
;
var1
<
userVoList
.
size
();++
var1
){
UserVo
userVo
=
userVoList
.
get
(
var1
);
List
<
String
>
roleIdList
=
userServiceImpl
.
listRoleIdList
(
userVo
);
List
<
String
>
roleList
=
new
ArrayList
(
roleIdList
.
size
());
for
(
int
var2
=
0
;
var2
<
roleIdList
.
size
();++
var2
){
String
role
=
userServiceImpl
.
getRoleByRoleId
(
roleIdList
.
get
(
var2
));
roleList
.
add
(
role
);
}
UserDto
userDto
=
userServiceImpl
.
makeUserDto
(
userVo
,
roleIdList
,
roleList
);
userDtoList
.
add
(
userDto
);
}
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
null
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
userDtoList
);
return
result
;
return
result
;
}
}
...
@@ -83,11 +95,20 @@ public class UserController {
...
@@ -83,11 +95,20 @@ public class UserController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/user"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/user"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Object
user
(){
//@PathVariable Long id
public
Object
user
(
String
userId
){
//@PathVariable Long id
UserVo
vo
=
userDao
.
load
(
null
,
UserVo
.
class
);
UserVo
userVo
=
userServiceImpl
.
getUserById
(
userId
);
//UserVo userVo = userDao.getById(id);
if
(
userVo
==
null
){
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
vo
);
return
new
Result
(
4001
,
"该用户不存在"
,
null
);
}
List
<
String
>
roleIdList
=
userServiceImpl
.
listRoleIdList
(
userVo
);
List
<
String
>
roleList
=
new
ArrayList
(
roleIdList
.
size
());
for
(
int
var2
=
0
;
var2
<
roleIdList
.
size
();++
var2
){
String
role
=
userServiceImpl
.
getRoleByRoleId
(
roleIdList
.
get
(
var2
));
roleList
.
add
(
role
);
}
UserDto
userDto
=
userServiceImpl
.
makeUserDto
(
userVo
,
roleIdList
,
roleList
);
Result
result
=
new
Result
(
0
,
"SUCCESS"
,
userDto
);
return
result
;
return
result
;
}
}
...
...
src/main/java/com/pangding/web/tright/dao/RoleDao.java
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
;
package
com
.
pangding
.
web
.
tright
.
dao
;
import
com.pangding.web.tright.dto.RoleDto
;
import
com.pangding.web.tright.vo.RoleTrightRelation
;
import
com.pangding.web.tright.vo.RoleVo
;
import
com.pangding.web.tright.vo.RoleVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
java.util.List
;
import
java.util.List
;
public
interface
RoleDao
{
public
interface
RoleDao
extends
BaseDao
{
int
save
(
RoleVo
roleVo
);
RoleVo
getRoleById
(
String
id
);
RoleVo
getRole
(
String
name
);
RoleVo
getRole
ByName
(
String
name
);
int
update
(
RoleVo
roleVo
);
int
checkNameExist
(
RoleVo
roleVo
);
int
deleteRole
(
Long
id
);
int
deleteRoleUser
(
Long
roleId
);
List
<
RoleVo
>
getRoleVoList
(
);
RoleVo
getById
(
Long
i
d
);
List
<
String
>
getTrightIdList
(
String
roleI
d
);
int
deleteRoleTright
(
Long
role
Id
);
String
getTrightNameByTrightId
(
String
tright
Id
);
int
saveRoleTright
(
Long
roleId
,
List
<
Long
>
trights
);
int
update
(
RoleVo
roleVo
);
}
}
src/main/java/com/pangding/web/tright/dao/RoleTrightDao.java
0 → 100644
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
;
import
com.yanzuoguang.dao.BaseDao
;
public
interface
RoleTrightDao
extends
BaseDao
{
String
getPKByRoleId
(
String
roleId
);
}
src/main/java/com/pangding/web/tright/dao/TrightDao.java
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
;
package
com
.
pangding
.
web
.
tright
.
dao
;
import
com.pangding.web.tright.vo.TrightVo
;
import
com.pangding.web.tright.vo.TrightVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
java.util.List
;
import
java.util.List
;
public
interface
TrightDao
{
public
interface
TrightDao
extends
BaseDao
{
int
save
(
TrightVo
trightVo
);
int
checkValid
(
TrightVo
trightVo
);
int
update
(
TrightVo
trightVo
);
int
deleteRoleTright
(
Long
id
);
int
deleteRoleTright
(
Long
id
);
...
...
src/main/java/com/pangding/web/tright/dao/UserDao.java
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
;
package
com
.
pangding
.
web
.
tright
.
dao
;
import
com.pangding.web.tright.dto.UserDto
;
import
com.pangding.web.tright.vo.UserRoleRelation
;
import
com.pangding.web.tright.vo.UserRoleRelation
;
import
com.pangding.web.tright.vo.UserVo
;
import
com.pangding.web.tright.vo.UserVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.dao.BaseDao
;
...
@@ -11,12 +12,16 @@ public interface UserDao extends BaseDao {
...
@@ -11,12 +12,16 @@ public interface UserDao extends BaseDao {
// int saveUser(UserVo userVo);
// int saveUser(UserVo userVo);
//
//
UserVo
getUser
(
UserVo
userVo
);
UserVo
getUser
(
UserVo
userVo
);
//
//
// int update(UserVo userVo);
// int update(UserVo userVo);
int
deleteUserRole
(
UserRoleRelation
userRoleRelation
);
List
<
UserVo
>
listUserVo
();
List
<
String
>
getRoleIdList
(
UserVo
userVo
);
int
saveUserRoles
(
List
<
UserRoleRelation
>
userRoleRelations
);
String
getRoleByRoleId
(
String
roleId
);
// UserVo getById(Long i
d);
UserVo
getUserById
(
String
userI
d
);
}
}
src/main/java/com/pangding/web/tright/dao/UserRoleDao.java
0 → 100644
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
;
import
com.yanzuoguang.dao.BaseDao
;
public
interface
UserRoleDao
extends
BaseDao
{
String
getPKByRoleId
(
String
roleId
);
}
src/main/java/com/pangding/web/tright/dao/impl/RoleDaoImpl.java
View file @
661946b8
...
@@ -9,48 +9,71 @@ import java.util.List;
...
@@ -9,48 +9,71 @@ import java.util.List;
@Component
@Component
public
class
RoleDaoImpl
extends
BaseDaoImpl
implements
RoleDao
{
public
class
RoleDaoImpl
extends
BaseDaoImpl
implements
RoleDao
{
private
static
final
String
GET_ROLE_BY_ID
=
"GET_ROLE_BY_ID"
;
private
static
final
String
GET_ROLE_BY_NAME
=
"GET_ROLE_BY_NAME"
;
private
static
final
String
CHECK_NAME_EXIST
=
"CHECK_NAME_EXIST"
;
private
static
final
String
GET_ROLELIST
=
"GET_ROLEDTO_LIST"
;
private
static
final
String
GET_TRIGHTID_LIST
=
"GET_TRIGHTID_LIST"
;
private
static
final
String
GET_TRIGHTNAME_BY_TRIGHTID
=
"GET_TRIGHTNAME_BY_TRIGHTID"
;
@Override
@Override
public
int
save
(
RoleVo
roleVo
)
{
protected
void
init
()
{
return
0
;
register
(
RoleVo
.
class
);
Table
.
add
(
GET_ROLE_BY_ID
,
"select r.* from pd_role r where 1=1"
)
.
add
(
"id"
,
"and r.id = ?"
);
Table
.
add
(
GET_ROLE_BY_NAME
,
"select r.* from pd_role r where 1=1"
)
.
add
(
"name"
,
"and r.name = ?"
);
Table
.
add
(
CHECK_NAME_EXIST
,
"select count(r.id) from pd_role r where 1=1"
)
.
add
(
"name"
,
"and r.name = ?"
)
.
add
(
"id"
,
"and r.id <> ?"
);
Table
.
add
(
GET_ROLELIST
,
"select * from pd_role where 1=1"
);
Table
.
add
(
GET_TRIGHTID_LIST
,
"select authority_id from pd_role_authority where 1=1"
)
.
add
(
"roleId"
,
"and role_id = ?"
);
Table
.
add
(
GET_TRIGHTNAME_BY_TRIGHTID
,
"select name from pd_authority where 1=1"
)
.
add
(
"trightId"
,
"and id = ?"
);
}
}
@Override
@Override
public
RoleVo
getRole
(
String
name
)
{
public
RoleVo
getRole
ById
(
String
id
)
{
return
null
;
return
this
.
queryFirst
(
RoleVo
.
class
,
GET_ROLE_BY_ID
,
id
)
;
}
}
@Override
@Override
public
int
update
(
RoleVo
roleVo
)
{
public
RoleVo
getRoleByName
(
String
name
)
{
return
0
;
return
this
.
queryFirst
(
RoleVo
.
class
,
GET_ROLE_BY_NAME
,
name
)
;
}
}
@Override
@Override
public
int
deleteRole
(
Long
id
)
{
public
int
checkNameExist
(
RoleVo
roleVo
)
{
return
0
;
return
this
.
queryFirst
(
int
.
class
,
CHECK_NAME_EXIST
,
roleVo
)
;
}
}
@Override
@Override
public
int
deleteRoleUser
(
Long
roleId
)
{
public
List
<
RoleVo
>
getRoleVoList
(
)
{
return
0
;
return
this
.
query
(
RoleVo
.
class
,
GET_ROLELIST
,
null
)
;
}
}
@Override
@Override
public
RoleVo
getById
(
Long
i
d
)
{
public
List
<
String
>
getTrightIdList
(
String
roleI
d
)
{
return
null
;
return
this
.
query
(
String
.
class
,
GET_TRIGHTID_LIST
,
roleId
)
;
}
}
@Override
@Override
public
int
deleteRoleTright
(
Long
role
Id
)
{
public
String
getTrightNameByTrightId
(
String
tright
Id
)
{
return
0
;
return
this
.
queryFirst
(
String
.
class
,
GET_TRIGHTNAME_BY_TRIGHTID
,
trightId
)
;
}
}
@Override
@Override
public
int
saveRoleTright
(
Long
roleId
,
List
<
Long
>
trights
)
{
public
int
update
(
RoleVo
roleVo
)
{
return
0
;
return
0
;
}
}
@Override
protected
void
init
()
{
}
}
}
src/main/java/com/pangding/web/tright/dao/impl/RoleTrightDaoImpl.java
0 → 100644
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
.
impl
;
import
com.pangding.web.tright.dao.RoleTrightDao
;
import
com.pangding.web.tright.vo.RoleTrightRelation
;
import
com.yanzuoguang.dao.Impl.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
@Component
public
class
RoleTrightDaoImpl
extends
BaseDaoImpl
implements
RoleTrightDao
{
private
static
final
String
GET_PK_BY_ROLEID
=
"GET_PK_BY_ROLEID"
;
@Override
protected
void
init
()
{
register
(
RoleTrightRelation
.
class
);
Table
.
add
(
GET_PK_BY_ROLEID
,
"select id from pd_role_authority where 1=1"
)
.
add
(
"roleId"
,
"and role_id = ?"
);
}
@Override
public
String
getPKByRoleId
(
String
roleId
)
{
return
this
.
queryFirst
(
String
.
class
,
GET_PK_BY_ROLEID
,
roleId
);
}
}
src/main/java/com/pangding/web/tright/dao/impl/TrightDaoImpl.java
View file @
661946b8
...
@@ -8,14 +8,22 @@ import org.springframework.stereotype.Component;
...
@@ -8,14 +8,22 @@ import org.springframework.stereotype.Component;
import
java.util.List
;
import
java.util.List
;
@Component
@Component
public
class
TrightDaoImpl
extends
BaseDaoImpl
implements
TrightDao
{
public
class
TrightDaoImpl
extends
BaseDaoImpl
implements
TrightDao
{
private
static
final
String
CHECK_VALID
=
"CHECK_VALID"
;
@Override
@Override
public
int
save
(
TrightVo
trightVo
)
{
protected
void
init
()
{
return
0
;
register
(
TrightVo
.
class
);
Table
.
add
(
CHECK_VALID
,
"select count(a.id) from pd_authority a where 1=1"
)
.
add
(
"name"
,
"and a.name = ?"
)
.
add
(
"url"
,
"and a.url = ?"
)
.
add
(
"id"
,
"and a.id <> ?"
);
}
}
@Override
@Override
public
int
update
(
TrightVo
trightVo
)
{
public
int
checkValid
(
TrightVo
trightVo
)
{
return
0
;
return
this
.
queryFirst
(
int
.
class
,
CHECK_VALID
,
trightVo
)
;
}
}
@Override
@Override
...
@@ -48,8 +56,5 @@ public class TrightDaoImpl extends BaseDaoImpl implements TrightDao {
...
@@ -48,8 +56,5 @@ public class TrightDaoImpl extends BaseDaoImpl implements TrightDao {
return
null
;
return
null
;
}
}
@Override
protected
void
init
()
{
}
}
}
src/main/java/com/pangding/web/tright/dao/impl/UserDaoImpl.java
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
.
impl
;
package
com
.
pangding
.
web
.
tright
.
dao
.
impl
;
import
com.pangding.web.tright.dao.UserDao
;
import
com.pangding.web.tright.dao.UserDao
;
import
com.pangding.web.tright.dto.UserDto
;
import
com.pangding.web.tright.vo.UserRoleRelation
;
import
com.pangding.web.tright.vo.UserRoleRelation
;
import
com.pangding.web.tright.vo.UserVo
;
import
com.pangding.web.tright.vo.UserVo
;
import
com.yanzuoguang.dao.DaoConst
;
import
com.yanzuoguang.dao.DaoConst
;
...
@@ -12,53 +13,40 @@ import org.springframework.stereotype.Component;
...
@@ -12,53 +13,40 @@ import org.springframework.stereotype.Component;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
@Component
@Component
public
class
UserDaoImpl
extends
BaseDaoImpl
implements
UserDao
{
public
class
UserDaoImpl
extends
BaseDaoImpl
implements
UserDao
{
final
String
GET_USER
=
"GET_USER"
;
final
String
DELETE_USER_ROLE
=
"deleteUserRole"
;
private
static
final
String
GET_USER
=
"GET_USER"
;
final
String
SAVE_USER_ROLE
=
"saveUserRoles"
;
private
static
final
String
DELETE_USER_ROLE
=
"deleteUserRole"
;
// @Override
private
static
final
String
SAVE_USER_ROLE
=
"saveUserRoles"
;
// public int saveUser(UserVo userVo) {
private
static
final
String
GET_ALL_USERS
=
"GET_ALL_USERS"
;
//
private
static
final
String
GET_ROLE_IDS
=
"GET_ROLE_IDS"
;
// String s = this.saveWith(userVo.getClass(),"insert into ",null);
private
static
final
String
GET_USER_BY_ID
=
"GET_USER_BY_ID"
;
// System.out.println(s);
private
static
final
String
GET_ROLE_BY_ROLEID
=
"GET_ROLE_BY_ROLEID"
;
// return 0;
// }
//
//
// @Override
// public int update(UserVo userVo) {
// return 0;
// }
//
// @Override
// public int deleteUserRole(Long userId) {
// return 0;
// }
//
// @Override
// public int saveUserRoles(Long userId, List<Long> roleIds) {
// return 0;
// }
//
// @Override
// public UserVo getById(Long id) {
// return null;
// }
//
@Override
@Override
protected
void
init
()
{
protected
void
init
()
{
register
(
UserVo
.
class
);
register
(
UserVo
.
class
);
Table
.
add
(
GET_USER
,
"SELECT
p.* FROM pd_user p
WHERE 1=1 "
)
Table
.
add
(
GET_USER
,
"SELECT
id,account,phone,status,remark,create_time,creator FROM pd_user
WHERE 1=1 "
)
.
add
(
"
username"
,
" AND p.user_name
= ?"
);
.
add
(
"
account"
,
" AND account
= ?"
);
Table
.
add
(
DELETE_USER_ROLE
,
"delete from pd_user_role_relation where 1=1"
)
Table
.
add
(
DELETE_USER_ROLE
,
"delete from pd_user_role_relation where 1=1"
)
.
add
(
"tu_id"
,
"and tu_id = ?"
);
.
add
(
"userId"
,
"and user_id = ?"
);
Table
.
add
(
GET_ALL_USERS
,
"select id,account,phone,status,remark,create_time,creator from pd_user where 1=1"
);
Table
.
add
(
GET_ROLE_IDS
,
"select role_id from pd_user_role where 1=1"
)
.
add
(
"userId"
,
"and user_id = ?"
);
Table
.
add
(
GET_USER_BY_ID
,
"select id,account,phone,status,remark,create_time,creator from pd_user where 1=1"
)
.
add
(
"userId"
,
"and user_id = ?"
);
Table
.
add
(
GET_ROLE_BY_ROLEID
,
"select name from pd_role where 1=1"
)
.
add
(
"roleId"
,
"and id = ?"
);
}
}
...
@@ -67,22 +55,26 @@ public class UserDaoImpl extends BaseDaoImpl implements UserDao {
...
@@ -67,22 +55,26 @@ public class UserDaoImpl extends BaseDaoImpl implements UserDao {
return
this
.
queryFirst
(
UserVo
.
class
,
GET_USER
,
userVo
);
return
this
.
queryFirst
(
UserVo
.
class
,
GET_USER
,
userVo
);
}
}
@Override
@Override
public
int
deleteUserRole
(
UserRoleRelation
userRoleRelation
)
{
public
List
<
UserVo
>
listUserVo
()
{
userRoleRelation
.
setTru_id
(
1
l
);
if
(
userRoleRelation
.
getTu_id
()!=
null
)
{
return
this
.
query
(
UserVo
.
class
,
GET_ALL_USERS
,
null
);
return
this
.
updateSql
(
DELETE_USER_ROLE
,
userRoleRelation
);
}
else
{
return
0
;
}
}
@Override
public
List
<
String
>
getRoleIdList
(
UserVo
userVo
)
{
return
this
.
query
(
String
.
class
,
GET_ROLE_IDS
,
userVo
);
}
}
@Override
@Override
public
int
saveUserRoles
(
List
<
UserRoleRelation
>
userRoleRelations
)
{
public
String
getRoleByRoleId
(
String
roleId
)
{
//this.create(userRoleRelations);
return
this
.
queryFirst
(
String
.
class
,
GET_ROLE_BY_ROLEID
,
roleId
);
for
(
UserRoleRelation
userRoleRelation
:
userRoleRelations
)
{
//this.save(userRoleRelation);
}
}
return
0
;
@Override
public
UserVo
getUserById
(
String
userId
)
{
return
this
.
queryFirst
(
UserVo
.
class
,
GET_USER_BY_ID
,
userId
);
}
}
}
}
src/main/java/com/pangding/web/tright/dao/impl/UserRoleDaoImpl.java
0 → 100644
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
dao
.
impl
;
import
com.pangding.web.tright.dao.UserRoleDao
;
import
com.pangding.web.tright.vo.UserRoleRelation
;
import
com.yanzuoguang.dao.Impl.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
@Component
public
class
UserRoleDaoImpl
extends
BaseDaoImpl
implements
UserRoleDao
{
private
static
final
String
GET_PK_BY_ROLEID
=
"GET_PK_BY_ROLEID"
;
@Override
protected
void
init
()
{
register
(
UserRoleRelation
.
class
);
Table
.
add
(
GET_PK_BY_ROLEID
,
"select id from pd_user_role where 1=1"
)
.
add
(
"roleId"
,
"and role_id = ?"
);
}
@Override
public
String
getPKByRoleId
(
String
roleId
)
{
return
this
.
queryFirst
(
String
.
class
,
GET_PK_BY_ROLEID
,
roleId
);
}
}
src/main/java/com/pangding/web/tright/dto/RoleDto.java
View file @
661946b8
...
@@ -6,13 +6,24 @@ import java.util.List;
...
@@ -6,13 +6,24 @@ import java.util.List;
public
class
RoleDto
extends
RoleVo
{
public
class
RoleDto
extends
RoleVo
{
private
List
<
Lo
ng
>
trightIds
;
private
List
<
Stri
ng
>
trightIds
;
public
List
<
Long
>
getTrightIds
()
{
private
List
<
String
>
trightNames
;
public
List
<
String
>
getTrightIds
()
{
return
trightIds
;
return
trightIds
;
}
}
public
void
setTrightIds
(
List
<
Lo
ng
>
trightIds
)
{
public
void
setTrightIds
(
List
<
Stri
ng
>
trightIds
)
{
this
.
trightIds
=
trightIds
;
this
.
trightIds
=
trightIds
;
}
}
public
List
<
String
>
getTrightNames
()
{
return
trightNames
;
}
public
void
setTrightNames
(
List
<
String
>
trightNames
)
{
this
.
trightNames
=
trightNames
;
}
}
}
src/main/java/com/pangding/web/tright/dto/UserDto.java
View file @
661946b8
...
@@ -6,13 +6,23 @@ import java.util.List;
...
@@ -6,13 +6,23 @@ import java.util.List;
public
class
UserDto
extends
UserVo
{
public
class
UserDto
extends
UserVo
{
private
List
<
Lo
ng
>
roleIds
;
private
List
<
Stri
ng
>
roleIds
;
public
List
<
Long
>
getRoleIds
()
{
private
List
<
String
>
roles
;
public
List
<
String
>
getRoleIds
()
{
return
roleIds
;
return
roleIds
;
}
}
public
void
setRoleIds
(
List
<
Lo
ng
>
roleIds
)
{
public
void
setRoleIds
(
List
<
Stri
ng
>
roleIds
)
{
this
.
roleIds
=
roleIds
;
this
.
roleIds
=
roleIds
;
}
}
public
List
<
String
>
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
List
<
String
>
roles
)
{
this
.
roles
=
roles
;
}
}
}
src/main/java/com/pangding/web/tright/service/RoleService.java
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
service
;
package
com
.
pangding
.
web
.
tright
.
service
;
import
com.pangding.web.tright.dto.RoleDto
;
import
com.pangding.web.tright.dto.RoleDto
;
import
com.pangding.web.tright.vo.RoleVo
;
import
java.util.List
;
public
interface
RoleService
{
public
interface
RoleService
{
void
saveRole
(
RoleDto
roleDto
);
void
saveRole
(
RoleVo
roleVo
);
RoleVo
getRoleById
(
String
id
);
RoleVo
getRoleByName
(
String
name
);
void
roleAndTright
(
RoleDto
roleDto
);
Boolean
checkNameExist
(
RoleVo
roleVo
);
List
<
RoleVo
>
getRoleVoList
();
List
<
String
>
getTrightIdList
(
String
roleId
);
String
getTrightNameByTrightId
(
String
trightId
);
RoleDto
makeRoleDto
(
RoleVo
roleVo
,
List
<
String
>
trightIdList
,
List
<
String
>
trightNameList
);
void
deleteRole
(
String
roleId
);
void
deleteRoleUser
(
String
roleId
);
void
deleteRoleTright
(
String
roleId
);
String
getRoleUserPKByRoleId
(
String
roleId
);
void
deleteRole
(
Long
i
d
);
String
getRoleTrightPKByRoleId
(
String
roleI
d
);
}
}
src/main/java/com/pangding/web/tright/service/TrightService.java
View file @
661946b8
...
@@ -8,4 +8,6 @@ public interface TrightService {
...
@@ -8,4 +8,6 @@ public interface TrightService {
void
update
(
TrightVo
trightVo
);
void
update
(
TrightVo
trightVo
);
void
delete
(
Long
id
);
void
delete
(
Long
id
);
Boolean
checkValid
(
TrightVo
trightVo
);
}
}
src/main/java/com/pangding/web/tright/service/UserService.java
View file @
661946b8
...
@@ -3,13 +3,24 @@ package com.pangding.web.tright.service;
...
@@ -3,13 +3,24 @@ package com.pangding.web.tright.service;
import
com.pangding.web.tright.dto.UserDto
;
import
com.pangding.web.tright.dto.UserDto
;
import
com.pangding.web.tright.vo.UserVo
;
import
com.pangding.web.tright.vo.UserVo
;
public
interface
UserService
{
import
java.lang.reflect.Array
;
import
java.util.List
;
UserVo
saveUser
(
UserDto
userDto
);
public
interface
UserService
{
UserVo
updateUser
(
UserDto
userDto
);
void
userAndRole
(
UserDto
userDto
);
UserVo
getUser
(
UserVo
userVo
);
UserVo
getUser
(
UserVo
userVo
);
String
passwordEncoder
(
String
credentials
,
String
salt
);
String
passwordEncoder
(
String
credentials
,
String
salt
);
List
<
UserVo
>
listUserVo
();
List
<
String
>
listRoleIdList
(
UserVo
userVo
);
String
getRoleByRoleId
(
String
roleId
);
UserDto
makeUserDto
(
UserVo
userVo
,
List
<
String
>
roleIdList
,
List
<
String
>
roleList
);
UserVo
getUserById
(
String
userId
);
}
}
src/main/java/com/pangding/web/tright/service/impl/RoleServiceImpl.java
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
service
.
impl
;
package
com
.
pangding
.
web
.
tright
.
service
.
impl
;
import
com.pangding.web.tright.dao.RoleDao
;
import
com.pangding.web.tright.dao.RoleDao
;
import
com.pangding.web.tright.dao.RoleTrightDao
;
import
com.pangding.web.tright.dao.UserRoleDao
;
import
com.pangding.web.tright.dto.RoleDto
;
import
com.pangding.web.tright.dto.RoleDto
;
import
com.pangding.web.tright.service.RoleService
;
import
com.pangding.web.tright.service.RoleService
;
import
com.pangding.web.tright.vo.RoleTrightRelation
;
import
com.pangding.web.tright.vo.RoleVo
;
import
com.pangding.web.tright.vo.RoleVo
;
import
com.pangding.web.tright.vo.UserRoleRelation
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
@Service
@Service
public
class
RoleServiceImpl
implements
RoleService
{
public
class
RoleServiceImpl
implements
RoleService
{
@Autowired
@Autowired
RoleDao
roleDao
;
RoleDao
roleDao
;
@Autowired
UserRoleDao
userRoleDaoImpl
;
@Autowired
RoleTrightDao
roleTrightDaoImpl
;
@Override
@Override
public
void
saveRole
(
RoleDto
roleDto
)
{
public
void
saveRole
(
RoleVo
roleVo
)
{
RoleVo
role
=
roleDto
;
roleDao
.
create
(
roleVo
);
if
(
role
.
getTrId
()
!=
null
)
{
// 修改
RoleVo
r
=
roleDao
.
getRole
(
role
.
getRoleName
());
if
(
r
!=
null
&&
r
.
getTrId
()
!=
role
.
getTrId
())
{
throw
new
IllegalArgumentException
(
role
.
getRoleName
()
+
"已存在"
);
}
}
roleDao
.
update
(
role
);
@Override
}
else
{
// 新增
public
RoleVo
getRoleById
(
String
id
)
{
RoleVo
r
=
roleDao
.
getRole
(
role
.
getRoleName
());
return
roleDao
.
getRoleById
(
id
);
if
(
r
!=
null
)
{
throw
new
IllegalArgumentException
(
role
.
getRoleName
()
+
"已存在"
);
}
}
roleDao
.
save
(
role
);
@Override
public
RoleVo
getRoleByName
(
String
name
)
{
return
roleDao
.
getRoleByName
(
name
);
}
@Override
public
void
roleAndTright
(
RoleDto
roleDto
)
{
List
<
String
>
trightIds
=
roleDto
.
getTrightIds
();
for
(
String
trightId
:
trightIds
)
{
RoleTrightRelation
roleTrightRelation
=
new
RoleTrightRelation
();
roleTrightRelation
.
setTrightId
(
trightId
);
roleTrightRelation
.
setRoleId
(
roleDto
.
getId
());
roleTrightRelation
.
setId
(
UUID
.
randomUUID
().
toString
());
roleTrightDaoImpl
.
create
(
roleTrightRelation
);
}
}
saveRoleTright
(
role
.
getTrId
(),
roleDto
.
getTrightIds
());
}
}
private
void
saveRoleTright
(
Long
roleId
,
List
<
Long
>
trights
)
{
@Override
roleDao
.
deleteRoleTright
(
roleId
);
public
Boolean
checkNameExist
(
RoleVo
roleVo
)
{
trights
.
remove
(
0L
);
if
(
roleDao
.
checkNameExist
(
roleVo
)
>
0
){
return
false
;}
if
(!
CollectionUtils
.
isEmpty
(
trights
))
{
return
true
;
roleDao
.
saveRoleTright
(
roleId
,
trights
);
}
@Override
public
List
<
RoleVo
>
getRoleVoList
()
{
return
roleDao
.
getRoleVoList
();
}
}
@Override
public
List
<
String
>
getTrightIdList
(
String
roleId
)
{
return
roleDao
.
getTrightIdList
(
roleId
);
}
@Override
public
String
getTrightNameByTrightId
(
String
trightId
)
{
return
roleDao
.
getTrightNameByTrightId
(
trightId
);
}
@Override
public
RoleDto
makeRoleDto
(
RoleVo
roleVo
,
List
<
String
>
trightIdList
,
List
<
String
>
trightNameList
)
{
RoleDto
roleDto
=
(
RoleDto
)
roleVo
;
roleDto
.
setTrightIds
(
trightIdList
);
roleDto
.
setTrightNames
(
trightNameList
);
return
roleDto
;
}
@Override
public
void
deleteRole
(
String
roleId
)
{
roleDao
.
remove
(
roleId
);
}
@Override
public
void
deleteRoleUser
(
String
id
)
{
if
(
id
!=
null
&&
id
!=
""
)
{
userRoleDaoImpl
.
remove
(
id
);
}
}
@Override
public
void
deleteRoleTright
(
String
id
)
{
if
(
id
!=
null
&&
id
!=
""
)
{
roleTrightDaoImpl
.
remove
(
id
);
}
}
@Override
public
String
getRoleUserPKByRoleId
(
String
roleId
)
{
return
userRoleDaoImpl
.
getPKByRoleId
(
roleId
);
}
}
@Override
@Override
public
void
deleteRole
(
Long
id
)
{
public
String
getRoleTrightPKByRoleId
(
String
roleId
)
{
roleDao
.
deleteRoleUser
(
id
);
return
roleTrightDaoImpl
.
getPKByRoleId
(
roleId
);
roleDao
.
deleteRole
(
id
);
}
}
}
}
src/main/java/com/pangding/web/tright/service/impl/TrightServiceImpl.java
View file @
661946b8
...
@@ -13,7 +13,7 @@ public class TrightServiceImpl implements TrightService {
...
@@ -13,7 +13,7 @@ public class TrightServiceImpl implements TrightService {
TrightDao
trightDao
;
TrightDao
trightDao
;
@Override
@Override
public
void
save
(
TrightVo
trightVo
)
{
public
void
save
(
TrightVo
trightVo
)
{
trightDao
.
sav
e
(
trightVo
);
trightDao
.
creat
e
(
trightVo
);
}
}
@Override
@Override
...
@@ -21,6 +21,13 @@ public class TrightServiceImpl implements TrightService {
...
@@ -21,6 +21,13 @@ public class TrightServiceImpl implements TrightService {
trightDao
.
update
(
trightVo
);
trightDao
.
update
(
trightVo
);
}
}
@Override
public
Boolean
checkValid
(
TrightVo
trightVo
)
{
int
checkResult
=
trightDao
.
checkValid
(
trightVo
);
if
(
checkResult
==
0
){
return
true
;}
else
{
return
false
;}
}
@Override
@Override
public
void
delete
(
Long
id
)
{
public
void
delete
(
Long
id
)
{
trightDao
.
deleteRoleTright
(
id
);
trightDao
.
deleteRoleTright
(
id
);
...
...
src/main/java/com/pangding/web/tright/service/impl/UserServiceImpl.java
View file @
661946b8
...
@@ -11,6 +11,7 @@ import org.springframework.util.CollectionUtils;
...
@@ -11,6 +11,7 @@ import org.springframework.util.CollectionUtils;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
@Service
@Service
public
class
UserServiceImpl
implements
UserService
{
public
class
UserServiceImpl
implements
UserService
{
...
@@ -19,27 +20,27 @@ public class UserServiceImpl implements UserService {
...
@@ -19,27 +20,27 @@ public class UserServiceImpl implements UserService {
UserDao
userDao
;
UserDao
userDao
;
@Override
@Override
public
UserVo
saveUser
(
UserDto
userDto
)
{
public
List
<
UserVo
>
listUserVo
()
{
UserVo
userVo
=
userDto
;
// return userDao.listUser();
userDao
.
create
(
userVo
);
return
userDao
.
listUserVo
();
userAndRole
(
userDto
);
return
userVo
;
}
}
private
void
saveUserRoles
(
List
<
UserRoleRelation
>
userRoleRelations
)
{
@Override
userDao
.
deleteUserRole
(
userRoleRelations
.
get
(
0
));
public
void
userAndRole
(
UserDto
userDto
)
{
if
(!
CollectionUtils
.
isEmpty
(
userRoleRelations
))
{
userDao
.
saveUserRoles
(
userRoleRelations
);
List
<
String
>
roleIds
=
userDto
.
getRoleIds
();
//多个角色
}
for
(
String
roleId
:
roleIds
)
{
UserRoleRelation
userRoleRelation
=
new
UserRoleRelation
();
userRoleRelation
.
setRoleId
(
roleId
);
userRoleRelation
.
setUserId
(
userDto
.
getId
());
userRoleRelation
.
setId
(
UUID
.
randomUUID
().
toString
());
userDao
.
create
(
userRoleRelation
);
}
}
@Override
public
UserVo
updateUser
(
UserDto
userDto
)
{
userDao
.
update
(
userDto
);
userAndRole
(
userDto
);
return
userDto
;
}
}
@Override
@Override
public
UserVo
getUser
(
UserVo
userVo
)
{
public
UserVo
getUser
(
UserVo
userVo
)
{
return
userDao
.
getUser
(
userVo
);
return
userDao
.
getUser
(
userVo
);
...
@@ -50,19 +51,26 @@ public class UserServiceImpl implements UserService {
...
@@ -50,19 +51,26 @@ public class UserServiceImpl implements UserService {
return
null
;
return
null
;
}
}
private
void
userAndRole
(
UserDto
userDto
){
@Override
if
(
userDto
.
getRoleIds
()!=
null
&&
userDto
.
getRoleIds
().
size
()!=
0
)
{
public
List
<
String
>
listRoleIdList
(
UserVo
userVo
)
{
List
<
Long
>
longs
=
userDto
.
getRoleIds
();
//多个角色
return
userDao
.
getRoleIdList
(
userVo
);
List
<
UserRoleRelation
>
userRoleRelations
=
new
ArrayList
<>();
//查询当前用户的ID
//UserVo userVo = userDao.getUser(userDto);
for
(
Long
l
:
longs
)
{
UserRoleRelation
userRoleRelation
=
new
UserRoleRelation
();
userRoleRelation
.
setTr_id
(
l
);
userRoleRelation
.
setTu_id
(
userDto
.
getTuId
());
userRoleRelations
.
add
(
userRoleRelation
);
}
}
saveUserRoles
(
userRoleRelations
);
@Override
public
UserDto
makeUserDto
(
UserVo
userVo
,
List
<
String
>
roleIdList
,
List
<
String
>
roleList
)
{
UserDto
userDto
=
(
UserDto
)
userVo
;
userDto
.
setRoleIds
(
roleIdList
);
userDto
.
setRoles
(
roleList
);
return
userDto
;
}
}
@Override
public
String
getRoleByRoleId
(
String
roleId
)
{
return
userDao
.
getRoleByRoleId
(
roleId
);
}
@Override
public
UserVo
getUserById
(
String
userId
)
{
return
userDao
.
getUserById
(
userId
);
}
}
}
}
src/main/java/com/pangding/web/tright/vo/RoleTrightRelation.java
0 → 100644
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
vo
;
import
com.yanzuoguang.dao.TableAnnotation
;
import
java.io.Serializable
;
@TableAnnotation
(
"pd_role_authority"
)
public
class
RoleTrightRelation
implements
Serializable
{
/*主键id*/
private
String
id
;
@TableAnnotation
(
"role_id"
)
/*角色id*/
private
String
roleId
;
/*权限id*/
@TableAnnotation
(
"authority_id"
)
private
String
trightId
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getTrightId
()
{
return
trightId
;
}
public
void
setTrightId
(
String
trightId
)
{
this
.
trightId
=
trightId
;
}
}
src/main/java/com/pangding/web/tright/vo/RoleVo.java
View file @
661946b8
...
@@ -7,49 +7,45 @@ import java.util.Date;
...
@@ -7,49 +7,45 @@ import java.util.Date;
@TableAnnotation
(
"pd_role"
)
@TableAnnotation
(
"pd_role"
)
public
class
RoleVo
implements
Serializable
{
public
class
RoleVo
implements
Serializable
{
private
Long
trId
;
//主键ID
private
Long
parentTrId
;
//角色父ID
private
String
roleName
;
//角色名
private
Date
createTime
;
//创建时间
private
String
describe
;
//描述
public
Long
getTrId
()
{
private
String
id
;
//主键id
return
trId
;
}
p
ublic
void
setTrId
(
Long
trId
)
{
p
rivate
String
pid
;
//父角色id
this
.
trId
=
trId
;
}
private
String
name
;
//角色名
public
Long
getParentTrId
()
{
private
String
remark
;
//描述
return
parentTrId
;
public
String
getId
()
{
return
id
;
}
}
public
void
set
ParentTrId
(
Long
parentTrI
d
)
{
public
void
set
Id
(
String
i
d
)
{
this
.
parentTrId
=
parentTrI
d
;
this
.
id
=
i
d
;
}
}
public
String
get
RoleName
()
{
public
String
get
Pid
()
{
return
roleName
;
return
pid
;
}
}
public
void
set
RoleName
(
String
roleName
)
{
public
void
set
Pid
(
String
pid
)
{
this
.
roleName
=
roleName
;
this
.
pid
=
pid
;
}
}
public
Date
getCreateTi
me
()
{
public
String
getNa
me
()
{
return
createTi
me
;
return
na
me
;
}
}
public
void
set
CreateTime
(
Date
createTi
me
)
{
public
void
set
Name
(
String
na
me
)
{
this
.
createTime
=
createTi
me
;
this
.
name
=
na
me
;
}
}
public
String
get
Describe
()
{
public
String
get
Remark
()
{
return
describe
;
return
remark
;
}
}
public
void
set
Describe
(
String
describe
)
{
public
void
set
Remark
(
String
remark
)
{
this
.
describe
=
describe
;
this
.
remark
=
remark
;
}
}
}
}
src/main/java/com/pangding/web/tright/vo/TrightVo.java
View file @
661946b8
package
com
.
pangding
.
web
.
tright
.
vo
;
package
com
.
pangding
.
web
.
tright
.
vo
;
import
com.yanzuoguang.dao.TableAnnotation
;
import
com.yanzuoguang.dao.TableAnnotation
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.InitDao
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
/**
/**
* 权限表
* 权限表
*/
*/
@TableAnnotation
(
"pd_tright"
)
@TableAnnotation
(
"pd_authority"
)
public
class
TrightVo
implements
Serializable
{
public
class
TrightVo
implements
Serializable
,
InitDao
{
private
Long
trId
;
//权限ID
//主键id
private
Long
sysId
;
//系统ID
private
String
id
;
private
Long
moduleId
;
//上级模块ID
//父权限id
private
String
moduleName
;
//模块名
private
String
pid
;
private
Integer
menuOrFunc
;
//菜单/功能(1:菜单,2:功能)
//权限名
private
String
alias
;
//权限别名
private
String
name
;
private
String
requestURL
;
//请求URL
//权限类型
private
String
requestJur
;
//请求权限(多个用,分割)
private
String
type
;
private
Integer
openWith
;
//打开方式(1:blankHTML,2:innerHTML,3:dialog)
//别名
private
String
dialogTitle
;
//对话框标题
private
String
alias
;
private
Integer
dialogWidth
;
//对话框宽度
//权限url
private
Integer
dialogHeight
;
//对话框高度
private
String
url
;
private
String
operatOrField
;
//操作字段(表字段...)
@TableAnnotation
(
"open_mode"
)
//打开方式
private
String
openMode
;
//描述
private
String
remark
;
@TableAnnotation
(
"create_time"
)
//创建时间
private
Timestamp
createTime
;
public
Long
getTr
Id
()
{
public
String
get
Id
()
{
return
trI
d
;
return
i
d
;
}
}
public
void
set
TrId
(
Long
trI
d
)
{
public
void
set
Id
(
String
i
d
)
{
this
.
trId
=
trI
d
;
this
.
id
=
i
d
;
}
}
public
Long
getSysI
d
()
{
public
String
getPi
d
()
{
return
sysI
d
;
return
pi
d
;
}
}
public
void
set
SysId
(
Long
sysI
d
)
{
public
void
set
Pid
(
String
pi
d
)
{
this
.
sysId
=
sysI
d
;
this
.
pid
=
pi
d
;
}
}
public
Long
getModuleId
()
{
public
String
getName
()
{
return
moduleId
;
return
name
;
}
}
public
void
set
ModuleId
(
Long
moduleId
)
{
public
void
set
Name
(
String
name
)
{
this
.
moduleId
=
moduleId
;
this
.
name
=
name
;
}
}
public
String
get
ModuleNam
e
()
{
public
String
get
Typ
e
()
{
return
moduleNam
e
;
return
typ
e
;
}
}
public
void
setModuleName
(
String
moduleName
)
{
public
void
setType
(
String
type
)
{
this
.
moduleName
=
moduleName
;
this
.
type
=
type
;
}
public
Integer
getMenuOrFunc
()
{
return
menuOrFunc
;
}
public
void
setMenuOrFunc
(
Integer
menuOrFunc
)
{
this
.
menuOrFunc
=
menuOrFunc
;
}
}
public
String
getAlias
()
{
public
String
getAlias
()
{
...
@@ -71,59 +74,41 @@ public class TrightVo implements Serializable {
...
@@ -71,59 +74,41 @@ public class TrightVo implements Serializable {
this
.
alias
=
alias
;
this
.
alias
=
alias
;
}
}
public
String
getRequestURL
()
{
public
String
getUrl
()
{
return
requestURL
;
return
url
;
}
public
void
setRequestURL
(
String
requestURL
)
{
this
.
requestURL
=
requestURL
;
}
public
String
getRequestJur
()
{
return
requestJur
;
}
public
void
setRequestJur
(
String
requestJur
)
{
this
.
requestJur
=
requestJur
;
}
public
Integer
getOpenWith
()
{
return
openWith
;
}
public
void
setOpenWith
(
Integer
openWith
)
{
this
.
openWith
=
openWith
;
}
}
public
String
getDialogTitle
(
)
{
public
void
setUrl
(
String
url
)
{
return
dialogTitle
;
this
.
url
=
url
;
}
}
public
void
setDialogTitle
(
String
dialogTitle
)
{
public
String
getOpenMode
(
)
{
this
.
dialogTitle
=
dialogTitl
e
;
return
openMod
e
;
}
}
public
Integer
getDialogWidth
(
)
{
public
void
setOpenMode
(
String
openMode
)
{
return
dialogWidth
;
this
.
openMode
=
openMode
;
}
}
public
void
setDialogWidth
(
Integer
dialogWidth
)
{
public
String
getRemark
(
)
{
this
.
dialogWidth
=
dialogWidth
;
return
remark
;
}
}
public
Integer
getDialogHeight
(
)
{
public
void
setRemark
(
String
remark
)
{
return
dialogHeight
;
this
.
remark
=
remark
;
}
}
public
void
setDialogHeight
(
Integer
dialogHeight
)
{
public
Timestamp
getCreateTime
(
)
{
this
.
dialogHeight
=
dialogHeight
;
return
createTime
;
}
}
public
String
getOperatOrField
(
)
{
public
void
setCreateTime
(
Timestamp
createTime
)
{
return
operatOrField
;
this
.
createTime
=
createTime
;
}
}
public
void
setOperatOrField
(
String
operatOrField
)
{
@Override
this
.
operatOrField
=
operatOrField
;
public
void
init
()
{
String
createTimeString
=
StringHelper
.
getFirst
(
DateHelper
.
getDateTimeString
(
this
.
createTime
),
DateHelper
.
getNow
());
this
.
createTime
=
Timestamp
.
valueOf
(
createTimeString
);
}
}
}
}
src/main/java/com/pangding/web/tright/vo/UserRoleRelation.java
View file @
661946b8
...
@@ -2,36 +2,40 @@ package com.pangding.web.tright.vo;
...
@@ -2,36 +2,40 @@ package com.pangding.web.tright.vo;
import
com.yanzuoguang.dao.TableAnnotation
;
import
com.yanzuoguang.dao.TableAnnotation
;
@TableAnnotation
(
"pd_user_role_relation"
)
import
java.io.Serializable
;
public
class
UserRoleRelation
{
@TableAnnotation
(
"tru_id"
)
@TableAnnotation
(
"pd_user_role"
)
private
Long
tru_id
;
public
class
UserRoleRelation
implements
Serializable
{
@TableAnnotation
(
"tr_id"
)
private
Long
tr_id
;
private
String
id
;
@TableAnnotation
(
"tu_id"
)
@TableAnnotation
(
"user_id"
)
private
Long
tu_id
;
/*用户id*/
private
String
userId
;
public
Long
getTru_id
()
{
@TableAnnotation
(
"role_id"
)
return
tru_id
;
/*角色id*/
private
String
roleId
;
public
String
getId
()
{
return
id
;
}
}
public
void
set
Tru_id
(
Long
tru_
id
)
{
public
void
set
Id
(
String
id
)
{
this
.
tru_id
=
tru_
id
;
this
.
id
=
id
;
}
}
public
Long
getTr_i
d
()
{
public
String
getUserI
d
()
{
return
tr_i
d
;
return
userI
d
;
}
}
public
void
set
Tr_id
(
Long
tr_i
d
)
{
public
void
set
UserId
(
String
userI
d
)
{
this
.
tr_id
=
tr_i
d
;
this
.
userId
=
userI
d
;
}
}
public
Long
getTu_i
d
()
{
public
String
getRoleI
d
()
{
return
tu_i
d
;
return
roleI
d
;
}
}
public
void
set
Tu_id
(
Long
tu_i
d
)
{
public
void
set
RoleId
(
String
roleI
d
)
{
this
.
tu_id
=
tu_i
d
;
this
.
roleId
=
roleI
d
;
}
}
}
}
src/main/java/com/pangding/web/tright/vo/UserVo.java
View file @
661946b8
...
@@ -6,40 +6,44 @@ import com.yanzuoguang.util.helper.StringHelper;
...
@@ -6,40 +6,44 @@ import com.yanzuoguang.util.helper.StringHelper;
import
com.yanzuoguang.util.vo.InitDao
;
import
com.yanzuoguang.util.vo.InitDao
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.Date
;
import
java.util.Date
;
@TableAnnotation
(
"pd_user"
)
@TableAnnotation
(
"pd_user"
)
public
class
UserVo
implements
Serializable
,
InitDao
{
public
class
UserVo
implements
Serializable
,
InitDao
{
@TableAnnotation
(
"tu_id"
)
/*主键id*/
private
Long
tuId
;
//主键ID
private
String
id
;
@TableAnnotation
(
"user_name"
)
/*账号*/
private
String
userName
;
//用户名
private
String
account
;
private
String
password
;
//密码
/*密码*/
@TableAnnotation
(
"phone_number"
)
private
String
password
;
private
String
phoneNumber
;
//手机号
/*手机号*/
private
String
phone
;
/*状态*/
private
String
status
;
/*描述*/
private
String
remark
;
@TableAnnotation
(
"create_time"
)
@TableAnnotation
(
"create_time"
)
private
String
createTime
;
//创建时间
/*创建时间*/
@TableAnnotation
(
"login_time"
)
private
Timestamp
createTime
;
private
String
loginTime
;
//登录时间
/*创建人*/
@TableAnnotation
(
"last_login_time"
)
private
String
creator
;
private
String
lastLoginTime
;
//上次登录时间
private
Integer
count
;
//登录次数
public
Long
getTu
Id
()
{
public
String
get
Id
()
{
return
tuI
d
;
return
i
d
;
}
}
public
void
set
TuId
(
Long
tuI
d
)
{
public
void
set
Id
(
String
i
d
)
{
this
.
tuId
=
tuI
d
;
this
.
id
=
i
d
;
}
}
public
String
get
UserName
()
{
public
String
get
Account
()
{
return
userName
;
return
account
;
}
}
public
void
set
UserName
(
String
userName
)
{
public
void
set
Account
(
String
account
)
{
this
.
userName
=
userName
;
this
.
account
=
account
;
}
}
public
String
getPassword
()
{
public
String
getPassword
()
{
...
@@ -50,50 +54,49 @@ public class UserVo implements Serializable, InitDao {
...
@@ -50,50 +54,49 @@ public class UserVo implements Serializable, InitDao {
this
.
password
=
password
;
this
.
password
=
password
;
}
}
public
String
getPhone
Number
()
{
public
String
getPhone
()
{
return
phone
Number
;
return
phone
;
}
}
public
void
setPhone
Number
(
String
phoneNumber
)
{
public
void
setPhone
(
String
phone
)
{
this
.
phone
Number
=
phoneNumber
;
this
.
phone
=
phone
;
}
}
public
String
get
CreateTime
()
{
public
String
get
Status
()
{
return
createTime
;
return
status
;
}
}
public
void
set
CreateTime
(
String
createTime
)
{
public
void
set
Status
(
String
status
)
{
this
.
createTime
=
createTime
;
this
.
status
=
status
;
}
}
public
String
get
LoginTime
()
{
public
String
get
Remark
()
{
return
loginTime
;
return
remark
;
}
}
public
void
set
LoginTime
(
String
loginTime
)
{
public
void
set
Remark
(
String
remark
)
{
this
.
loginTime
=
loginTime
;
this
.
remark
=
remark
;
}
}
public
String
getLastLogin
Time
()
{
public
Timestamp
getCreate
Time
()
{
return
lastLogin
Time
;
return
create
Time
;
}
}
public
void
set
LastLoginTime
(
String
lastLogin
Time
)
{
public
void
set
CreateTime
(
Timestamp
create
Time
)
{
this
.
lastLoginTime
=
lastLogin
Time
;
this
.
createTime
=
create
Time
;
}
}
public
Integer
getCount
()
{
public
String
getCreator
()
{
return
c
ount
;
return
c
reator
;
}
}
public
void
setC
ount
(
Integer
count
)
{
public
void
setC
reator
(
String
creator
)
{
this
.
c
ount
=
count
;
this
.
c
reator
=
creator
;
}
}
@Override
@Override
public
void
init
()
{
public
void
init
()
{
this
.
createTime
=
StringHelper
.
getFirst
(
this
.
createTime
,
DateHelper
.
getNow
());
String
createTimeString
=
StringHelper
.
getFirst
(
DateHelper
.
getDateTimeString
(
this
.
createTime
),
DateHelper
.
getNow
());
this
.
loginTime
=
StringHelper
.
getFirst
(
this
.
loginTime
,
DateHelper
.
getNow
());
this
.
createTime
=
Timestamp
.
valueOf
(
createTimeString
);
this
.
lastLoginTime
=
StringHelper
.
getFirst
(
this
.
lastLoginTime
,
DateHelper
.
getNow
());
}
}
}
}
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