|
@@ -3,24 +3,13 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
-import com.ym.mec.biz.dal.dto.CourseHomeworkStudentDetailDto;
|
|
|
-import com.ym.mec.biz.dal.dto.CourseHomeworkWrapper;
|
|
|
-import com.ym.mec.biz.dal.dto.EduHomeworkCardDto;
|
|
|
-import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
|
|
|
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentHomeworkRecordDto;
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.ExtraExercilseReplyQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentCourseHomeWorkQueryInfo;
|
|
|
-import com.ym.mec.biz.service.CourseHomeworkService;
|
|
|
-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.StudentServeService;
|
|
|
-import com.ym.mec.biz.service.SysConfigService;
|
|
|
-import com.ym.mec.biz.service.SysMessageService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
@@ -73,6 +62,9 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
@Autowired
|
|
|
private CourseHomeworkService courseHomeworkService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StudentLessonTrainingDetailService studentLessonTrainingDetailService;
|
|
|
+
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExtracurricularExercisesReply> getDAO() {
|
|
|
return extracurricularExercisesReplyDao;
|
|
@@ -90,6 +82,21 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
throw new BizException("课外训练不存在");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ // 设置乐团声部
|
|
|
+ Map<Integer, StudentSubjectDto> subjectDtoMap= new HashMap<>();
|
|
|
+ if (StringUtils.isNotBlank(extracurricularExercises.getMusicGroupId())) {
|
|
|
+
|
|
|
+ // 学生ID集合
|
|
|
+ Set<Integer> userIdList = extraExerciseStudents.stream()
|
|
|
+ .map(ExtracurricularExercisesReply::getUserId)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ // 设置声部
|
|
|
+ subjectDtoMap = studentLessonTrainingDetailService
|
|
|
+ .getStudentMusicGroupSubject(new ArrayList<>(userIdList), extracurricularExercises.getMusicGroupId());
|
|
|
+ }
|
|
|
+
|
|
|
List<StudentCourseHomework> studentCourseHomeworks=new ArrayList<>();
|
|
|
for (ExtraExerciseStudentsDto extraExerciseStudent : extraExerciseStudents) {
|
|
|
StudentCourseHomework studentCourseHomework= JSON.parseObject(JSON.toJSONString(extraExerciseStudent),StudentCourseHomework.class);
|
|
@@ -103,8 +110,17 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
studentCourseHomework.setIsView(extraExerciseStudent.getIsView()==0?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
studentCourseHomework.setAvatar(extraExerciseStudent.getHeadUrl());
|
|
|
studentCourseHomework.setType(ELessonTrainingType.valueOf(extracurricularExercises.getGroupType()));
|
|
|
- studentCourseHomeworks.add(studentCourseHomework);
|
|
|
+
|
|
|
+ StudentSubjectDto studentSubjectDto = subjectDtoMap.get(extraExerciseStudent.getUserId());
|
|
|
+ if (studentSubjectDto != null) {
|
|
|
+ studentCourseHomework.setSubjectId(studentSubjectDto.getSubjectId());
|
|
|
+ studentCourseHomework.setSubjectName(studentSubjectDto.getSubjectName());
|
|
|
+ }
|
|
|
+
|
|
|
+ studentCourseHomeworks.add(studentCourseHomework);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
return studentCourseHomeworks;
|
|
|
}
|
|
|
|