diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java index ca4795d..5605840 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java @@ -119,7 +119,8 @@ public class ExpertManage { // 增加用户专家角色 Role expertRole = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name())); - UserRole expertUserRole = iUserRoleService.getOne(Wrappers.lambdaQuery(UserRole.class).eq(UserRole::getRoleId, expertRole.getId())); + UserRole expertUserRole = iUserRoleService.getOne(Wrappers.lambdaQuery(UserRole.class) + .eq(UserRole::getRoleId, expertRole.getId()).eq(UserRole::getUserId,userId)); if (Objects.isNull(expertUserRole)) { expertUserRole = new UserRole(); expertUserRole.setUserId(userId);