|
|
|
@ -42,6 +42,8 @@ import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
|
|
import static com.teaching.backend.constant.RoleConstants.TEACHER_ROLE; |
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
|
@Slf4j |
|
|
|
|
public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> implements UmsUserService { |
|
|
|
@ -377,18 +379,17 @@ public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> impl |
|
|
|
|
} |
|
|
|
|
throw new UsernameNotFoundException("用户名或密码错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<TeacherInfVO> getTeacherInfList() { |
|
|
|
|
List<UmsTeacher> umsTeachers = umsTeacherMapper.selectList(new LambdaQueryWrapper<UmsTeacher>()); |
|
|
|
|
List<UmsUser> umsUserTeachers = query().eq("role_id", TEACHER_ROLE).list(); |
|
|
|
|
TeacherInfVO teacherInfVO = null; |
|
|
|
|
List<TeacherInfVO> teacherInfList = new ArrayList<>();; |
|
|
|
|
for (UmsTeacher umsTeacher : umsTeachers) { |
|
|
|
|
List<TeacherInfVO> teacherInfList = new ArrayList<>(); |
|
|
|
|
for (UmsUser umsUserTeacher : umsUserTeachers) { |
|
|
|
|
teacherInfVO = new TeacherInfVO(); |
|
|
|
|
UmsUser umsUser = umsUserMapper.selectOne(new LambdaQueryWrapper<UmsUser>() |
|
|
|
|
.eq(UmsUser::getId, umsTeacher.getUserId())); |
|
|
|
|
teacherInfVO.setName(umsTeacher.getName()); |
|
|
|
|
teacherInfVO.setUsername(umsUser.getUsername()); |
|
|
|
|
String teacherName = umsTeacherMapper.selectOne(new LambdaQueryWrapper<>(UmsTeacher.class) |
|
|
|
|
.eq(UmsTeacher::getUserId, umsUserTeacher.getId())).getName(); |
|
|
|
|
teacherInfVO.setName(teacherName); |
|
|
|
|
teacherInfVO.setUserId(umsUserTeacher.getId()); |
|
|
|
|
teacherInfList.add(teacherInfVO); |
|
|
|
|
} |
|
|
|
|
return teacherInfList; |
|
|
|
|