数据导出

This commit is contained in:
sunxiqing 2025-01-06 18:36:34 +08:00
parent bd5fda0ecc
commit 8bb3af3036
2 changed files with 9 additions and 0 deletions

View File

@ -162,6 +162,11 @@ public class UserController {
if (!userRespVOS.isEmpty()) {
userRespVOS.stream().forEach(sysUser ->{
UserStudentExcelVO student = new UserStudentExcelVO();
if (sysUser.getUserType()==1){
student.setStatusType(sysUser.getStatusType()==1?"培训教师":"教师");
}else if (sysUser.getUserType()==2){
student.setStatusType(sysUser.getStatusType()==1?"学员":"学生");
}
BeanUtil.copyProperties(sysUser, student);
studentUserList.add(student);
});

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.system.controller.admin.user.vo.user;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -27,11 +29,13 @@ public class UserStudentExcelVO {
private String statusType;
@ExcelProperty("性别")
@DictFormat(DictTypeConstants.USER_SEX)
private String sex;
@ExcelProperty("手机号码")
private String mobile;
@ExcelProperty("状态")
@DictFormat(DictTypeConstants.COMMON_STATUS)
private String status;
}