|
@@ -26,8 +26,9 @@ import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.enums.ELessonTrainingType;
|
|
import com.ym.mec.biz.dal.enums.ELessonTrainingType;
|
|
import com.ym.mec.biz.dal.enums.StandardEnum;
|
|
import com.ym.mec.biz.dal.enums.StandardEnum;
|
|
import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
|
|
import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
|
|
|
|
+import com.ym.mec.biz.service.ExtracurricularExercisesService;
|
|
import com.ym.mec.biz.service.MusicGroupService;
|
|
import com.ym.mec.biz.service.MusicGroupService;
|
|
-import com.ym.mec.biz.service.StudentService;
|
|
|
|
|
|
+import com.ym.mec.biz.service.StudentLessonTrainingDetailService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
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;
|
|
@@ -122,6 +123,12 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupService musicGroupService;
|
|
private MusicGroupService musicGroupService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExtracurricularExercisesService extracurricularExercisesService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private StudentLessonTrainingDetailService studentLessonTrainingDetailService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public BaseDAO<Long, StudentCourseHomework> getDAO() {
|
|
public BaseDAO<Long, StudentCourseHomework> getDAO() {
|
|
return studentCourseHomeworkDao;
|
|
return studentCourseHomeworkDao;
|
|
@@ -743,8 +750,7 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<StudentCourseHomework> findStudentCourseHomeworkByCourseV2(StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query) {
|
|
public List<StudentCourseHomework> findStudentCourseHomeworkByCourseV2(StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query) {
|
|
- List<StudentCourseHomework> studentCourseHomeworkByCourse = findStudentCourseHomeworkByCourse(
|
|
|
|
- query.getCourseScheduleId().longValue(), null, null);
|
|
|
|
|
|
+ List<StudentCourseHomework> studentCourseHomeworkByCourse = studentCourseHomeworkDao.findStudentCourseHomeworkByCourse(query);
|
|
for (StudentCourseHomework studentCourseHomework : studentCourseHomeworkByCourse) {
|
|
for (StudentCourseHomework studentCourseHomework : studentCourseHomeworkByCourse) {
|
|
studentCourseHomework.setType(ELessonTrainingType.HOMEWORK);
|
|
studentCourseHomework.setType(ELessonTrainingType.HOMEWORK);
|
|
}
|
|
}
|
|
@@ -804,6 +810,9 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
|
|
|
// 设置完成状态
|
|
// 设置完成状态
|
|
for (StudentCourseHomework studentCourseHomework : studentCourseHomeworkByCourse) {
|
|
for (StudentCourseHomework studentCourseHomework : studentCourseHomeworkByCourse) {
|
|
|
|
+ if (studentCourseHomework.getStandardFlag() == null) {
|
|
|
|
+ studentCourseHomework.setFinishFlag(false);
|
|
|
|
+ } else
|
|
if( studentCourseHomework.getStandardFlag().equals(StandardEnum.STANDARD) || studentCourseHomework.getStandardFlag().equals(StandardEnum.EXCELLENT)) {
|
|
if( studentCourseHomework.getStandardFlag().equals(StandardEnum.STANDARD) || studentCourseHomework.getStandardFlag().equals(StandardEnum.EXCELLENT)) {
|
|
studentCourseHomework.setFinishFlag(true);
|
|
studentCourseHomework.setFinishFlag(true);
|
|
} else {
|
|
} else {
|
|
@@ -839,6 +848,11 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
public List<StudentCourseHomework> findExtraExerciseStudentsV2(StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query) {
|
|
public List<StudentCourseHomework> findExtraExerciseStudentsV2(StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query) {
|
|
List<StudentCourseHomework> extraExerciseStudents = extracurricularExercisesReplyService.findExtraExerciseStudents(
|
|
List<StudentCourseHomework> extraExerciseStudents = extracurricularExercisesReplyService.findExtraExerciseStudents(
|
|
query.getCourseScheduleId().longValue(), null);
|
|
query.getCourseScheduleId().longValue(), null);
|
|
|
|
+ if (query.getSubjectId() != null) {
|
|
|
|
+ extraExerciseStudents = extraExerciseStudents.stream()
|
|
|
|
+ .filter(o -> o.getSubjectId().equals(query.getSubjectId()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ }
|
|
for (StudentCourseHomework studentCourseHomework : extraExerciseStudents) {
|
|
for (StudentCourseHomework studentCourseHomework : extraExerciseStudents) {
|
|
studentCourseHomework.setType(ELessonTrainingType.EXTRACURRICULAR);
|
|
studentCourseHomework.setType(ELessonTrainingType.EXTRACURRICULAR);
|
|
}
|
|
}
|
|
@@ -849,10 +863,34 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
* 学生端查看练习详情
|
|
* 学生端查看练习详情
|
|
*
|
|
*
|
|
* @param query
|
|
* @param query
|
|
|
|
+ * @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public CourseHomeworkWrapper.StudentCourseHomeworkDetail findStudentHomeworkRecordDetail(CourseHomeworkWrapper.StudentCourseHomeworkQuery query) {
|
|
|
|
- return null;
|
|
|
|
|
|
+ public CourseHomeworkWrapper.CourseHomeworkList findStudentHomeworkRecordDetail(CourseHomeworkWrapper.StudentCourseHomeworkQuery query) {
|
|
|
|
+ CourseHomeworkWrapper.CourseHomeworkList courseHomeworkDetail = null;
|
|
|
|
+ if (ELessonTrainingType.HOMEWORK.equals(query)) {
|
|
|
|
+ courseHomeworkDetail= courseHomeworkService.findCourseHomeworkDetail(
|
|
|
|
+ query.getCourseScheduleId());
|
|
|
|
+ } else {
|
|
|
|
+ courseHomeworkDetail = courseHomeworkService.findCourseExtraHomeworkDetail(query.getCourseScheduleId());
|
|
|
|
+ }
|
|
|
|
+ if (courseHomeworkDetail == null) {
|
|
|
|
+ throw new BizException("作业不存在");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail> detailList = studentLessonTrainingDetailService.getBaseLessonTrainingDetail(
|
|
|
|
+ courseHomeworkDetail.getCourseHomeworkId(), query.getType(), query.getUserId());
|
|
|
|
+
|
|
|
|
+ long count = detailList.stream().filter(o -> o.getTrainingTimes() < o.getTimes()).count();
|
|
|
|
+ if (count >0) {
|
|
|
|
+ courseHomeworkDetail.setFinishStatus(false);
|
|
|
|
+ } else {
|
|
|
|
+ courseHomeworkDetail.setFinishStatus(true);
|
|
|
|
+ }
|
|
|
|
+ courseHomeworkDetail.setTrainingDetailList(detailList);
|
|
|
|
+
|
|
|
|
+ return courseHomeworkDetail;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -886,6 +924,9 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
studentLessonTraining.setStandardFlag(courseHomeworkStudentDetail.getStandardFlag());
|
|
studentLessonTraining.setStandardFlag(courseHomeworkStudentDetail.getStandardFlag());
|
|
|
|
|
|
// 作业完成情况
|
|
// 作业完成情况
|
|
|
|
+ if (courseHomeworkStudentDetail.getStandardFlag() == null) {
|
|
|
|
+ studentLessonTraining.setFinishFlag(false);
|
|
|
|
+ } else
|
|
if( courseHomeworkStudentDetail.getStandardFlag().equals(StandardEnum.STANDARD) || courseHomeworkStudentDetail.getStandardFlag().equals(StandardEnum.EXCELLENT)) {
|
|
if( courseHomeworkStudentDetail.getStandardFlag().equals(StandardEnum.STANDARD) || courseHomeworkStudentDetail.getStandardFlag().equals(StandardEnum.EXCELLENT)) {
|
|
studentLessonTraining.setFinishFlag(true);
|
|
studentLessonTraining.setFinishFlag(true);
|
|
} else {
|
|
} else {
|
|
@@ -903,13 +944,33 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public StudentLessonTrainingDetailWrapper.StudentLessonTraining findExtracurricularExercisesDetailPublicV2(Long courseScheduleId, Long userId, ELessonTrainingType type) {
|
|
public StudentLessonTrainingDetailWrapper.StudentLessonTraining findExtracurricularExercisesDetailPublicV2(Long courseScheduleId, Long userId, ELessonTrainingType type) {
|
|
- StudentLessonTrainingDetailWrapper.StudentLessonTraining userInfo = getUserInfo(userId);
|
|
|
|
|
|
+ StudentLessonTrainingDetailWrapper.StudentLessonTraining studentLessonTraining = getUserInfo(userId);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 作业信息
|
|
|
|
+ ExtracurricularExercisesReply exercisesReply = extracurricularExercisesReplyDao.getByExtraIdAndUserId(
|
|
|
|
+ courseScheduleId, userId);
|
|
|
|
+ if (exercisesReply == null) {
|
|
|
|
+ throw new BizException("作业不存在");
|
|
|
|
+ }
|
|
|
|
+ studentLessonTraining.setStandardFlag(exercisesReply.getStandardFlag());
|
|
|
|
+
|
|
|
|
+ // 作业完成情况
|
|
|
|
+ if (exercisesReply.getStandardFlag() == null) {
|
|
|
|
+ studentLessonTraining.setFinishFlag(false);
|
|
|
|
+ } else if( exercisesReply.getStandardFlag().equals(StandardEnum.STANDARD) || exercisesReply.getStandardFlag().equals(StandardEnum.EXCELLENT)) {
|
|
|
|
+ studentLessonTraining.setFinishFlag(true);
|
|
|
|
+ } else {
|
|
|
|
+ studentLessonTraining.setFinishFlag(false);
|
|
|
|
+ }
|
|
|
|
|
|
- // extracurricularExercisesReplyDao.findExtraExerciseStudentDetail(courseScheduleId, userId);
|
|
|
|
|
|
+ // 练习内容
|
|
|
|
+ List<StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail> studentLessonTrainingDetails = studentCourseHomeworkDao
|
|
|
|
+ .findByStudentIdsAndCourseScheduleId(Collections.singletonList(userId.intValue()), exercisesReply.getExtracurricularExercisesId(),type);
|
|
|
|
|
|
- // 作业完成情况 TODO
|
|
|
|
|
|
+ studentLessonTraining.setStudentLessonTrainingDetail(studentLessonTrainingDetails);
|
|
|
|
+ return studentLessonTraining;
|
|
|
|
|
|
- return userInfo;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@NotNull
|
|
@NotNull
|