Parcourir la source

学校端支持查看学员练习情况

zouxuan il y a 1 an
Parent
commit
b4689f305f

+ 2 - 1
mec-application/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -435,7 +435,8 @@ public class ClassGroupController extends BaseController {
 
     @ApiOperation(value = "学校端-场地管理列表")
     @PostMapping("/teachingPointCourse")
-    public HttpResponseResult<PageInfo<TeachingPointWrapper.CourseTeachingPoint>> teachingPoint(@RequestBody TeachingPointWrapper.TeachingPointQuery queryInfo,@RequestHeader Integer coopId) {
+    public HttpResponseResult<PageInfo<TeachingPointWrapper.CourseTeachingPoint>>
+    teachingPoint(@RequestBody TeachingPointWrapper.TeachingPointQuery queryInfo,@RequestHeader Integer coopId) {
         if (coopId == null) {
             return succeed(new PageInfo<>());
         }

+ 50 - 8
mec-application/src/main/java/com/ym/mec/web/controller/school/SchoolStudentHomeworkController.java

@@ -1,22 +1,21 @@
 package com.ym.mec.web.controller.school;
 
 
-import com.ym.mec.biz.dal.dto.StudentLessonExaminationDetailDto;
-import com.ym.mec.biz.dal.dto.StudentLessonExaminationDto;
-import com.ym.mec.biz.dal.dto.StudentLessonTrainingDetailWrapper;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.StudentCourseHomework;
 import com.ym.mec.biz.dal.enums.ELessonTrainingType;
+import com.ym.mec.biz.dal.page.LessonExaminationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentLessonExaminationQueryDto;
 import com.ym.mec.biz.dal.page.StudentLessonExaminationQueryInfo;
-import com.ym.mec.biz.service.StudentCourseHomeworkService;
-import com.ym.mec.biz.service.StudentLessonExaminationDetailService;
-import com.ym.mec.biz.service.StudentLessonExaminationService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -34,9 +33,52 @@ public class SchoolStudentHomeworkController extends BaseController {
     private StudentLessonExaminationService studentLessonExaminationService;
     @Resource
     private StudentLessonExaminationDetailService studentLessonExaminationDetailService;
-
-    @Autowired
+    @Resource
     private StudentCourseHomeworkService studentCourseHomeworkService;
+    @Resource
+    private StudentExtracurricularExercisesSituationService studentExtracurricularExercisesSituationService;
+    @Resource
+    private LessonExaminationService lessonExaminationService;
+    @Resource
+    private MusicGroupDao musicGroupDao;
+    @ApiOperation(value = "获取教师有服务指标的课程列表")
+    @PostMapping("/queryHomework")
+    public HttpResponseResult<PageInfo<CourseHomeworkWrapper.CourseHomeworkList>>
+    queryHomework(@RequestBody CourseHomeworkWrapper.CourseHomeworkQuery queryInfo,@RequestHeader Integer coopId) {
+        //获取合作单位关联的所有乐团列表
+        List<String> musicGroupIds = musicGroupDao.findNormalByCooperationId(coopId);
+        if (CollectionUtils.isEmpty(musicGroupIds)) {
+            return succeed(new PageInfo<>());
+        }
+        queryInfo.setMusicGroupIds(musicGroupIds);
+        return succeed(studentExtracurricularExercisesSituationService.queryTeacherServeHomeworkDetailV2(queryInfo));
+    }
+
+    @ApiOperation(value = "获取课外作业列表")
+    @PostMapping("/queryExtraHomework")
+    public HttpResponseResult<PageInfo<CourseHomeworkWrapper.CourseHomeworkList>>
+    queryExtraHomework(@RequestBody CourseHomeworkWrapper.CourseHomeworkQuery queryInfo,@RequestHeader Integer coopId) {
+        //获取合作单位关联的所有乐团列表
+        List<String> musicGroupIds = musicGroupDao.findNormalByCooperationId(coopId);
+        if (CollectionUtils.isEmpty(musicGroupIds)) {
+            return succeed(new PageInfo<>());
+        }
+        queryInfo.setMusicGroupIds(musicGroupIds);
+        return succeed(studentExtracurricularExercisesSituationService.queryTeacherExtraHomeworkDetailV2(queryInfo));
+    }
+
+    @ApiOperation(value = "获取进度评测列表")
+    @PostMapping("queryLessonExamination")
+    public HttpResponseResult<PageInfo<LessonExaminationResultDto>>
+    queryLessonExamination(@RequestBody LessonExaminationQueryInfo queryInfo, @RequestHeader Integer coopId) {
+        //获取合作单位关联的所有乐团列表
+        List<String> musicGroupIds = musicGroupDao.findNormalByCooperationId(coopId);
+        if (CollectionUtils.isEmpty(musicGroupIds)) {
+            return succeed(new PageInfo<>());
+        }
+        queryInfo.setMusicGroupIds(musicGroupIds);
+        return succeed(lessonExaminationService.queryPage(queryInfo));
+    }
 
     @ApiOperation(value = "获取课后评测学员列表")
     @PostMapping("queryLessonStudent")

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseHomeworkWrapper.java

@@ -50,6 +50,9 @@ public class CourseHomeworkWrapper {
         @ApiModelProperty(value = "乐团id")
         private String musicGroupId;
 
+        @ApiModelProperty(value = "乐团id")
+        private List<String> musicGroupIds;
+
         @ApiModelProperty(value = "班级类型  SINGLE:声部班,MIX:合奏班")
         private String classType;
 

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/LessonExaminationQueryInfo.java

@@ -4,6 +4,8 @@ import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class LessonExaminationQueryInfo extends QueryInfo {
 
@@ -13,6 +15,9 @@ public class LessonExaminationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "乐团编号")
     private String musicGroupId;
 
+    @ApiModelProperty(value = "乐团编号列表")
+    private List<String> musicGroupIds;
+
     @ApiModelProperty(value = "老师编号")
     private Integer teacherId;
 

+ 15 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/TeachingPointWrapper.java

@@ -24,6 +24,9 @@ public class TeachingPointWrapper {
         @ApiModelProperty("分页行数")
         private Integer rows;
 
+        @ApiModelProperty("分部")
+        private Integer organId;
+
         @ApiModelProperty("合作单位ID")
         private Integer cooperationOrganId;
 
@@ -71,9 +74,21 @@ public class TeachingPointWrapper {
         @ApiModelProperty("课程ID")
         private Long courseId;
 
+        @ApiModelProperty("合作单位")
+        private String coopName;
+
         @ApiModelProperty("课程名")
         private String courseName;
 
+        @ApiModelProperty("课程类型")
+        private CourseSchedule.CourseScheduleType courseType;
+
+        @ApiModelProperty("分部")
+        private Integer organId;
+
+        @ApiModelProperty("分部")
+        private String organName;
+
         @ApiModelProperty(value = "课程状态")
         private CourseStatusEnum courseStatus;
 
@@ -85,11 +100,9 @@ public class TeachingPointWrapper {
         @ApiModelProperty(value = "上课时间")
         private Date startClassTime;
 
-        /** 结束时间 */
         @ApiModelProperty(value = "结束时间")
         private Date endClassTime;
 
-
         @ApiModelProperty("乐团ID")
         private String musicGroupId;
 

+ 23 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -216,6 +216,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
     @Autowired
     private TenantInfoService tenantInfoService;
+    @Autowired
+    private CooperationOrganService cooperationOrganService;
+    @Autowired
+    private OrganizationService organizationService;
 
     private final Logger businessLogger = LoggerFactory
             .getLogger(this.getClass());
@@ -6058,7 +6062,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         if (CollectionUtils.isEmpty(courseTeachingPoints)) {
             return page;
         }
-
         // 设置老师信息
 
         // 老师ID集合
@@ -6076,12 +6079,29 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 .map(TeachingPointWrapper.CourseTeachingPoint::getCourseId)
                 .filter(Objects::nonNull)
                 .collect(Collectors.toList());
+		//获取乐团编号
+		List<String> musicGroupIds = courseTeachingPoints.stream().map(TeachingPointWrapper.CourseTeachingPoint::getMusicGroupId).collect(Collectors.toList());
+		Map<String,String> coopNameMap = new HashMap<>();
+		if (CollectionUtils.isNotEmpty(musicGroupIds)) {
+			coopNameMap = cooperationOrganService.getDao().
+					queryByGroupIds(musicGroupIds).stream().collect(Collectors.toMap(e -> e.getMusicGroupId(), e -> e.getName()));
+		}
+		//获取分部编号
+		List<Integer> organIds = courseTeachingPoints.stream().map(TeachingPointWrapper.CourseTeachingPoint::getOrganId).collect(Collectors.toList());
+		Map<Integer,Organization> organNameMap = new HashMap<>();
+		if (CollectionUtils.isNotEmpty(musicGroupIds)) {
+			organNameMap = organizationService.getMapByIds(organIds);
+		}
 
         Map<Long, TeacherAttendance> attendanceMap = teacherAttendanceService.getMapByCourseIds(courseIds);
 
         for (TeachingPointWrapper.CourseTeachingPoint courseTeachingPoint : courseTeachingPoints) {
-
-            // 设置老师信息
+			courseTeachingPoint.setCoopName(coopNameMap.get(courseTeachingPoint.getMusicGroupId()));
+			Organization organization = organNameMap.get(courseTeachingPoint.getOrganId());
+			if (Objects.nonNull(organization)){
+				courseTeachingPoint.setOrganName(organization.getName());
+			}
+			// 设置老师信息
             if (courseTeachingPoint.getTeacherId() != null) {
                 Teacher teacher = teacherMap.get(courseTeachingPoint.getTeacherId());
                 if (teacher != null) {

+ 6 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -4340,10 +4340,15 @@
             <if test="param.classType != null and param.classType != ''">
                 and cs.type_ = #{param.classType}
             </if>
-
             <if test="param.musicGroupId != null and  param.musicGroupId != ''">
                 and #{param.musicGroupId} = cs.music_group_id_
             </if>
+            <if test="param.musicGroupIds != null and param.musicGroupIds.size > 0">
+                and cs.music_group_id_ IN
+                <foreach collection="param.musicGroupIds" item="musicGroupId" open="(" separator="," close=")">
+                    #{musicGroupId}
+                </foreach>
+            </if>
             <if test="param.homeWorkStatus != null">
                 <if test="param.homeWorkStatus.code == 'UNASSIGNED'">
                     and ch.id_ is null

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/CourseSchedulePlusMapper.xml

@@ -9,6 +9,7 @@
         ,mg.id_ as musicGroupId
         ,mg.name_ as musicGroupName
         ,cs.actual_teacher_id_ as teacherId
+        ,cs.organ_id_ as organId
         ,cs.teaching_point_ as teachingPoint
         ,cs.class_date_ as courseDate
         ,cs.start_class_time_ as startClassTime
@@ -23,6 +24,9 @@
             <if test="param.cooperationOrganId != null">
                 and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
             </if>
+            <if test="param.organId != null">
+                and cs.organ_id_ = #{param.organId}
+            </if>
             <if test="param.startTime != null">
                 and cs.class_date_ &gt;= date_format(#{param.startTime}, '%Y-%m-%d')
             </if>

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/LessonExaminationMapper.xml

@@ -68,6 +68,12 @@
             <if test="musicGroupId != null and musicGroupId != ''">
                 AND le.music_group_id_ = #{musicGroupId}
             </if>
+            <if test="musicGroupIds != null and musicGroupIds.size > 0">
+                and le.music_group_id_ IN
+                <foreach collection="musicGroupIds" item="musicGroupId" open="(" separator="," close=")">
+                    #{musicGroupId}
+                </foreach>
+            </if>
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(le.organ_id_,#{organId})
             </if>

+ 20 - 2
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -975,7 +975,16 @@
     <select id="queryStudentExerciseMusicGroupList" resultType="com.ym.mec.biz.dal.dto.MusicGroupExtracurricularSummaryDto">
     	SELECT sees.music_group_id_ musicGroupId,mg.name_ musicGroupName,count(distinct sees.student_id_) studentNum,group_concat(distinct  sees.student_id_) as studentIds from student_extracurricular_exercises_situation_ sees
 		LEFT JOIN music_group mg on mg.id_ = sees.music_group_id_
-		WHERE sees.teacher_id_ = #{teacherId} and sees.serve_type_ = 'EXERCISE' and sees.actual_exercises_num_ = 0
+		WHERE sees.serve_type_ = 'EXERCISE' and sees.actual_exercises_num_ = 0
+        <if test="teacherId != null">
+            AND sees.teacher_id_ = #{teacherId}
+        </if>
+        <if test="musicGroupIds != null and musicGroupIds.size > 0">
+            and sees.music_group_id_ IN
+            <foreach collection="musicGroupIds" item="musicGroupId" open="(" separator="," close=")">
+                #{musicGroupId}
+            </foreach>
+        </if>
 		<if test="musicGroupName != null and musicGroupName != ''">
 			and mg.name_ LIKE CONCAT('%', #{musicGroupName}, '%')
 		</if>
@@ -992,7 +1001,16 @@
     <select id="queryStudentExerciseMusicGroupListCount" resultType="int">
     	SELECT count(distinct sees.music_group_id_) from student_extracurricular_exercises_situation_ sees 
 		LEFT JOIN music_group mg on mg.id_ = sees.music_group_id_
-		WHERE sees.teacher_id_ = #{teacherId} and sees.serve_type_ = 'EXERCISE' and sees.actual_exercises_num_ = 0
+		WHERE sees.serve_type_ = 'EXERCISE' and sees.actual_exercises_num_ = 0
+		<if test="teacherId != null">
+            AND sees.teacher_id_ = #{teacherId}
+		</if>
+        <if test="musicGroupIds != null and musicGroupIds.size > 0">
+            and sees.music_group_id_ IN
+            <foreach collection="musicGroupIds" item="musicGroupId" open="(" separator="," close=")">
+                #{musicGroupId}
+            </foreach>
+        </if>
 		<if test="musicGroupName != null and musicGroupName != ''">
 			and mg.name_ LIKE CONCAT('%', #{musicGroupName}, '%')
 		</if>