增加修改患者个人信息接口

master
冯凯 2023-10-29 10:13:59 +08:00
parent f5d177c552
commit 5fe549a27b
6 changed files with 112 additions and 6 deletions

View File

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

View File

@ -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("","修改失败");
}
}

View File

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

View File

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

View File

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

View File

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