Commit e294a187 authored by huyuchen's avatar huyuchen

菜单权限修改

parent 5effcffb
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;
}
...@@ -41,7 +41,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable { ...@@ -41,7 +41,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
* 用户id * 用户id
*/ */
@Schema(description = "用户id") @Schema(description = "用户id")
@ExcelAttribute(name = "用户id",isExport = false) @ExcelAttribute(name = "用户id",needExport = false)
@ExcelProperty("用户id")
private String userId; private String userId;
/** /**
...@@ -71,8 +72,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable { ...@@ -71,8 +72,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
/** /**
* 编码 * 编码
*/ */
@Length(max = 10, message = "编码 不能超过10 个字符") @Length(max = 30, message = "编码 不能超过30 个字符")
@ExcelAttribute(name = "编码", maxLength = 10) @ExcelAttribute(name = "编码", maxLength = 30)
@Schema(description = "编码") @Schema(description = "编码")
@ExcelProperty("编码") @ExcelProperty("编码")
private String code; private String code;
......
...@@ -6,8 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -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.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo; 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.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.SysUserPermissionSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -43,7 +43,7 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> { ...@@ -43,7 +43,7 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
* @param sysUserPermission 新权限-用户权限表 * @param sysUserPermission 新权限-用户权限表
* @return * @return
*/ */
List<SysUserPermissionVo> userSelectList(@Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission); List<SysUserPermissionExportVo> userSelectList(@Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission);
/** /**
* 根据名称或者编码查询数据 * 根据名称或者编码查询数据
......
...@@ -21,10 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; ...@@ -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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo; 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.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo; import com.yifu.cloud.plus.v1.yifu.permission.vo.*;
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 lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -105,14 +102,14 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM ...@@ -105,14 +102,14 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
public void listExport(HttpServletResponse response, SysUserPermissionSearchVo searchVo) { public void listExport(HttpServletResponse response, SysUserPermissionSearchVo searchVo) {
String fileName = "数据权限表批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "数据权限表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<SysUserPermissionVo> list = new ArrayList<>(); List<SysUserPermissionExportVo> list = new ArrayList<>();
long count = baseMapper.userSelectCount(searchVo); long count = baseMapper.userSelectCount(searchVo);
try (ServletOutputStream out = response.getOutputStream()) { try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, SysUserPermissionVo.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, SysUserPermissionExportVo.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
...@@ -222,6 +219,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM ...@@ -222,6 +219,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
Integer rowIndex = readRowHolder.getRowIndex(); Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1); data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex()); ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
errorMessage.setData(data);
if (Common.isNotNull(errorMessage)) { if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage); errorMessageList.add(errorMessage);
} else { } else {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
</resultMap> </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.SysUserPermissionExportVo">
<result property="empName" column="EMP_NAME"/> <result property="empName" column="EMP_NAME"/>
<result property="empLoginName" column="EMP_LOGIN_NAME"/> <result property="empLoginName" column="EMP_LOGIN_NAME"/>
<result property="empDept" column="EMP_DEPT"/> <result property="empDept" column="EMP_DEPT"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment