Browse Source

管乐迷评测记录详情

zouxuan 1 năm trước cách đây
mục cha
commit
b1ec44e721

+ 52 - 0
mec-application/src/main/java/com/ym/mec/web/controller/education/EduCooperationOrganController.java

@@ -0,0 +1,52 @@
+package com.ym.mec.web.controller.education;
+
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.page.CooperationOrganQueryInfo;
+import com.ym.mec.biz.service.CooperationOrganService;
+import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@RequestMapping("${app-config.url.web:}/eduCooperationOrgan")
+@Api(tags = "合作单位(教学点)服务")
+@RestController
+public class EduCooperationOrganController extends BaseController {
+
+    @Resource
+    private CooperationOrganService cooperationOrganService;
+    @Resource
+    private OrganizationService organizationService;
+
+    @ApiOperation(value = "分页查询合作单位(教学点)列表")
+    @GetMapping("/queryPage")
+    public HttpResponseResult<PageInfo<CooperationOrgan>> queryPage(CooperationOrganQueryInfo queryInfo) {
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        return succeed(cooperationOrganService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "根据分部获取合作单位(教学点)列表")
+    @GetMapping("/queryByOrganId")
+    public HttpResponseResult<List<CooperationOrgan>> queryByOrganId(String organId, Boolean enable) {
+        return succeed(cooperationOrganService.queryByOrganId(organId,enable));
+    }
+
+    @ApiOperation(value = "合作单位的乐团")
+    @GetMapping("/musicGroupPage")
+    public HttpResponseResult<List<MusicGroup>> musicGroupPage(@RequestHeader Integer coopId) {
+        if (coopId == null) {
+            return succeed();
+        }
+        return succeed(cooperationOrganService.musicGroupPage(coopId));
+    }
+}

+ 79 - 0
mec-application/src/main/java/com/ym/mec/web/controller/school/SchoolStudentHomeworkController.java

@@ -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);
+    }
 }