小程序手机号与openid解绑代码修改
This commit is contained in:
parent
25bec878d1
commit
f49f838ba0
@ -78,4 +78,11 @@ public interface ResidentInfoMapper {
|
|||||||
* @return 居民基本信息
|
* @return 居民基本信息
|
||||||
*/
|
*/
|
||||||
List<ResidentInfo> getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName);
|
List<ResidentInfo> getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户openid
|
||||||
|
* @param residentInfo 用户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateResidentInfoOpenid(ResidentInfo residentInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -173,6 +173,10 @@
|
|||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateResidentInfoOpenid" parameterType="com.xinelu.manage.domain.residentinfo.ResidentInfo">
|
||||||
|
UPDATE resident_info SET open_id = #{openId} WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteResidentInfoById" parameterType="Long">
|
<delete id="deleteResidentInfoById" parameterType="Long">
|
||||||
delete from resident_info where id = #{id}
|
delete from resident_info where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|||||||
@ -279,6 +279,7 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService
|
|||||||
// 更新用户的openid
|
// 更新用户的openid
|
||||||
ResidentInfo residentInfo = residentInfos.get(0);
|
ResidentInfo residentInfo = residentInfos.get(0);
|
||||||
residentInfo.setOpenId(openId);
|
residentInfo.setOpenId(openId);
|
||||||
|
residentInfo.setUpdateTime(LocalDateTime.now());
|
||||||
residentInfoMapper.updateResidentInfo(residentInfo);
|
residentInfoMapper.updateResidentInfo(residentInfo);
|
||||||
log.info("用户注册成功,姓名:{},手机号:{},openid:{}", verifySmsCodeDTO.getPatientName(), verifySmsCodeDTO.getPhoneNum(), openId);
|
log.info("用户注册成功,姓名:{},手机号:{},openid:{}", verifySmsCodeDTO.getPatientName(), verifySmsCodeDTO.getPhoneNum(), openId);
|
||||||
return AjaxResult.success("注册成功!", residentInfo);
|
return AjaxResult.success("注册成功!", residentInfo);
|
||||||
@ -310,7 +311,8 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService
|
|||||||
|
|
||||||
// 清空openid字段,更新用户信息
|
// 清空openid字段,更新用户信息
|
||||||
residentInfo.setOpenId(null);
|
residentInfo.setOpenId(null);
|
||||||
residentInfoMapper.updateResidentInfo(residentInfo);
|
residentInfo.setUpdateTime(LocalDateTime.now());
|
||||||
|
residentInfoMapper.updateResidentInfoOpenid(residentInfo);
|
||||||
log.info("解绑成功,手机号:{},openId:{}", phoneNum, openId);
|
log.info("解绑成功,手机号:{},openId:{}", phoneNum, openId);
|
||||||
return AjaxResult.success("解绑成功!");
|
return AjaxResult.success("解绑成功!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user