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
Show 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 {
...
@@ -22,5 +22,7 @@ public class ReqUserInfo {
private
Long
organId
;
private
Long
organId
;
private
Long
srvOrganId
;
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 {
...
@@ -25,6 +25,6 @@ public class InitResourceRoleCacheRunner implements CommandLineRunner {
@Override
@Override
public
void
run
(
String
...
args
)
{
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;
...
@@ -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.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.hungraim.ltc.constant.Gender
;
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.SystemUser
;
import
com.hungraim.ltc.pojo.entity.system.SystemUserRole
;
import
com.hungraim.ltc.pojo.entity.system.SystemUserRole
;
import
com.hungraim.ltc.pojo.vo.system.ReqUserInfo
;
import
com.hungraim.ltc.pojo.vo.system.ReqUserInfo
;
...
@@ -16,6 +18,7 @@ import com.hungraim.ltc.system.service.impl.SystemUserServiceImpl;
...
@@ -16,6 +18,7 @@ import com.hungraim.ltc.system.service.impl.SystemUserServiceImpl;
import
com.hungraim.ltc.util.CheckStrength
;
import
com.hungraim.ltc.util.CheckStrength
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
com.hungraim.ltc.util.ResultCode
;
import
com.hungraim.ltc.util.TokenParsingUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
...
@@ -172,7 +175,9 @@ public class UserController {
...
@@ -172,7 +175,9 @@ public class UserController {
* @return
* @return
*/
*/
@PostMapping
(
"/queryUsers"
)
@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
<>();
QueryWrapper
<
SystemUser
>
systemUserQueryWrapper
=
new
QueryWrapper
<>();
if
(!
StrUtil
.
isBlankIfStr
(
reqUserInfo
.
getName
()))
{
if
(!
StrUtil
.
isBlankIfStr
(
reqUserInfo
.
getName
()))
{
...
@@ -185,7 +190,16 @@ public class UserController {
...
@@ -185,7 +190,16 @@ public class UserController {
if
(!
StrUtil
.
isBlankIfStr
(
reqUserInfo
.
getEnable
()))
{
if
(!
StrUtil
.
isBlankIfStr
(
reqUserInfo
.
getEnable
()))
{
systemUserQueryWrapper
.
and
(
wrapper
->
wrapper
.
lambda
().
eq
(
SystemUser:
:
getUserStatus
,
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
<
SystemUser
>
users
=
userInfoService
.
list
(
systemUserQueryWrapper
);
List
<
ChFndOrgan
>
chFndOrganList
=
userInfoService
.
fndAllOrgans
();
List
<
ChSrvOrgan
>
chSrvOrganList
=
userInfoService
.
srvOrganLists
();
List
<
ReqUserInfo
>
resUsers
=
users
.
stream
().
map
(
user
->
{
List
<
ReqUserInfo
>
resUsers
=
users
.
stream
().
map
(
user
->
{
ReqUserInfo
userInfo
=
new
ReqUserInfo
();
ReqUserInfo
userInfo
=
new
ReqUserInfo
();
userInfo
.
setId
(
user
.
getUserId
());
userInfo
.
setId
(
user
.
getUserId
());
...
@@ -196,6 +210,12 @@ public class UserController {
...
@@ -196,6 +210,12 @@ public class UserController {
userInfo
.
setGender
(
Gender
.
MAN
.
getCode
().
equals
(
user
.
getGender
())
?
Gender
.
MAN
.
getDesc
()
:
Gender
.
WOMAN
.
getDesc
());
userInfo
.
setGender
(
Gender
.
MAN
.
getCode
().
equals
(
user
.
getGender
())
?
Gender
.
MAN
.
getDesc
()
:
Gender
.
WOMAN
.
getDesc
());
userInfo
.
setOrganId
(
user
.
getOrganId
());
userInfo
.
setOrganId
(
user
.
getOrganId
());
userInfo
.
setSrvOrganId
(
user
.
getSrvOrganId
());
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
;
return
userInfo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
Result
.
success
(
resUsers
);
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;
...
@@ -2,8 +2,13 @@ package com.hungraim.ltc.system.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
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
com.hungraim.ltc.pojo.entity.system.SystemUser
;
import
org.apache.ibatis.annotations.Mapper
;
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;
...
@@ -12,4 +17,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
@Mapper
public
interface
SystemUserMapper
extends
BaseMapper
<
SystemUser
>
{
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
;
package
com
.
hungraim
.
ltc
.
system
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
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
com.hungraim.ltc.pojo.entity.system.SystemUser
;
import
java.util.List
;
/**
/**
* @author hubin
* @author hubin
*/
*/
public
interface
ISystemUserService
extends
IService
<
SystemUser
>
{
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;
...
@@ -2,6 +2,8 @@ package com.hungraim.ltc.system.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
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.pojo.entity.system.SystemUser
;
import
com.hungraim.ltc.system.dao.SystemUserMapper
;
import
com.hungraim.ltc.system.dao.SystemUserMapper
;
import
com.hungraim.ltc.system.dao.SystemUserRoleMapper
;
import
com.hungraim.ltc.system.dao.SystemUserRoleMapper
;
...
@@ -9,6 +11,7 @@ import com.hungraim.ltc.system.service.ISystemUserService;
...
@@ -9,6 +11,7 @@ import com.hungraim.ltc.system.service.ISystemUserService;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* @author hubin
* @author hubin
...
@@ -23,4 +26,13 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
...
@@ -23,4 +26,13 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
private
SystemUserRoleMapper
userRoleMapper
;
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