|
@@ -53,6 +53,7 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
|
|
|
bindUser.setPatientId(patient.getId());
|
|
|
bindUser.setUserId(AppUtil.getUser().getId());
|
|
|
bindUser.setPatientName(patient.getName());
|
|
|
+ bindUser.setRelationship(dto.getRelationship());
|
|
|
if (bindUserMapper.selectBindUser(bindUser) != null) {
|
|
|
return AjaxResult.error("你已绑定过该就诊人");
|
|
|
}
|
|
@@ -63,8 +64,9 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
|
|
|
User user = AppUtil.getUser();
|
|
|
user.setPatientId(patient.getId());
|
|
|
user.setPatientName(patient.getName());
|
|
|
+ user.setRelationship(dto.getRelationship());
|
|
|
if (!userService.updateById(user)) {
|
|
|
- throw new ServerException("绑定就诊人失败");
|
|
|
+ throw new ServerException("缓存信息过期,绑定就诊人失败,请重新登录再试");
|
|
|
}
|
|
|
tokenService.setLoginUser(user);
|
|
|
}
|
|
@@ -87,6 +89,7 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
|
|
|
if (bindUser.getPatientId().equals(AppUtil.getUser().getPatientId())) {
|
|
|
User user = AppUtil.getUser();
|
|
|
user.setPatientName("");
|
|
|
+ user.setRelationship("");
|
|
|
user.setPatientId(0l);
|
|
|
userService.updateById(user);
|
|
|
tokenService.setLoginUser(user);
|
|
@@ -107,6 +110,7 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
|
|
|
User user = AppUtil.getUser();
|
|
|
user.setPatientId(bindUser.getPatientId());
|
|
|
user.setPatientName(bindUser.getPatientName());
|
|
|
+ user.setRelationship(bindUser.getRelationship());
|
|
|
if (!userService.updateById(user)) {
|
|
|
throw new ServerException("切换就诊人失败");
|
|
|
}
|