Merge remote-tracking branch 'xnjz/master'
This commit is contained in:
commit
91502bcfe5
@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
|
||||
import cn.iocoder.yudao.module.system.convert.user.UserConvert;
|
||||
@ -163,11 +164,18 @@ public class UserController {
|
||||
userRespVOS.stream().forEach(sysUser ->{
|
||||
UserStudentExcelVO student = new UserStudentExcelVO();
|
||||
BeanUtil.copyProperties(sysUser, student);
|
||||
if (sysUser.getUserType()==1){
|
||||
student.setStatusType(sysUser.getStatusType()==1?"培训教师":"教师");
|
||||
}else if (sysUser.getUserType()==2){
|
||||
student.setStatusType(sysUser.getStatusType()==1?"学员":"学生");
|
||||
}
|
||||
studentUserList.add(student);
|
||||
});
|
||||
}
|
||||
// 输出 Excel
|
||||
ExcelUtils.write(response, "学生数据.xls", "数据", UserStudentExcelVO.class, studentUserList );
|
||||
ExcelUtils.write(response, "学生数据.xls", "数据", UserStudentExcelVO.class,
|
||||
BeanUtils.toBean(studentUserList, UserStudentExcelVO.class));
|
||||
// ExcelUtils.write(response, "学生数据.xls", "数据", UserStudentExcelVO.class, studentUserList );
|
||||
}
|
||||
|
||||
@GetMapping("/teacher/export")
|
||||
|
@ -1,5 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.user.vo.user;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@ -26,12 +29,14 @@ public class UserStudentExcelVO {
|
||||
@ExcelProperty("学生类型")
|
||||
private String statusType;
|
||||
|
||||
@ExcelProperty("性别")
|
||||
@ExcelProperty(value = "性别",converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.USER_SEX)
|
||||
private String sex;
|
||||
|
||||
@ExcelProperty("手机号码")
|
||||
private String mobile;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
@ExcelProperty(value = "状态",converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||
private String status;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user