update 课列内容

develop
hhb@hotmail.com 4 months ago
parent 4eb23c5208
commit c8089b9a99

@ -388,11 +388,11 @@ public class TeacherServiceImpl implements TeacherService {
do {
if(StringUtils.isNotEmpty(teacherDto.getGrade())) {
slice = lessonRecordRepository.findAllByGrade(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getGrade(),teacherDto.getSubjectId(),pageRequest);
slice = lessonRecordRepository.findAllByGrade(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getGrade(),teacherDto.getSubjectId(),teacherDto.getPeriodId(),pageRequest);
} else if(StringUtils.isNotEmpty(teacherDto.getTmdId())) {
slice = lessonRecordRepository.findAllByAcademicYearId(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getTmdId(),teacherDto.getSubjectId(),pageRequest);
slice = lessonRecordRepository.findAllByAcademicYearId(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getTmdId(),teacherDto.getSubjectId(),teacherDto.getPeriodId(),pageRequest);
} else {
slice = lessonRecordRepository.findAll(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getSubjectId(), pageRequest);
slice = lessonRecordRepository.findAll(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getSubjectId(),teacherDto.getPeriodId(), pageRequest);
}
List<LessonRecord> content = slice.getContent();
if (ObjectUtils.isEmpty(content)) {
@ -437,7 +437,7 @@ public class TeacherServiceImpl implements TeacherService {
long startTimestamp = startDatetime.toInstant(ZoneOffset.UTC).toEpochMilli();
long endTimestamp = endDatetime.toInstant(ZoneOffset.UTC).toEpochMilli();
List<LessonRecord> lessonRecords = lessonRecordRepository.getLessonsByConditions(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), startTimestamp, endTimestamp, teacherDto.getSubjectId(),teacherDto.getTmdId());
List<LessonRecord> lessonRecords = lessonRecordRepository.getLessonsByConditions(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), startTimestamp, endTimestamp, teacherDto.getSubjectId(),teacherDto.getTmdId(),teacherDto.getPeriodId());
int[] counts = {0, 0, 0, 0, 0};
String[] keys = {"cooperation", "internet", "task", "exam", "diffential"};
@ -746,7 +746,9 @@ public class TeacherServiceImpl implements TeacherService {
}
}
}
List<LessonRecord> lessonRecords = lessonRecordRepository.getLessonsByConditions(String.format(PK.PK_LESSON_RECORD, teacherDto.getCode()), teacherDto.getStartTime(), teacherDto.getEndTime(), teacherDto.getSubjectId(),teacherDto.getTmdId(),teacherDto.getPeriodId());
if(teacherDto.getTmdId() != null) {
List<SugVo> sugVos = sugVoList.stream().filter(sugVo -> sugVo.getHabook().equals(teacherDto.getTmdId())).collect(Collectors.toList());
LinkedHashMap<String,Object> mapTeach = new LinkedHashMap<>();
int[] scores = new int[5];
@ -767,6 +769,7 @@ public class TeacherServiceImpl implements TeacherService {
mapTeach.put("TAttendance",scores[3]);
//T(数据)互动次数
mapTeach.put("TInteraction",scores[4]);
mapTeach.put("Lessons",lessonRecords.size());
return mapTeach;
}else if(teacherDto.getGradeName() != null) {
@ -801,6 +804,7 @@ public class TeacherServiceImpl implements TeacherService {
mapTeach.put("TAttendance",scores[3]);
//T(数据)互动次数
mapTeach.put("TInteraction",scores[4]);
mapTeach.put("Lessons",lessonRecords.size());
return mapTeach;
}else {
@ -823,6 +827,7 @@ public class TeacherServiceImpl implements TeacherService {
mapTeach.put("TAttendance", scores[3]);
//T(数据)互动次数
mapTeach.put("TInteraction", scores[4]);
mapTeach.put("Lessons",lessonRecords.size());
return mapTeach;

@ -16,18 +16,21 @@ public interface LessonRecordRepository extends CosmosRepository<LessonRecord, S
"c.code = @code and " +
"(IS_NULL(@startTime) or c.startTime >= @startTime) and " +
"(IS_NULL(@endTime) or c.startTime <= @endTime) and "+
"c.status<>404 and "+
"c.periodId = @periodId and "+
"(IS_NULL(@subjectId) or c.subjectId = @subjectId) and"+
" c.tmdid = @tmdId")
List<LessonRecord> getLessonsByConditions(String code, Long startTime, Long endTime,String subjectId,String tmdId);
"(IS_NULL(@tmdId) or c.tmdId = @tmdId) ")
List<LessonRecord> getLessonsByConditions(String code, Long startTime, Long endTime,String subjectId,String tmdId,String periodId);
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and c.tmdid = @tmdId and " +
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and c.tmdid = @tmdId and c.periodId = @periodId and" +
"(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")
Slice<LessonRecord> findAllByAcademicYearId(String code, String tmdId,String subjectId,Pageable pageable);
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and array_contains(c.grade,@grade) and" +
Slice<LessonRecord> findAllByAcademicYearId(String code, String tmdId,String subjectId,String periodId,Pageable pageable);
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and array_contains(c.grade,@grade) and c.periodId = @periodId and" +
"(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")
Slice<LessonRecord> findAllByGrade(String code, String grade,String subjectId,Pageable pageable);
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and " +
Slice<LessonRecord> findAllByGrade(String code, String grade,String subjectId,String periodId,Pageable pageable);
@Query("select * from LessonRecord as c where c.code = @code and c.expire<=0 and c.status<>404 and c.periodId = @periodId and" +
"(IS_NULL(@subjectId) or c.subjectId = @subjectId) ")
Slice<LessonRecord> findAll(String code,String subjectId,Pageable pageable);
Slice<LessonRecord> findAll(String code,String subjectId,String periodId,Pageable pageable);
}

Loading…
Cancel
Save