|
@@ -374,8 +374,16 @@ public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> impleme
|
|
|
QueryWrapper<UserRole> userRoleQuery = new QueryWrapper<>();
|
|
|
userRoleQuery.eq("user_role_type", 1);
|
|
|
userRoleQuery.eq("mobile", enPhone);
|
|
|
- if (userRoleService.getOne(userRoleQuery) == null)
|
|
|
+ UserRole userRole = userRoleService.getOne(userRoleQuery);
|
|
|
+ if (userRole == null)
|
|
|
userRoleService.addUserRole(userAccount, enPhone, userAccount.getNickname(), userAccount.getHeadimg(), doctorList.get(0).getId(), 1, 1);
|
|
|
+ else{
|
|
|
+// QueryWrapper<UserAccount> userAccQuery = new QueryWrapper<>();
|
|
|
+// userAccQuery.eq("mobile", enPhone);
|
|
|
+// UserAccount userAccount1 = userAccountMapper.selectOne(userAccQuery);
|
|
|
+ userRole.setAccountId(userAccount.getId());
|
|
|
+ userRoleService.updateById(userRole);
|
|
|
+ }
|
|
|
if(doctorList.get(0).getCheckStatus()!=null && doctorList.get(0).getCheckStatus().equals(2)){
|
|
|
Cookie cookie=new Cookie("redirectCode","personalInfo");
|
|
|
cookie.setPath("/");
|