|
@@ -18,11 +18,11 @@ import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -30,39 +30,31 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Long, ExtracurricularExercisesReply> implements ExtracurricularExercisesReplyService {
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ExtracurricularExercisesReplyDao extracurricularExercisesReplyDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ExtracurricularExercisesDao extracurricularExercisesDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysMessageService sysMessageService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private TeacherDao teacherDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentDao studentDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleDao courseScheduleDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SysMusicScoreDao sysMusicScoreDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentServeService studentServeService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupService musicGroupService;
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupDao classGroupDao;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExtracurricularExercisesService extracurricularExercisesService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseHomeworkService courseHomeworkService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentLessonTrainingDetailService studentLessonTrainingDetailService;
|
|
|
|
|
|
@Override
|
|
@@ -71,6 +63,32 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public List<StudentCourseHomework> findExtraExerciseStudents(StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query) {
|
|
|
+ Long extraExerciseId = query.getCourseScheduleId().longValue();
|
|
|
+ ExtracurricularExercises extracurricularExercises = extracurricularExercisesDao.get(extraExerciseId);
|
|
|
+ if(extracurricularExercises == null){
|
|
|
+ throw new BizException("课外训练不存在");
|
|
|
+ }
|
|
|
+ List<ExtraExerciseStudentsDto> extraExerciseStudents = extracurricularExercisesReplyDao.findExtraExerciseStudent(query);
|
|
|
+ List<StudentCourseHomework> studentCourseHomeworks=new ArrayList<>();
|
|
|
+ for (ExtraExerciseStudentsDto extraExerciseStudent : extraExerciseStudents) {
|
|
|
+ StudentCourseHomework studentCourseHomework= JSON.parseObject(JSON.toJSONString(extraExerciseStudent),StudentCourseHomework.class);
|
|
|
+ studentCourseHomework.setId(extraExerciseStudent.getId());
|
|
|
+ studentCourseHomework.setCourseHomeworkId(extraExerciseId);
|
|
|
+ studentCourseHomework.setCourseScheduleId(extraExerciseId);
|
|
|
+ studentCourseHomework.setUserId(extraExerciseStudent.getUserId());
|
|
|
+ studentCourseHomework.setUserName(extraExerciseStudent.getStudentName());
|
|
|
+ studentCourseHomework.setStatus(extraExerciseStudent.getStatus()==0?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
+ studentCourseHomework.setIsReplied(extraExerciseStudent.getIsReplied()==0?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
+ studentCourseHomework.setIsView(extraExerciseStudent.getIsView()==0?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
+ studentCourseHomework.setAvatar(extraExerciseStudent.getHeadUrl());
|
|
|
+ studentCourseHomework.setType(ELessonTrainingType.valueOf(extracurricularExercises.getGroupType()));
|
|
|
+ studentCourseHomeworks.add(studentCourseHomework);
|
|
|
+ }
|
|
|
+ return studentCourseHomeworks;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<StudentCourseHomework> findExtraExerciseStudents(Long extraExerciseId, String studentName) {
|
|
|
if(Objects.isNull(extraExerciseId)){
|
|
|
throw new BizException("请选择课外训练");
|