Commit 05b03632 authored by fangxinjiang's avatar fangxinjiang

用户信息新增 ldap 机构信息

parent f52d19d1
...@@ -476,4 +476,5 @@ public interface CommonConstants { ...@@ -476,4 +476,5 @@ public interface CommonConstants {
public static final String XLSX = ".xlsx"; public static final String XLSX = ".xlsx";
public static final String ERROR_IMPORT = "执行异常";
} }
...@@ -70,9 +70,16 @@ public class YifuUser extends User { ...@@ -70,9 +70,16 @@ public class YifuUser extends User {
@Getter @Getter
private final String userGroup; private final String userGroup;
public YifuUser(String id, Long deptId,String deptName, String username, String nickname,String systemFlag, String password, String phone, boolean enabled, /**
boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked,String userGroup, * LDAP_DN
Collection<? extends GrantedAuthority> authorities) { */
@Getter
private String ldapDn;
public YifuUser(String id, Long deptId,String deptName, String username, String nickname,String systemFlag,
String password, String phone, boolean enabled, boolean accountNonExpired,
boolean credentialsNonExpired, String ldapDn, boolean accountNonLocked,
String userGroup, Collection<? extends GrantedAuthority> authorities) {
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
this.id = id; this.id = id;
this.deptId = deptId; this.deptId = deptId;
...@@ -81,6 +88,7 @@ public class YifuUser extends User { ...@@ -81,6 +88,7 @@ public class YifuUser extends User {
this.nickname = nickname; this.nickname = nickname;
this.systemFlag = systemFlag; this.systemFlag = systemFlag;
this.userGroup = userGroup; this.userGroup = userGroup;
this.ldapDn = ldapDn;
} }
} }
...@@ -69,9 +69,11 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered { ...@@ -69,9 +69,11 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered {
SysUser user = info.getSysUser(); SysUser user = info.getSysUser();
// 构造security用户 // 构造security用户
return new YifuUser(user.getUserId(), user.getDeptId(),user.getDeptName(), user.getUsername(),user.getNickname(),user.getSystemFlag(), return new YifuUser(user.getUserId(), user.getDeptId(),user.getDeptName(), user.getUsername(),user.getNickname()
SecurityConstants.BCRYPT + user.getPassword(), user.getPhone(), true, true, ,user.getSystemFlag(), SecurityConstants.BCRYPT + user.getPassword(), user.getPhone(),
true, StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL), user.getUserGroup(),authorities); true, true, true,
StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL),
user.getLdapDn(), user.getUserGroup(),authorities);
} }
/** /**
......
...@@ -86,9 +86,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -86,9 +86,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType("multipart/form-data"); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding(CommonConstants.UTF8);
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, IncomeExportVo.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, IncomeExportVo.class).build();
int index = 0; int index = 0;
...@@ -97,7 +97,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -97,7 +97,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo, null, Common.getList(searchVo.getIds()), ""); list = noPageDiy(searchVo, null, Common.getList(searchVo.getIds()), CommonConstants.EMPTY_STRING);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
ExcelUtil<IncomeExportVo> util = new ExcelUtil<>(IncomeExportVo.class); ExcelUtil<IncomeExportVo> util = new ExcelUtil<>(IncomeExportVo.class);
for (IncomeExportVo vo : list) { for (IncomeExportVo vo : list) {
...@@ -124,14 +124,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -124,14 +124,14 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
out.flush(); out.flush();
excelWriter.finish(); excelWriter.finish();
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error(CommonConstants.ERROR_IMPORT, e);
} finally { } finally {
try { try {
if (null != out) { if (null != out) {
out.close(); out.close();
} }
} catch (IOException e) { } catch (IOException e) {
log.error("执行异常", e); log.error(CommonConstants.ERROR_IMPORT, e);
} }
} }
} }
......
...@@ -132,4 +132,10 @@ public class SysUser extends BaseEntity { ...@@ -132,4 +132,10 @@ public class SysUser extends BaseEntity {
@TableLogic @TableLogic
private String delFlag; private String delFlag;
/**
* LDAP_DN
*/
@Schema(description = "LDAP_DN")
private String ldapDn;
} }
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.api.vo; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -127,4 +128,10 @@ public class UserVO implements Serializable { ...@@ -127,4 +128,10 @@ public class UserVO implements Serializable {
* 是否是系统内置 * 是否是系统内置
*/ */
private String systemFlag; private String systemFlag;
/**
* LDAP_DN
*/
@Schema(description = "LDAP_DN")
private String ldapDn;
} }
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<result column="post" property="post"/> <result column="post" property="post"/>
<result column="email" property="email"/> <result column="email" property="email"/>
<result column="system_flag" property="systemFlag"/> <result column="system_flag" property="systemFlag"/>
<result column="dept_dn" property="ldapDn"/>
<collection property="roleList" ofType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole" <collection property="roleList" ofType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole"
select="com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMapper.listRolesByUserId" column="user_id"> select="com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMapper.listRolesByUserId" column="user_id">
</collection> </collection>
...@@ -60,6 +61,7 @@ ...@@ -60,6 +61,7 @@
<result column="post" property="post"/> <result column="post" property="post"/>
<result column="email" property="email"/> <result column="email" property="email"/>
<result column="system_flag" property="systemFlag"/> <result column="system_flag" property="systemFlag"/>
<result column="dept_dn" property="ldapDn"/>
<collection property="roleList" ofType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole"> <collection property="roleList" ofType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole">
<id column="role_id" property="roleId"/> <id column="role_id" property="roleId"/>
<result column="role_name" property="roleName"/> <result column="role_name" property="roleName"/>
...@@ -88,6 +90,7 @@ ...@@ -88,6 +90,7 @@
sys_user.post, sys_user.post,
sys_user.email, sys_user.email,
sys_user.system_flag, sys_user.system_flag,
sys_user.dept_dn,
r.role_id, r.role_id,
r.role_name, r.role_name,
r.role_code, r.role_code,
...@@ -112,6 +115,7 @@ ...@@ -112,6 +115,7 @@
sys_user.post, sys_user.post,
sys_user.email, sys_user.email,
sys_user.system_flag, sys_user.system_flag,
sys_user.dept_dn,
r.role_id, r.role_id,
r.role_name, r.role_name,
r.role_code, r.role_code,
...@@ -192,7 +196,8 @@ ...@@ -192,7 +196,8 @@
u.user_group, u.user_group,
u.email, u.email,
u.system_flag, u.system_flag,
d.name AS deptName d.name AS deptName,
u.dept_dn
FROM sys_user u FROM sys_user u
LEFT JOIN sys_dept d ON d.dept_id = u.dept_id LEFT JOIN sys_dept d ON d.dept_id = u.dept_id
<where> <where>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment