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