Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
govdna
Project
Project
Details
Activity
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
开发共享交流平台
govdna
Commits
786001e8
Commit
786001e8
authored
Aug 07, 2018
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user
parent
d30db6af
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
AbstractController.java
.../govmade/modules/basic/controller/AbstractController.java
+1
-1
UserController.java
...com/govmade/modules/system/controller/UserController.java
+3
-2
UserServiceImpl.java
.../govmade/modules/system/service/impl/UserServiceImpl.java
+2
-1
No files found.
src/main/java/com/govmade/modules/basic/controller/AbstractController.java
View file @
786001e8
...
@@ -19,7 +19,7 @@ public abstract class AbstractController {
...
@@ -19,7 +19,7 @@ public abstract class AbstractController {
//return (UserEntity) SecurityUtils.getSubject().getPrincipal();
//return (UserEntity) SecurityUtils.getSubject().getPrincipal();
UserEntity
ue
=
new
UserEntity
();
UserEntity
ue
=
new
UserEntity
();
ue
.
setDeptId
(
1L
);
ue
.
setDeptId
(
1L
);
return
null
;
return
ue
;
}
}
protected
Long
getUserId
()
{
protected
Long
getUserId
()
{
...
...
src/main/java/com/govmade/modules/system/controller/UserController.java
View file @
786001e8
...
@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.govmade.common.utils.Constant
;
import
com.govmade.common.utils.Constant
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.PageUtils
;
...
@@ -52,10 +53,10 @@ public class UserController extends AbstractController {
...
@@ -52,10 +53,10 @@ public class UserController extends AbstractController {
* 用户列表
* 用户列表
*/
*/
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
R
list
(
Map
<
String
,
Object
>
params
)
{
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
// 只有超级管理员,才能查看所有用户列表
// 只有超级管理员,才能查看所有用户列表
if
(
getUserId
()
!
=
Constant
.
SUPER_ADMIN
)
{
if
(
getUserId
()
=
=
Constant
.
SUPER_ADMIN
)
{
params
.
put
(
"createBy"
,
getUserId
());
params
.
put
(
"createBy"
,
getUserId
());
}
else
{
}
else
{
params
.
put
(
"deptId"
,
getUser
().
getDeptId
());
// 部门管理员,查看本部门用户列表
params
.
put
(
"deptId"
,
getUser
().
getDeptId
());
// 部门管理员,查看本部门用户列表
...
...
src/main/java/com/govmade/modules/system/service/impl/UserServiceImpl.java
View file @
786001e8
...
@@ -30,9 +30,10 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
...
@@ -30,9 +30,10 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
// TODO Auto-generated method stub
// TODO Auto-generated method stub
String
username
=
(
String
)
params
.
get
(
"username"
);
String
username
=
(
String
)
params
.
get
(
"username"
);
Long
createBy
=
(
Long
)
params
.
get
(
"createBy"
);
Long
createBy
=
(
Long
)
params
.
get
(
"createBy"
);
Long
deptId
=
(
Long
)
params
.
get
(
"deptId"
);
Page
<
UserEntity
>
page
=
this
.
selectPage
(
new
Query
<
UserEntity
>(
params
).
getPage
(),
new
EntityWrapper
<
UserEntity
>()
Page
<
UserEntity
>
page
=
this
.
selectPage
(
new
Query
<
UserEntity
>(
params
).
getPage
(),
new
EntityWrapper
<
UserEntity
>()
.
eq
(
StrUtil
.
isNotBlank
(
username
),
"username"
,
username
).
eq
(
createBy
!=
null
,
"create_by"
,
createBy
));
.
eq
(
StrUtil
.
isNotBlank
(
username
),
"username"
,
username
).
eq
(
deptId
!=
null
,
"dept_id"
,
deptId
).
eq
(
createBy
!=
null
,
"create_by"
,
createBy
));
return
new
PageUtils
(
page
);
return
new
PageUtils
(
page
);
}
}
...
...
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