1. 完成所有导出的功能

This commit is contained in:
YunaiV 2021-01-15 01:54:36 +08:00
parent d8a52a8c61
commit c3df5bc62f
35 changed files with 326 additions and 330 deletions

View File

@ -54,9 +54,10 @@ export function delData(dictCode) {
// 导出字典数据 // 导出字典数据
export function exportData(query) { export function exportData(query) {
return request({ return request({
url: '/system/dict/data/export', url: '/system/dict-data/export',
method: 'get', method: 'get',
params: query params: query,
responseType: 'blob'
}) })
} }

View File

@ -48,7 +48,8 @@ export function exportType(query) {
return request({ return request({
url: '/system/dict-type/export', url: '/system/dict-type/export',
method: 'get', method: 'get',
params: query params: query,
responseType: 'blob'
}) })
} }

View File

@ -69,6 +69,7 @@ export function exportRole(query) {
return request({ return request({
url: '/system/role/export', url: '/system/role/export',
method: 'get', method: 'get',
params: query params: query,
responseType: 'blob'
}) })
} }

View File

@ -314,7 +314,7 @@ export default {
}).then(function() { }).then(function() {
return exportData(queryParams); return exportData(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.downloadExcel(response, '字典数据.xls');
}) })
} }
} }

View File

@ -304,7 +304,10 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.addDateRange(this.queryParams, [
this.dateRange[0] ? this.dateRange[0] + ' 00:00:00' : undefined,
this.dateRange[1] ? this.dateRange[1] + ' 23:59:59' : undefined,
]);
this.$confirm('是否确认导出所有类型数据项?', "警告", { this.$confirm('是否确认导出所有类型数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -312,7 +315,7 @@ export default {
}).then(function() { }).then(function() {
return exportType(queryParams); return exportType(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.downloadExcel(response, '数据类型.xls');
}) })
} }
} }

View File

@ -568,7 +568,7 @@ export default {
}).then(function() { }).then(function() {
return exportRole(queryParams); return exportRole(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.downloadExcel(response, '角色数据.xls');
}) })
} }
} }

View File

@ -1,157 +0,0 @@
package cn.iocoder.dashboard.framework.excel;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.math.BigDecimal;
/**
* 自定义导出Excel数据注解
*
* @author ruoyi
*/
@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Excel {
/**
* 导出时在excel中排序
*/
int sort() default Integer.MAX_VALUE;
/**
* 导出到Excel中的名字.
*/
String name() default "";
/**
* 日期格式, : yyyy-MM-dd
*/
String dateFormat() default "";
/**
* 如果是字典类型请设置字典的type值 (: sys_user_sex)
*/
String dictType() default "";
/**
* 读取内容转表达式 (: 0=,1=,2=未知)
*/
public String readConverterExp() default "";
/**
* 分隔符读取字符串组内容
*/
public String separator() default ",";
/**
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
*/
public int scale() default -1;
/**
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
*/
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
/**
* 导出类型0数字 1字符串
*/
public ColumnType cellType() default ColumnType.STRING;
/**
* 导出时在excel中每个列的高度 单位为字符
*/
public double height() default 14;
/**
* 导出时在excel中每个列的宽 单位为字符
*/
public double width() default 16;
/**
* 文字后缀,% 90 变成90%
*/
String suffix() default "";
/**
* 当值为空时,字段的默认值
*/
String defaultValue() default "";
/**
* 提示信息
*/
String prompt() default "";
/**
* 设置只能选择不能输入的列内容.
*/
String[] combo() default {};
/**
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
*/
boolean isExport() default true;
/**
* 另一个类中的属性名称,支持多级获取,以小数点隔开
*/
String targetAttr() default "";
/**
* 是否自动统计数据,在最后追加一行统计数据总和
*/
boolean isStatistics() default false;
/**
* 导出字段对齐方式0默认1靠左2居中3靠右
*/
Align align() default Align.AUTO;
enum Align {
AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
private final int value;
Align(int value) {
this.value = value;
}
public int value() {
return this.value;
}
}
/**
* 字段类型0导出导入1仅导出2仅导入
*/
Type type() default Type.ALL;
enum Type {
ALL(0), EXPORT(1), IMPORT(2);
private final int value;
Type(int value) {
this.value = value;
}
public int value() {
return this.value;
}
}
enum ColumnType {
NUMERIC(0), STRING(1), IMAGE(2);
private final int value;
ColumnType(int value) {
this.value = value;
}
public int value() {
return this.value;
}
}
}

View File

@ -1,19 +0,0 @@
package cn.iocoder.dashboard.framework.excel;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Excel注解集
*
* @author ruoyi
*/
@Deprecated
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Excels
{
Excel[] value();
}

View File

@ -10,18 +10,32 @@ import java.util.List;
/** /**
* Excel 工具类 * Excel 工具类
*
* @author 芋道源码
*/ */
public class ExcelUtils { public class ExcelUtils {
public static void write(HttpServletResponse response, String filename, String sheetName, /**
Class<?> head, List<?> data) throws IOException { * 将列表以 Excel 响应给前端
// 设置 header contentType *
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8")); * @param response 响应
response.setContentType("application/vnd.ms-excel;charset=UTF-8"); * @param filename 文件名
* @param sheetName Excel sheet
* @param head Excel head
* @param data 数据列表哦
* @param <T> 泛型保证 head data 类型的一致性
* @throws IOException 写入失败的情况
*/
public static <T> void write(HttpServletResponse response, String filename, String sheetName,
Class<T> head, List<T> data) throws IOException {
// 输出 Excel // 输出 Excel
EasyExcel.write(response.getOutputStream(), head) EasyExcel.write(response.getOutputStream(), head)
.autoCloseStream(false) // 不要自动关闭交给 Servlet 自己处理
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度自动适配最大 255 宽度 .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度自动适配最大 255 宽度
.sheet(sheetName).doWrite(data); .sheet(sheetName).doWrite(data);
// 设置 header contentType写在最后的原因是避免报错时响应 contentType 已经被修改了
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
} }
} }

View File

@ -89,10 +89,10 @@ public class SysPostController {
// @PreAuthorize("@ss.hasPermi('system:post:export')") // @PreAuthorize("@ss.hasPermi('system:post:export')")
public void export(HttpServletResponse response, @Validated SysPostExportReqVO reqVO) throws IOException { public void export(HttpServletResponse response, @Validated SysPostExportReqVO reqVO) throws IOException {
List<SysPostDO> posts = postService.listPosts(reqVO); List<SysPostDO> posts = postService.listPosts(reqVO);
List<SysPostExcelVO> excelPosts = SysPostConvert.INSTANCE.convertList03(posts); List<SysPostExcelVO> excelDataList = SysPostConvert.INSTANCE.convertList03(posts);
// 输出 // 输出
ExcelUtils.write(response, "岗位数据.xls", "岗位列表", ExcelUtils.write(response, "岗位数据.xls", "岗位列表",
SysPostExcelVO.class, excelPosts); SysPostExcelVO.class, excelDataList);
} }
} }

View File

@ -1,12 +1,8 @@
package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; package cn.iocoder.dashboard.modules.system.controller.dept.vo.post;
import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat;
import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS;
/** /**
* 岗位 Excel 导出响应 VO * 岗位 Excel 导出响应 VO
*/ */
@ -25,8 +21,9 @@ public class SysPostExcelVO {
@ExcelProperty("岗位排序") @ExcelProperty("岗位排序")
private String sort; private String sort;
@ExcelProperty(value = "状态", converter = DictConvert.class) // @ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat(SYS_COMMON_STATUS) // @DictFormat(SYS_COMMON_STATUS)
@ExcelProperty(value = "状态")
private String status; private String status;
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.dict;
import cn.iocoder.dashboard.common.pojo.CommonResult; import cn.iocoder.dashboard.common.pojo.CommonResult;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.*; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.*;
import cn.iocoder.dashboard.modules.system.convert.dict.SysDictDataConvert; import cn.iocoder.dashboard.modules.system.convert.dict.SysDictDataConvert;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO;
@ -13,6 +14,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
import static cn.iocoder.dashboard.common.pojo.CommonResult.success; import static cn.iocoder.dashboard.common.pojo.CommonResult.success;
@ -25,8 +28,8 @@ public class SysDictDataController {
@Resource @Resource
private SysDictDataService dictDataService; private SysDictDataService dictDataService;
@GetMapping("/list-all-simple")
@ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地") @ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地")
@GetMapping("/list-all-simple")
// 无需添加权限认证因为前端全局都需要 // 无需添加权限认证因为前端全局都需要
public CommonResult<List<SysDictDataSimpleVO>> listSimpleDictDatas() { public CommonResult<List<SysDictDataSimpleVO>> listSimpleDictDatas() {
List<SysDictDataDO> list = dictDataService.listDictDatas(); List<SysDictDataDO> list = dictDataService.listDictDatas();
@ -75,14 +78,16 @@ public class SysDictDataController {
return success(true); return success(true);
} }
@ApiOperation("导出字典数据")
@GetMapping("/export")
// @Log(title = "字典类型", businessType = BusinessType.EXPORT) // @Log(title = "字典类型", businessType = BusinessType.EXPORT)
// @PreAuthorize("@ss.hasPermi('system:dict:export')") // @PreAuthorize("@ss.hasPermi('system:dict:export')")
// @GetMapping("/export") public void export(HttpServletResponse response, @Validated SysDictDataExportReqVO reqVO) throws IOException {
// public AjaxResult export(SysDictType dictType) { List<SysDictDataDO> list = dictDataService.listDictDatas(reqVO);
// List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); List<SysDictDataExcelVO> excelDataList = SysDictDataConvert.INSTANCE.convertList02(list);
// ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); // 输出
// return util.exportExcel(list, "字典类型"); ExcelUtils.write(response, "字典数据.xls", "数据列表",
// } SysDictDataExcelVO.class, excelDataList);
}
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.dict;
import cn.iocoder.dashboard.common.pojo.CommonResult; import cn.iocoder.dashboard.common.pojo.CommonResult;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.*; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.*;
import cn.iocoder.dashboard.modules.system.convert.dict.SysDictTypeConvert; import cn.iocoder.dashboard.modules.system.convert.dict.SysDictTypeConvert;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO;
@ -13,6 +14,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
import static cn.iocoder.dashboard.common.pojo.CommonResult.success; import static cn.iocoder.dashboard.common.pojo.CommonResult.success;
@ -76,14 +79,16 @@ public class SysDictTypeController {
return success(SysDictTypeConvert.INSTANCE.convertList(list)); return success(SysDictTypeConvert.INSTANCE.convertList(list));
} }
// @ApiOperation("导出数据类型")
@GetMapping("/export")
// @Log(title = "字典类型", businessType = BusinessType.EXPORT) // @Log(title = "字典类型", businessType = BusinessType.EXPORT)
// @PreAuthorize("@ss.hasPermi('system:dict:export')") // @PreAuthorize("@ss.hasPermi('system:dict:export')")
// @GetMapping("/export") public void export(HttpServletResponse response, @Validated SysDictTypeExportReqVO reqVO) throws IOException {
// public AjaxResult export(SysDictType dictType) { List<SysDictTypeDO> list = dictTypeService.listDictTypes(reqVO);
// List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); List<SysDictTypeExcelVO> excelTypeList = SysDictTypeConvert.INSTANCE.convertList02(list);
// ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); // 输出
// return util.exportExcel(list, "字典类型"); ExcelUtils.write(response, "字典类型.xls", "类型列表",
// } SysDictTypeExcelVO.class, excelTypeList);
}
} }

View File

@ -0,0 +1,24 @@
package cn.iocoder.dashboard.modules.system.controller.dict.vo.data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Size;
@ApiModel("字典类型导出 Request VO")
@Data
public class SysDictDataExportReqVO {
@ApiModelProperty(value = "字典标签", example = "芋道")
@Size(max = 100, message = "字典标签长度不能超过100个字符")
private String label;
@ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
private String dictType;
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
private Integer status;
}

View File

@ -0,0 +1,35 @@
package cn.iocoder.dashboard.modules.system.controller.dict.vo.type;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Size;
import java.util.Date;
import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("字典类型分页列表 Request VO")
@Data
public class SysDictTypeExportReqVO {
@ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配")
private String name;
@ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
private String type;
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
private Integer status;
@ApiModelProperty(value = "开始时间", example = "2020-10-24")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginTime;
@ApiModelProperty(value = "结束时间", example = "2020-10-24")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endTime;
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.dashboard.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
@ -13,6 +14,7 @@ import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOU
@ApiModel("字典类型分页列表 Request VO") @ApiModel("字典类型分页列表 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true)
public class SysDictTypePageReqVO extends PageParam { public class SysDictTypePageReqVO extends PageParam {
@ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配") @ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配")

View File

@ -3,6 +3,7 @@ package cn.iocoder.dashboard.modules.system.controller.permission;
import cn.iocoder.dashboard.common.enums.CommonStatusEnum; import cn.iocoder.dashboard.common.enums.CommonStatusEnum;
import cn.iocoder.dashboard.common.pojo.CommonResult; import cn.iocoder.dashboard.common.pojo.CommonResult;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.*; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.*;
import cn.iocoder.dashboard.modules.system.convert.permission.SysRoleConvert; import cn.iocoder.dashboard.modules.system.convert.permission.SysRoleConvert;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO;
@ -14,6 +15,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
@ -80,16 +83,6 @@ public class SysRoleController {
return success(SysRoleConvert.INSTANCE.convert(role)); return success(SysRoleConvert.INSTANCE.convert(role));
} }
// @Log(title = "角色管理", businessType = BusinessType.EXPORT)
// @PreAuthorize("@ss.hasPermi('system:role:export')")
// @GetMapping("/export")
// public AjaxResult export(SysRole role)
// {
// List<SysRole> list = roleService.selectRoleList(role);
// ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
// return util.exportExcel(list, "角色数据");
// }
@ApiOperation("修改角色状态") @ApiOperation("修改角色状态")
@PostMapping("/update-status") @PostMapping("/update-status")
// @PreAuthorize("@ss.hasPermi('system:role:edit')") // @PreAuthorize("@ss.hasPermi('system:role:edit')")
@ -99,4 +92,15 @@ public class SysRoleController {
return success(true); return success(true);
} }
@GetMapping("/export")
// @Log(title = "角色管理", businessType = BusinessType.EXPORT)
// @PreAuthorize("@ss.hasPermi('system:role:export')")
public void export(HttpServletResponse response, @Validated SysRoleExportReqVO reqVO) throws IOException {
List<SysRoleDO> list = roleService.listRoles(reqVO);
List<SysRoleExcelVO> excelDataList = SysRoleConvert.INSTANCE.convertList03(list);
// 输出
ExcelUtils.write(response, "角色数据.xls", "角色列表",
SysRoleExcelVO.class, excelDataList);
}
} }

View File

@ -1,30 +0,0 @@
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
import cn.iocoder.dashboard.framework.excel.Excel;
import lombok.Data;
/**
* 角色 Excel 导出响应 VO
*/
@Data
public class SysRoleExcelRespVO {
@Excel(name = "角色序号", cellType = Excel.ColumnType.NUMERIC)
private Long id;
@Excel(name = "角色名称")
private String name;
@Excel(name = "角色标志")
private String code;
@Excel(name = "角色排序")
private Integer sort;
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
private Integer dataScope;
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
private String status;
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat;
import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert;
import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* 角色 Excel 导出响应 VO
*/
@Data
public class SysRoleExcelVO {
@ExcelProperty("角色序号")
private Long id;
@ExcelProperty("角色名称")
private String name;
@ExcelProperty("角色标志")
private String code;
@ExcelProperty("角色排序")
private Integer sort;
@ExcelProperty("数据范围")
private Integer dataScope;
@ExcelProperty(value = "角色状态", converter = DictConvert.class)
@DictFormat(DictTypeEnum.SYS_COMMON_STATUS)
private String status;
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("角色分页 Request VO")
@Data
public class SysRoleExportReqVO {
@ApiModelProperty(value = "角色名称", example = "芋道", notes = "模糊匹配")
private String name;
@ApiModelProperty(value = "角色标识", example = "yudao", notes = "模糊匹配")
private String code;
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
private Integer status;
@ApiModelProperty(value = "开始时间", example = "2020-10-24")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginTime;
@ApiModelProperty(value = "结束时间", example = "2020-10-24")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endTime;
}

View File

@ -1,52 +0,0 @@
package cn.iocoder.dashboard.modules.system.controller.user.vo.user;
import cn.iocoder.dashboard.framework.excel.Excel;
import cn.iocoder.dashboard.framework.excel.Excels;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dept.SysDeptDO;
import lombok.Data;
import java.util.Date;
/**
* 用户 Excel 导出响应 VO
*/
@Data
public class SysUserExcelRespBackVO {
@Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号")
private Long id;
@Excel(name = "登录名称")
private String username;
@Excel(name = "用户名称")
private String nickname;
@Excel(name = "部门编号", type = Excel.Type.IMPORT)
private Long deptId;
@Excel(name = "用户邮箱")
private String email;
@Excel(name = "手机号码")
private String mobile;
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
private String sex;
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
private Integer status;
@Excel(name = "最后登录IP", type = Excel.Type.EXPORT)
private String loginIp;
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
private Date loginDate;
@Excels({
@Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
@Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
})
private SysDeptDO dept;
}

View File

@ -0,0 +1,38 @@
package cn.iocoder.dashboard.modules.system.controller.user.vo.user;
import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat;
import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert;
import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* 用户 Excel 导入 VO
*/
@Data
public class SysUserImportExcelVO {
@ExcelProperty("登录名称")
private String username;
@ExcelProperty("用户名称")
private String nickname;
@ExcelProperty("部门编号")
private Long deptId;
@ExcelProperty("用户邮箱")
private String email;
@ExcelProperty("手机号码")
private String mobile;
@ExcelProperty(value = "用户性别", converter = DictConvert.class)
@DictFormat(DictTypeEnum.SYS_USER_SEX)
private String sex;
@ExcelProperty(value = "账号状态", converter = DictConvert.class)
@DictFormat(DictTypeEnum.SYS_COMMON_STATUS)
private Integer status;
}

View File

@ -1,10 +1,7 @@
package cn.iocoder.dashboard.modules.system.convert.dict; package cn.iocoder.dashboard.modules.system.convert.dict;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.*;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataRespVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataSimpleVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataUpdateReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
@ -31,4 +28,6 @@ public interface SysDictDataConvert {
@Mapping(source = "records", target = "list") @Mapping(source = "records", target = "list")
PageResult<SysDictDataDO> convertPage02(IPage<SysDictDataDO> page); PageResult<SysDictDataDO> convertPage02(IPage<SysDictDataDO> page);
List<SysDictDataExcelVO> convertList02(List<SysDictDataDO> bean);
} }

View File

@ -1,10 +1,7 @@
package cn.iocoder.dashboard.modules.system.convert.dict; package cn.iocoder.dashboard.modules.system.convert.dict;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.*;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeRespVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeSimpleRespVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeUpdateReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
@ -31,4 +28,6 @@ public interface SysDictTypeConvert {
List<SysDictTypeSimpleRespVO> convertList(List<SysDictTypeDO> list); List<SysDictTypeSimpleRespVO> convertList(List<SysDictTypeDO> list);
List<SysDictTypeExcelVO> convertList02(List<SysDictTypeDO> list);
} }

View File

@ -1,10 +1,7 @@
package cn.iocoder.dashboard.modules.system.convert.permission; package cn.iocoder.dashboard.modules.system.convert.permission;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.*;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleRespVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleSimpleRespVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleUpdateReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
@ -29,4 +26,6 @@ public interface SysRoleConvert {
List<SysRoleSimpleRespVO> convertList02(List<SysRoleDO> list); List<SysRoleSimpleRespVO> convertList02(List<SysRoleDO> list);
List<SysRoleExcelVO> convertList03(List<SysRoleDO> list);
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dao.dict;
import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.dashboard.framework.mybatis.core.util.MyBatisUtils; import cn.iocoder.dashboard.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataPageReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataPageReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -36,4 +37,9 @@ public interface SysDictDataMapper extends BaseMapper<SysDictDataDO> {
return selectList(new QueryWrapper<>()); return selectList(new QueryWrapper<>());
} }
default List<SysDictDataDO> selectList(SysDictDataExportReqVO reqVO) {
return selectList(new QueryWrapperX<SysDictDataDO>().likeIfPresent("label", reqVO.getLabel())
.likeIfPresent("dict_type", reqVO.getDictType())
.eqIfPresent("status", reqVO.getStatus()));
}
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dao.dict;
import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.dashboard.framework.mybatis.core.util.MyBatisUtils; import cn.iocoder.dashboard.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -22,6 +23,13 @@ public interface SysDictTypeMapper extends BaseMapper<SysDictTypeDO> {
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime())); .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
} }
default List<SysDictTypeDO> selectList(SysDictTypeExportReqVO reqVO) {
return selectList(new QueryWrapperX<SysDictTypeDO>().likeIfPresent("name", reqVO.getName())
.likeIfPresent("dict_type", reqVO.getType())
.eqIfPresent("status", reqVO.getStatus())
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
}
default SysDictTypeDO selectByType(String type) { default SysDictTypeDO selectByType(String type) {
return selectOne(new QueryWrapperX<SysDictTypeDO>().eq("dict_type", type)); return selectOne(new QueryWrapperX<SysDictTypeDO>().eq("dict_type", type));
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dao.permission;
import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.dashboard.framework.mybatis.core.util.MyBatisUtils; import cn.iocoder.dashboard.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRolePageReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRolePageReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -18,9 +19,16 @@ public interface SysRoleMapper extends BaseMapper<SysRoleDO> {
default IPage<SysRoleDO> selectPage(SysRolePageReqVO reqVO) { default IPage<SysRoleDO> selectPage(SysRolePageReqVO reqVO) {
return selectPage(MyBatisUtils.buildPage(reqVO), return selectPage(MyBatisUtils.buildPage(reqVO),
new QueryWrapperX<SysRoleDO>().likeIfPresent("name", reqVO.getName()) new QueryWrapperX<SysRoleDO>().likeIfPresent("name", reqVO.getName())
.likeIfPresent("code", reqVO.getCode()) .likeIfPresent("code", reqVO.getCode())
.eqIfPresent("status", reqVO.getStatus()) .eqIfPresent("status", reqVO.getStatus())
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime())); .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
}
default List<SysRoleDO> listRoles(SysRoleExportReqVO reqVO) {
return selectList(new QueryWrapperX<SysRoleDO>().likeIfPresent("name", reqVO.getName())
.likeIfPresent("code", reqVO.getCode())
.eqIfPresent("status", reqVO.getStatus())
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
} }
default SysRoleDO selectByName(String name) { default SysRoleDO selectByName(String name) {
@ -34,4 +42,5 @@ public interface SysRoleMapper extends BaseMapper<SysRoleDO> {
default List<SysRoleDO> selectListByStatus(@Nullable Collection<Integer> statuses) { default List<SysRoleDO> selectListByStatus(@Nullable Collection<Integer> statuses) {
return selectList(new QueryWrapperX<SysRoleDO>().in("status", statuses)); return selectList(new QueryWrapperX<SysRoleDO>().in("status", statuses));
} }
} }

View File

@ -3,6 +3,7 @@ package cn.iocoder.dashboard.modules.system.service.dict;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.framework.dict.core.service.DictDataFrameworkService; import cn.iocoder.dashboard.framework.dict.core.service.DictDataFrameworkService;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataPageReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataPageReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataUpdateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataUpdateReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO;
@ -36,6 +37,14 @@ public interface SysDictDataService extends DictDataFrameworkService {
*/ */
PageResult<SysDictDataDO> pageDictDatas(SysDictDataPageReqVO reqVO); PageResult<SysDictDataDO> pageDictDatas(SysDictDataPageReqVO reqVO);
/**
* 获得字典数据列表
*
* @param reqVO 列表请求
* @return 字典数据列表
*/
List<SysDictDataDO> listDictDatas(SysDictDataExportReqVO reqVO);
/** /**
* 获得字典数据详情 * 获得字典数据详情
* *

View File

@ -2,6 +2,7 @@ package cn.iocoder.dashboard.modules.system.service.dict;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeUpdateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeUpdateReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO;
@ -23,6 +24,14 @@ public interface SysDictTypeService {
*/ */
PageResult<SysDictTypeDO> pageDictTypes(SysDictTypePageReqVO reqVO); PageResult<SysDictTypeDO> pageDictTypes(SysDictTypePageReqVO reqVO);
/**
* 获得字典类型列表
*
* @param reqVO 列表请求
* @return 字典类型列表
*/
List<SysDictTypeDO> listDictTypes(SysDictTypeExportReqVO reqVO);
/** /**
* 获得字典类型详情 * 获得字典类型详情
* *

View File

@ -4,6 +4,7 @@ import cn.iocoder.dashboard.common.enums.CommonStatusEnum;
import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil; import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataPageReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataPageReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataUpdateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDictDataUpdateReqVO;
import cn.iocoder.dashboard.modules.system.convert.dict.SysDictDataConvert; import cn.iocoder.dashboard.modules.system.convert.dict.SysDictDataConvert;
@ -84,6 +85,13 @@ public class SysDictDataServiceImpl implements SysDictDataService {
return SysDictDataConvert.INSTANCE.convertPage02(dictDataMapper.selectList(reqVO)); return SysDictDataConvert.INSTANCE.convertPage02(dictDataMapper.selectList(reqVO));
} }
@Override
public List<SysDictDataDO> listDictDatas(SysDictDataExportReqVO reqVO) {
List<SysDictDataDO> list = dictDataMapper.selectList(reqVO);
list.sort(COMPARATOR_TYPE_AND_SORT);
return list;
}
@Override @Override
public SysDictDataDO getDictData(Long id) { public SysDictDataDO getDictData(Long id) {
return dictDataMapper.selectById(id); return dictDataMapper.selectById(id);

View File

@ -3,6 +3,7 @@ package cn.iocoder.dashboard.modules.system.service.dict.impl;
import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil; import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO;
import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeUpdateReqVO; import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeUpdateReqVO;
import cn.iocoder.dashboard.modules.system.convert.dict.SysDictTypeConvert; import cn.iocoder.dashboard.modules.system.convert.dict.SysDictTypeConvert;
@ -40,6 +41,11 @@ public class SysDictTypeServiceImpl implements SysDictTypeService {
return SysDictTypeConvert.INSTANCE.convertPage02(dictTypeMapper.selectList(reqVO)); return SysDictTypeConvert.INSTANCE.convertPage02(dictTypeMapper.selectList(reqVO));
} }
@Override
public List<SysDictTypeDO> listDictTypes(SysDictTypeExportReqVO reqVO) {
return dictTypeMapper.selectList(reqVO);
}
@Override @Override
public SysDictTypeDO getDictType(Long id) { public SysDictTypeDO getDictType(Long id) {
return dictTypeMapper.selectById(id); return dictTypeMapper.selectById(id);

View File

@ -2,6 +2,7 @@ package cn.iocoder.dashboard.modules.system.service.permission;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRolePageReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRolePageReqVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleUpdateReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleUpdateReqVO;
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO;
@ -93,6 +94,14 @@ public interface SysRoleService {
*/ */
PageResult<SysRoleDO> pageRole(SysRolePageReqVO reqVO); PageResult<SysRoleDO> pageRole(SysRolePageReqVO reqVO);
/**
* 获得角色列表
*
* @param reqVO 列表查询
* @return 角色列表
*/
List<SysRoleDO> listRoles(SysRoleExportReqVO reqVO);
/** /**
* 更新角色状态 * 更新角色状态
* *

View File

@ -5,6 +5,7 @@ import cn.iocoder.dashboard.common.enums.CommonStatusEnum;
import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil; import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleCreateReqVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleExportReqVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRolePageReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRolePageReqVO;
import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleUpdateReqVO; import cn.iocoder.dashboard.modules.system.controller.permission.vo.role.SysRoleUpdateReqVO;
import cn.iocoder.dashboard.modules.system.convert.permission.SysRoleConvert; import cn.iocoder.dashboard.modules.system.convert.permission.SysRoleConvert;
@ -140,6 +141,11 @@ public class SysRoleServiceImpl implements SysRoleService {
return SysRoleConvert.INSTANCE.convertPage(roleDOPage); return SysRoleConvert.INSTANCE.convertPage(roleDOPage);
} }
@Override
public List<SysRoleDO> listRoles(SysRoleExportReqVO reqVO) {
return roleMapper.listRoles(reqVO);
}
@Override @Override
public void updateRoleStatus(Long id, Integer status) { public void updateRoleStatus(Long id, Integer status) {
// 校验是否可以更新 // 校验是否可以更新

View File

@ -335,15 +335,4 @@ public class SysUserServiceImpl implements SysUserService {
// return successMsg.toString(); // return successMsg.toString();
// } // }
// /**
// * 根据条件分页查询用户列表
// *
// * @param user 用户信息
// * @return 用户信息集合信息
// */
// @Override
// @DataScope(deptAlias = "d", userAlias = "u")
// public List<SysUser> selectUserList(SysUser user) {
// return userMapper.selectUserList(user);
// }
} }