fix:78310
This commit is contained in:
+19
-4
@@ -33,6 +33,7 @@ import com.jero.modules.system.vo.SysUserRoleVO;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
@@ -515,10 +516,24 @@ public class SysUserController {
|
|||||||
}
|
}
|
||||||
//update-end--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
|
//update-end--Author:kangxiaolin Date:20180825 for:[03]用户导出,如果选择数据则只导出相关数据----------------------
|
||||||
List<SysUser> pageList = sysUserService.list(queryWrapper);
|
List<SysUser> pageList = sysUserService.list(queryWrapper);
|
||||||
pageList.forEach(user -> {
|
if(!CollectionUtils.isEmpty(pageList)){
|
||||||
// 对手机号、邮箱进行解密处理
|
//批量查询用户的所属部门
|
||||||
sysUserService.proceedUserInfoDecrypt(user);
|
//step.1 先拿到全部的 useids
|
||||||
});
|
List<String> userIds = pageList.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||||
|
//step.2 通过 useids,一次性查询用户的所属部门名字
|
||||||
|
Map<String,String> useDepNames = sysUserService.getDepNamesByUserIds(userIds);
|
||||||
|
//step.3 通过 useids,一次性查询用户的角色名字
|
||||||
|
Map<String,String> useRoleNames = sysUserService.getRoleNamesByUserIds(userIds);
|
||||||
|
//step.4 遍历赋值
|
||||||
|
pageList.forEach(item->{
|
||||||
|
item.setOrgCodeTxt(useDepNames.get(item.getId()));
|
||||||
|
item.setRoleTxt(useRoleNames.get(item.getId()));
|
||||||
|
// 对手机号、邮箱进行解密处理
|
||||||
|
sysUserService.proceedUserInfoDecrypt(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//导出文件名称
|
//导出文件名称
|
||||||
mv.addObject(JeroController.FILE_NAME, "用户列表");
|
mv.addObject(JeroController.FILE_NAME, "用户列表");
|
||||||
|
|||||||
@@ -40,15 +40,21 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 工号(也是登录账号)
|
* 工号(也是登录账号)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "工号", width = 15)
|
@Excel(name = "账号", width = 15)
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 真实姓名
|
* 真实姓名
|
||||||
*/
|
*/
|
||||||
@Excel(name = "真实姓名", width = 15)
|
@Excel(name = "用户姓名", width = 15)
|
||||||
private String realname;
|
private String realname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位
|
||||||
|
*/
|
||||||
|
@Excel(name = "岗位", width = 15)
|
||||||
|
private String post;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码
|
* 密码
|
||||||
*/
|
*/
|
||||||
@@ -64,13 +70,11 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 头像
|
* 头像
|
||||||
*/
|
*/
|
||||||
@Excel(name = "头像", width = 15,type = 2)
|
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生日
|
* 生日
|
||||||
*/
|
*/
|
||||||
@Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
|
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date birthday;
|
private Date birthday;
|
||||||
@@ -85,13 +89,12 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 电子邮件
|
* 电子邮件
|
||||||
*/
|
*/
|
||||||
@Excel(name = "电子邮件", width = 15)
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电话
|
* 电话
|
||||||
*/
|
*/
|
||||||
@Excel(name = "电话", width = 15)
|
@Excel(name = "手机号码", width = 15)
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,9 +103,11 @@ public class SysUser implements Serializable {
|
|||||||
private String orgCode;
|
private String orgCode;
|
||||||
|
|
||||||
/**部门名称*/
|
/**部门名称*/
|
||||||
|
@Excel(name = "组织机构", width = 15)
|
||||||
private transient String orgCodeTxt;
|
private transient String orgCodeTxt;
|
||||||
|
|
||||||
/**角色名称*/
|
/**角色名称*/
|
||||||
|
@Excel(name = "角色", width = 15)
|
||||||
private transient String roleTxt;
|
private transient String roleTxt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,14 +123,12 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 删除状态(0,正常,1已删除)
|
* 删除状态(0,正常,1已删除)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "删除状态", width = 15,dicCode="del_flag")
|
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 座机号
|
* 座机号
|
||||||
*/
|
*/
|
||||||
@Excel(name = "座机号", width = 15)
|
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -155,13 +158,11 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 身份(0 普通成员 1 上级)
|
* 身份(0 普通成员 1 上级)
|
||||||
*/
|
*/
|
||||||
@Excel(name="(1普通成员 2上级)",width = 15)
|
|
||||||
private Integer userIdentity;
|
private Integer userIdentity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负责部门
|
* 负责部门
|
||||||
*/
|
*/
|
||||||
@Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
|
||||||
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||||
private String departIds;
|
private String departIds;
|
||||||
|
|
||||||
@@ -187,10 +188,6 @@ public class SysUser implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String typeId;
|
private String typeId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 岗位
|
|
||||||
*/
|
|
||||||
private String post;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 职务级别
|
* 职务级别
|
||||||
|
|||||||
Reference in New Issue
Block a user