Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
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
hubin
long-tern-care-service
Commits
b91156fc
Commit
b91156fc
authored
Feb 17, 2023
by
maqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理-机构权限
parent
7b623153
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
2 deletions
+57
-2
ReqUserInfo.java
...ain/java/com/hungraim/ltc/pojo/vo/system/ReqUserInfo.java
+2
-0
InitResourceRoleCacheRunner.java
...m/hungraim/ltc/component/InitResourceRoleCacheRunner.java
+1
-1
UserController.java
...va/com/hungraim/ltc/system/controller/UserController.java
+21
-1
SystemUserMapper.java
...in/java/com/hungraim/ltc/system/dao/SystemUserMapper.java
+12
-0
ISystemUserService.java
...a/com/hungraim/ltc/system/service/ISystemUserService.java
+9
-0
SystemUserServiceImpl.java
...ngraim/ltc/system/service/impl/SystemUserServiceImpl.java
+12
-0
No files found.
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/system/ReqUserInfo.java
View file @
b91156fc
...
...
@@ -22,5 +22,7 @@ public class ReqUserInfo {
private
Long
organId
;
private
Long
srvOrganId
;
private
String
organName
;
private
String
srvOrganName
;
}
system/system-admin-service/src/main/java/com/hungraim/ltc/component/InitResourceRoleCacheRunner.java
View file @
b91156fc
...
...
@@ -25,6 +25,6 @@ public class InitResourceRoleCacheRunner implements CommandLineRunner {
@Override
public
void
run
(
String
...
args
)
{
resourceService
.
refreshPermissionRolesCache
();
//
resourceService.refreshPermissionRolesCache();
}
}
system/system-admin-service/src/main/java/com/hungraim/ltc/system/controller/UserController.java
View file @
b91156fc
...
...
@@ -5,6 +5,8 @@ import cn.hutool.core.util.StrUtil;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.hungraim.ltc.constant.Gender
;
import
com.hungraim.ltc.pojo.entity.disable.ChFndOrgan
;
import
com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan
;
import
com.hungraim.ltc.pojo.entity.system.SystemUser
;
import
com.hungraim.ltc.pojo.entity.system.SystemUserRole
;
import
com.hungraim.ltc.pojo.vo.system.ReqUserInfo
;
...
...
@@ -16,6 +18,7 @@ import com.hungraim.ltc.system.service.impl.SystemUserServiceImpl;
import
com.hungraim.ltc.util.CheckStrength
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
com.hungraim.ltc.util.TokenParsingUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
...
...
@@ -172,7 +175,9 @@ public class UserController {
* @return
*/
@PostMapping
(
"/queryUsers"
)
public
Result
queryUsers
(
ReqUserInfo
reqUserInfo
)
{
public
Result
queryUsers
(
@RequestHeader
(
"Authorization"
)
String
token
,
ReqUserInfo
reqUserInfo
)
{
long
srvOrganId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
long
organId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"organId"
);
QueryWrapper
<
SystemUser
>
systemUserQueryWrapper
=
new
QueryWrapper
<>();
if
(!
StrUtil
.
isBlankIfStr
(
reqUserInfo
.
getName
()))
{
...
...
@@ -185,7 +190,16 @@ public class UserController {
if
(!
StrUtil
.
isBlankIfStr
(
reqUserInfo
.
getEnable
()))
{
systemUserQueryWrapper
.
and
(
wrapper
->
wrapper
.
lambda
().
eq
(
SystemUser:
:
getUserStatus
,
reqUserInfo
.
getEnable
()));
}
if
(
srvOrganId
!=
0
)
{
systemUserQueryWrapper
.
and
(
wrapper
->
wrapper
.
lambda
().
eq
(
SystemUser:
:
getSrvOrganId
,
srvOrganId
));
}
if
(
organId
!=
0
)
{
systemUserQueryWrapper
.
and
(
wrapper
->
wrapper
.
lambda
().
eq
(
SystemUser:
:
getOrganId
,
organId
));
}
List
<
SystemUser
>
users
=
userInfoService
.
list
(
systemUserQueryWrapper
);
List
<
ChFndOrgan
>
chFndOrganList
=
userInfoService
.
fndAllOrgans
();
List
<
ChSrvOrgan
>
chSrvOrganList
=
userInfoService
.
srvOrganLists
();
List
<
ReqUserInfo
>
resUsers
=
users
.
stream
().
map
(
user
->
{
ReqUserInfo
userInfo
=
new
ReqUserInfo
();
userInfo
.
setId
(
user
.
getUserId
());
...
...
@@ -196,6 +210,12 @@ public class UserController {
userInfo
.
setGender
(
Gender
.
MAN
.
getCode
().
equals
(
user
.
getGender
())
?
Gender
.
MAN
.
getDesc
()
:
Gender
.
WOMAN
.
getDesc
());
userInfo
.
setOrganId
(
user
.
getOrganId
());
userInfo
.
setSrvOrganId
(
user
.
getSrvOrganId
());
if
(
userInfo
.
getOrganId
()!=
null
&&
userInfo
.
getOrganId
()>
0
&&
userInfo
.
getSrvOrganId
()!=
null
&&
!
userInfo
.
getSrvOrganId
().
equals
(
"0"
)){
List
<
ChFndOrgan
>
collect
=
chFndOrganList
.
stream
().
filter
(
chFndOrgan
->
chFndOrgan
.
getOrganId
().
equals
(
user
.
getOrganId
().
toString
())).
collect
(
Collectors
.
toList
());
List
<
ChSrvOrgan
>
chSrvOrgans
=
chSrvOrganList
.
stream
().
filter
(
chSrvOrgan
->
chSrvOrgan
.
getSrvOrganId
().
equals
(
user
.
getSrvOrganId
().
intValue
())).
collect
(
Collectors
.
toList
());
userInfo
.
setOrganName
(
collect
.
get
(
0
).
getOrganName
());
userInfo
.
setSrvOrganName
(
chSrvOrgans
.
get
(
0
).
getSrvOrganName
());
}
return
userInfo
;
}).
collect
(
Collectors
.
toList
());
return
Result
.
success
(
resUsers
);
...
...
system/system-admin-service/src/main/java/com/hungraim/ltc/system/dao/SystemUserMapper.java
View file @
b91156fc
...
...
@@ -2,8 +2,13 @@ package com.hungraim.ltc.system.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hungraim.ltc.pojo.entity.disable.ChFndOrgan
;
import
com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan
;
import
com.hungraim.ltc.pojo.entity.system.SystemUser
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* 用户
...
...
@@ -12,4 +17,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
SystemUserMapper
extends
BaseMapper
<
SystemUser
>
{
@Select
(
"select ORGAN_ID,ORGAN_NAME from CH_FND_ORGAN"
)
List
<
ChFndOrgan
>
fndAllOrgans
();
@Select
(
"select SRV_ORGAN_ID,SRV_ORGAN_NAME from CH_SRV_ORGAN"
)
List
<
ChSrvOrgan
>
srvOrganLists
();
}
system/system-admin-service/src/main/java/com/hungraim/ltc/system/service/ISystemUserService.java
View file @
b91156fc
package
com
.
hungraim
.
ltc
.
system
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.hungraim.ltc.pojo.entity.disable.ChFndOrgan
;
import
com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan
;
import
com.hungraim.ltc.pojo.entity.system.SystemUser
;
import
java.util.List
;
/**
* @author hubin
*/
public
interface
ISystemUserService
extends
IService
<
SystemUser
>
{
List
<
ChFndOrgan
>
fndAllOrgans
();
List
<
ChSrvOrgan
>
srvOrganLists
();
}
system/system-admin-service/src/main/java/com/hungraim/ltc/system/service/impl/SystemUserServiceImpl.java
View file @
b91156fc
...
...
@@ -2,6 +2,8 @@ package com.hungraim.ltc.system.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.hungraim.ltc.pojo.entity.disable.ChFndOrgan
;
import
com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan
;
import
com.hungraim.ltc.pojo.entity.system.SystemUser
;
import
com.hungraim.ltc.system.dao.SystemUserMapper
;
import
com.hungraim.ltc.system.dao.SystemUserRoleMapper
;
...
...
@@ -9,6 +11,7 @@ import com.hungraim.ltc.system.service.ISystemUserService;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author hubin
...
...
@@ -23,4 +26,13 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
private
SystemUserRoleMapper
userRoleMapper
;
@Override
public
List
<
ChFndOrgan
>
fndAllOrgans
()
{
return
userMapper
.
fndAllOrgans
();
}
@Override
public
List
<
ChSrvOrgan
>
srvOrganLists
()
{
return
userMapper
.
srvOrganLists
();
}
}
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