| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 熙讯节目 |
| | |
| | | poleXixunPlayer.setHeight(programPro.getHeight()); |
| | | poleXixunPlayer.setWidth(programPro.getWidth()); |
| | | poleXixunPlayer.setTotalSize((float) programPro.getTotalSize() / 1000000 + "MB"); |
| | | // poleXixunPlayer.setTotalSize( Long.parseLong(programPro.getTotalSize()) / 1000000 + "MB"); |
| | | // programPro.setProgramId(poleXixunPlayer.getProgramId()); |
| | | // System.out.println(poleXixunPlayer.getProgramId()); |
| | | poleXixunPlayer.setRequestBody(json); |
| | | poleXixunPlayer.setScreenShot(programPro.getScreenShot()); |
| | | // poleXixunPlayer.setCreatTime(sdf.format(date)); |
| | | poleXixunPlayer.setCreateUserId(SecurityUtils.getUserId()); |
| | | if(!clientService.findClientId()){ |
| | | if (!clientService.findClientId()) { |
| | | poleXixunPlayer.setClientId(clientService.getClientId()); |
| | | } |
| | | |
| | |
| | | |
| | | public Object getByPid(Long pid) { |
| | | PoleXixunPlayerEntity byId = getById(pid); |
| | | List<Long> fileIds=new ArrayList<>(); |
| | | List<LedSFile> file=new ArrayList<>(); |
| | | List<Long> fileIds = new ArrayList<>(); |
| | | List<LedSFile> file = new ArrayList<>(); |
| | | if (byId == null) { |
| | | throw new BusinessException("未找到该节目"); |
| | | } |
| | |
| | | programPro.getLayers().forEach( |
| | | layerPro -> { |
| | | layerPro.getSources().forEach( |
| | | sourcePro -> { |
| | | long fileId = Long.parseLong(sourcePro.getId()); |
| | | file.add(xiXunFileService.getById(fileId)); |
| | | } |
| | | sourcePro -> { |
| | | long fileId = Long.parseLong(sourcePro.getId()); |
| | | file.add(xiXunFileService.getById(fileId)); |
| | | } |
| | | ); |
| | | } |
| | | ); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return programPro; |
| | | return programPro; |
| | | } |
| | | |
| | | /** |
| | | * 推送节目 |
| | | * |
| | | * @param programId |
| | | * @param lightemitIds |
| | | */ |
| | |
| | | |
| | | Collection<PoleLightemitEntity> poleLightemitEntities = poleLightemitService.listByIds(lightemitIds); |
| | | |
| | | if(poleLightemitEntities != null){ |
| | | for (PoleLightemitEntity entity: poleLightemitEntities) { |
| | | if (poleLightemitEntities != null) { |
| | | for (PoleLightemitEntity entity : poleLightemitEntities) { |
| | | lightemitUtils.clear(entity.getLightemitControlCode()); |
| | | poleLightemitService.updateRequestBody(entity.getLightemitControlCode(), jsondata); |
| | | String post = lightemitUtils.post(realtimeServerBean.getCommand() + entity.getLightemitControlCode(), jsondata); |
| | | LogUtils.error("结果:"+post); |
| | | LogUtils.error("结果:" + post); |
| | | } |
| | | } |
| | | } |