From b794c777bb5605ba3a8364447c06dcac931f2a12 Mon Sep 17 00:00:00 2001 From: heminjian502 Date: Wed, 17 Aug 2022 21:40:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=BE=AE=E4=BF=A1=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/system/service/impl/WechatServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java index aa9836a..095e50f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java @@ -100,7 +100,7 @@ public class WechatServiceImpl implements IWechatService { } else { // 已绑定信息 直接登录 resp.setBindFlag(true); - TDoctor tDoctor = tDoctorMapper.selectTDoctorById(wechatUser.getId()); + TDoctor tDoctor = tDoctorMapper.selectTDoctorById(wechatUser.getUserId()); String token = buildTokenByDoctor(tDoctor); resp.setToken(token); } @@ -148,14 +148,14 @@ public class WechatServiceImpl implements IWechatService { TDoctor currentDoctor = tDoctorMapper.selectTDoctorByPhone(req.getPhone()); TWechatUser wechatUser = new TWechatUser(); if (Objects.nonNull(currentDoctor)) { - // 存在 需要把患者信息更新 并绑定openid - BeanUtils.copyProperties(req, currentDoctor); - currentDoctor.setDelFlag("0"); - tDoctorMapper.updateTDoctor(currentDoctor); TWechatUser queryUser = tWechatUserMapper.selectWechatUserByUserId(currentDoctor.getId()); if (Objects.nonNull(queryUser)) { throw new ServiceException("该手机号已绑定其他微信账号!"); } + // 存在 需要把患者信息更新 并绑定openid + BeanUtils.copyProperties(req, currentDoctor); + currentDoctor.setDelFlag("0"); + tDoctorMapper.updateTDoctor(currentDoctor); wechatUser.setUserId(currentDoctor.getId()); tDoctor.setId(currentDoctor.getId()); } else {