修改user
parent
cae7ca04f8
commit
1de5f4aaa4
|
@ -9,12 +9,12 @@ import lombok.Data;
|
||||||
* @date 2023/10/26 10:57
|
* @date 2023/10/26 10:57
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class Doctor extends User{
|
public class Doctor extends SysUser{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
医生id
|
医生id
|
||||||
*/
|
*/
|
||||||
private Integer doctorId;
|
private Long doctorId;
|
||||||
/*
|
/*
|
||||||
就职医院名称
|
就职医院名称
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,12 +9,12 @@ import lombok.Data;
|
||||||
* @date 2023/10/26 10:57
|
* @date 2023/10/26 10:57
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class Patient extends User{
|
public class Patient extends SysUser{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
患者id
|
患者id
|
||||||
*/
|
*/
|
||||||
private Integer patientId;
|
private Long patientId;
|
||||||
/*
|
/*
|
||||||
体重
|
体重
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -75,6 +75,11 @@ public class SysUser extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
/*
|
||||||
|
邮箱验证码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 帐号状态(0正常 1停用)
|
* 帐号状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
|
@ -295,6 +300,14 @@ public class SysUser extends BaseEntity {
|
||||||
this.roleId = roleId;
|
this.roleId = roleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
@ -317,6 +330,7 @@ public class SysUser extends BaseEntity {
|
||||||
.append("updateTime", getUpdateTime())
|
.append("updateTime", getUpdateTime())
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
.append("dept", getDept())
|
.append("dept", getDept())
|
||||||
|
.append("code",getCode())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,6 +348,18 @@ public class SysUserController extends BaseController
|
||||||
return toAjax(userService.resetPwd(user));
|
return toAjax(userService.resetPwd(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 个人设置重置密码
|
||||||
|
* @param: * @param user
|
||||||
|
* @return: Result
|
||||||
|
* @author 冯凯
|
||||||
|
* @date: 2023/10/27 14:02
|
||||||
|
*/
|
||||||
|
// public Result resentPwd(@RequestBody User user){
|
||||||
|
// userService.checkUserIfAllowed(user);
|
||||||
|
// user.setPwd1();
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态修改
|
* 状态修改
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -162,7 +162,7 @@ public interface SysUserMapper {
|
||||||
void insertDoctor(Doctor doctor1);
|
void insertDoctor(Doctor doctor1);
|
||||||
|
|
||||||
//添加用户角色
|
//添加用户角色
|
||||||
int insertUseRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);
|
int insertUseRole(@Param("userId") Long userId, @Param("roleId") Integer roleId);
|
||||||
|
|
||||||
int registerPatient(Patient patient);
|
int registerPatient(Patient patient);
|
||||||
|
|
||||||
|
@ -179,5 +179,4 @@ public interface SysUserMapper {
|
||||||
* @author 冯凯
|
* @author 冯凯
|
||||||
* @date: 2023/10/27 10:01
|
* @date: 2023/10/27 10:01
|
||||||
*/
|
*/
|
||||||
User checkEmail(@Param("email") String email);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -611,8 +611,8 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
|
|
||||||
Integer roleId=100;
|
Integer roleId=100;
|
||||||
//添加用户表
|
//添加用户表
|
||||||
int count=userMapper.registerDoctor(doctor);
|
int count=userMapper.insertUser(doctor);
|
||||||
Integer userId = doctor.getUserId();
|
Long userId = doctor.getUserId();
|
||||||
Doctor doctor1 = new Doctor();
|
Doctor doctor1 = new Doctor();
|
||||||
doctor1.setUserId(userId);
|
doctor1.setUserId(userId);
|
||||||
doctor1.setDepartmentId(doctor.getDepartmentId());
|
doctor1.setDepartmentId(doctor.getDepartmentId());
|
||||||
|
@ -637,9 +637,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @date: 2023/10/27 10:01
|
* @date: 2023/10/27 10:01
|
||||||
*/
|
*/
|
||||||
public void checkEmail(String email) {
|
public void checkEmail(String email) {
|
||||||
User user=userMapper.checkEmail(email);
|
SysUser sysUser = userMapper.checkEmailUnique(email);
|
||||||
System.out.println(user);
|
System.out.println(sysUser);
|
||||||
Assert.isNull(user,
|
Assert.isNull(sysUser,
|
||||||
StringUtils.format("邮箱{}存在",email));
|
StringUtils.format("邮箱{}存在",email));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,9 +656,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
public Boolean registerPatient(Patient patient) {
|
public Boolean registerPatient(Patient patient) {
|
||||||
Integer roleId=101;
|
Integer roleId=101;
|
||||||
//
|
//
|
||||||
patient.setStatus(1);
|
patient.setStatus("1");
|
||||||
int count=userMapper.registerPatient(patient);
|
int count=userMapper.registerPatient(patient);
|
||||||
Integer userId = patient.getUserId();
|
Long userId = patient.getUserId();
|
||||||
Patient patient1 = new Patient();
|
Patient patient1 = new Patient();
|
||||||
patient1.setUserId(userId);
|
patient1.setUserId(userId);
|
||||||
String inviteCode = RandomUtil.randomString("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 10);
|
String inviteCode = RandomUtil.randomString("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 10);
|
||||||
|
|
|
@ -157,9 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectDoctor" resultType="com.health.system.common.domain.Doctor">
|
<select id="selectDoctor" resultType="com.health.system.common.domain.Doctor">
|
||||||
select * from tb_doctor where doctor_id=#{userId}
|
select * from tb_doctor where doctor_id=#{userId}
|
||||||
</select>
|
</select>
|
||||||
<select id="checkEmail" resultType="com.health.system.common.domain.User">
|
|
||||||
select user_id,name,email,avatar,status from tb_user where email=#{email}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||||
|
|
Loading…
Reference in New Issue