zouxuan 4 年之前
父節點
當前提交
8da565fd4e

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

@@ -145,14 +145,14 @@ public class RoomController{
     }
 
     @RequestMapping(value = "pushDownloadExamSongMsg", method = RequestMethod.POST)
-    public Object pushDownloadExamSongMsg(Long roomId,Integer examSongId) throws Exception {
-        roomService.pushDownloadExamSongMsg(roomId,examSongId);
+    public Object pushDownloadExamSongMsg(@RequestBody ExamSongData examSongData) throws Exception {
+        roomService.pushDownloadExamSongMsg(examSongData.getRoomId(),examSongData.getExamSongId());
         return new BaseResponse<>();
     }
 
     @RequestMapping(value = "adjustExamSong", method = RequestMethod.POST)
-    public Object adjustExamSong(Long roomId,Integer status,Integer examSongId) throws Exception {
-        roomService.adjustExamSong(roomId,status,examSongId);
+    public Object adjustExamSong(@RequestBody ExamSongData examSongData) throws Exception {
+        roomService.adjustExamSong(examSongData.getRoomId(),examSongData.getStatus(),examSongData.getExamSongId());
         return new BaseResponse<>();
     }
 

+ 31 - 0
mec-im/src/main/java/com/ym/pojo/ExamSongData.java

@@ -0,0 +1,31 @@
+package com.ym.pojo;
+
+public class ExamSongData {
+	private String roomId;
+	private Integer examSongId;
+	private Integer status;
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getRoomId() {
+		return roomId;
+	}
+
+	public void setRoomId(String roomId) {
+		this.roomId = roomId;
+	}
+
+	public Integer getExamSongId() {
+		return examSongId;
+	}
+
+	public void setExamSongId(Integer examSongId) {
+		this.examSongId = examSongId;
+	}
+}

+ 8 - 7
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -1284,7 +1284,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void pushDownloadExamSongMsg(Long roomId, Integer examSongId) throws Exception {
+    public void pushDownloadExamSongMsg(String roomId, Integer examSongId) throws Exception {
         SysUser authUser = sysUserFeignService.queryUserInfo();
         ExamSongDownloadMessageMessage msg = new ExamSongDownloadMessageMessage();
         SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
@@ -1293,29 +1293,30 @@ public class RoomServiceImpl implements RoomService {
         }
         msg.setSongName(sysExamSong.getName());
         msg.setUrl(sysExamSong.getUrl());
-        imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), msg, 1);
+        imHelper.publishMessage(authUser.getId().toString(), roomId, msg, 1);
         //学员曲目下载状态改为未下载
         ExamSongDownloadData json = new ExamSongDownloadData();
         json.setSongName(sysExamSong.getName());
         json.setUrl(sysExamSong.getUrl());
         json.setStatus(0);
         json.setSongId(examSongId);
-        courseScheduleStudentPaymentDao.adjustExamSong(roomId,null, JSON.toJSONString(json));
+        courseScheduleStudentPaymentDao.adjustExamSong(Long.parseLong(roomId.substring(1)),null, JSON.toJSONString(json));
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void adjustExamSong(Long roomId, Integer status,Integer examSongId) throws Exception {
+    public void adjustExamSong(String 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);
+        long scheduleId = Long.parseLong(roomId.substring(1));
+        CourseSchedule courseSchedule = courseScheduleDao.get(scheduleId);
 
         //给老师发送学员曲目下载状态
         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);
+        imHelper.publishMessage(authUser.getId().toString(), roomId, deviceResourceMessage, 1);
 
         SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
         if(sysExamSong == null){
@@ -1326,7 +1327,7 @@ public class RoomServiceImpl implements RoomService {
         msg.setUrl(sysExamSong.getUrl());
         msg.setStatus(status);
         msg.setSongId(examSongId);
-        courseScheduleStudentPaymentDao.adjustExamSong(roomId,authUser.getId(),JSON.toJSONString(msg));
+        courseScheduleStudentPaymentDao.adjustExamSong(scheduleId,authUser.getId(),JSON.toJSONString(msg));
     }
 
     public void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {

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

@@ -84,7 +84,7 @@ public interface RoomService {
      * @param roomId
      * @param examSongId
      */
-    void pushDownloadExamSongMsg(Long roomId, Integer examSongId) throws Exception;
+    void pushDownloadExamSongMsg(String roomId, Integer examSongId) throws Exception;
 
     /**
      * 修改学员伴奏下载状态
@@ -92,5 +92,5 @@ public interface RoomService {
      * @param roomId
      * @param status
      */
-    void adjustExamSong(Long roomId,Integer status,Integer examSongId) throws Exception;
+    void adjustExamSong(String roomId,Integer status,Integer examSongId) throws Exception;
 }