|  | @@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.dao.MusicGroupDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.StudentAttendance;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.StudentCourseHomework;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.Subject;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.ELessonTrainingType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.LessonExaminationQueryInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.StudentLessonExaminationQueryDto;
 | 
	
	
		
			
				|  | @@ -23,6 +24,7 @@ import org.springframework.validation.annotation.Validated;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import javax.annotation.Resource;
 | 
	
		
			
				|  |  | +import java.util.ArrayList;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  |  import java.util.Objects;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
	
		
			
				|  | @@ -46,6 +48,10 @@ public class SchoolStudentHomeworkController extends BaseController {
 | 
	
		
			
				|  |  |      private StudentAttendanceService studentAttendanceService;
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      private MusicGroupDao musicGroupDao;
 | 
	
		
			
				|  |  | +    @Resource
 | 
	
		
			
				|  |  | +    private SubjectService subjectService;
 | 
	
		
			
				|  |  | +    @Resource
 | 
	
		
			
				|  |  | +    private CourseHomeworkService courseHomeworkService;
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取教师有服务指标的课程列表")
 | 
	
		
			
				|  |  |      @PostMapping("/queryHomework")
 | 
	
		
			
				|  |  |      public HttpResponseResult<PageInfo<CourseHomeworkWrapper.CourseHomeworkList>>
 | 
	
	
		
			
				|  | @@ -85,6 +91,27 @@ public class SchoolStudentHomeworkController extends BaseController {
 | 
	
		
			
				|  |  |          return succeed(lessonExaminationService.queryPage(queryInfo));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "获取单个进度评测")
 | 
	
		
			
				|  |  | +    @GetMapping("getOneLessonExamination")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<LessonExaminationResultDto> queryPage(Long lessonExaminationId) {
 | 
	
		
			
				|  |  | +        LessonExaminationQueryInfo queryInfo = new LessonExaminationQueryInfo();
 | 
	
		
			
				|  |  | +        queryInfo.setLessonExaminationId(lessonExaminationId);
 | 
	
		
			
				|  |  | +        LessonExaminationResultDto resultDto = lessonExaminationService.queryPage(queryInfo).getRows().get(0);
 | 
	
		
			
				|  |  | +        return succeed(resultDto);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "获取进度评测学员列表")
 | 
	
		
			
				|  |  | +    @PostMapping("queryLessonExaminationPage")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<PageInfo<StudentLessonExaminationDto>> queryLessonExaminationPage(@RequestBody StudentLessonExaminationQueryInfo queryInfo) {
 | 
	
		
			
				|  |  | +        return succeed(studentLessonExaminationService.queryPage(queryInfo));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "获取学员评测详情列表")
 | 
	
		
			
				|  |  | +    @PostMapping("queryStudentLessonExaminationDetail")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<List<StudentLessonExaminationDetailDto>> queryStudentLessonExaminationDetail(@RequestBody StudentLessonExaminationQueryDto query) {
 | 
	
		
			
				|  |  | +        return succeed(studentLessonExaminationDetailService.queryAll(query));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @ApiOperation(value = "学员请假列表")
 | 
	
		
			
				|  |  |      @PostMapping("queryStudentLeave")
 | 
	
		
			
				|  |  |      public HttpResponseResult<PageInfo<CourseHomeworkWrapper.StudentLeaveResult>>
 | 
	
	
		
			
				|  | @@ -143,5 +170,57 @@ public class SchoolStudentHomeworkController extends BaseController {
 | 
	
		
			
				|  |  |              return succeed(studentCourseHomeworkService.findExtracurricularExercisesDetailPublicV2(courseScheduleId, userId, type));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "根据课程计划获取需要交作业的学生声部-公用")
 | 
	
		
			
				|  |  | +    @PostMapping("/findCourseStudentsSubjectPublic/v2")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<List<Subject>> findCourseStudentsSubjectPublicV2(@Validated @RequestBody StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query){
 | 
	
		
			
				|  |  | +        List<StudentCourseHomework> studentCourseHomeworkByCourseV2;
 | 
	
		
			
				|  |  | +        if(ELessonTrainingType.HOMEWORK.equals(query.getType())){
 | 
	
		
			
				|  |  | +            if (Objects.isNull(query.getCourseScheduleId())) {
 | 
	
		
			
				|  |  | +                throw new BizException("请指定课程");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            studentCourseHomeworkByCourseV2 = studentCourseHomeworkService.findStudentCourseHomeworkByCourseV2(
 | 
	
		
			
				|  |  | +                    query);
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +            studentCourseHomeworkByCourseV2 = studentCourseHomeworkService.findExtraExerciseStudentsV2(query);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (org.springframework.util.CollectionUtils.isEmpty(studentCourseHomeworkByCourseV2)) {
 | 
	
		
			
				|  |  | +            return succeed(new ArrayList<>());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // 获取声部
 | 
	
		
			
				|  |  | +        List<Integer> collect = studentCourseHomeworkByCourseV2.stream().map(StudentCourseHomework::getSubjectId).collect(
 | 
	
		
			
				|  |  | +                Collectors.toList());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return succeed(subjectService.findBySubjectByIdList(collect));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "获取作业详情")
 | 
	
		
			
				|  |  | +    @GetMapping(value = "/findCourseHomeworkDetail")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<CourseHomeworkWrapper.CourseHomeworkList> findCourseHomeworkDetail(Integer courseScheduleId){
 | 
	
		
			
				|  |  | +        return succeed(courseHomeworkService.findCourseHomeworkDetail(courseScheduleId));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "根据课程计划获取需要交作业的学生统计")
 | 
	
		
			
				|  |  | +    @PostMapping("/findCourseStudentsPublicSubject/v2")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<CourseHomeworkWrapper.StudentHomeworkRecordStat> findCourseStudentsPublicSubjectV2(@Validated @RequestBody StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query){
 | 
	
		
			
				|  |  | +        List<StudentCourseHomework> list;
 | 
	
		
			
				|  |  | +        if(ELessonTrainingType.HOMEWORK.equals(query.getType())){
 | 
	
		
			
				|  |  | +            if (Objects.isNull(query.getCourseScheduleId())) {
 | 
	
		
			
				|  |  | +                throw new BizException("请指定课程");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            list =  (studentCourseHomeworkService.findStudentCourseHomeworkByCourseV2(query));
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +            list =  (studentCourseHomeworkService.findExtraExerciseStudentsV2(query));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CourseHomeworkWrapper.StudentHomeworkRecordStat stat = new CourseHomeworkWrapper.StudentHomeworkRecordStat();
 | 
	
		
			
				|  |  | +        stat.setAllNum(list.size());
 | 
	
		
			
				|  |  | +        stat.setFinishNum((int) list.stream().filter(StudentCourseHomework::getFinishFlag).count());
 | 
	
		
			
				|  |  | +        stat.setUnFinishNum(stat.getAllNum()-stat.getFinishNum());
 | 
	
		
			
				|  |  | +        stat.setStudentCourseHomeworkList(list);
 | 
	
		
			
				|  |  | +        return succeed(stat);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 |