Commit 05b03632 authored by fangxinjiang's avatar fangxinjiang

用户信息新增 ldap 机构信息

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