Просмотр исходного кода

1、课表organ_id_字段初始化;
2、课表列表去除团体名和班级名,搜索更改为按团体编号/课程编号/课程名搜索
3、修复对外课程无部门编号
4、节假日获取方式调整
5、线上乐团课创建
6、服务指标添加教务老师编号

Joe 5 лет назад
Родитель
Сommit
fd93f30df2

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -377,5 +377,5 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      * @param studentIds
      * @return
      */
-    List<Map<Integer, Integer>> getStudentEducationalTeachers(@Param("studentIds") List<Integer> studentIds);
+    List<StudentEduTeacherDto> getStudentEducationalTeachers(@Param("studentIds") List<Integer> studentIds);
 }

+ 34 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentEduTeacherDto.java

@@ -0,0 +1,34 @@
+package com.ym.mec.biz.dal.dto;
+
+public class StudentEduTeacherDto {
+
+    private Integer studentId;
+
+    private Integer educationalTeacherId;
+
+    private String educationalTeacherName;
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public Integer getEducationalTeacherId() {
+        return educationalTeacherId;
+    }
+
+    public void setEducationalTeacherId(Integer educationalTeacherId) {
+        this.educationalTeacherId = educationalTeacherId;
+    }
+
+    public String getEducationalTeacherName() {
+        return educationalTeacherName;
+    }
+
+    public void setEducationalTeacherName(String educationalTeacherName) {
+        this.educationalTeacherName = educationalTeacherName;
+    }
+}

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentExercisesSituationDto.java

@@ -18,6 +18,26 @@ public class StudentExercisesSituationDto extends StudentExtracurricularExercise
 
     private Integer existPracticeCourse;
 
+    private Integer educationalTeacherId;
+
+    private String educationalTeacherName;
+
+    public Integer getEducationalTeacherId() {
+        return educationalTeacherId;
+    }
+
+    public void setEducationalTeacherId(Integer educationalTeacherId) {
+        this.educationalTeacherId = educationalTeacherId;
+    }
+
+    public String getEducationalTeacherName() {
+        return educationalTeacherName;
+    }
+
+    public void setEducationalTeacherName(String educationalTeacherName) {
+        this.educationalTeacherName = educationalTeacherName;
+    }
+
     public Integer getExistPracticeCourse() {
         return existPracticeCourse;
     }

+ 18 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -1,9 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.CourseScheduleDao;
-import com.ym.mec.biz.dal.dao.ExtracurricularExercisesReplyDao;
-import com.ym.mec.biz.dal.dao.StudentExtracurricularExercisesSituationDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.StudentEduTeacherDto;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
 import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
@@ -18,6 +16,7 @@ import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import java.time.DayOfWeek;
 import java.time.LocalDate;
@@ -37,6 +36,8 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 	private CourseScheduleDao courseScheduleDao;
 	@Autowired
 	private TeacherDao teacherDao;
+	@Autowired
+	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 
 	@Override
 	public BaseDAO<Long, StudentExtracurricularExercisesSituation> getDAO() {
@@ -90,11 +91,17 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
+			Map<Integer, Long> studentVipCourseMap=new HashMap<>();
 			if(Objects.isNull(queryInfo.getExistVipCourse())){
 				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
 				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(),GroupType.VIP);
-				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
-				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
+				studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
+			}
+			List<Integer> studentIds = dataList.stream().map(StudentExercisesSituationDto::getStudentId).collect(Collectors.toList());
+			List<StudentEduTeacherDto> studentEducationalTeachers = classGroupStudentMapperDao.getStudentEducationalTeachers(studentIds);
+			Map<Integer, List<StudentEduTeacherDto>> studentEduTeachersMap = studentEducationalTeachers.stream().collect(Collectors.groupingBy(StudentEduTeacherDto::getStudentId));
+			for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
+				if(Objects.isNull(queryInfo.getExistVipCourse())){
 					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
 					if(Objects.isNull(vipCourses)||vipCourses<=0){
 						exercisesSituationDto.setExistVipCourse(0);
@@ -102,6 +109,11 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 						exercisesSituationDto.setExistVipCourse(1);
 					}
 				}
+				List<StudentEduTeacherDto> studentEduTeachers = studentEduTeachersMap.get(exercisesSituationDto.getStudentId());
+				if(!CollectionUtils.isEmpty(studentEduTeachers)){
+					exercisesSituationDto.setEducationalTeacherId(studentEduTeachers.get(0).getEducationalTeacherId());
+					exercisesSituationDto.setEducationalTeacherName(studentEduTeachers.get(0).getEducationalTeacherName());
+				}
 			}
 		}
 		if (count == 0) {

+ 45 - 13
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -454,20 +454,52 @@
             </if>
         </where>
     </select>
-    <select id="getStudentEducationalTeachers" resultType="java.util.Map">
-        SELECT t.user_id_ AS 'key',MAX(t.educational_teacher_id_) AS 'value'
-        FROM (
-        SELECT cgsm.user_id_, g.educational_teacher_id_ FROM class_group_student_mapper cgsm
-        LEFT JOIN music_group g ON cgsm.music_group_id_=g.id_
-        WHERE cgsm.group_type_='MUSIC'
+    <select id="getStudentEducationalTeachers" resultType="com.ym.mec.biz.dal.dto.StudentEduTeacherDto">
+        SELECT
+        t.user_id_ studentId,
+        t.educational_teacher_id_ educationalTeacherId,
+        su.username_
+        FROM
+        (
+        SELECT
+        cgsm.user_id_,
+        g.educational_teacher_id_
+        FROM
+        class_group_student_mapper cgsm
+        LEFT JOIN music_group g ON cgsm.music_group_id_ = g.id_
+        WHERE
+        cgsm.group_type_ = 'MUSIC'
+        AND cgsm.user_id_ IN
+        <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+            #{studentId}
+        </foreach>
         UNION ALL
-        SELECT cgsm.user_id_, g.educational_teacher_id_ FROM class_group_student_mapper cgsm
-        LEFT JOIN vip_group g ON cgsm.music_group_id_=g.id_
-        WHERE cgsm.group_type_='VIP'
+        SELECT
+        cgsm.user_id_,
+        g.educational_teacher_id_
+        FROM
+        class_group_student_mapper cgsm
+        LEFT JOIN vip_group g ON cgsm.music_group_id_ = g.id_
+        WHERE
+        cgsm.group_type_ = 'VIP'
+        AND cgsm.user_id_ IN
+        <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+            #{studentId}
+        </foreach>
         UNION ALL
-        SELECT cgsm.user_id_, g.educational_teacher_id_ FROM class_group_student_mapper cgsm
-        LEFT JOIN practice_group g ON cgsm.music_group_id_=g.id_
-        WHERE cgsm.group_type_='PRACTICE'
-        ) t GROUP BY t.user_id_
+        SELECT
+        cgsm.user_id_,
+        g.educational_teacher_id_
+        FROM
+        class_group_student_mapper cgsm
+        LEFT JOIN practice_group g ON cgsm.music_group_id_ = g.id_
+        WHERE
+        cgsm.group_type_ = 'PRACTICE'
+        AND cgsm.user_id_ IN
+        <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+            #{studentId}
+        </foreach>
+        ) t
+        LEFT JOIN sys_user su ON t.educational_teacher_id_=su.id_
     </select>
 </mapper>