| | |
| | | } |
| | | |
| | | public Map<String, Object> pushToLed(Long planId, List<NovaPushResultVO> nova) { |
| | | if(nova==null){ |
| | | if (nova == null) { |
| | | throw new BusinessException("请选择正确的LED屏"); |
| | | } |
| | | PushToLed pushToLed = playPlanMapper.pushToLed(planId); |
| | | if (pushToLed.getPages() == null) { |
| | | throw new BusinessException("节目内容丢失"); |
| | | } |
| | | PlayPlanNv byId = getById(planId); |
| | | if (pushToLed == null) { |
| | | throw new BusinessException("未找到该播放计划"); |
| | |
| | | program.setPlayerIds(playerIds); |
| | | |
| | | //获取节目实体 |
| | | program.setPages(JSON.parseObject(pushToLed.getPages(), List.class)); |
| | | |
| | | |
| | | List<ProgramDto> programDtos = JSON.parseArray(pushToLed.getPages(), ProgramDto.class); |
| | | programDtos.forEach( |
| | | programDto -> { |
| | | programDto.getWidgets().forEach( |
| | | widget -> { |
| | | String url = widget.getUrl(); |
| | | LEDProgramFile one = fileService.getOne(Wrappers.lambdaQuery(LEDProgramFile.class).eq(LEDProgramFile::getFileUrl, url)); |
| | | if (one == null) { |
| | | throw new BusinessException("节目文件已失效"); |
| | | } |
| | | widget.setMd5(one.getMd5()); |
| | | widget.setSize(one.getSize()); |
| | | } |
| | | ); |
| | | } |
| | | ); |
| | | |
| | | program.setPages(programDtos); |
| | | |
| | | //获取节目定时实体 |
| | | program.setSchedule((JSON.parseObject(pushToLed.getSchedule(), Map.class))); |
| | |
| | | if (ledProgram == null) { |
| | | throw new BusinessException("未找到节目"); |
| | | } |
| | | if (ledProgram.getPages() == null) { |
| | | throw new BusinessException("节目内容丢失"); |
| | | } |
| | | if (SecurityUtils.getClientId() != null && !Objects.equals(ledProgram.getClientId(), SecurityUtils.getUserId()) && !Objects.equals(ledProgram.getClientId(), SecurityUtils.getClientId())) { |
| | | throw new BusinessException("请不要操作其他人的节目"); |
| | | } |