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
d95d0696
Commit
d95d0696
authored
Sep 01, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.5.8-hgw-权限-角色-账号
parent
f5b2c1c5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
433 additions
and
430 deletions
+433
-430
SysRoleInfoSaveVo.java
...u/cloud/plus/v1/yifu/permission/vo/SysRoleInfoSaveVo.java
+41
-0
SysUserInfoSaveVo.java
...u/cloud/plus/v1/yifu/permission/vo/SysUserInfoSaveVo.java
+25
-0
SysRoleInfoController.java
.../plus/v1/permission/controller/SysRoleInfoController.java
+36
-37
SysUserInfoController.java
.../plus/v1/permission/controller/SysUserInfoController.java
+8
-19
SysRoleInfoMapper.java
...fu/cloud/plus/v1/permission/mapper/SysRoleInfoMapper.java
+7
-0
SysRoleMenuResMapper.java
...cloud/plus/v1/permission/mapper/SysRoleMenuResMapper.java
+9
-0
SysUserRoleResMapper.java
...cloud/plus/v1/permission/mapper/SysUserRoleResMapper.java
+4
-0
SysRoleInfoService.java
.../cloud/plus/v1/permission/service/SysRoleInfoService.java
+27
-5
SysRoleMenuResService.java
...oud/plus/v1/permission/service/SysRoleMenuResService.java
+10
-0
SysUserInfoService.java
.../cloud/plus/v1/permission/service/SysUserInfoService.java
+19
-6
SysUserRoleResService.java
...oud/plus/v1/permission/service/SysUserRoleResService.java
+20
-16
SysRoleInfoServiceImpl.java
...us/v1/permission/service/impl/SysRoleInfoServiceImpl.java
+102
-177
SysRoleMenuResServiceImpl.java
...v1/permission/service/impl/SysRoleMenuResServiceImpl.java
+12
-0
SysUserInfoServiceImpl.java
...us/v1/permission/service/impl/SysUserInfoServiceImpl.java
+58
-165
SysUserRoleResServiceImpl.java
...v1/permission/service/impl/SysUserRoleResServiceImpl.java
+10
-0
SysRoleInfoMapper.xml
...ssion-biz/src/main/resources/mapper/SysRoleInfoMapper.xml
+24
-2
SysRoleMenuResMapper.xml
...on-biz/src/main/resources/mapper/SysRoleMenuResMapper.xml
+6
-0
SysUserInfoMapper.xml
...ssion-biz/src/main/resources/mapper/SysUserInfoMapper.xml
+4
-3
SysUserRoleResMapper.xml
...on-biz/src/main/resources/mapper/SysUserRoleResMapper.xml
+11
-0
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/vo/SysRoleInfoSaveVo.java
0 → 100644
View file @
d95d0696
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
permission
.
vo
;
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import
cn.hutool.core.lang.tree.Tree
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 角色新增vo
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public
class
SysRoleInfoSaveVo
implements
Serializable
{
private
SysRoleInfo
role
;
private
List
<
SysRoleMenuRes
>
resList
;
private
List
<
Tree
<
String
>>
tree
;
}
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/vo/SysUserInfoSaveVo.java
0 → 100644
View file @
d95d0696
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
permission
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 账号新增vo
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public
class
SysUserInfoSaveVo
implements
Serializable
{
private
SysUserInfo
user
;
private
List
<
SysUserRoleRes
>
resList
;
private
String
dataAuth
;
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/controller/SysRoleInfoController.java
View file @
d95d0696
...
...
@@ -3,20 +3,19 @@ package com.yifu.cloud.plus.v1.permission.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.permission.service.SysRoleInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
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.permission.entity.SysRoleInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.SneakyThrows
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
...
...
@@ -33,6 +32,7 @@ import java.util.List;
public
class
SysRoleInfoController
{
private
final
SysRoleInfoService
sysRoleInfoService
;
private
final
SysUserRoleResService
sysUserRoleResService
;
/**
...
...
@@ -70,22 +70,22 @@ public class SysRoleInfoController {
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('ekp_sysroleinfo_get')"
)
@GetMapping
(
"/{fdId}"
)
@PreAuthorize
(
"@pms.hasPermission('ekp_sysroleinfo_get')"
)
public
R
<
SysRoleInfo
>
getById
(
@PathVariable
(
"fdId"
)
String
fdId
)
{
return
R
.
ok
(
sysRoleInfoService
.
getById
(
fdId
)
);
public
R
<
SysRoleInfo
SaveVo
>
getById
(
@PathVariable
(
"fdId"
)
String
fdId
)
{
return
sysRoleInfoService
.
getInfoById
(
fdId
);
}
/**
* 新增新权限-角色表
*
* @param
sysRoleInf
o 新权限-角色表
* @param
v
o 新权限-角色表
* @return R
*/
@Operation
(
summary
=
"新增
新权限-角色表"
,
description
=
"新增
新权限-角色表:hasPermission('ekp_sysroleinfo_add')"
)
@SysLog
(
"新增新权限-角色表"
)
@Operation
(
summary
=
"新增
或编辑新权限-角色表"
,
description
=
"新增或保存
新权限-角色表:hasPermission('ekp_sysroleinfo_add')"
)
@SysLog
(
"新增
或编辑
新权限-角色表"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('ekp_sysroleinfo_add')"
)
public
R
<
Boolean
>
save
(
@RequestBody
SysRoleInfo
sysRoleInf
o
)
{
return
R
.
ok
(
sysRoleInfoService
.
save
(
sysRoleInfo
)
);
public
R
<
String
>
saveOrUpdateRoleInfo
(
@RequestBody
SysRoleInfoSaveVo
v
o
)
{
return
sysRoleInfoService
.
saveOrUpdateRoleInfo
(
vo
);
}
/**
...
...
@@ -94,7 +94,7 @@ public class SysRoleInfoController {
* @param sysRoleInfo 新权限-角色表
* @return R
*/
@Operation
(
summary
=
"修改新权限-角色表"
,
description
=
"修改新权限-角色表:hasPermission('ekp_sysroleinfo_edit')"
)
@Operation
(
summary
=
"修改新权限-角色表
(可以修改状态)
"
,
description
=
"修改新权限-角色表:hasPermission('ekp_sysroleinfo_edit')"
)
@SysLog
(
"修改新权限-角色表"
)
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('ekp_sysroleinfo_edit')"
)
...
...
@@ -108,39 +108,38 @@ public class SysRoleInfoController {
* @param fdId id
* @return R
*/
@Operation
(
summary
=
"通过id删除新权限-角色表"
,
description
=
"通过id删除新权限-角色表:hasPermission('ekp_sysroleinfo_del')"
)
@Operation
(
summary
=
"通过id删除新权限-角色表
-假删除
"
,
description
=
"通过id删除新权限-角色表:hasPermission('ekp_sysroleinfo_del')"
)
@SysLog
(
"通过id删除新权限-角色表"
)
@DeleteMapping
(
"/{fdId}"
)
@PreAuthorize
(
"@pms.hasPermission('ekp_sysroleinfo_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
String
fdId
)
{
return
R
.
ok
(
sysRoleInfoService
.
removeById
(
fdId
));
// 删除关联表
sysUserRoleResService
.
deleteByRoleId
(
fdId
);
// 假删除角色表
SysRoleInfo
roleInfo
=
sysRoleInfoService
.
getById
(
fdId
);
roleInfo
.
setDeleteFlag
(
CommonConstants
.
ONE_INT
);
sysRoleInfoService
.
updateById
(
roleInfo
);
return
R
.
ok
();
}
/**
*
新权限-角色表 批量导入
*
通过id删除新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
**/
@SneakyThrows
@Operation
(
description
=
"批量新增新权限-角色表 hasPermission('ekp_sysroleinfo-batch-import')"
)
@SysLog
(
"批量新增新权限-角色表"
)
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('ekp_sysroleinfo-batch-import')"
)
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
@RequestBody
MultipartFile
file
)
{
return
sysRoleInfoService
.
importDiy
(
file
.
getInputStream
());
* @param fdId id
* @return R
*/
@Operation
(
summary
=
"冻结-角色表"
,
description
=
"冻结-角色表:hasPermission('ekp_sysroleinfo_freeze')"
)
@SysLog
(
"冻结-角色表"
)
@PostMapping
(
"/freezeById"
)
@PreAuthorize
(
"@pms.hasPermission('ekp_sysroleinfo_freeze')"
)
public
R
<
Boolean
>
freezeById
(
@RequestParam
String
fdId
)
{
// 删除关联表
sysUserRoleResService
.
deleteByRoleId
(
fdId
);
// 冻结角色表
SysRoleInfo
roleInfo
=
sysRoleInfoService
.
getById
(
fdId
);
roleInfo
.
setStatus
(
CommonConstants
.
ONE_INT
);
sysRoleInfoService
.
updateById
(
roleInfo
);
return
R
.
ok
();
}
/**
* 新权限-角色表 批量导出
*
* @author hgw
* @date 2023-08-29 14:49:40
**/
@Operation
(
description
=
"导出新权限-角色表 hasPermission('ekp_sysroleinfo-export')"
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@pms.hasPermission('ekp_sysroleinfo-export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysRoleInfoSearchVo
searchVo
)
{
sysRoleInfoService
.
listExport
(
response
,
searchVo
);
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/controller/SysUserInfoController.java
View file @
d95d0696
...
...
@@ -6,6 +6,7 @@ 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.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -67,22 +68,22 @@ public class SysUserInfoController {
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('ekp_sysuserinfo_get')"
)
@GetMapping
(
"/{fdId}"
)
@PreAuthorize
(
"@pms.hasPermission('ekp_sysuserinfo_get')"
)
public
R
<
SysUserInfo
>
getById
(
@PathVariable
(
"fdId"
)
String
fdId
)
{
return
R
.
ok
(
sysUserInfoService
.
getById
(
fdId
)
);
public
R
<
SysUserInfo
SaveVo
>
getById
(
@PathVariable
(
"fdId"
)
String
fdId
)
{
return
sysUserInfoService
.
getInfoById
(
fdId
);
}
/**
* 新增新权限-账号管理表
*
* @param
sysUserInf
o 新权限-账号管理表
* @param
v
o 新权限-账号管理表
* @return R
*/
@Operation
(
summary
=
"新增
新权限-账号管理表"
,
description
=
"新增
新权限-账号管理表:hasPermission('ekp_sysuserinfo_add')"
)
@SysLog
(
"新增新权限-账号管理表"
)
@Operation
(
summary
=
"新增
或编辑新权限-账号管理表"
,
description
=
"新增或编辑
新权限-账号管理表:hasPermission('ekp_sysuserinfo_add')"
)
@SysLog
(
"新增
或编辑
新权限-账号管理表"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('ekp_sysuserinfo_add')"
)
public
R
<
Boolean
>
save
(
@RequestBody
SysUserInfo
sysUserInf
o
)
{
return
R
.
ok
(
sysUserInfoService
.
save
(
sysUserInfo
)
);
public
R
<
String
>
saveOrUpdateUserInfo
(
@RequestBody
SysUserInfoSaveVo
v
o
)
{
return
sysUserInfoService
.
saveOrUpdateUserInfo
(
vo
);
}
/**
...
...
@@ -113,16 +114,4 @@ public class SysUserInfoController {
return
R
.
ok
(
sysUserInfoService
.
removeById
(
fdId
));
}
/**
* 新权限-账号管理表 批量导出
*
* @author hgw
* @date 2023-08-29 14:49:40
**/
@Operation
(
description
=
"导出新权限-账号管理表 hasPermission('ekp_sysuserinfo-export')"
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@pms.hasPermission('ekp_sysuserinfo-export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysUserInfoSearchVo
searchVo
)
{
sysUserInfoService
.
listExport
(
response
,
searchVo
);
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysRoleInfoMapper.java
View file @
d95d0696
...
...
@@ -23,6 +23,8 @@ import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 新权限-角色表
*
...
...
@@ -38,4 +40,9 @@ public interface SysRoleInfoMapper extends BaseMapper<SysRoleInfo> {
* @return
*/
IPage
<
SysRoleInfo
>
getSysRoleInfoPage
(
Page
<
SysRoleInfo
>
page
,
@Param
(
"sysRoleInfo"
)
SysRoleInfoSearchVo
sysRoleInfo
);
List
<
String
>
getAllRoleDataAuthByUserId
(
@Param
(
"userId"
)
String
userId
);
int
checkExistenceRole
(
@Param
(
"roleName"
)
String
roleName
,
@Param
(
"roleId"
)
String
roleId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysRoleMenuResMapper.java
View file @
d95d0696
...
...
@@ -37,4 +37,13 @@ public interface SysRoleMenuResMapper extends BaseMapper<SysRoleMenuRes> {
* @return
*/
IPage
<
SysRoleMenuRes
>
getSysRoleMenuResPage
(
Page
<
SysRoleMenuRes
>
page
,
@Param
(
"sysRoleMenuRes"
)
SysRoleMenuRes
sysRoleMenuRes
);
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:19
* @return: boolean
**/
boolean
deleteByRoleId
(
@Param
(
"roleId"
)
String
roleId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserRoleResMapper.java
View file @
d95d0696
...
...
@@ -37,4 +37,8 @@ public interface SysUserRoleResMapper extends BaseMapper<SysUserRoleRes> {
* @return
*/
IPage
<
SysUserRoleRes
>
getSysUserRoleResPage
(
Page
<
SysUserRoleRes
>
page
,
@Param
(
"sysUserRoleRes"
)
SysUserRoleRes
sysUserRoleRes
);
boolean
deleteByUserId
(
@Param
(
"userId"
)
String
userId
);
boolean
deleteByRoleId
(
@Param
(
"roleId"
)
String
roleId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysRoleInfoService.java
View file @
d95d0696
...
...
@@ -18,13 +18,11 @@ package com.yifu.cloud.plus.v1.permission.service;/*
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.InputStream
;
import
java.util.List
;
/**
...
...
@@ -42,9 +40,33 @@ public interface SysRoleInfoService extends IService<SysRoleInfo> {
*/
IPage
<
SysRoleInfo
>
getSysRoleInfoPage
(
Page
<
SysRoleInfo
>
page
,
SysRoleInfoSearchVo
sysRoleInfo
);
R
<
List
<
ErrorMessage
>>
importDiy
(
InputStream
inputStream
);
/**
* @param fdId
* @Description: 查看
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo>
**/
R
<
SysRoleInfoSaveVo
>
getInfoById
(
String
fdId
);
void
listExport
(
HttpServletResponse
response
,
SysRoleInfoSearchVo
searchVo
);
/**
* @param vo
* @Description: 新增或编辑新权限-角色表
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
R
<
String
>
saveOrUpdateRoleInfo
(
SysRoleInfoSaveVo
vo
);
List
<
SysRoleInfo
>
noPageDiy
(
SysRoleInfoSearchVo
searchVo
);
/**
* @param userId
* @Description: 各种角色的权限融合
* @Author: hgw
* @Date: 2023/8/30 18:06
* @return: java.lang.String
**/
String
getAllRoleDataAuthByUserId
(
String
userId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysRoleMenuResService.java
View file @
d95d0696
...
...
@@ -39,4 +39,14 @@ public interface SysRoleMenuResService extends IService<SysRoleMenuRes> {
IPage
<
SysRoleMenuRes
>
getSysRoleMenuResPage
(
Page
<
SysRoleMenuRes
>
page
,
SysRoleMenuResSearchVo
sysRoleMenuRes
);
List
<
SysRoleMenuRes
>
noPageDiy
(
SysRoleMenuResSearchVo
searchVo
);
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:19
* @return: boolean
**/
boolean
deleteByRoleId
(
String
roleId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysUserInfoService.java
View file @
d95d0696
...
...
@@ -18,13 +18,12 @@ package com.yifu.cloud.plus.v1.permission.service;/*
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.InputStream
;
import
java.util.List
;
/**
...
...
@@ -42,9 +41,23 @@ public interface SysUserInfoService extends IService<SysUserInfo> {
*/
IPage
<
SysUserInfo
>
getSysUserInfoPage
(
Page
<
SysUserInfo
>
page
,
SysUserInfoSearchVo
sysUserInfo
);
R
<
List
<
ErrorMessage
>>
importDiy
(
InputStream
inputStream
);
List
<
SysUserInfo
>
noPageDiy
(
SysUserInfoSearchVo
searchVo
);
void
listExport
(
HttpServletResponse
response
,
SysUserInfoSearchVo
searchVo
);
/**
* @param fdId
* @Description: 查看
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo>
**/
R
<
SysUserInfoSaveVo
>
getInfoById
(
String
fdId
);
List
<
SysUserInfo
>
noPageDiy
(
SysUserInfoSearchVo
searchVo
);
/**
* @param vo
* @Description: 新增或编辑新权限-账号表
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
R
<
String
>
saveOrUpdateUserInfo
(
SysUserInfoSaveVo
vo
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysUserRoleResService.java
View file @
d95d0696
package
com
.
yifu
.
cloud
.
plus
.
v1
.
permission
.
service
;
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
permission
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -39,4 +24,23 @@ public interface SysUserRoleResService extends IService<SysUserRoleRes> {
IPage
<
SysUserRoleRes
>
getSysUserRoleResPage
(
Page
<
SysUserRoleRes
>
page
,
SysUserRoleResSearchVo
sysUserRoleRes
);
List
<
SysUserRoleRes
>
noPageDiy
(
SysUserRoleResSearchVo
searchVo
);
/**
* @param userId
* @Description: 根据账号删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:45
* @return: boolean
**/
boolean
deleteByUserId
(
String
userId
);
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:45
* @return: boolean
**/
boolean
deleteByRoleId
(
String
roleId
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysRoleInfoServiceImpl.java
View file @
d95d0696
This diff is collapsed.
Click to expand it.
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysRoleMenuResServiceImpl.java
View file @
d95d0696
...
...
@@ -66,6 +66,18 @@ public class SysRoleMenuResServiceImpl extends ServiceImpl<SysRoleMenuResMapper,
return
baseMapper
.
selectList
(
wrapper
);
}
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:19
* @return: boolean
**/
@Override
public
boolean
deleteByRoleId
(
String
roleId
)
{
return
baseMapper
.
deleteByRoleId
(
roleId
);
}
private
LambdaQueryWrapper
buildQueryWrapper
(
SysRoleMenuResSearchVo
entity
)
{
LambdaQueryWrapper
<
SysRoleMenuRes
>
wrapper
=
Wrappers
.
lambdaQuery
();
if
(
ArrayUtil
.
isNotEmpty
(
entity
.
getCreateTimes
()))
{
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserInfoServiceImpl.java
View file @
d95d0696
This diff is collapsed.
Click to expand it.
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserRoleResServiceImpl.java
View file @
d95d0696
...
...
@@ -66,6 +66,16 @@ public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper,
return
baseMapper
.
selectList
(
wrapper
);
}
@Override
public
boolean
deleteByUserId
(
String
userId
)
{
return
baseMapper
.
deleteByUserId
(
userId
);
}
@Override
public
boolean
deleteByRoleId
(
String
roleId
)
{
return
baseMapper
.
deleteByRoleId
(
roleId
);
}
private
LambdaQueryWrapper
buildQueryWrapper
(
SysUserRoleResSearchVo
entity
)
{
LambdaQueryWrapper
<
SysUserRoleRes
>
wrapper
=
Wrappers
.
lambdaQuery
();
if
(
ArrayUtil
.
isNotEmpty
(
entity
.
getCreateTimes
()))
{
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysRoleInfoMapper.xml
View file @
d95d0696
...
...
@@ -55,7 +55,7 @@
AND a.fd_id = #{sysRoleInfo.fdId}
</if>
<if
test=
"sysRoleInfo.roleName != null and sysRoleInfo.roleName.trim() != ''"
>
AND a.role_name
= #{sysRoleInfo.roleName}
AND a.role_name
like concat('%',#{sysRoleInfo.roleName},'%')
</if>
<if
test=
"sysRoleInfo.remark != null and sysRoleInfo.remark.trim() != ''"
>
AND a.remark = #{sysRoleInfo.remark}
...
...
@@ -98,8 +98,30 @@
<include
refid=
"Base_Column_List"
/>
FROM sys_role_info a
<where>
1=1
a.delete_flag = 0
<include
refid=
"sysRoleInfo_where"
/>
</where>
order by a.CREATE_TIME desc
</select>
<!-- 根据用户Id获取所有的角色的权限-->
<select
id=
"getAllRoleDataAuthByUserId"
resultType=
"java.lang.String"
>
SELECT
a.data_auth
FROM sys_role_info a
left join sys_user_role_res r on r.role_id = a.fd_id
where a.delete_flag = 0 and r.user_id = #{userId}
</select>
<!-- 查找名称是否存在-->
<select
id=
"checkExistenceRole"
resultType=
"java.lang.Integer"
>
SELECT
count(1)
FROM sys_role_info a
where a.delete_flag = 0 and a.role_name = #{roleName}
<if
test=
"roleId != null and roleId.trim() != ''"
>
AND a.fd_id != #{roleId}
</if>
</select>
</mapper>
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysRoleMenuResMapper.xml
View file @
d95d0696
...
...
@@ -56,4 +56,10 @@
<include
refid=
"sysRoleMenuRes_where"
/>
</where>
</select>
<!-- 根据角色删除关联表 -->
<delete
id=
"deleteByRoleId"
>
delete from sys_role_menu_res where role_id = #{roleId}
</delete>
</mapper>
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserInfoMapper.xml
View file @
d95d0696
...
...
@@ -61,7 +61,7 @@
AND a.fd_id = #{sysUserInfo.fdId}
</if>
<if
test=
"sysUserInfo.fdName != null and sysUserInfo.fdName.trim() != ''"
>
AND a.fd_name
= #{sysUserInfo.fdName}
AND a.fd_name
like concat('%',#{sysUserInfo.fdName},'%')
</if>
<if
test=
"sysUserInfo.fdLoginName != null and sysUserInfo.fdLoginName.trim() != ''"
>
AND a.fd_login_name = #{sysUserInfo.fdLoginName}
...
...
@@ -70,7 +70,7 @@
AND a.fd_ldap_dn = #{sysUserInfo.fdLdapDn}
</if>
<if
test=
"sysUserInfo.fdDeptName != null and sysUserInfo.fdDeptName.trim() != ''"
>
AND a.fd_dept_name
= #{sysUserInfo.fdDeptName}
AND a.fd_dept_name
like concat('%',#{sysUserInfo.fdDeptName},'%')
</if>
<if
test=
"sysUserInfo.fdMobileNo != null and sysUserInfo.fdMobileNo.trim() != ''"
>
AND a.fd_mobile_no = #{sysUserInfo.fdMobileNo}
...
...
@@ -82,7 +82,7 @@
AND a.status = #{sysUserInfo.status}
</if>
<if
test=
"sysUserInfo.roleNames != null and sysUserInfo.roleNames.trim() != ''"
>
AND a.role_names
= #{sysUserInfo.roleNames}
AND a.role_names
like concat('%',#{sysUserInfo.roleNames},'%')
</if>
<if
test=
"sysUserInfo.createBy != null and sysUserInfo.createBy.trim() != ''"
>
AND a.CREATE_BY = #{sysUserInfo.createBy}
...
...
@@ -110,5 +110,6 @@
1=1
<include
refid=
"sysUserInfo_where"
/>
</where>
order by a.CREATE_TIME desc
</select>
</mapper>
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserRoleResMapper.xml
View file @
d95d0696
...
...
@@ -56,4 +56,15 @@
<include
refid=
"sysUserRoleRes_where"
/>
</where>
</select>
<!-- 根据账号删除关联表 -->
<delete
id=
"deleteByUserId"
>
delete from sys_user_role_res where user_id = #{userId}
</delete>
<!-- 根据角色删除关联表 -->
<delete
id=
"deleteByRoleId"
>
delete from sys_user_role_res where role_id = #{roleId}
</delete>
</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