增加修改患者个人信息接口
parent
f5d177c552
commit
5fe549a27b
|
@ -0,0 +1,39 @@
|
|||
package com.health.system.common.domain.request;
|
||||
import com.health.system.common.domain.SysUser;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 冯凯
|
||||
* @version 1.0
|
||||
* @description: 个人信息设置实体类
|
||||
* @date 2023/10/29 9:37
|
||||
*/
|
||||
@Data
|
||||
public class SefInformationReq extends SysUser {
|
||||
|
||||
/*
|
||||
体重
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/*
|
||||
身高
|
||||
*/
|
||||
private Integer height;
|
||||
|
||||
/*
|
||||
性别
|
||||
*/
|
||||
private Integer gender;
|
||||
|
||||
/*
|
||||
年龄
|
||||
*/
|
||||
private Integer age;
|
||||
|
||||
/*
|
||||
绑定微信号
|
||||
*/
|
||||
private String weChat;
|
||||
|
||||
}
|
|
@ -14,6 +14,7 @@ import com.health.common.security.annotation.RequiresPermissions;
|
|||
import com.health.common.security.utils.SecurityUtils;
|
||||
import com.health.system.common.domain.*;
|
||||
import com.health.system.common.domain.model.LoginUser;
|
||||
import com.health.system.common.domain.request.SefInformationReq;
|
||||
import com.health.system.server.service.*;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -421,4 +422,19 @@ public class SysUserController extends BaseController
|
|||
{
|
||||
return success(deptService.selectDeptTreeList(dept));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description:更改患者个人信息
|
||||
* @param: * @param null
|
||||
* @return: null
|
||||
* @author 冯凯
|
||||
* @date: 2023/10/29 9:33
|
||||
*/
|
||||
|
||||
@PostMapping("/updSelfInformation")
|
||||
public Result updSelfInformation(@RequestBody SefInformationReq sefInformationReq){
|
||||
Boolean flag=userService.updSelfInformation(sefInformationReq);
|
||||
return flag==true?Result.success("","修改成功"):Result.error("","修改失败");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.health.system.server.mapper;
|
|||
|
||||
import com.health.common.core.user.CommonBody;
|
||||
import com.health.system.common.domain.*;
|
||||
import com.health.system.common.domain.request.SefInformationReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -187,10 +188,21 @@ public interface SysUserMapper {
|
|||
Doctor selectDoctor(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* @description: 核对邮箱是否已经注册过
|
||||
* @param: * @param email
|
||||
* @return: void
|
||||
* @description: 修改个人信息
|
||||
* @param: * @param sefInformationReq
|
||||
* @return: int
|
||||
* @author 冯凯
|
||||
* @date: 2023/10/27 10:01
|
||||
* @date: 2023/10/29 10:01
|
||||
*/
|
||||
int updSelfInformation(SefInformationReq sefInformationReq);
|
||||
|
||||
/**
|
||||
* @description: 修改个人形象照
|
||||
* @param: * @param avatar
|
||||
* @return: Boolean
|
||||
* @author 冯凯
|
||||
* @date: 2023/10/29 10:01
|
||||
*/
|
||||
Boolean updSelfAvatar(String avatar);
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import com.health.common.core.domain.Result;
|
||||
import com.health.common.core.user.CommonBody;
|
||||
import com.health.system.common.domain.*;
|
||||
import com.health.system.common.domain.request.SefInformationReq;
|
||||
|
||||
/**
|
||||
* 用户 业务层
|
||||
|
@ -231,4 +232,13 @@ public interface ISysUserService
|
|||
Doctor selectDoctor(Long userId);
|
||||
|
||||
void checkEmail(String email);
|
||||
|
||||
/**
|
||||
* @description:更改患者个人信息
|
||||
* @param: * @param null
|
||||
* @return: null
|
||||
* @author 冯凯
|
||||
* @date: 2023/10/29 9:33
|
||||
*/
|
||||
Boolean updSelfInformation(SefInformationReq sefInformationReq);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.health.common.core.utils.bean.BeanValidators;
|
|||
import com.health.common.datascope.annotation.DataScope;
|
||||
import com.health.common.security.utils.SecurityUtils;
|
||||
import com.health.system.common.domain.*;
|
||||
import com.health.system.common.domain.request.SefInformationReq;
|
||||
import com.health.system.server.mapper.*;
|
||||
import com.health.system.server.service.ISysConfigService;
|
||||
import com.health.system.server.service.ISysUserService;
|
||||
|
@ -649,6 +650,20 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
StringUtils.format("邮箱{}存在",email));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:更改个人信息
|
||||
* @param: * @param null
|
||||
* @return: null
|
||||
* @author 冯凯
|
||||
* @date: 2023/10/29 9:33
|
||||
*/
|
||||
@Override
|
||||
public Boolean updSelfInformation(SefInformationReq sefInformationReq) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
sefInformationReq.setUserId(userId);
|
||||
return userMapper.updSelfInformation(sefInformationReq)>0;
|
||||
}
|
||||
|
||||
//---------------注册医生---------------------------
|
||||
/**
|
||||
* @description: 医生注册
|
||||
|
|
|
@ -316,7 +316,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
<update id="updateUser" parameterType="com.health.system.common.domain.SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
|
@ -351,8 +351,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updPasswordByEmail">
|
||||
update tb_user set password=#{password} where email=#{email}
|
||||
</update>
|
||||
<update id="updSelfInformation">
|
||||
update tb_patient
|
||||
<set>
|
||||
<if test="gender != null and gender != 0">gender=#{gender},</if>
|
||||
<if test="weight != null ">weight=#{weight},</if>
|
||||
<if test="height != null">height=#{height},</if>
|
||||
<if test="age != null ">age=#{age},</if>
|
||||
<if test="weChat != null and weChat != 0">weChat=#{weChat},</if>
|
||||
</set>
|
||||
where patient_id=#{userId}
|
||||
</update>
|
||||
<update id="updSelfAvatar">
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
update sys_user set del_flag = '2' where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
|
|
Loading…
Reference in New Issue