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
e294a187
Commit
e294a187
authored
Sep 13, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜单权限修改
parent
5effcffb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
12 deletions
+98
-12
SysUserPermissionExportVo.java
...plus/v1/yifu/permission/vo/SysUserPermissionExportVo.java
+87
-0
SysUserPermissionVo.java
...cloud/plus/v1/yifu/permission/vo/SysUserPermissionVo.java
+4
-3
SysUserPermissionMapper.java
...ud/plus/v1/permission/mapper/SysUserPermissionMapper.java
+2
-2
SysUserPermissionServiceImpl.java
...permission/service/impl/SysUserPermissionServiceImpl.java
+4
-6
SysUserPermissionMapper.xml
...biz/src/main/resources/mapper/SysUserPermissionMapper.xml
+1
-1
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/vo/SysUserPermissionExportVo.java
0 → 100644
View file @
e294a187
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
permission
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
public
class
SysUserPermissionExportVo
implements
Serializable
{
/**
* 员工姓名
*/
@Length
(
max
=
20
,
message
=
"员工姓名 不能超过20 个字符"
)
@ExcelAttribute
(
name
=
"员工姓名"
,
maxLength
=
20
)
@Schema
(
description
=
"员工姓名"
)
@ExcelProperty
(
"员工姓名"
)
private
String
empName
;
/**
* 登录账号
*/
@NotBlank
(
message
=
"登录账号 不能为空"
)
@Length
(
max
=
10
,
message
=
"登录账号 不能超过10 个字符"
)
@ExcelAttribute
(
name
=
"登录账号"
,
isNotEmpty
=
true
,
errorInfo
=
"登录账号 不能为空"
,
maxLength
=
10
)
@Schema
(
description
=
"登录账号"
)
@ExcelProperty
(
"登录账号"
)
private
String
empLoginName
;
/**
* 所属部门
*/
@Length
(
max
=
20
,
message
=
"所属部门 不能超过20 个字符"
)
@ExcelAttribute
(
name
=
"所属部门"
,
maxLength
=
20
)
@Schema
(
description
=
"所属部门"
)
@ExcelProperty
(
"所属部门"
)
private
String
empDept
;
/**
* 权限类型
*/
@Length
(
max
=
8
,
message
=
"权限类型 不能超过8 个字符"
)
@ExcelAttribute
(
name
=
"权限类型"
,
maxLength
=
8
)
@Schema
(
description
=
"权限类型"
)
@ExcelProperty
(
"权限类型"
)
private
String
permissionType
;
/**
* 名称
*/
@Length
(
max
=
20
,
message
=
"名称 不能超过20 个字符"
)
@ExcelAttribute
(
name
=
"名称"
,
maxLength
=
20
)
@Schema
(
description
=
"名称"
)
@ExcelProperty
(
"名称"
)
private
String
name
;
/**
* 编码
*/
@Length
(
max
=
30
,
message
=
"编码 不能超过30 个字符"
)
@ExcelAttribute
(
name
=
"编码"
,
maxLength
=
30
)
@Schema
(
description
=
"编码"
)
@ExcelProperty
(
"编码"
)
private
String
code
;
/**
* 是否包含(0 是 1否)
*/
@Length
(
max
=
1
,
message
=
"是否含下级部门 不能超过1 个字符"
)
@ExcelAttribute
(
name
=
"是否含下级部门"
,
maxLength
=
1
)
@Schema
(
description
=
"是否含下级部门"
)
@ExcelProperty
(
"是否含下级部门"
)
private
String
isContains
;
/**
* 授权状态(0启用、1禁用)
*/
@Length
(
max
=
1
,
message
=
"授权状态 不能超过1 个字符"
)
@ExcelAttribute
(
name
=
"授权状态"
,
maxLength
=
1
)
@Schema
(
description
=
"授权状态"
)
@ExcelProperty
(
"授权状态"
)
private
String
permissionStatus
;
}
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/vo/SysUserPermissionVo.java
View file @
e294a187
...
...
@@ -41,7 +41,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
* 用户id
*/
@Schema
(
description
=
"用户id"
)
@ExcelAttribute
(
name
=
"用户id"
,
isExport
=
false
)
@ExcelAttribute
(
name
=
"用户id"
,
needExport
=
false
)
@ExcelProperty
(
"用户id"
)
private
String
userId
;
/**
...
...
@@ -71,8 +72,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
/**
* 编码
*/
@Length
(
max
=
10
,
message
=
"编码 不能超过1
0 个字符"
)
@ExcelAttribute
(
name
=
"编码"
,
maxLength
=
1
0
)
@Length
(
max
=
30
,
message
=
"编码 不能超过3
0 个字符"
)
@ExcelAttribute
(
name
=
"编码"
,
maxLength
=
3
0
)
@Schema
(
description
=
"编码"
)
@ExcelProperty
(
"编码"
)
private
String
code
;
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserPermissionMapper.java
View file @
e294a187
...
...
@@ -6,8 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionExportVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -43,7 +43,7 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
* @param sysUserPermission 新权限-用户权限表
* @return
*/
List
<
SysUserPermissionVo
>
userSelectList
(
@Param
(
"sysUserPermission"
)
SysUserPermissionSearchVo
sysUserPermission
);
List
<
SysUserPermission
Export
Vo
>
userSelectList
(
@Param
(
"sysUserPermission"
)
SysUserPermissionSearchVo
sysUserPermission
);
/**
* 根据名称或者编码查询数据
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserPermissionServiceImpl.java
View file @
e294a187
...
...
@@ -21,10 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo
;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.*
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -105,14 +102,14 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
public
void
listExport
(
HttpServletResponse
response
,
SysUserPermissionSearchVo
searchVo
)
{
String
fileName
=
"数据权限表批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//获取要导出的列表
List
<
SysUserPermissionVo
>
list
=
new
ArrayList
<>();
List
<
SysUserPermission
Export
Vo
>
list
=
new
ArrayList
<>();
long
count
=
baseMapper
.
userSelectCount
(
searchVo
);
try
(
ServletOutputStream
out
=
response
.
getOutputStream
())
{
response
.
setContentType
(
CommonConstants
.
MULTIPART_FORM_DATA
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
CommonConstants
.
UTF8
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
SysUserPermissionVo
.
class
).
build
();
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
SysUserPermission
Export
Vo
.
class
).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
for
(
int
i
=
0
;
i
<=
count
;
i
+=
CommonConstants
.
EXCEL_EXPORT_LIMIT
)
{
...
...
@@ -222,6 +219,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
Integer
rowIndex
=
readRowHolder
.
getRowIndex
();
data
.
setRowIndex
(
rowIndex
+
1
);
ErrorMessage
errorMessage
=
util1
.
checkEntity
(
data
,
data
.
getRowIndex
());
errorMessage
.
setData
(
data
);
if
(
Common
.
isNotNull
(
errorMessage
))
{
errorMessageList
.
add
(
errorMessage
);
}
else
{
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserPermissionMapper.xml
View file @
e294a187
...
...
@@ -21,7 +21,7 @@
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
</resultMap>
<resultMap
id=
"sysUserPermissionExportMap"
type=
"com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionVo"
>
<resultMap
id=
"sysUserPermissionExportMap"
type=
"com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermission
Export
Vo"
>
<result
property=
"empName"
column=
"EMP_NAME"
/>
<result
property=
"empLoginName"
column=
"EMP_LOGIN_NAME"
/>
<result
property=
"empDept"
column=
"EMP_DEPT"
/>
...
...
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