Showing
15 changed files
with
407 additions
and
9 deletions
| @@ -2,17 +2,21 @@ package com.wondertek.controller; | @@ -2,17 +2,21 @@ package com.wondertek.controller; | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import com.wondertek.dto.BackupMaterialDto; | 4 | import com.wondertek.dto.BackupMaterialDto; |
| 5 | +import com.wondertek.dto.BackupUploadVo; | ||
| 5 | import com.wondertek.service.BackupMaterialService; | 6 | import com.wondertek.service.BackupMaterialService; |
| 6 | import com.wondertek.util.PageBean; | 7 | import com.wondertek.util.PageBean; |
| 8 | +import com.wondertek.util.ResultBean; | ||
| 7 | import jakarta.annotation.Resource; | 9 | import jakarta.annotation.Resource; |
| 8 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
| 9 | import org.springframework.web.bind.annotation.GetMapping; | 11 | import org.springframework.web.bind.annotation.GetMapping; |
| 12 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 10 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| 11 | import org.springframework.web.bind.annotation.RestController; | 14 | import org.springframework.web.bind.annotation.RestController; |
| 15 | +import org.springframework.web.multipart.MultipartFile; | ||
| 12 | 16 | ||
| 13 | @Slf4j | 17 | @Slf4j |
| 14 | @RestController | 18 | @RestController |
| 15 | -@RequestMapping("bkMaterial") | 19 | +@RequestMapping("/backup/material") |
| 16 | public class BackupMaterialController { | 20 | public class BackupMaterialController { |
| 17 | @Resource | 21 | @Resource |
| 18 | private BackupMaterialService backupMaterialService; | 22 | private BackupMaterialService backupMaterialService; |
| @@ -22,4 +26,10 @@ public class BackupMaterialController { | @@ -22,4 +26,10 @@ public class BackupMaterialController { | ||
| 22 | PageBean queryPage(BackupMaterialDto backupMaterialDto){ | 26 | PageBean queryPage(BackupMaterialDto backupMaterialDto){ |
| 23 | return backupMaterialService.queryPage(backupMaterialDto); | 27 | return backupMaterialService.queryPage(backupMaterialDto); |
| 24 | } | 28 | } |
| 29 | + | ||
| 30 | + //垫片上传 | ||
| 31 | + @PostMapping("upload") | ||
| 32 | + ResultBean upload(MultipartFile backupFile, BackupUploadVo backupUploadVo){ | ||
| 33 | + return backupMaterialService.upload(backupFile, backupUploadVo); | ||
| 34 | + } | ||
| 25 | } | 35 | } |
| 1 | package com.wondertek.controller; | 1 | package com.wondertek.controller; |
| 2 | 2 | ||
| 3 | +import com.wondertek.dto.BlockParam; | ||
| 3 | import com.wondertek.dto.DelayParam; | 4 | import com.wondertek.dto.DelayParam; |
| 5 | +import com.wondertek.dto.MarkParam; | ||
| 4 | import com.wondertek.service.RoomOperationSerivice; | 6 | import com.wondertek.service.RoomOperationSerivice; |
| 5 | import com.wondertek.util.ResultBean; | 7 | import com.wondertek.util.ResultBean; |
| 6 | import jakarta.annotation.Resource; | 8 | import jakarta.annotation.Resource; |
| 7 | import lombok.extern.slf4j.Slf4j; | 9 | import lombok.extern.slf4j.Slf4j; |
| 8 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.RestController; | 10 | +import org.springframework.web.bind.annotation.*; |
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * @Description: 审片间控制 | 13 | * @Description: 审片间控制 |
| @@ -21,10 +22,42 @@ public class RoomOperationController { | @@ -21,10 +22,42 @@ public class RoomOperationController { | ||
| 21 | @Resource | 22 | @Resource |
| 22 | private RoomOperationSerivice roomOperationSerivice; | 23 | private RoomOperationSerivice roomOperationSerivice; |
| 23 | 24 | ||
| 24 | - @RequestMapping("/setDelayTime") | ||
| 25 | - public ResultBean setDelayTime(DelayParam delayParam) { | ||
| 26 | - | 25 | + /** |
| 26 | + * @Description: 设置延时 | ||
| 27 | + * @Author W5669 | ||
| 28 | + * @Create 2025/7/22 | ||
| 29 | + * @Version 1.0 | ||
| 30 | + */ | ||
| 31 | + @PostMapping("/setDelayTime") | ||
| 32 | + public ResultBean setDelayTime(@RequestBody DelayParam delayParam) { | ||
| 33 | + log.info("-->【云审片平台】审片间延时设置,delayParam:{}",delayParam); | ||
| 27 | return roomOperationSerivice.setDelayTime(delayParam); | 34 | return roomOperationSerivice.setDelayTime(delayParam); |
| 28 | 35 | ||
| 29 | } | 36 | } |
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * @Description: 屏蔽/恢复 | ||
| 40 | + * @Author W5669 | ||
| 41 | + * @Create 2025/7/22 | ||
| 42 | + * @Version 1.0 | ||
| 43 | + */ | ||
| 44 | + @PostMapping("/blockStatus") | ||
| 45 | + public ResultBean blockStatus (@RequestBody BlockParam blockParam) { | ||
| 46 | + log.info("-->审片间【{}】操作,参数:{}",blockParam.getBlockStatus().equals(0)?"恢复":"屏蔽",blockParam); | ||
| 47 | + return roomOperationSerivice.blockStatus(blockParam); | ||
| 48 | + | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @PostMapping("/addMark") | ||
| 52 | + public ResultBean addMark (@RequestBody MarkParam markParam) { | ||
| 53 | + log.info("-->审片间标记,参数:{}",markParam); | ||
| 54 | + return roomOperationSerivice.addMark(markParam); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @GetMapping("/operation/list") | ||
| 58 | + public ResultBean operationList(@RequestParam(value = "roomId") Long roomId) { | ||
| 59 | + return roomOperationSerivice.operationList(roomId); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + | ||
| 30 | } | 63 | } |
| 1 | +package com.wondertek.dto; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * @Description: 垫片上传参数 | ||
| 7 | + * @Author W5669 | ||
| 8 | + * @Create 2025/7/24 | ||
| 9 | + * @Version 1.0 | ||
| 10 | + */ | ||
| 11 | +@Data | ||
| 12 | +public class BackupUploadVo { | ||
| 13 | + //png、jpg、mp4等 | ||
| 14 | + private String fileType; | ||
| 15 | + //垫片名 | ||
| 16 | + private String backupName; | ||
| 17 | + //审片间id | ||
| 18 | + private String roomId; | ||
| 19 | + //1:垫片1,2:垫片2 | ||
| 20 | + private String backupOrder; | ||
| 21 | + | ||
| 22 | +} |
| 1 | +package com.wondertek.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.time.LocalDateTime; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * @Description: 屏蔽/恢复参数 | ||
| 10 | + * @Author W5669 | ||
| 11 | + * @Create 2025/7/22 | ||
| 12 | + * @Version 1.0 | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +public class BlockParam { | ||
| 16 | + private Long roomId; | ||
| 17 | + /** | ||
| 18 | + 执行操作。0: 恢复(对应屏蔽状态未屏蔽),1: 屏蔽(对应屏蔽状态已屏蔽 | ||
| 19 | + */ | ||
| 20 | + private Integer blockStatus; | ||
| 21 | + /** | ||
| 22 | + 屏蔽类型,0:音画屏蔽 1-画面屏蔽(暂不支持) | ||
| 23 | + */ | ||
| 24 | + private Integer blockType; | ||
| 25 | + /** | ||
| 26 | + 操作时间 | ||
| 27 | + */ | ||
| 28 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 29 | + private LocalDateTime operationTime; | ||
| 30 | +} |
| 1 | +package com.wondertek.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.time.LocalDateTime; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * @Description: 审片间标记 | ||
| 10 | + * @Author W5669 | ||
| 11 | + * @Create 2025/7/24 | ||
| 12 | + * @Version 1.0 | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +public class MarkParam { | ||
| 16 | + private Long roomId; | ||
| 17 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 18 | + private LocalDateTime markStartTime; | ||
| 19 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 20 | + private LocalDateTime markEndTime; | ||
| 21 | +} |
| @@ -34,7 +34,7 @@ public class MonitorMark { | @@ -34,7 +34,7 @@ public class MonitorMark { | ||
| 34 | */ | 34 | */ |
| 35 | private String createdBy; | 35 | private String createdBy; |
| 36 | /** | 36 | /** |
| 37 | - * 操作时间 | 37 | + * 创建时间 |
| 38 | */ | 38 | */ |
| 39 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 39 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| 40 | private LocalDateTime createdTime; | 40 | private LocalDateTime createdTime; |
| @@ -49,4 +49,15 @@ public class MonitorMark { | @@ -49,4 +49,15 @@ public class MonitorMark { | ||
| 49 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 49 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| 50 | private LocalDateTime markEndTime; | 50 | private LocalDateTime markEndTime; |
| 51 | 51 | ||
| 52 | + /** | ||
| 53 | + * 操作类型, mark-标记,block-屏蔽。recover-恢复 | ||
| 54 | + */ | ||
| 55 | + private String operationType; | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * 操作时间 | ||
| 59 | + */ | ||
| 60 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 61 | + private LocalDateTime OperationTime; | ||
| 62 | + | ||
| 52 | } | 63 | } |
| 1 | +package com.wondertek.enums; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @Description:审片间播控操作类型 | ||
| 5 | + */ | ||
| 6 | +public enum RoomOperationEnum { | ||
| 7 | + MARK("mark", "标记"), | ||
| 8 | + BLOCK("block", "屏蔽"), | ||
| 9 | + RECOVER("recover", "恢复"); | ||
| 10 | + | ||
| 11 | + | ||
| 12 | + private final String code; | ||
| 13 | + private final String name; | ||
| 14 | + | ||
| 15 | + RoomOperationEnum(String status, String name) { | ||
| 16 | + this.code = status; | ||
| 17 | + this.name = name; | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + public String getCode() { | ||
| 21 | + return code; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + public String getName() { | ||
| 25 | + return name; | ||
| 26 | + } | ||
| 27 | +} |
| @@ -2,10 +2,15 @@ package com.wondertek.service; | @@ -2,10 +2,15 @@ package com.wondertek.service; | ||
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | import com.wondertek.dto.BackupMaterialDto; | 4 | import com.wondertek.dto.BackupMaterialDto; |
| 5 | +import com.wondertek.dto.BackupUploadVo; | ||
| 5 | import com.wondertek.entity.BackupMaterial; | 6 | import com.wondertek.entity.BackupMaterial; |
| 6 | import com.wondertek.util.PageBean; | 7 | import com.wondertek.util.PageBean; |
| 8 | +import com.wondertek.util.ResultBean; | ||
| 9 | +import org.springframework.web.multipart.MultipartFile; | ||
| 7 | 10 | ||
| 8 | public interface BackupMaterialService extends IService<BackupMaterial> { | 11 | public interface BackupMaterialService extends IService<BackupMaterial> { |
| 9 | 12 | ||
| 10 | PageBean queryPage(BackupMaterialDto BackupMaterialDto); | 13 | PageBean queryPage(BackupMaterialDto BackupMaterialDto); |
| 14 | + | ||
| 15 | + ResultBean upload(MultipartFile backupFile, BackupUploadVo backupUploadVo); | ||
| 11 | } | 16 | } |
| 1 | package com.wondertek.service; | 1 | package com.wondertek.service; |
| 2 | 2 | ||
| 3 | +import com.wondertek.dto.BlockParam; | ||
| 3 | import com.wondertek.dto.DelayParam; | 4 | import com.wondertek.dto.DelayParam; |
| 5 | +import com.wondertek.dto.MarkParam; | ||
| 4 | import com.wondertek.util.ResultBean; | 6 | import com.wondertek.util.ResultBean; |
| 5 | 7 | ||
| 6 | /** | 8 | /** |
| @@ -16,4 +18,25 @@ public interface RoomOperationSerivice { | @@ -16,4 +18,25 @@ public interface RoomOperationSerivice { | ||
| 16 | * @return | 18 | * @return |
| 17 | */ | 19 | */ |
| 18 | ResultBean setDelayTime(DelayParam delayParam); | 20 | ResultBean setDelayTime(DelayParam delayParam); |
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 屏蔽、恢复 | ||
| 24 | + * @param blockParam | ||
| 25 | + * @return | ||
| 26 | + */ | ||
| 27 | + ResultBean blockStatus(BlockParam blockParam); | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 标记 | ||
| 31 | + * @param markParam | ||
| 32 | + * @return | ||
| 33 | + */ | ||
| 34 | + ResultBean addMark(MarkParam markParam); | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 获取播控操作记录 | ||
| 38 | + * @param roomId | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + ResultBean operationList(Long roomId); | ||
| 19 | } | 42 | } |
| @@ -5,13 +5,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | @@ -5,13 +5,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 7 | import com.wondertek.dto.BackupMaterialDto; | 7 | import com.wondertek.dto.BackupMaterialDto; |
| 8 | +import com.wondertek.dto.BackupUploadVo; | ||
| 8 | import com.wondertek.entity.BackupMaterial; | 9 | import com.wondertek.entity.BackupMaterial; |
| 9 | import com.wondertek.mapper.BackupMaterialMapper; | 10 | import com.wondertek.mapper.BackupMaterialMapper; |
| 10 | import com.wondertek.service.BackupMaterialService; | 11 | import com.wondertek.service.BackupMaterialService; |
| 11 | import com.wondertek.util.PageBean; | 12 | import com.wondertek.util.PageBean; |
| 13 | +import com.wondertek.util.ResultBean; | ||
| 12 | import jakarta.annotation.Resource; | 14 | import jakarta.annotation.Resource; |
| 13 | import org.apache.commons.lang3.StringUtils; | 15 | import org.apache.commons.lang3.StringUtils; |
| 14 | import org.springframework.stereotype.Service; | 16 | import org.springframework.stereotype.Service; |
| 17 | +import org.springframework.web.multipart.MultipartFile; | ||
| 15 | 18 | ||
| 16 | @Service | 19 | @Service |
| 17 | public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, BackupMaterial> implements BackupMaterialService { | 20 | public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, BackupMaterial> implements BackupMaterialService { |
| @@ -39,4 +42,15 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | @@ -39,4 +42,15 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | ||
| 39 | IPage<BackupMaterial> resultPage = backupMaterialMapper.selectPage(pageInfo, queryWrapper); | 42 | IPage<BackupMaterial> resultPage = backupMaterialMapper.selectPage(pageInfo, queryWrapper); |
| 40 | return new PageBean(Integer.parseInt(String.valueOf(resultPage.getPages())),resultPage.getTotal(),resultPage.getRecords()); | 43 | return new PageBean(Integer.parseInt(String.valueOf(resultPage.getPages())),resultPage.getTotal(),resultPage.getRecords()); |
| 41 | } | 44 | } |
| 45 | + | ||
| 46 | + @Override | ||
| 47 | + public ResultBean upload(MultipartFile backupFile, BackupUploadVo backupUploadVo) { | ||
| 48 | + //上传文件 | ||
| 49 | + //加入保存垫片素材表 | ||
| 50 | + //添加审片间垫片配置 | ||
| 51 | + //垫片搬迁到转码平台,对应垫片任务切流 | ||
| 52 | + //判断是否需要修改当前播出流的垫片 | ||
| 53 | + | ||
| 54 | + return null; | ||
| 55 | + } | ||
| 42 | } | 56 | } |
| 1 | package com.wondertek.service.impl; | 1 | package com.wondertek.service.impl; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.util.ObjectUtil; | ||
| 3 | import cn.hutool.http.HttpRequest; | 4 | import cn.hutool.http.HttpRequest; |
| 4 | import cn.hutool.http.HttpResponse; | 5 | import cn.hutool.http.HttpResponse; |
| 5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 7 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
| 6 | import com.fasterxml.jackson.core.type.TypeReference; | 8 | import com.fasterxml.jackson.core.type.TypeReference; |
| 9 | +import com.wondertek.dto.BlockParam; | ||
| 7 | import com.wondertek.dto.DelayParam; | 10 | import com.wondertek.dto.DelayParam; |
| 11 | +import com.wondertek.dto.MarkParam; | ||
| 8 | import com.wondertek.entity.LiveMonitorRoom; | 12 | import com.wondertek.entity.LiveMonitorRoom; |
| 13 | +import com.wondertek.entity.MonitorMark; | ||
| 9 | import com.wondertek.entity.StreamTask; | 14 | import com.wondertek.entity.StreamTask; |
| 15 | +import com.wondertek.enums.RoomOperationEnum; | ||
| 16 | +import com.wondertek.exception.BusinessException; | ||
| 10 | import com.wondertek.mapper.LiveMonitorRoomMapper; | 17 | import com.wondertek.mapper.LiveMonitorRoomMapper; |
| 18 | +import com.wondertek.mapper.MonitorMarkMapper; | ||
| 11 | import com.wondertek.mapper.StreamTaskMapper; | 19 | import com.wondertek.mapper.StreamTaskMapper; |
| 12 | import com.wondertek.service.RoomOperationSerivice; | 20 | import com.wondertek.service.RoomOperationSerivice; |
| 13 | import com.wondertek.util.JSONUtils; | 21 | import com.wondertek.util.JSONUtils; |
| 14 | import com.wondertek.util.ResponseData; | 22 | import com.wondertek.util.ResponseData; |
| 15 | import com.wondertek.util.ResultBean; | 23 | import com.wondertek.util.ResultBean; |
| 24 | +import com.wondertek.vo.RoomBlock; | ||
| 25 | +import com.wondertek.vo.RoomMark; | ||
| 26 | +import com.wondertek.vo.RoomOperationVo; | ||
| 16 | import jakarta.annotation.Resource; | 27 | import jakarta.annotation.Resource; |
| 17 | import lombok.extern.slf4j.Slf4j; | 28 | import lombok.extern.slf4j.Slf4j; |
| 18 | import org.springframework.beans.factory.annotation.Value; | 29 | import org.springframework.beans.factory.annotation.Value; |
| 19 | import org.springframework.stereotype.Service; | 30 | import org.springframework.stereotype.Service; |
| 20 | 31 | ||
| 32 | +import java.time.LocalDateTime; | ||
| 33 | +import java.util.ArrayList; | ||
| 21 | import java.util.HashMap; | 34 | import java.util.HashMap; |
| 22 | import java.util.List; | 35 | import java.util.List; |
| 23 | import java.util.Map; | 36 | import java.util.Map; |
| @@ -37,10 +50,13 @@ public class RoomOperationServiceImpl implements RoomOperationSerivice { | @@ -37,10 +50,13 @@ public class RoomOperationServiceImpl implements RoomOperationSerivice { | ||
| 37 | private StreamTaskMapper streamTaskMapper; | 50 | private StreamTaskMapper streamTaskMapper; |
| 38 | @Value("${transcode.delayTimeUrl}") | 51 | @Value("${transcode.delayTimeUrl}") |
| 39 | private String delayTimeUrl; | 52 | private String delayTimeUrl; |
| 53 | + @Value("${transcode.blockStatusUrl}") | ||
| 54 | + private String blockStatusUrl; | ||
| 55 | + @Resource | ||
| 56 | + private MonitorMarkMapper monitorMarkMapper; | ||
| 40 | 57 | ||
| 41 | @Override | 58 | @Override |
| 42 | public ResultBean setDelayTime(DelayParam delayParam) { | 59 | public ResultBean setDelayTime(DelayParam delayParam) { |
| 43 | - log.info("-->【云审片平台】审片间延时设置,delayParam:{}",delayParam); | ||
| 44 | LiveMonitorRoom liveMonitorRoom = liveMonitorRoomMapper.selectById(delayParam.getRoomId()); | 60 | LiveMonitorRoom liveMonitorRoom = liveMonitorRoomMapper.selectById(delayParam.getRoomId()); |
| 45 | LambdaQueryWrapper<StreamTask> wrapper = new LambdaQueryWrapper<>(); | 61 | LambdaQueryWrapper<StreamTask> wrapper = new LambdaQueryWrapper<>(); |
| 46 | wrapper.eq(StreamTask::getRoomId,delayParam.getRoomId()); | 62 | wrapper.eq(StreamTask::getRoomId,delayParam.getRoomId()); |
| @@ -53,6 +69,18 @@ public class RoomOperationServiceImpl implements RoomOperationSerivice { | @@ -53,6 +69,18 @@ public class RoomOperationServiceImpl implements RoomOperationSerivice { | ||
| 53 | streamTask.setDelayTime(delayParam.getDelayFirst()); | 69 | streamTask.setDelayTime(delayParam.getDelayFirst()); |
| 54 | streamTaskMapper.updateById(streamTask); | 70 | streamTaskMapper.updateById(streamTask); |
| 55 | } | 71 | } |
| 72 | + if (streamTask.getPlayType().equals("delay2")){ | ||
| 73 | + delayTask(streamTask.getTaskId(),delayParam.getDelaySecond()); | ||
| 74 | + //更新任务 | ||
| 75 | + streamTask.setDelayTime(delayParam.getDelaySecond()); | ||
| 76 | + streamTaskMapper.updateById(streamTask); | ||
| 77 | + } | ||
| 78 | + if (streamTask.getPlayType().equals("play")){ | ||
| 79 | + delayTask(streamTask.getTaskId(),delayParam.getDelayPlay()); | ||
| 80 | + //更新任务 | ||
| 81 | + streamTask.setDelayTime(delayParam.getDelayPlay()); | ||
| 82 | + streamTaskMapper.updateById(streamTask); | ||
| 83 | + } | ||
| 56 | }); | 84 | }); |
| 57 | 85 | ||
| 58 | //2.更新多画 | 86 | //2.更新多画 |
| @@ -86,4 +114,112 @@ public class RoomOperationServiceImpl implements RoomOperationSerivice { | @@ -86,4 +114,112 @@ public class RoomOperationServiceImpl implements RoomOperationSerivice { | ||
| 86 | log.error("请求转码系统延时接口失败,url:{}", delayTimeUrl, e); | 114 | log.error("请求转码系统延时接口失败,url:{}", delayTimeUrl, e); |
| 87 | } | 115 | } |
| 88 | } | 116 | } |
| 117 | + | ||
| 118 | + @Override | ||
| 119 | + public ResultBean blockStatus(BlockParam blockParam) { | ||
| 120 | + LiveMonitorRoom liveMonitorRoom = liveMonitorRoomMapper.selectById(blockParam.getRoomId()); | ||
| 121 | + if (ObjectUtil.isNull(liveMonitorRoom)){ | ||
| 122 | + return ResultBean.error("审片间不存在"); | ||
| 123 | + } | ||
| 124 | + //获取当前播出流 | ||
| 125 | + LambdaQueryWrapper<StreamTask> wrapper = new LambdaQueryWrapper<>(); | ||
| 126 | + wrapper.eq(StreamTask::getRoomId,blockParam.getRoomId()); | ||
| 127 | + wrapper.eq(StreamTask::getPlayType,"play"); | ||
| 128 | + List<StreamTask> streamTasks = streamTaskMapper.selectList(wrapper); | ||
| 129 | + if (CollectionUtils.isEmpty(streamTasks)){ | ||
| 130 | + return ResultBean.error("当前审片间没有播放任务"); | ||
| 131 | + } | ||
| 132 | + streamTasks.forEach(streamTask -> { | ||
| 133 | + //调用屏蔽接口 | ||
| 134 | + Map<String, Object> paramsMap = new HashMap<>(); | ||
| 135 | + paramsMap.put("taskId", streamTask.getTaskId()); | ||
| 136 | + paramsMap.put("blockStatus", blockParam.getBlockStatus()); | ||
| 137 | + HttpResponse execute = null; | ||
| 138 | + try { | ||
| 139 | + execute = HttpRequest.post(blockStatusUrl) | ||
| 140 | + .header("Content-Type", "application/json") | ||
| 141 | + .body(JSONUtils.obj2json(paramsMap)).timeout(30000).execute(); | ||
| 142 | + if (execute.isOk()) { | ||
| 143 | + log.info("-->请求转码系统屏蔽接口,url:{},paramsMap:{}",blockStatusUrl,paramsMap); | ||
| 144 | + String body = execute.body(); | ||
| 145 | + ResponseData response = JSONUtils.jsonToObject(body, new TypeReference<ResponseData>() { | ||
| 146 | + }); | ||
| 147 | + if (response.getResultCode().equals("0")) { | ||
| 148 | + log.info("请求转码系统屏蔽接口成功"); | ||
| 149 | + }else { | ||
| 150 | + log.info("请求转码系统屏蔽接口响应失败,response:{}",response); | ||
| 151 | + throw new BusinessException("block_status_error", "屏蔽状态错误"); | ||
| 152 | + } | ||
| 153 | + } else { | ||
| 154 | + log.error("请求转码系统屏蔽接口失败,url:{},body:{}", blockStatusUrl, execute.body()); | ||
| 155 | + throw new BusinessException("block_status_error", "屏蔽状态错误"); | ||
| 156 | + } | ||
| 157 | + } catch (Exception e) { | ||
| 158 | + log.error("请求转码系统屏蔽接口失败,url:{}", blockStatusUrl, e); | ||
| 159 | + throw new BusinessException("block_status_error", "屏蔽状态错误"); | ||
| 160 | + } | ||
| 161 | + }); | ||
| 162 | + | ||
| 163 | + //保存播控操作记录 | ||
| 164 | + MonitorMark monitorMark = new MonitorMark(); | ||
| 165 | + monitorMark.setRoomId(blockParam.getRoomId()); | ||
| 166 | + monitorMark.setCreatedTime(LocalDateTime.now()); | ||
| 167 | + monitorMark.setCreatedBy("admin"); | ||
| 168 | + monitorMark.setOperationType(blockParam.getBlockStatus().equals("0") ? RoomOperationEnum.RECOVER.getCode() : RoomOperationEnum.BLOCK.getCode()); | ||
| 169 | + monitorMark.setOperationTime(LocalDateTime.now()); | ||
| 170 | + monitorMarkMapper.insert(monitorMark); | ||
| 171 | + | ||
| 172 | + liveMonitorRoom.setBrocStatus(String.valueOf(blockParam.getBlockStatus())); | ||
| 173 | + liveMonitorRoomMapper.updateById(liveMonitorRoom); | ||
| 174 | + | ||
| 175 | + return ResultBean.ok("设置成功"); | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + @Override | ||
| 179 | + public ResultBean addMark(MarkParam markParam) { | ||
| 180 | + | ||
| 181 | + MonitorMark monitorMark = new MonitorMark(); | ||
| 182 | + monitorMark.setRoomId(markParam.getRoomId()); | ||
| 183 | + monitorMark.setMarkStartTime(markParam.getMarkStartTime()); | ||
| 184 | + monitorMark.setMarkEndTime(markParam.getMarkEndTime()); | ||
| 185 | + monitorMark.setOperationType(RoomOperationEnum.MARK.getCode()); | ||
| 186 | + monitorMark.setCreatedTime(LocalDateTime.now()); | ||
| 187 | + monitorMark.setCreatedBy("admin"); | ||
| 188 | + monitorMarkMapper.insert(monitorMark); | ||
| 189 | + | ||
| 190 | + return ResultBean.ok("标记成功"); | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + @Override | ||
| 194 | + public ResultBean operationList(Long roomId) { | ||
| 195 | + LambdaQueryWrapper<MonitorMark> wrapper = new LambdaQueryWrapper<>(); | ||
| 196 | + wrapper.eq(MonitorMark::getRoomId, roomId); | ||
| 197 | + List<MonitorMark> monitorMarks = monitorMarkMapper.selectList(wrapper); | ||
| 198 | + RoomOperationVo roomOperationVo = new RoomOperationVo(); | ||
| 199 | + ArrayList<RoomMark> markList = new ArrayList<>(); | ||
| 200 | + ArrayList<RoomBlock> blockList = new ArrayList<>(); | ||
| 201 | + if(CollectionUtils.isNotEmpty(monitorMarks)){ | ||
| 202 | + //根据operationType处理数据 | ||
| 203 | + monitorMarks.forEach(monitorMark -> { | ||
| 204 | + if (monitorMark.getOperationType().equals(RoomOperationEnum.MARK.getCode())){ | ||
| 205 | + RoomMark roomMark = new RoomMark(); | ||
| 206 | + roomMark.setId(monitorMark.getId()); | ||
| 207 | + roomMark.setMarkStartTime(monitorMark.getMarkStartTime()); | ||
| 208 | + roomMark.setMarkEndTime(monitorMark.getMarkEndTime()); | ||
| 209 | + markList.add(roomMark); | ||
| 210 | + }else { | ||
| 211 | + RoomBlock roomBlock = new RoomBlock(); | ||
| 212 | + roomBlock.setId(monitorMark.getId()); | ||
| 213 | + roomBlock.setOperationTime(monitorMark.getOperationTime()); | ||
| 214 | + roomBlock.setOperationType(monitorMark.getOperationType()); | ||
| 215 | + blockList.add(roomBlock); | ||
| 216 | + } | ||
| 217 | + }); | ||
| 218 | + roomOperationVo.setMarkList(markList); | ||
| 219 | + roomOperationVo.setBlockList(blockList); | ||
| 220 | + } | ||
| 221 | + roomOperationVo.setMarkList(markList); | ||
| 222 | + roomOperationVo.setBlockList(blockList); | ||
| 223 | + return ResultBean.ok(roomOperationVo); | ||
| 224 | + } | ||
| 89 | } | 225 | } |
| 1 | +package com.wondertek.vo; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import lombok.Data; | ||
| 5 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 6 | + | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @Description: | ||
| 11 | + * @Author W5669 | ||
| 12 | + * @Create 2025/7/24 | ||
| 13 | + * @Version 1.0 | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +public class RoomBlock { | ||
| 17 | + private Long id; | ||
| 18 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 19 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 20 | + private LocalDateTime operationTime; | ||
| 21 | + private String operationType; | ||
| 22 | +} |
src/main/java/com/wondertek/vo/RoomMark.java
0 → 100644
| 1 | +package com.wondertek.vo; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import lombok.Data; | ||
| 5 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 6 | + | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @Description: | ||
| 11 | + * @Author W5669 | ||
| 12 | + * @Create 2025/7/24 | ||
| 13 | + * @Version 1.0 | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +public class RoomMark { | ||
| 17 | + private Long id; | ||
| 18 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 19 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 20 | + private LocalDateTime markStartTime; | ||
| 21 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 22 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 23 | + private LocalDateTime markEndTime; | ||
| 24 | +} |
| 1 | +package com.wondertek.vo; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | + | ||
| 5 | +import java.util.List; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @Description: 审片间播控操作记录 | ||
| 9 | + * @Author W5669 | ||
| 10 | + * @Create 2025/7/24 | ||
| 11 | + * @Version 1.0 | ||
| 12 | + */ | ||
| 13 | +@Data | ||
| 14 | +public class RoomOperationVo { | ||
| 15 | + //标记 | ||
| 16 | + private List<RoomMark> markList; | ||
| 17 | + //屏蔽、恢复 | ||
| 18 | + private List<RoomBlock> blockList; | ||
| 19 | +} |
| @@ -60,7 +60,8 @@ mybatis-plus: | @@ -60,7 +60,8 @@ mybatis-plus: | ||
| 60 | logic-delete-value: 0 | 60 | logic-delete-value: 0 |
| 61 | 61 | ||
| 62 | transcode: | 62 | transcode: |
| 63 | - delayTimeUrl: http://192.168.1.41:8080/transcode/delayTime # 延迟接口 | 63 | + delayTimeUrl: http://192.168.1.237:9002/api/v1/delayTime # 延迟接口 |
| 64 | + blockStatusUrl: http://192.168.1.237:9002/api/v1/blockStatus # 屏蔽/恢复 | ||
| 64 | getTaskDetail: http://192.168.1.237:9002/api/v1/getTaskDetail | 65 | getTaskDetail: http://192.168.1.237:9002/api/v1/getTaskDetail |
| 65 | 66 | ||
| 66 | crp: | 67 | crp: |
-
Please register or login to post a comment