|  | @@ -13,12 +13,10 @@ import com.ym.dao.WhiteboardDao;
 | 
	
		
			
				|  |  |  import com.ym.job.ScheduleManager;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SysConfigDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.TeacherDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.RongyunBasicUserDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.CourseSchedule;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.SysExamSong;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.Teacher;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.GroupType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.TeachModeEnum;
 | 
	
	
		
			
				|  | @@ -89,6 +87,8 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SysUserFeignService sysUserFeignService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | +    private SysExamSongDao sysExamSongDao;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  |      private SysConfigDao sysConfigDao;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private RedisTemplate<String,String> redisTemplate;
 | 
	
	
		
			
				|  | @@ -200,6 +200,8 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |          } else if (roleEnum == RoleEnum.RoleAssistant && display.isEmpty()) {
 | 
	
		
			
				|  |  |              display = "display://type=0?userId=" + userId + "?uri=";
 | 
	
		
			
				|  |  |          }else {
 | 
	
		
			
				|  |  | +            //获取学员曲目下载状态
 | 
	
		
			
				|  |  | +            userResult.setExamSongDownloadOn(courseScheduleStudentPaymentDao.getExamSongDownloadStatus(courseId,userId));
 | 
	
		
			
				|  |  |              Room room = roomDao.findByRid(roomId);
 | 
	
		
			
				|  |  |              if (room != null) {
 | 
	
		
			
				|  |  |                  display = room.getDisplay();
 | 
	
	
		
			
				|  | @@ -226,7 +228,8 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |          if(roomMemberList != null && roomMemberList.size() > 0){
 | 
	
		
			
				|  |  |              Set<String> userIds = roomMemberList.stream().map(e -> e.getUid()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  |              Map<Integer,String> midiMap = MapUtil.convertMybatisMap(courseScheduleStudentPaymentDao.queryMidiByUserIdsAndCourseId(userIds,courseId.toString()));
 | 
	
		
			
				|  |  | -            roomResult.setMembers(roomMemberList,midiMap);
 | 
	
		
			
				|  |  | +            Map<Integer,String> examSongMap = MapUtil.convertMybatisMap(courseScheduleStudentPaymentDao.queryExamSongByUserIdsAndCourseId(userIds,courseId.toString()));
 | 
	
		
			
				|  |  | +            roomResult.setMembers(roomMemberList,midiMap,examSongMap);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          roomResult.setWhiteboards(whiteboardDao.findByRid(roomId));
 | 
	
		
			
				|  |  |          log.info("join room: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, userName, roleEnum);
 | 
	
	
		
			
				|  | @@ -850,7 +853,8 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |              RoomResult roomResult = new RoomResult();
 | 
	
		
			
				|  |  |              Set<String> userIds = roomMemberList.stream().map(e -> e.getUid()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  |              Map<Integer,String> midiMap = MapUtil.convertMybatisMap(courseScheduleStudentPaymentDao.queryMidiByUserIdsAndCourseId(userIds,roomId.substring(1)));
 | 
	
		
			
				|  |  | -            roomResult.setMembers(roomMemberList,midiMap);
 | 
	
		
			
				|  |  | +            Map<Integer,String> examSongMap = MapUtil.convertMybatisMap(courseScheduleStudentPaymentDao.queryExamSongByUserIdsAndCourseId(userIds,roomId.substring(1)));
 | 
	
		
			
				|  |  | +            roomResult.setMembers(roomMemberList,midiMap,examSongMap);
 | 
	
		
			
				|  |  |              return roomResult.getMembers();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return null;
 | 
	
	
		
			
				|  | @@ -1273,6 +1277,37 @@ public class RoomServiceImpl implements RoomService {
 | 
	
		
			
				|  |  |          return courseScheduleStudentPaymentDao.queryNoJoinStu(roomId,roomId.substring(1));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +    public void pushDownloadExamSongMsg(Long roomId, Integer examSongId) throws Exception {
 | 
	
		
			
				|  |  | +        SysUser authUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        ExamSongDownloadMessageMessage msg = new ExamSongDownloadMessageMessage();
 | 
	
		
			
				|  |  | +        SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
 | 
	
		
			
				|  |  | +        if(sysExamSong == null){
 | 
	
		
			
				|  |  | +            throw new BizException("曲目信息不存在");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        msg.setSongName(sysExamSong.getName());
 | 
	
		
			
				|  |  | +        msg.setUrl(sysExamSong.getUrl());
 | 
	
		
			
				|  |  | +        imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), msg, 1);
 | 
	
		
			
				|  |  | +        //学员曲目下载状态改为未下载
 | 
	
		
			
				|  |  | +        courseScheduleStudentPaymentDao.adjustExamSong(roomId,null,0);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +    public void adjustExamSong(Long roomId, Integer status) throws Exception {
 | 
	
		
			
				|  |  | +        if(roomId == null || status == 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);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      public void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {
 | 
	
		
			
				|  |  |          roomDao.updateDisplayByRid(roomId, display);
 | 
	
		
			
				|  |  |          DisplayMessage displayMessage = new DisplayMessage(display);
 |