Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

周箭河 5 lat temu
rodzic
commit
9a87283051

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
 import com.ym.mec.biz.dal.entity.PracticeGroup;
 import com.ym.mec.biz.dal.enums.GroupStatusEnum;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.security.core.parameters.P;
 
 import java.util.Date;
 import java.util.List;
@@ -357,4 +358,13 @@ public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, Pr
                                         @Param("remindStatus") Integer remindStatus);
 
     List<PracticeCourseDto> getPracticeGroupByIds(@Param("practiceIds") List<Long> practiceIds);
+
+    /**
+     * @describe 获取网管课类型
+     * @author Joburgess
+     * @date 2020.08.20
+     * @param practiceIds:
+     * @return java.util.List<java.util.Map<java.lang.Long,java.lang.String>>
+     */
+    List<Map<Long, String>> getPracticeGroupType(@Param("practiceIds") List<Long> practiceIds);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java

@@ -41,6 +41,16 @@ public class CourseScheduleEndDto extends CourseSchedule {
 
     private String settlementTime;
 
+    private String practiceGroupType;
+
+    public String getPracticeGroupType() {
+        return practiceGroupType;
+    }
+
+    public void setPracticeGroupType(String practiceGroupType) {
+        this.practiceGroupType = practiceGroupType;
+    }
+
     public String getSettlementTime() {
         return settlementTime;
     }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -3743,6 +3743,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			List<Map<Long, String>> coursesSettlementTimeMaps = courseScheduleTeacherSalaryDao.getCoursesSettlementTime(courseScheduleIds);
 			Map<Long, String> coursesSettlementTimeMap = MapUtil.convertIntegerMap(coursesSettlementTimeMaps);
 
+			List<Long> practiceIds = results.stream().filter(e -> PRACTICE.equals(e.getGroupType())).map(e -> Long.valueOf(e.getMusicGroupId())).collect(Collectors.toList());
+			Map<Long, String> practiceGroupTypeMap=new HashMap<>();
+			if(!CollectionUtils.isEmpty(practiceIds)){
+				List<Map<Long, String>> practiceGroupType = practiceGroupDao.getPracticeGroupType(practiceIds);
+				practiceGroupTypeMap = MapUtil.convertIntegerMap(practiceGroupType);
+			}
+
 			//获取班级声部名称
             List<Map<Integer, String>> classGroupSubjectNameMaps = classGroupDao.findClassGroupSubjectNameMaps(courseScheduleIds);
             Map<Integer, String> classGroupSubjectNameMap = MapUtil.convertIntegerMap(classGroupSubjectNameMaps);
@@ -3751,6 +3758,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
 				result.setSubjectName(classGroupSubjectNameMap.get(result.getId()));
 				result.setStudentId(studentIdMap.get(result.getId()));
+				result.setPracticeGroupType(practiceGroupTypeMap.get(Long.valueOf(result.getMusicGroupId())));
 //				List<TeacherAttendance> courseTeacherAttendances = courseTeacherAttendanceMap.get(result.getId());
 				/*if(!CollectionUtils.isEmpty(courseTeacherAttendances)){
 					TeacherAttendance teacherAttendance=courseTeacherAttendances.get(0);

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

@@ -2281,28 +2281,28 @@
 
     <select id="endFindCourseSchedules" resultMap="CourseScheduleEndDto">
         SELECT
-        cs.id_,
-        cs.group_type_,
-        cs.music_group_id_,
-        cs.class_group_id_,
-        cs.status_,
-        cs.name_,
-        cs.class_date_,
-        CONCAT(cs.class_date_,' ',cs.start_class_time_) course_start_time_,
-        CONCAT(cs.class_date_,' ',cs.end_class_time_) course_end_time_,
-        cs.actual_teacher_id_,
-        cs.teach_mode_,
-        cs.type_,
-        cs.schoole_id_,
-        s.name_ schoole_name_,
-        o.name_ organ_name_,
-        CASE WHEN COUNT(sa.id_) > 0 THEN 1 ELSE 0 END isCallNames
+            cs.id_,
+            cs.group_type_,
+            cs.music_group_id_,
+            cs.class_group_id_,
+            cs.status_,
+            cs.name_,
+            cs.class_date_,
+            CONCAT(cs.class_date_,' ',cs.start_class_time_) course_start_time_,
+            CONCAT(cs.class_date_,' ',cs.end_class_time_) course_end_time_,
+            cs.actual_teacher_id_,
+            cs.teach_mode_,
+            cs.type_,
+            cs.schoole_id_,
+            s.name_ schoole_name_,
+            o.name_ organ_name_,
+            CASE WHEN COUNT(sa.id_) > 0 THEN 1 ELSE 0 END isCallNames
         FROM
-        course_schedule cs
-        LEFT JOIN school s ON cs.schoole_id_=s.id_
-        LEFT JOIN organization o ON cs.organ_id_=o.id_
-        LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
-        <include refid="endFindCourseSchedulesCondition"/>
+            course_schedule cs
+            LEFT JOIN school s ON cs.schoole_id_=s.id_
+            LEFT JOIN organization o ON cs.organ_id_=o.id_
+            LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
+            <include refid="endFindCourseSchedulesCondition"/>
         GROUP BY cs.id_
         ORDER BY course_start_time_,cs.id_
         <include refid="global.limit"/>

+ 8 - 0
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -707,4 +707,12 @@
             #{id}
         </foreach>
     </select>
+
+    <select id="getPracticeGroupType" resultType="map">
+        SELECT id_ AS 'key', type_ AS 'value' FROM practice_group
+        WHERE id_ IN
+        <foreach collection="practiceIds" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </select>
 </mapper>