فهرست منبع

Merge remote-tracking branch 'origin/master'

Joburgess 4 سال پیش
والد
کامیت
05e693a476

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -301,12 +301,12 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     List<Map<Integer, String>> queryMidiByUserIdsAndCourseId(@Param("userIds") Set<String> userIds, @Param("courseScheduleId") String courseScheduleId);
 
     /**
-     * 获取用户的节拍器信息
+     * 获取用户的曲目下载信息
      * @param userIds
      * @param courseScheduleId
      * @return
      */
-    List<Map<Integer, Integer>> queryExamSongByUserIdsAndCourseId(@Param("userIds") Set<String> userIds, @Param("courseScheduleId") String courseScheduleId);
+    List<Map<Integer, String>> queryExamSongByUserIdsAndCourseId(@Param("userIds") Set<String> userIds, @Param("courseScheduleId") String courseScheduleId);
 
     /**
      * 获取单个用户的midi
@@ -364,11 +364,11 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     int countAll(Map<String, Object> params);
 
     /**
-     * 修改学员曲目下载状态
+     * 修改学员曲目下载信息
      * @author zouxuan
      * @param roomId
      */
-    void adjustExamSong(@Param("roomId") Long roomId, @Param("userId") Integer userId, @Param("status") Integer status);
+    void adjustExamSong(@Param("roomId") Long roomId, @Param("userId") Integer userId, @Param("examSongJson") String examSongJson);
 
     /**
      * 获取学员的曲目下载状态
@@ -377,7 +377,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @param userId
      * @return
      */
-    Boolean getExamSongDownloadStatus(@Param("roomId") Long roomId,
+    String getExamSongDownloadStatus(@Param("roomId") Long roomId,
                                       @Param("userId") String userId);
 
 

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

@@ -80,6 +80,8 @@ public class MusicGroupCourseScheduleDto {
     private String remark;
 
     private YesOrNoEnum isCallNames;
+    
+    private Integer schoolId;
 
     public YesOrNoEnum getIsCallNames() {
         return isCallNames;
@@ -273,4 +275,12 @@ public class MusicGroupCourseScheduleDto {
 		this.courseScheduleName = courseScheduleName;
 	}
 
+	public Integer getSchoolId() {
+		return schoolId;
+	}
+
+	public void setSchoolId(Integer schoolId) {
+		this.schoolId = schoolId;
+	}
+
 }

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

@@ -1900,6 +1900,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                                 backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                             }
                         }
+                        if(CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())){
+							preCourseSchedule.setTeachingTeacherIdList(new ArrayList<>(Arrays.asList(preCourseSchedule.getActualTeacherId())));
+						}else{
+							preCourseSchedule.getTeachingTeacherIdList().add(preCourseSchedule.getActualTeacherId());
+						}
+                        if(CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())){
+							backCourseSchedule.setTeachingTeacherIdList(new ArrayList<>(Arrays.asList(backCourseSchedule.getActualTeacherId())));
+						}else{
+							backCourseSchedule.getTeachingTeacherIdList().add(backCourseSchedule.getActualTeacherId());
+						}
                         if (!CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())
                                 && !CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
                             List<Integer> repeatIds = preCourseSchedule.getTeachingTeacherIdList()

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -756,6 +756,7 @@
         <result property="settlementTime" column="settlement_time_"/>
         <result property="remark" column="remark_"/>
         <result property="courseScheduleName" column="course_schedule_name_"/>
+        <result property="schoolId" column="school_id_"/>
     </resultMap>
     <select id="queryMusicGroupCourseSchedule" resultMap="MusicGroupCourseScheduleDto">
         SELECT cs.id_ course_schedule_id_,cs.class_date_,cs.start_class_time_,cs.end_class_time_,cs.class_group_id_,
@@ -788,7 +789,8 @@
         cg.name_ class_group_name_,
         ta.sign_in_time_,
         ta.sign_out_time_,
-        ta.remark_
+        ta.remark_,
+        cs.schoole_id_ school_id_
         FROM course_schedule cs
         LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
         LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_

+ 5 - 5
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -164,8 +164,8 @@
 	<update id="adjustExamSong">
 		UPDATE course_schedule_student_payment
 		<set>
-			<if test="status != null">
-				exam_song_download_status_ = #{status}
+			<if test="examSongJson != null">
+				exam_song_download_json_ = #{examSongJson}
 			</if>
 		</set>
 		WHERE course_schedule_id_ = #{roomId}
@@ -173,8 +173,8 @@
 			AND user_id_ = #{userId}
 		</if>
 	</update>
-	<select id="getExamSongDownloadStatus" resultType="boolean">
-		SELECT CASE WHEN exam_song_download_status_ IS NULL THEN 0 ELSE exam_song_download_status_ END
+	<select id="getExamSongDownloadStatus" resultType="String">
+		SELECT exam_song_download_json_
 		FROM course_schedule_student_payment
 		WHERE course_schedule_id_ = #{roomId}
 		<if test="userId != null">
@@ -497,7 +497,7 @@
 		AND cssp.course_schedule_id_ = #{courseScheduleId}
 	</select>
 	<select id="queryExamSongByUserIdsAndCourseId" resultType="java.util.Map">
-		SELECT user_id_ 'key',CASE WHEN exam_song_download_status_ IS NULL THEN 0 ELSE exam_song_download_status_ END 'value' FROM course_schedule_student_payment
+		SELECT user_id_ 'key',CASE WHEN exam_song_download_json_ IS NULL THEN '' ELSE exam_song_download_json_ END 'value' FROM course_schedule_student_payment
 		WHERE user_id_ IN
 		<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
 			#{userId}

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

@@ -216,7 +216,7 @@
             s.name_ as 'value'
         FROM
             student_registration sr
-            LEFT JOIN `subject` s ON sr.subject_id_ = s.id_
+            LEFT JOIN `subject` s ON sr.actual_subject_id_ = s.id_
         WHERE 1=1
         AND
         <foreach collection="studentInfos" item="student" open="(" close=")" separator=" OR ">

+ 2 - 2
mec-im/src/main/java/com/ym/controller/RoomController.java

@@ -151,8 +151,8 @@ public class RoomController{
     }
 
     @RequestMapping(value = "adjustExamSong", method = RequestMethod.POST)
-    public Object adjustExamSong(Long roomId,Integer status) throws Exception {
-        roomService.adjustExamSong(roomId,status);
+    public Object adjustExamSong(Long roomId,Integer status,Integer examSongId) throws Exception {
+        roomService.adjustExamSong(roomId,status,examSongId);
         return new BaseResponse<>();
     }
 

+ 26 - 27
mec-im/src/main/java/com/ym/pojo/ExamSongDownloadData.java

@@ -1,41 +1,40 @@
 package com.ym.pojo;
 
-import lombok.Data;
-
-@Data
 public class ExamSongDownloadData {
-	private Boolean examSongDownloadOn;
-	private String roomId;
-	private String userId;
-	private String ticket;
+	private Integer status;
+	private String url;
+	private String songName;
 
-	public Boolean getExamSongDownloadOn() {
-		return examSongDownloadOn;
+	public Integer getStatus() {
+		return status;
 	}
 
-	public void setExamSongDownloadOn(Boolean examSongDownloadOn) {
-		this.examSongDownloadOn = examSongDownloadOn;
+	public void setStatus(Integer status) {
+		this.status = status;
 	}
 
-	public String getRoomId() {
-		return roomId;
-	}
-	public void setRoomId(String roomId) {
-		this.roomId = roomId;
-	}
-	public String getUserId() {
-		return userId;
-	}
-	public void setUserId(String userId) {
-		this.userId = userId;
-	}
-	public String getTicket() {
-		return ticket;
+	public String getUrl() {
+		return url;
 	}
-	public void setTicket(String ticket) {
-		this.ticket = ticket;
+
+	public void setUrl(String url) {
+		this.url = url;
 	}
 
+	public String getSongName() {
+		return songName;
+	}
 
+	public void setSongName(String songName) {
+		this.songName = songName;
+	}
 
+	@Override
+	public String toString() {
+		return "{" +
+				"status=" + status +
+				", url='" + url + '\'' +
+				", songName='" + songName + '\'' +
+				'}';
+	}
 }

+ 2 - 2
mec-im/src/main/java/com/ym/pojo/RoomResult.java

@@ -34,7 +34,7 @@ public class RoomResult {
         boolean camera;
         boolean microphone;
         boolean handUpOn;
-        boolean examSongDownloadOn;
+        String examSongDownloadJson;
         CustomMessage playMidiJson;
     }
 
@@ -57,7 +57,7 @@ public class RoomResult {
             result.setHandUpOn(member.isHand());
             result.setHeadUrl(member.getHeadUrl());
             result.setPlayMidiJson(JSONObject.parseObject(midiMap.get(Integer.parseInt(member.getUid())),CustomMessage.class));
-            result.setExamSongDownloadOn(examSongMap.get(member.getRid())=="0"?false:true);
+            result.setExamSongDownloadJson(examSongMap.get(member.getRid()));
             members.add(result);
         }
     }

+ 20 - 5
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.service.Impl;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.ym.common.ApiException;
 import com.ym.common.DisplayEnum;
@@ -201,7 +202,7 @@ public class RoomServiceImpl implements RoomService {
             display = "display://type=0?userId=" + userId + "?uri=";
         }else {
             //获取学员曲目下载状态
-            userResult.setExamSongDownloadOn(courseScheduleStudentPaymentDao.getExamSongDownloadStatus(courseId,userId));
+            userResult.setExamSongDownloadJson(courseScheduleStudentPaymentDao.getExamSongDownloadStatus(courseId,userId));
             Room room = roomDao.findByRid(roomId);
             if (room != null) {
                 display = room.getDisplay();
@@ -1290,22 +1291,36 @@ public class RoomServiceImpl implements RoomService {
         msg.setUrl(sysExamSong.getUrl());
         imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), msg, 1);
         //学员曲目下载状态改为未下载
-        courseScheduleStudentPaymentDao.adjustExamSong(roomId,null,0);
+        ExamSongDownloadData json = new ExamSongDownloadData();
+        json.setSongName(sysExamSong.getName());
+        json.setUrl(sysExamSong.getUrl());
+        json.setStatus(0);
+        courseScheduleStudentPaymentDao.adjustExamSong(roomId,null, JSON.toJSONString(json));
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void adjustExamSong(Long roomId, Integer status) throws Exception {
-        if(roomId == null || status == null){
+    public void adjustExamSong(Long roomId, Integer status,Integer examSongId) throws Exception {
+        if(roomId == null || status == null || examSongId == null){
             throw new BizException("参数校验失败");
         }
         SysUser authUser = sysUserFeignService.queryUserInfo();
         CourseSchedule courseSchedule = courseScheduleDao.get(roomId);
-        courseScheduleStudentPaymentDao.adjustExamSong(roomId,authUser.getId(),status);
+
         //给老师发送学员曲目下载状态
         DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(DeviceTypeEnum.ExamSong.ordinal(), status==0?false:true);
         deviceResourceMessage.setUserId(courseSchedule.getActualTeacherId().toString());
         imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), deviceResourceMessage, 1);
+
+        SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
+        if(sysExamSong == null){
+            throw new BizException("曲目信息不存在");
+        }
+        ExamSongDownloadData msg = new ExamSongDownloadData();
+        msg.setSongName(sysExamSong.getName());
+        msg.setUrl(sysExamSong.getUrl());
+        msg.setStatus(status);
+        courseScheduleStudentPaymentDao.adjustExamSong(roomId,authUser.getId(),JSON.toJSONString(msg));
     }
 
     public void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {

+ 1 - 1
mec-im/src/main/java/com/ym/service/RoomService.java

@@ -92,5 +92,5 @@ public interface RoomService {
      * @param roomId
      * @param status
      */
-    void adjustExamSong(Long roomId,Integer status) throws Exception;
+    void adjustExamSong(Long roomId,Integer status,Integer examSongId) throws Exception;
 }