1、注册信息提交接口增加职位参数;
2、注册申请记录列表查询接口增加职位返回; 3、用户信息新增、修改、列表及详情接口增加职位返回; 4、发送注册验证码及重置密码验证码优化
This commit is contained in:
parent
feb0d70c15
commit
4f1c9f433e
@ -198,7 +198,7 @@ public class SysLoginController extends BaseController
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
emailService.sendVerifyCode(email, uuid);
|
||||
emailService.sendEmailCode(email, uuid, "重置密码验证码");
|
||||
ajax.put("uuid", uuid);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ public class SysRegisterController extends BaseController
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
emailService.sendVerifyCode(email, uuid);
|
||||
emailService.sendEmailCode(email, uuid, "注册验证码");
|
||||
ajax.put("uuid", uuid);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@ -50,6 +50,10 @@ public class SysUser extends BaseEntity
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/** 职位 */
|
||||
@Excel(name = "职位")
|
||||
private String position;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String phonenumber;
|
||||
@ -190,6 +194,14 @@ public class SysUser extends BaseEntity
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(String position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||
public String getPhonenumber()
|
||||
{
|
||||
|
||||
@ -13,6 +13,8 @@ public class RegisterBody extends LoginBody
|
||||
|
||||
private String email;
|
||||
|
||||
private String position;
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
@ -36,4 +38,12 @@ public class RegisterBody extends LoginBody
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(String position) {
|
||||
this.position = position;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,19 +22,20 @@ public class EmailService {
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 发送邮箱验证码
|
||||
* 发送注册邮箱验证码
|
||||
*
|
||||
* @param email 邮箱
|
||||
* @param uuid 唯一标识
|
||||
* @param subject 邮件主题
|
||||
*/
|
||||
public void sendVerifyCode(String email, String uuid) {
|
||||
public void sendEmailCode(String email, String uuid, String subject) {
|
||||
String code = String.valueOf(new Random().nextInt(899999) + 100000);
|
||||
String verifyKey = CacheConstants.EMAIL_CODE_KEY + email + ":" + StringUtils.nvl(uuid, "");
|
||||
redisCache.setCacheObject(verifyKey, code, 5, TimeUnit.MINUTES);
|
||||
SimpleMailMessage message = new SimpleMailMessage();
|
||||
message.setFrom("adamlawen@qq.com");
|
||||
message.setTo(email);
|
||||
message.setSubject("注册验证码");
|
||||
message.setSubject(subject);
|
||||
message.setText("您的验证码是:" + code + ",5分钟内有效。");
|
||||
mailSender.send(message);
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ public class SysRegisterService
|
||||
{
|
||||
String msg = "", username = registerBody.getUsername(), nickname = registerBody.getNickname(),
|
||||
password = registerBody.getPassword(), company = registerBody.getCompany(),
|
||||
email = registerBody.getEmail();
|
||||
email = registerBody.getEmail(), position = registerBody.getPosition();
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(username);
|
||||
sysUser.setEmail(email);
|
||||
@ -99,6 +99,7 @@ public class SysRegisterService
|
||||
|
||||
sysUser.setNickName(StringUtils.isNotEmpty(nickname) ? nickname : username);
|
||||
sysUser.setCompany(company);
|
||||
sysUser.setPosition(position);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||
sysUser.setStatus("3"); //设置为审核中
|
||||
boolean regFlag = userService.registerUser(sysUser);
|
||||
|
||||
@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<id property="userId" column="user_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="company" column="company" />
|
||||
<result property="position" column="position" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="nickNameEn" column="nick_name_en" />
|
||||
@ -51,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.company, u.user_name, u.nick_name, u.nick_name_en,u.email, u.avatar, u.phonenumber, u.language,
|
||||
select u.user_id, u.dept_id, u.company, u.position, u.user_name, u.nick_name, u.nick_name_en, u.email, u.avatar, u.phonenumber, u.language,
|
||||
u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||
@ -62,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.company, u.nick_name, u.nick_name_en, u.user_name, u.email, u.avatar, u.language, u.phonenumber,
|
||||
select u.user_id, u.dept_id, u.company, u.position, u.nick_name, u.nick_name_en, u.user_name, u.email, u.avatar, u.language, u.phonenumber,
|
||||
u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
@ -104,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.company, u.user_name, u.nick_name, u.nick_name_en, u.email, u.phonenumber, u.language, u.status, u.create_time
|
||||
select distinct u.user_id, u.dept_id, u.company, u.position, u.user_name, u.nick_name, u.nick_name_en, u.email, u.phonenumber, u.language, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@ -121,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.company, u.user_name, u.nick_name, u.nick_name_en, u.email, u.phonenumber, u.language, u.status, u.create_time
|
||||
select distinct u.user_id, u.dept_id, u.company, u.position, u.user_name, u.nick_name, u.nick_name_en, u.email, u.phonenumber, u.language, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@ -170,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="company != null and company != ''">company,</if>
|
||||
<if test="position != null and position != ''">position,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="nickNameEn != null and nickNameEn != ''">nick_name_en,</if>
|
||||
@ -187,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="company != null and company != ''">#{company},</if>
|
||||
<if test="position != null and position != ''">#{position},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="nickNameEn != null and nickNameEn != ''">#{nickNameEn},</if>
|
||||
@ -208,6 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="company != null and company != ''">company = #{company},</if>
|
||||
<if test="position != null and position != ''">position = #{position},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="nickNameEn != null and nickNameEn != ''">nick_name_en = #{nickNameEn},</if>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user