Procházet zdrojové kódy

修改网络教室曲目ID接收和传参类型为string

Steven před 7 měsíci
rodič
revize
a14339a817

+ 22 - 22
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Controller/TXClassroomViewController.m

@@ -428,20 +428,20 @@
         {
             
             if (tagButton.isSelected == NO) { // 关闭
-                [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeMicrophone];
+                [[ClassroomService sharedService] enableDevice:NO songId:@"" withType:DeviceTypeMicrophone];
             }
             else { // 打开
-                [[ClassroomService sharedService] enableDevice:YES songId:0 withType:DeviceTypeMicrophone];
+                [[ClassroomService sharedService] enableDevice:YES songId:@"" withType:DeviceTypeMicrophone];
             }
         }
             break;
         case ClassTitleViewActionTagCamera:
         {
             if (tagButton.isSelected == NO) {
-                [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeCamera];
+                [[ClassroomService sharedService] enableDevice:NO songId:@"" withType:DeviceTypeCamera];
             }
             else {
-                [[ClassroomService sharedService] enableDevice:YES songId:0 withType:DeviceTypeCamera];
+                [[ClassroomService sharedService] enableDevice:YES songId:@"" withType:DeviceTypeCamera];
             }
         }
             break;
@@ -558,7 +558,7 @@
                 [ClassroomService sharedService].currentRoom.isPlaySong = NO;
                 DeviceType type = self.isAccompany ? DeviceTypeAccompany : DeviceTypeMusicScore;
                 
-                [[ClassroomService sharedService] enableMutilMemberDevice:NO type:type songId:[weakSelf.songId intValue] soundVolume:weakSelf.soundVolume forUser:@""];
+                [[ClassroomService sharedService] enableMutilMemberDevice:NO type:type songId:weakSelf.songId soundVolume:weakSelf.soundVolume forUser:@""];
                 weakSelf.accompanyView.isPlaying = NO;
             }
     }
@@ -1218,21 +1218,21 @@
             case MainToolButtonTagMic: // 麦克风
             {
                 if (toolButton.isSelected) { // 打开
-                    [[ClassroomService sharedService] enableDevice:YES songId:0 withType:DeviceTypeMicrophone];
+                    [[ClassroomService sharedService] enableDevice:YES songId:@"" withType:DeviceTypeMicrophone];
                 }
                 else { // 关闭
-                    [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeMicrophone];
+                    [[ClassroomService sharedService] enableDevice:NO songId:@"" withType:DeviceTypeMicrophone];
                 }
             }
                 break;
             case MainToolButtonTagCamero: // 摄像头
             {
                 if (toolButton.isSelected) { // 打开
-                    [[ClassroomService sharedService] enableDevice:YES songId:0 withType:DeviceTypeCamera];
+                    [[ClassroomService sharedService] enableDevice:YES songId:@"" withType:DeviceTypeCamera];
                 }
                 else { // 关闭
                     
-                    [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeCamera];
+                    [[ClassroomService sharedService] enableDevice:NO songId:@"" withType:DeviceTypeCamera];
                 }
             }
                 break;
@@ -1259,7 +1259,7 @@
                     [self.alertView configWithTitle:@"提示" desc:@"确认打开学生的麦克风吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
                         
                     } confirm:^{
-                        [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeMicrophone songId:0 soundVolume:0 forUser:member.userId];
+                        [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeMicrophone songId:@"" soundVolume:0 forUser:member.userId];
                     }];
                 }
                 else { // 关闭
@@ -1268,7 +1268,7 @@
                     [self.alertView configWithTitle:@"提示" desc:@"确认关闭学生的麦克风吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
                         
                     } confirm:^{
-                        [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeMicrophone songId:0 soundVolume:0 forUser:member.userId];
+                        [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeMicrophone songId:@"" soundVolume:0 forUser:member.userId];
                     }];
                 }
             }
@@ -1281,7 +1281,7 @@
                     [self.alertView configWithTitle:@"提示" desc:@"邀请学生打开摄像头吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
                         
                     } confirm:^{
-                        [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeCamera songId:0 soundVolume:0 forUser:member.userId];
+                        [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeCamera songId:@"" soundVolume:0 forUser:member.userId];
                     }];
                 }
                 else { // 关闭
@@ -1290,7 +1290,7 @@
                     [self.alertView configWithTitle:@"提示" desc:@"确认关闭学生的摄像头吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
                         
                     } confirm:^{
-                        [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeCamera songId:0 soundVolume:0 forUser:member.userId];
+                        [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeCamera songId:@"" soundVolume:0 forUser:member.userId];
                     }];
                 }
             }
@@ -1331,7 +1331,7 @@
                     [self.containerView refreshShareStatus];
                     [self.videoListView showTeacherPrompt:NO];
                     if (member.handUpOn) {
-                        [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeHandup songId:0 soundVolume:0 forUser:member.userId];
+                        [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeHandup songId:@"" soundVolume:0 forUser:member.userId];
                     }
                 }
             }
@@ -1350,7 +1350,7 @@
 - (void)resetPlayBeatAndAccompany {
     if ([ClassroomService sharedService].currentRoom.isPlaySong) {
         DeviceType type = self.isAccompany ? DeviceTypeAccompany : DeviceTypeMusicScore;
-        [[ClassroomService sharedService] enableMutilMemberDevice:NO type:type songId:[self.songId intValue] soundVolume:self.soundVolume forUser:@""];
+        [[ClassroomService sharedService] enableMutilMemberDevice:NO type:type songId:self.songId soundVolume:self.soundVolume forUser:@""];
         // 重置伴奏按钮
         self.accompanyView.isPlaying = NO;
     }
@@ -2013,7 +2013,7 @@
         
         DeviceType type = self.isAccompany ? DeviceTypeAccompany : DeviceTypeMusicScore;
         // 取消记录当前播放曲目
-        [[ClassroomService sharedService] enableMutilMemberDevice:NO type:type songId:[songId intValue] soundVolume:self.soundVolume forUser:@""];
+        [[ClassroomService sharedService] enableMutilMemberDevice:NO type:type songId:songId soundVolume:self.soundVolume forUser:@""];
         
         [ClassroomService sharedService].currentRoom.isPlaySong = NO;
         [self unplayBeatNodeRefreshStream]; // 刷新音频流播放
@@ -2036,11 +2036,11 @@
         // 记录当前播放曲目
         if (![NSString isEmptyString:[ClassroomService sharedService].currentRoom.shareUserId]) {
             NSString *userId = [ClassroomService sharedService].currentRoom.shareUserId;
-            [[ClassroomService sharedService] enableMutilMemberDevice:YES type:type songId:[songId intValue] soundVolume:self.soundVolume forUser:userId];
+            [[ClassroomService sharedService] enableMutilMemberDevice:YES type:type songId:songId soundVolume:self.soundVolume forUser:userId];
             [self changeSongPlayDisplay:userId];
         }
         else {
-            [[ClassroomService sharedService] enableMutilMemberDevice:YES type:type songId:[songId intValue] soundVolume:self.soundVolume forUser:@""];
+            [[ClassroomService sharedService] enableMutilMemberDevice:YES type:type songId:songId soundVolume:self.soundVolume forUser:@""];
             [self changeSongPlayDisplay:@""];
         }
         
@@ -2084,10 +2084,10 @@
                 member.url = songUrl;
                 member.mp3Url = accompanyUrl;
                 member.examSongName = songName;
-                member.musicScoreAccompanimentId = [songId intValue];
+                member.musicScoreAccompanimentId = songId;
              
                 ClassSongMessage *songModel = [[ClassSongMessage alloc] init];
-                songModel.musicScoreAccompanimentId = [songId intValue];
+                songModel.musicScoreAccompanimentId = songId;
                 songModel.accompanimentPlayStatus = NO;
                 songModel.downStatus = 0;
                 songModel.playStatus = NO;
@@ -2099,7 +2099,7 @@
             else {
                 BOOL hasDownloadSong = NO;
                 for (ClassSongMessage *songModel in member.songMessage) {
-                    if (songModel.musicScoreAccompanimentId == [songId intValue]) {
+                    if ([songModel.musicScoreAccompanimentId isEqualToString:songId]) {
                         hasDownloadSong = YES;
                         break;
                     }
@@ -2107,7 +2107,7 @@
                 if (hasDownloadSong == NO) { // 如果没有下载 添加到列表
 
                     ClassSongMessage *songModel = [[ClassSongMessage alloc] init];
-                    songModel.musicScoreAccompanimentId = [songId intValue];
+                    songModel.musicScoreAccompanimentId = songId;
                     songModel.accompanimentPlayStatus = NO;
                     songModel.downStatus = 0;
                     songModel.playStatus = NO;

+ 3 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/ClassroomService.h

@@ -85,13 +85,13 @@ isAudience:(BOOL)audience
 #pragma mark 角色权限相关,仅老师有权限
 - (void)enableDevice:(BOOL)enable
                 type:(DeviceType)type
-              songId:(NSInteger)songId
+              songId:(NSString *)songId
          soundVolume:(NSInteger)soundVolume
              forUser:(NSString *)userId;
 // 批量操作设备
 - (void)enableMutilMemberDevice:(BOOL)enable
                            type:(DeviceType)type
-                         songId:(NSInteger)songId
+                         songId:(NSString *)songId
                     soundVolume:(NSInteger)soundVolume
                         forUser:(NSString *)userId;
 
@@ -112,7 +112,7 @@ isAudience:(BOOL)audience
 
 #pragma mark 操作当前用户设备状态,仅老师/学员有权限
 - (void)enableDevice:(BOOL)enable
-              songId:(NSInteger)songId
+              songId:(NSString *)songId
             withType:(DeviceType)type;
 
 #pragma mark ----- tx RTC room message

+ 11 - 64
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/ClassroomService.m

@@ -54,31 +54,6 @@ isAudience:(BOOL)audience
     [parm setObject:userName forKey:@"userName"];
     [parm setValue:@"TEACHER" forKey:@"clientType"];
     
-//    [KSNetworkingManager classroomRequest:KS_POST url:[self getUrl:@"/room/join"] parms:parm success:^(NSDictionary * _Nonnull dic) {
-//        if ([dic ks_integerValueForKey:@"code"] == 0) {
-//            Classroom *room = [Classroom classroomFromJson:[dic ks_dictionaryValueForKey:@"data"]];
-//            self.currentRoom = room;
-//            if (successBlock) {
-//                dispatch_main_async_safe(^{
-//                    successBlock(room);
-//                })
-//            }
-//        }
-//        else {
-//            if (errorBlock) {
-//                dispatch_main_async_safe(^{
-//                    errorBlock([dic ks_integerValueForKey:@"code"],MESSAGEKEY);
-//                })
-//            }
-//        }
-//    } faliure:^(NSError * _Nonnull error) {
-//        if (errorBlock) {
-//            dispatch_main_async_safe(^{
-//                errorBlock(error.code,@"");
-//            })
-//        }
-//    }];
-    
     [HTTPUtility requestWithHTTPMethod:HTTPMethodPost
                              URLString:@"/room/join"
                             parameters:parm
@@ -109,31 +84,7 @@ isAudience:(BOOL)audience
     NSMutableDictionary *parm = [[NSMutableDictionary alloc] init];
     [parm setObject:roomId forKey:@"roomId"];
     [parm setValue:@"TEACHER" forKey:@"clientType"];
-//    [KSNetworkingManager classroomRequest:KS_POST url:[self getUrl:@"/room/info"] parms:parm success:^(NSDictionary * _Nonnull dic) {
-//        if ([dic ks_integerValueForKey:@"code"] == 0 && [dic ks_boolValueForKey:@"status"]) {
-//            Classroom *room = [Classroom classroomFromJson:[dic ks_dictionaryValueForKey:@"data"]];
-//            self.currentRoom = room;
-//            if (successBlock) {
-//                dispatch_main_async_safe(^{
-//                    successBlock(room);
-//                })
-//            }
-//        }
-//        else {
-//            if (errorBlock) {
-//                dispatch_main_async_safe(^{
-//                    errorBlock([dic ks_integerValueForKey:@"code"],MESSAGEKEY);
-//                })
-//            }
-//        }
-//
-//    } faliure:^(NSError * _Nonnull error) {
-//        if (errorBlock) {
-//            dispatch_main_async_safe(^{
-//                errorBlock(error.code,@"");
-//            })
-//        }
-//    }];
+
     [HTTPUtility requestWithHTTPMethod:HTTPMethodPost
                              URLString:@"/room/info"
                             parameters:parm
@@ -166,11 +117,7 @@ isAudience:(BOOL)audience
         return;
     }
     NSDictionary *parm = [NSDictionary dictionaryWithObjectsAndKeys:self.currentRoom.roomId, @"roomId", self.currentRoom.currentMemberId, @"userId", @(requestStatus),@"requestStatus",[KeyChainTools getUUID],@"deviceNum",@"TEACHER",@"clientType",nil];
-//    [KSNetworkingManager classroomRequest:KS_POST url:[self getUrl:@"room/joinRoomStatusNotify"] parms:parm success:^(NSDictionary * _Nonnull dic) {
-//
-//    } faliure:^(NSError * _Nonnull error) {
-//
-//    }];
+
     [HTTPUtility requestWithHTTPMethod:HTTPMethodPost URLString:@"room/joinRoomStatusNotify" parameters:parm response:^(HTTPResult *result) {
         if (result.success) {
             NSLog(@"------ 通知成功");
@@ -246,7 +193,7 @@ isAudience:(BOOL)audience
 
 - (void)enableDevice:(BOOL)enable
                 type:(DeviceType)type
-              songId:(NSInteger)songId
+              songId:(NSString *)songId
          soundVolume:(NSInteger)soundVolume
              forUser:(NSString *)userId {
     if (![self checkWhetherInRoom]) {
@@ -264,11 +211,11 @@ isAudience:(BOOL)audience
     [dic setValue:@(enable) forKey:@"enable"];
 
      if (DeviceTypeMusicScore == type) { // 原音
-        [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
+        [dic setObject:songId forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
     else if (DeviceTypeAccompany == type) { // 伴奏
-        [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
+        [dic setObject:songId forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
     [dic setObject:userId forKey:@"userId"];
@@ -289,7 +236,7 @@ isAudience:(BOOL)audience
 // 操作全员设备
 - (void)enableMutilMemberDevice:(BOOL)enable
                            type:(DeviceType)type
-                         songId:(NSInteger)songId
+                         songId:(NSString *)songId
                     soundVolume:(NSInteger)soundVolume
                         forUser:(NSString *)userId {
     
@@ -303,11 +250,11 @@ isAudience:(BOOL)audience
     [dic setValue:@(enable) forKey:@"enable"];
 
     if (DeviceTypeMusicScore == type) { // 原音
-        [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
+        [dic setObject:songId forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
     else if (DeviceTypeAccompany == type) { // 伴奏
-        [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
+        [dic setObject:songId forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
     
@@ -453,7 +400,7 @@ isAudience:(BOOL)audience
 
 #pragma mark 操作当前用户设备状态,仅老师/学员有权限
 - (void)enableDevice:(BOOL)enable
-              songId:(NSInteger)songId
+              songId:(NSString *)songId
             withType:(DeviceType)type {
     if (![self checkWhetherInRoom]) {
         [self callbackFailureDescription:ErrorCodeUserNotExistInRoom];
@@ -467,11 +414,11 @@ isAudience:(BOOL)audience
 
     if (DeviceTypeMusicScore == type) { // 原音
 
-        [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
+        [dic setObject:songId forKey:@"musicScoreAccompanimentId"];
     }
     else if (DeviceTypeAccompany == type) { // 伴奏
 
-        [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
+        [dic setObject:songId forKey:@"musicScoreAccompanimentId"];
     }
     [dic setValue:@"TEACHER" forKey:@"clientType"];
 

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/ClassSongMessage.h

@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface ClassSongMessage : NSObject
 
-@property (nonatomic, assign) int musicScoreAccompanimentId;
+@property (nonatomic, strong) NSString *musicScoreAccompanimentId;
 @property (nonatomic, assign) BOOL accompanimentPlayStatus;
 @property (nonatomic, assign) BOOL downStatus;
 @property (nonatomic, assign) BOOL playStatus;

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/ClassSongMessage.m

@@ -12,7 +12,7 @@
 
 + (instancetype)messageFromJson:(NSDictionary *)dic {
     ClassSongMessage *message = [[ClassSongMessage alloc] init];
-    message.musicScoreAccompanimentId = [dic ks_intValueForKey:@"musicScoreAccompanimentId"];
+    message.musicScoreAccompanimentId = [dic ks_stringValueForKey:@"musicScoreAccompanimentId"];
     message.accompanimentPlayStatus = [dic ks_boolValueForKey:@"accompanimentPlayStatus"];
     message.downStatus = [dic ks_boolValueForKey:@"downStatus"];
     message.playStatus = [dic ks_boolValueForKey:@"playStatus"];

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/RoomMember.h

@@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSMutableArray *songMessage;
 
-@property (nonatomic, assign) int musicScoreAccompanimentId;
+@property (nonatomic, strong) NSString *musicScoreAccompanimentId;
 @property (nonatomic, assign) BOOL accompanimentPlayStatus;
 @property (nonatomic, assign) int downStatus;
 @property (nonatomic, assign) BOOL playStatus;

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/RoomMember.m

@@ -37,7 +37,7 @@
         [member.songMessage addObject:songModel];
         // 如果当前在播放伴奏或原声
         if ([parm ks_boolValueForKey:@"playStatus"] || [parm ks_boolValueForKey:@"accompanimentPlayStatus"]) {
-            member.musicScoreAccompanimentId = [parm ks_intValueForKey:@"musicScoreAccompanimentId"];
+            member.musicScoreAccompanimentId = [parm ks_stringValueForKey:@"musicScoreAccompanimentId"];
             member.accompanimentPlayStatus = [parm ks_boolValueForKey:@"accompanimentPlayStatus"];
             member.downStatus = [parm ks_intValueForKey:@"downStatus"];
             member.playStatus = [parm ks_boolValueForKey:@"playStatus"];

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanyView.h

@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)refreshView;
 
-- (void)refreshWithSongId:(int)songId;
+- (void)refreshWithSongId:(NSString *)songId;
 
 - (void)refreshAllSongStatus;
 

+ 15 - 15
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanyView.m

@@ -209,12 +209,12 @@
     [self requestData];
 }
 
-- (void)refreshWithSongId:(int)songId {
+- (void)refreshWithSongId:(NSString *)songId {
     dispatch_async(self.accompanyListQueue, ^{
         NSMutableArray *songArray = [ClassroomService sharedService].currentRoom.currentMember.songMessage;
         for (ClassSongMessage *songMessage in songArray) {
             
-            if (songMessage.musicScoreAccompanimentId == songId) {
+            if ([songMessage.musicScoreAccompanimentId isEqualToString:songId]) {
                 
                 NSMutableArray *memberArray = [self getStudentArrayForMemberArray:[ClassroomService sharedService].currentRoom.memberList];
                 
@@ -224,7 +224,7 @@
                     
                     for (ClassSongMessage *memberSong in member.songMessage) {
                         
-                        if (memberSong.musicScoreAccompanimentId == songId) {
+                        if ([memberSong.musicScoreAccompanimentId isEqualToString:songId]) {
                             if (memberSong.downStatus) { // 下载失败
                                 isFailed = YES;
                             }
@@ -279,7 +279,7 @@
             for (RoomMember *member in memberArray) {   // 遍历成员列表
                 
                 for (ClassSongMessage *memberSong in member.songMessage) { // 获取成员的曲目
-                    if (memberSong.musicScoreAccompanimentId == songMessage.musicScoreAccompanimentId) {
+                    if ([memberSong.musicScoreAccompanimentId isEqualToString:songMessage.musicScoreAccompanimentId]) {
                         if (memberSong.downStatus) { // 下载失败
                             isFailed = YES;
                         }
@@ -375,7 +375,7 @@
     // 获取当前数据源
     ClassSongMessage *songMessage = self.songArray[_currentChooseIndex];
     ACCOMPANYACTION action = _isPlaying ? ACCOMPANYACTION_PLAYSONG : ACCOMPANYACTION_STOP;
-    NSString *songId = [NSString stringWithFormat:@"%d",songMessage.musicScoreAccompanimentId];
+    NSString *songId = songMessage.musicScoreAccompanimentId;
     if (self.callback) {
         self.callback(action, songId, songMessage.examSongName, songMessage.isChooseAccompany);
     }
@@ -403,7 +403,7 @@
         prepareModel.isChoose = YES;
         [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
         
-        NSString *songId = [NSString stringWithFormat:@"%d",prepareModel.musicScoreAccompanimentId];
+        NSString *songId = prepareModel.musicScoreAccompanimentId;
         self.isPlaying = YES;
         // 回调
         if (self.callback) {
@@ -434,7 +434,7 @@
         prepareModel.isChoose = YES;
         [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
        
-        NSString *songId = [NSString stringWithFormat:@"%d",prepareModel.musicScoreAccompanimentId];
+        NSString *songId = prepareModel.musicScoreAccompanimentId;
         self.isPlaying = YES;
         // 回调
         if (self.callback) {
@@ -477,23 +477,23 @@
                 // 当前选择的曲目高亮
                 [self changeCelllChoose:index];
                 if (self.callback) {
-                    self.callback(ACCOMPANYACTION_PLAYSONG, [NSString stringWithFormat:@"%d", songMessage.musicScoreAccompanimentId], songMessage.examSongName, songMessage.isChooseAccompany);
+                    self.callback(ACCOMPANYACTION_PLAYSONG, songMessage.musicScoreAccompanimentId, songMessage.examSongName, songMessage.isChooseAccompany);
                 }
                 
                else if (self.actionBlock) {
                     NSString *songUrl = songMessage.isChooseAccompany ? songMessage.mp3Url : songMessage.url;
-                    self.actionBlock(ACCOMPANYACTION_PLAYSONG, [NSString stringWithFormat:@"%d", songMessage.musicScoreAccompanimentId], songMessage.examSongName, songMessage.isChooseAccompany, songUrl);
+                    self.actionBlock(ACCOMPANYACTION_PLAYSONG, songMessage.musicScoreAccompanimentId, songMessage.examSongName, songMessage.isChooseAccompany, songUrl);
                 }
             }
         }
     }
     else if (action == SongActionDisplay) {
         if (self.callback) {
-            self.callback(ACCOMPANYACTION_DISPLAY, [NSString stringWithFormat:@"%d", songMessage.musicScoreAccompanimentId], songMessage.examSongName, songMessage.isChooseAccompany);
+            self.callback(ACCOMPANYACTION_DISPLAY, songMessage.musicScoreAccompanimentId, songMessage.examSongName, songMessage.isChooseAccompany);
         }
         else if (self.actionBlock) {
             NSString *songUrl = songMessage.isChooseAccompany ? songMessage.mp3Url : songMessage.url;
-            self.actionBlock(ACCOMPANYACTION_DISPLAY, [NSString stringWithFormat:@"%d", songMessage.musicScoreAccompanimentId], songMessage.examSongName, songMessage.isChooseAccompany, songUrl);
+            self.actionBlock(ACCOMPANYACTION_DISPLAY, songMessage.musicScoreAccompanimentId, songMessage.examSongName, songMessage.isChooseAccompany, songUrl);
 
         }
     }
@@ -525,23 +525,23 @@
         // 如果在播放状态,直接当前选择曲目播放
         ClassSongMessage *currentSong = self.songArray[_currentChooseIndex];
         if (self.callback) {
-            self.callback(ACCOMPANYACTION_PLAYSONG, [NSString stringWithFormat:@"%d", currentSong.musicScoreAccompanimentId], currentSong.examSongName, currentSong.isChooseAccompany);
+            self.callback(ACCOMPANYACTION_PLAYSONG, currentSong.musicScoreAccompanimentId, currentSong.examSongName, currentSong.isChooseAccompany);
         }
         else if (self.actionBlock) {
             NSString *songUrl = currentSong.isChooseAccompany ? currentSong.mp3Url : currentSong.url;
-            self.actionBlock(ACCOMPANYACTION_PLAYSONG, [NSString stringWithFormat:@"%d", currentSong.musicScoreAccompanimentId], currentSong.examSongName, currentSong.isChooseAccompany, songUrl);
+            self.actionBlock(ACCOMPANYACTION_PLAYSONG, currentSong.musicScoreAccompanimentId, currentSong.examSongName, currentSong.isChooseAccompany, songUrl);
 
         }
     }
     else {
         ClassSongMessage *currentSong = self.songArray[_currentChooseIndex];
         if (self.callback) {
-            self.callback(ACCOMPANYACTION_CHOOSE, [NSString stringWithFormat:@"%d", currentSong.musicScoreAccompanimentId], currentSong.examSongName, currentSong.isChooseAccompany);
+            self.callback(ACCOMPANYACTION_CHOOSE, currentSong.musicScoreAccompanimentId, currentSong.examSongName, currentSong.isChooseAccompany);
             
         }
         else if (self.actionBlock) {
             NSString *songUrl = currentSong.isChooseAccompany ? currentSong.mp3Url : currentSong.url;
-            self.actionBlock(ACCOMPANYACTION_CHOOSE, [NSString stringWithFormat:@"%d", currentSong.musicScoreAccompanimentId], currentSong.examSongName, currentSong.isChooseAccompany, songUrl);
+            self.actionBlock(ACCOMPANYACTION_CHOOSE,currentSong.musicScoreAccompanimentId, currentSong.examSongName, currentSong.isChooseAccompany, songUrl);
         }
     }
 }

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/DownloadView/DownloadStatusCell.m

@@ -39,7 +39,7 @@
     
     NSInteger downStatus = member.downStatus;
     for (ClassSongMessage *message in member.songMessage) {
-        if (message.musicScoreAccompanimentId == [songId intValue]) {
+        if ([message.musicScoreAccompanimentId isEqualToString:songId]) {
             downStatus = message.downStatus;
         }
     }

+ 5 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/MemberListBodyView.m

@@ -181,7 +181,7 @@
                 [self.alertView configWithTitle:@"提示" desc:@"确定打开学生的麦克风吗?" leftTitle:@"取消" rightTitle:@"确定" cancel:^{
                     
                 } confirm:^{
-                    [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeMicrophone songId:0 soundVolume:0 forUser:cell.member.userId];
+                    [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeMicrophone songId:@"" soundVolume:0 forUser:cell.member.userId];
                     
                 }];
                 
@@ -190,7 +190,7 @@
                 [self.alertView configWithTitle:@"提示" desc:@"确定关闭学生的麦克风吗?" leftTitle:@"取消" rightTitle:@"确定" cancel:^{
                     
                 } confirm:^{
-                    [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeMicrophone songId:0 soundVolume:0 forUser:cell.member.userId];
+                    [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeMicrophone songId:@"" soundVolume:0 forUser:cell.member.userId];
 
                 }];
             }
@@ -203,7 +203,7 @@
                 [self.alertView configWithTitle:@"提示" desc:@"确定打开学生的摄像头吗?" leftTitle:@"取消" rightTitle:@"确定" cancel:^{
                     
                 } confirm:^{
-                    [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeCamera songId:0 soundVolume:0 forUser:cell.member.userId];
+                    [[ClassroomService sharedService] enableDevice:YES type:DeviceTypeCamera songId:@"" soundVolume:0 forUser:cell.member.userId];
                 }];
                 
             }else {
@@ -211,7 +211,7 @@
                 [self.alertView configWithTitle:@"提示" desc:@"确定关闭学生的摄像头吗?" leftTitle:@"取消" rightTitle:@"确定" cancel:^{
                     
                 } confirm:^{
-                    [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeCamera songId:0 soundVolume:0 forUser:cell.member.userId];
+                    [[ClassroomService sharedService] enableDevice:NO type:DeviceTypeCamera songId:@"" soundVolume:0 forUser:cell.member.userId];
                 }];
             }
         }
@@ -289,7 +289,7 @@
         [self.alertView configWithTitle:@"提示" desc:@"确定开启全部学生麦克风吗?" leftTitle:@"取消" rightTitle:@"确定" cancel:^{
             
         } confirm:^{
-            [[ClassroomService sharedService] enableMutilMemberDevice:YES type:DeviceTypeMicrophone songId:0 soundVolume:0 forUser:@""];
+            [[ClassroomService sharedService] enableMutilMemberDevice:YES type:DeviceTypeMicrophone songId:@"" soundVolume:0 forUser:@""];
         }];
     }
 }