修改user

master
冯凯 2023-10-27 14:24:52 +08:00
parent cae7ca04f8
commit 1de5f4aaa4
7 changed files with 39 additions and 16 deletions

View File

@ -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;
/* /*
*/ */

View File

@ -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;
/* /*
*/ */

View File

@ -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();
} }
} }

View File

@ -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();
// }
/** /**
* *
*/ */

View File

@ -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);
} }

View File

@ -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);

View File

@ -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">