|
|
@ -17,10 +17,12 @@ import cn.teammodel.utils.GroupUtil;
|
|
|
|
import cn.teammodel.utils.SchoolDateUtil;
|
|
|
|
import cn.teammodel.utils.SchoolDateUtil;
|
|
|
|
import com.azure.spring.data.cosmos.core.query.CosmosPageRequest;
|
|
|
|
import com.azure.spring.data.cosmos.core.query.CosmosPageRequest;
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
import org.springframework.data.domain.Slice;
|
|
|
|
import org.springframework.data.domain.Slice;
|
|
|
|
|
|
|
|
import org.springframework.data.domain.SliceImpl;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
@ -136,7 +138,13 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
Map<Long, Integer> countByWeek = SchoolDateUtil.createEmptyWeekMap(totalWeek);
|
|
|
|
Map<Long, Integer> countByWeek = SchoolDateUtil.createEmptyWeekMap(totalWeek);
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(teacherDto.getGrade())) {
|
|
|
|
|
|
|
|
slice = lessonRecordRepository.findAllByGrade(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getGrade(),pageRequest);
|
|
|
|
|
|
|
|
} else if(StringUtils.isNotEmpty(teacherDto.getTmdId())) {
|
|
|
|
slice = lessonRecordRepository.findAllByAcademicYearId(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getTmdId(),pageRequest);
|
|
|
|
slice = lessonRecordRepository.findAllByAcademicYearId(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getTmdId(),pageRequest);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
slice = lessonRecordRepository.findAll(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), pageRequest);
|
|
|
|
|
|
|
|
}
|
|
|
|
List<LessonRecord> content = slice.getContent();
|
|
|
|
List<LessonRecord> content = slice.getContent();
|
|
|
|
if (ObjectUtils.isEmpty(content)) {
|
|
|
|
if (ObjectUtils.isEmpty(content)) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|