Showing
2 changed files
with
32 additions
and
32 deletions
| @@ -24,7 +24,7 @@ public class MaterialSubmitVo { | @@ -24,7 +24,7 @@ public class MaterialSubmitVo { | ||
| 24 | private Integer backupOrder; | 24 | private Integer backupOrder; |
| 25 | //垫片状态 0-默认 1-当前选中 | 25 | //垫片状态 0-默认 1-当前选中 |
| 26 | private String backupStatus; | 26 | private String backupStatus; |
| 27 | - // 操作类型 0-提交素材库 1-上传审片间 | 27 | + // 操作类型 1-提交素材库 2-上传审片间 |
| 28 | @NotBlank(message = "操作类型不能为空") | 28 | @NotBlank(message = "操作类型不能为空") |
| 29 | private String operateType; | 29 | private String operateType; |
| 30 | //文件路径,绝对路径 | 30 | //文件路径,绝对路径 |
| @@ -450,37 +450,37 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | @@ -450,37 +450,37 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | ||
| 450 | backupMaterial.setDuration(materialSubmitVo.getDuration()); | 450 | backupMaterial.setDuration(materialSubmitVo.getDuration()); |
| 451 | backupMaterialMapper.insert(backupMaterial); | 451 | backupMaterialMapper.insert(backupMaterial); |
| 452 | 452 | ||
| 453 | - if(materialSubmitVo.getOperateType().equals("1")){ | ||
| 454 | - | ||
| 455 | - } | ||
| 456 | - //添加审片间垫片配置 | ||
| 457 | - LambdaQueryWrapper<BackupConfig> wrapper = new LambdaQueryWrapper<>(); | ||
| 458 | - wrapper.eq(BackupConfig::getRoomId,materialSubmitVo.getRoomId()); | ||
| 459 | - wrapper.eq(BackupConfig::getBackupOrder,materialSubmitVo.getBackupOrder()); | ||
| 460 | - BackupConfig backupConfig = backupConfigMapper.selectOne(wrapper); | ||
| 461 | - if(ObjectUtil.isNull(backupConfig)){ | ||
| 462 | - backupConfig = new BackupConfig(); | ||
| 463 | - backupConfig.setBackupStatus("0"); | ||
| 464 | - } | ||
| 465 | - backupConfig.setRoomId(materialSubmitVo.getRoomId()); | ||
| 466 | - backupConfig.setBackupId(backupMaterial.getId()); | ||
| 467 | - backupConfig.setBackupOrder(materialSubmitVo.getBackupOrder()); | ||
| 468 | - backupConfig.setBackupPath(relativePath); | ||
| 469 | - backupConfigMapper.insertOrUpdate(backupConfig); | ||
| 470 | - | ||
| 471 | - //对应垫片任务切源(转码平台演示环境已挂载统一存储),请求转码平台修改垫片任务直播源 | ||
| 472 | - changeChannelSource(streamTask.getTaskId(), destFilePath); | ||
| 473 | - //判断是否需要修改当前播出流的垫片 | ||
| 474 | - if("1".equals(backupConfig.getBackupStatus())){ | ||
| 475 | - //切换播出流垫片(主、备) | ||
| 476 | - LambdaQueryWrapper<StreamTask> playWrapper = new LambdaQueryWrapper<>(); | ||
| 477 | - playWrapper.eq(StreamTask::getRoomId,materialSubmitVo.getRoomId()); | ||
| 478 | - playWrapper.eq(StreamTask::getPlayType,"play"); | ||
| 479 | - List<StreamTask> playTasks = streamTaskMapper.selectList(playWrapper); | ||
| 480 | - if(CollectionUtil.isNotEmpty(playTasks)){ | ||
| 481 | - playTasks.forEach(playTask -> { | ||
| 482 | - changeBackup(playTask.getTaskId(), destFilePath); | ||
| 483 | - }); | 453 | + //是否需要上传到审片间 |
| 454 | + if(materialSubmitVo.getOperateType().equals("2")){ | ||
| 455 | + //添加审片间垫片配置 | ||
| 456 | + LambdaQueryWrapper<BackupConfig> wrapper = new LambdaQueryWrapper<>(); | ||
| 457 | + wrapper.eq(BackupConfig::getRoomId,materialSubmitVo.getRoomId()); | ||
| 458 | + wrapper.eq(BackupConfig::getBackupOrder,materialSubmitVo.getBackupOrder()); | ||
| 459 | + BackupConfig backupConfig = backupConfigMapper.selectOne(wrapper); | ||
| 460 | + if(ObjectUtil.isNull(backupConfig)){ | ||
| 461 | + backupConfig = new BackupConfig(); | ||
| 462 | + backupConfig.setBackupStatus("0"); | ||
| 463 | + } | ||
| 464 | + backupConfig.setRoomId(materialSubmitVo.getRoomId()); | ||
| 465 | + backupConfig.setBackupId(backupMaterial.getId()); | ||
| 466 | + backupConfig.setBackupOrder(materialSubmitVo.getBackupOrder()); | ||
| 467 | + backupConfig.setBackupPath(relativePath); | ||
| 468 | + backupConfigMapper.insertOrUpdate(backupConfig); | ||
| 469 | + | ||
| 470 | + //对应垫片任务切源(转码平台演示环境已挂载统一存储),请求转码平台修改垫片任务直播源 | ||
| 471 | + changeChannelSource(streamTask.getTaskId(), destFilePath); | ||
| 472 | + //判断是否需要修改当前播出流的垫片 | ||
| 473 | + if("1".equals(backupConfig.getBackupStatus())){ | ||
| 474 | + //切换播出流垫片(主、备) | ||
| 475 | + LambdaQueryWrapper<StreamTask> playWrapper = new LambdaQueryWrapper<>(); | ||
| 476 | + playWrapper.eq(StreamTask::getRoomId,materialSubmitVo.getRoomId()); | ||
| 477 | + playWrapper.eq(StreamTask::getPlayType,"play"); | ||
| 478 | + List<StreamTask> playTasks = streamTaskMapper.selectList(playWrapper); | ||
| 479 | + if(CollectionUtil.isNotEmpty(playTasks)){ | ||
| 480 | + playTasks.forEach(playTask -> { | ||
| 481 | + changeBackup(playTask.getTaskId(), destFilePath); | ||
| 482 | + }); | ||
| 483 | + } | ||
| 484 | } | 484 | } |
| 485 | } | 485 | } |
| 486 | 486 |
-
Please register or login to post a comment