bugfix-去除RoleExportExcelVO

pull/131/head
yinyilong 2024-08-26 09:28:17 +08:00
parent 59fc020616
commit 532e8333f2
3 changed files with 16 additions and 34 deletions

View File

@ -93,8 +93,8 @@ public class RoleController {
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<RoleDO> list = roleService.getRolePage(exportReqVO).getList();
// 输出
ExcelUtils.write(response, "角色数据.xls", "数据", RoleExportExcelVO.class,
BeanUtils.toBean(list, RoleExportExcelVO.class));
ExcelUtils.write(response, "角色数据.xls", "数据", RoleRespVO.class,
BeanUtils.toBean(list, RoleRespVO.class));
}
}

View File

@ -1,32 +0,0 @@
package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class RoleExportExcelVO {
@ExcelProperty("角色序号")
private Long id;
@ExcelProperty("角色名称")
private String name;
@ExcelProperty("角色标志")
private String code;
@ExcelProperty("角色排序")
private Integer sort;
@ExcelProperty(value = "角色状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.COMMON_STATUS)
private Integer status;
@ExcelProperty(value = "数据范围", converter = DictConvert.class)
@DictFormat(DictTypeConstants.DATA_SCOPE)
private Integer dataScope;
}

View File

@ -1,5 +1,10 @@
package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@ -9,22 +14,29 @@ import java.util.Set;
@Schema(description = "管理后台 - 角色信息 Response VO")
@Data
@ExcelIgnoreUnannotated
public class RoleRespVO {
@Schema(description = "角色编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("角色序号")
private Long id;
@Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "管理员")
@ExcelProperty("角色名称")
private String name;
@Schema(description = "角色标志", requiredMode = Schema.RequiredMode.REQUIRED, example = "admin")
@NotBlank(message = "角色标志不能为空")
@ExcelProperty("角色标志")
private String code;
@Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@ExcelProperty("角色排序")
private Integer sort;
@Schema(description = "状态,参见 CommonStatusEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "角色状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.COMMON_STATUS)
private Integer status;
@Schema(description = "角色类型,参见 RoleTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ -34,6 +46,8 @@ public class RoleRespVO {
private String remark;
@Schema(description = "数据范围,参见 DataScopeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "数据范围", converter = DictConvert.class)
@DictFormat(DictTypeConstants.DATA_SCOPE)
private Integer dataScope;
@Schema(description = "数据范围(指定部门数组)", example = "1")