Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
3c651f95
Commit
3c651f95
authored
Sep 05, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.5.8-hgw-权限-角色-账号
parent
9ce3005c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
143 additions
and
6 deletions
+143
-6
DaprEkpPermissionProperties.java
.../yifu/common/dapr/config/DaprEkpPermissionProperties.java
+39
-0
EkpPermissionTask.java
...com/yifu/cloud/plus/v1/job/compont/EkpPermissionTask.java
+40
-0
SysUserInfoController.java
.../plus/v1/permission/controller/SysUserInfoController.java
+15
-0
SysUserInfoMapper.java
...fu/cloud/plus/v1/permission/mapper/SysUserInfoMapper.java
+12
-0
SysUserInfoService.java
.../cloud/plus/v1/permission/service/SysUserInfoService.java
+9
-0
SysRoleInfoServiceImpl.java
...us/v1/permission/service/impl/SysRoleInfoServiceImpl.java
+6
-6
SysUserInfoServiceImpl.java
...us/v1/permission/service/impl/SysUserInfoServiceImpl.java
+13
-0
SysUserInfoMapper.xml
...ssion-biz/src/main/resources/mapper/SysUserInfoMapper.xml
+9
-0
No files found.
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/config/DaprEkpPermissionProperties.java
0 → 100644
View file @
3c651f95
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
/**
* @Author hgw
* @Date 2023-9-5 09:42:31
* @Description EKP数据权限
* @Version 1.0
*/
@Data
@Component
@PropertySource
(
"classpath:daprConfig.properties"
)
@ConfigurationProperties
(
value
=
"dapr.permission"
,
ignoreInvalidFields
=
false
)
public
class
DaprEkpPermissionProperties
{
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String
appUrl
;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String
appId
;
String
appPort
;
String
httpPort
;
String
grpcPort
;
String
metricsPort
;
}
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/EkpPermissionTask.java
0 → 100644
View file @
3c651f95
package
com
.
yifu
.
cloud
.
plus
.
v1
.
job
.
compont
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprEkpPermissionProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.stereotype.Component
;
/**
* @Author hgw
* @Description EKP权限定时任务
* @Date 2023-9-5 09:40:09
**/
@Component
(
value
=
"ekpPermissionTask"
)
@Slf4j
@EnableConfigurationProperties
(
DaprEkpPermissionProperties
.
class
)
public
class
EkpPermissionTask
{
@Autowired
private
DaprEkpPermissionProperties
daprEkpPermissionProperties
;
/**
* @return
* @Author hgw
* @Description 刷新EKP权限里的账号信息
* @Date 2023-9-5 09:45:22
* @Param
**/
public
void
doStatisticsTaxDeclarer
()
throws
Exception
{
log
.
info
(
"-------------刷新EKP权限里的账号信息-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprEkpPermissionProperties
.
getAppUrl
(),
daprEkpPermissionProperties
.
getAppId
(),
"/sysuserinfo/inner/doRefreshEkpUser"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"-------------刷新EKP权限里的账号信息-定时任务结束------------"
);
}
}
\ No newline at end of file
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/controller/SysUserInfoController.java
View file @
3c651f95
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yifu.cloud.plus.v1.permission.service.SysUserInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo
;
...
...
@@ -113,4 +114,18 @@ public class SysUserInfoController {
return
R
.
ok
(
sysUserInfoService
.
removeById
(
fdId
));
}
/**
* @param
* @Description: 定时任务-自动同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 16:07
* @return: void
**/
@Inner
@Operation
(
description
=
"定时任务-自动同步并更新账号信息"
)
@PostMapping
(
"/inner/doRefreshEkpUser"
)
public
void
doRefreshEkpUser
()
{
sysUserInfoService
.
doRefreshEkpUser
();
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserInfoMapper.java
View file @
3c651f95
...
...
@@ -22,6 +22,8 @@ import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 新权限-账号管理表
*
...
...
@@ -37,4 +39,14 @@ public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> {
* @return
*/
IPage
<
SysUserInfo
>
getSysUserInfoPage
(
Page
<
SysUserInfo
>
page
,
@Param
(
"sysUserInfo"
)
SysUserInfo
sysUserInfo
);
/**
* @param
* @Description: 获取EKP全部账号
* @Author: hgw
* @Date: 2023/9/4 11:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo>
**/
List
<
SysUserInfo
>
getEkpUser
();
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysUserInfoService.java
View file @
3c651f95
...
...
@@ -60,4 +60,13 @@ public interface SysUserInfoService extends IService<SysUserInfo> {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
R
<
String
>
saveOrUpdateUserInfo
(
SysUserInfoSaveVo
vo
);
/**
* @param
* @Description: 同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 11:30
* @return: void
**/
void
doRefreshEkpUser
();
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysRoleInfoServiceImpl.java
View file @
3c651f95
...
...
@@ -79,15 +79,15 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
SysRoleMenuResSearchVo
sysRoleMenuRes
=
new
SysRoleMenuResSearchVo
();
sysRoleMenuRes
.
setRoleId
(
role
.
getFdId
());
List
<
SysRoleMenuRes
>
resList
=
sysRoleMenuResService
.
noPageDiy
(
sysRoleMenuRes
);
List
<
TreeNode
<
String
>>
collect
=
sysMenuMapper
.
selectList
(
Wrappers
.<
SysMenu
>
lambdaQuery
()
.
orderByAsc
(
SysMenu:
:
getCreateTime
)).
stream
()
.
map
(
getNodeFunction
()).
collect
(
Collectors
.
toList
());
List
<
Tree
<
String
>>
tree
=
TreeUtil
.
build
(
collect
,
CommonConstants
.
ZERO_STRING
);
vo
.
setRole
(
role
);
vo
.
setResList
(
resList
);
vo
.
setTree
(
tree
);
}
List
<
TreeNode
<
String
>>
collect
=
sysMenuMapper
.
selectList
(
Wrappers
.<
SysMenu
>
lambdaQuery
()
.
orderByAsc
(
SysMenu:
:
getCreateTime
)).
stream
()
.
map
(
getNodeFunction
()).
collect
(
Collectors
.
toList
());
List
<
Tree
<
String
>>
tree
=
TreeUtil
.
build
(
collect
,
CommonConstants
.
ZERO_STRING
);
vo
.
setTree
(
tree
);
return
R
.
ok
(
vo
);
}
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserInfoServiceImpl.java
View file @
3c651f95
...
...
@@ -154,4 +154,17 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
return
R
.
failed
(
"请检查信息"
);
}
/**
* @param
* @Description: 同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 11:31
* @return: java.lang.String
**/
@Override
public
void
doRefreshEkpUser
()
{
List
<
SysUserInfo
>
ekpUser
=
baseMapper
.
getEkpUser
();
this
.
saveOrUpdateBatch
(
ekpUser
);
}
}
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserInfoMapper.xml
View file @
3c651f95
...
...
@@ -116,4 +116,13 @@
order by a.CREATE_TIME desc
</select>
<!--list-->
<select
id=
"getEkpUser"
resultMap=
"sysUserInfoMap"
>
select e.fd_id,e.fd_name,p.fd_login_name,e.fd_ldap_dn
,SUBSTRING_INDEX(SUBSTRING_INDEX(e.fd_ldap_dn,',ou', 2),',ou=', -1) AS fd_dept_name
,p.fd_mobile_no,p.fd_email
from sys_org_element e JOIN sys_org_person p on e.fd_id=p.fd_id
</select>
</mapper>
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