| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.config.VnnoxConstant; |
| | |
| | | import com.sandu.ximon.admin.utils.response.VnnoxPlayerResponse; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.admin.vo.NovaPushResultVO; |
| | | import com.sandu.ximon.admin.vo.NovaScreenShorUrlVO; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedPlayerInfoEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.net.URISyntaxException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | // 批量截屏 |
| | | public List<NovaScreenShorUrlVO> getScreenShotUrl(List<NovaPushResultVO> playerIds) { |
| | | List<NovaScreenShorUrlVO> screenShorUrlList = new ArrayList<>(); |
| | | |
| | | //从playerIds中获取playerId |
| | | List<String> AllplayerIdsList = playerIds.stream().map(item -> item.getPlayerId()).collect(Collectors.toList()); |
| | | List<List<String>> split = CollectionUtil.split(AllplayerIdsList, 100); |
| | | for (List<String> playerIdsList : split) { |
| | | VnnoxResult vnnoxResult = vnnoxAPIUtil.screenShot(playerIdsList); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | NovaScreenShorUrlVO screenShorUrlVO; |
| | | for (String successStrId : vnnoxResult.getSuccess()) { |
| | | screenShorUrlVO = new NovaScreenShorUrlVO(); |
| | | String url = null; |
| | | int num = 0; |
| | | while (num < 3) { |
| | | url = redisUtils.get(VnnoxConstant.REDIS_SCREEN_SHOT + successStrId); |
| | | if (url != null) { |
| | | break; |
| | | } else { |
| | | num++; |
| | | } |
| | | } |
| | | screenShorUrlVO.setShortUrl(url); |
| | | screenShorUrlVO.setPlayerId(successStrId); |
| | | screenShorUrlVO.setTime(now); |
| | | for (NovaPushResultVO bean : playerIds) { |
| | | if (bean.getPlayerId().equals(successStrId)) { |
| | | screenShorUrlVO.setName(bean.getName()); |
| | | break; |
| | | } |
| | | } |
| | | screenShorUrlList.add(screenShorUrlVO); |
| | | } |
| | | for (String failStrId : vnnoxResult.getFail()) { |
| | | screenShorUrlVO = new NovaScreenShorUrlVO(); |
| | | |
| | | String url = null; |
| | | screenShorUrlVO.setShortUrl(url); |
| | | screenShorUrlVO.setPlayerId(failStrId); |
| | | screenShorUrlVO.setTime(now); |
| | | for (NovaPushResultVO bean : playerIds) { |
| | | if (bean.getPlayerId().equals(failStrId)) { |
| | | screenShorUrlVO.setName(bean.getName()); |
| | | break; |
| | | } |
| | | } |
| | | screenShorUrlList.add(screenShorUrlVO); |
| | | } |
| | | } |
| | | return screenShorUrlList; |
| | | } |
| | | |
| | | |
| | | // //重启 |
| | | // public VnnoxResult reboot(List<LedPlayerEntity> playerList) { |
| | | // return vnnoxAPIUtil.reboot( |
| | |
| | | |
| | | |
| | | private List<PlayerWidget> generateWaterAndSensorWidget(A5AtmosphereHeartbeatReportInnerFrame.HeartBeatDataPackage poleSensorEntity) { |
| | | //TODO |
| | | |
| | | List widgetList = new ArrayList<>(); |
| | | List<String> list = new ArrayList<>(); |
| | | if (Objects.nonNull(poleSensorEntity)) { |