| | |
| | | import com.sandu.ximon.admin.utils.response.VnnoxPlayerListResponse; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxPlayerResponse; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResultResponse; |
| | | import com.sandu.ximon.admin.vo.NovaPushResultVO; |
| | | import com.sandu.ximon.admin.vo.NovaScreenShorUrlVO; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | |
| | | private LedPlayerEntityService ledPlayerEntityService; |
| | | |
| | | private VnnoxProgramAPIUtil vnnoxProgramAPIUtil; |
| | | private CountDownLatchUtil countDownLatchUtil; |
| | | |
| | | /** |
| | | * 设备校验注册 |
| | |
| | | |
| | | // 根据屏幕状态调整REDIS标识位 |
| | | for (String playerId : vnnoxResult.getSuccess()) { |
| | | redisUtils.set(VnnoxConstant.REDIS_SCREEN_STATUS + playerId, screenStatus, VnnoxConstant.REDIS_MAX_SAVE_TIME); |
| | | redisUtils.set(VnnoxConstant.REDIS_SCREEN_STATUS + playerId, screenStatus); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | VnnoxResult vnnoxResult = vnnoxAPIUtil.volChange(playerList.stream().map(item -> item.getPlayerId()).collect(Collectors.toList()), vol); |
| | | // 根据音量调整REDIS标识位 |
| | | for (String playerId : vnnoxResult.getSuccess()) { |
| | | redisUtils.set(VnnoxConstant.REDIS_VOL + playerId, vol, VnnoxConstant.REDIS_MAX_SAVE_TIME); |
| | | redisUtils.set(VnnoxConstant.REDIS_VOL + playerId, vol); |
| | | } |
| | | List<String> success = vnnoxResult.getSuccess(); |
| | | List<String> fail = vnnoxResult.getFail(); |
| | |
| | | VnnoxResult vnnoxResult = vnnoxAPIUtil.brightnessChange(playerList.stream().map(item -> item.getPlayerId()).collect(Collectors.toList()), brightness); |
| | | // 根据亮度调整REDIS标识位 |
| | | for (String playerId : vnnoxResult.getSuccess()) { |
| | | redisUtils.set(VnnoxConstant.REDIS_BRIGHTNESS + playerId, brightness, VnnoxConstant.REDIS_MAX_SAVE_TIME); |
| | | redisUtils.set(VnnoxConstant.REDIS_BRIGHTNESS + playerId, brightness); |
| | | } |
| | | List<String> success = vnnoxResult.getSuccess(); |
| | | List<String> fail = vnnoxResult.getFail(); |
| | |
| | | |
| | | |
| | | // 批量截屏 |
| | | public List<NovaScreenShorUrlVO> getScreenShotUrl(List<NovaPushResultVO> playerIds) { |
| | | public List<NovaScreenShorUrlVO> getScreenShotUrl(List<NovaPushResultVO> playerIds) throws InterruptedException { |
| | | List<NovaScreenShorUrlVO> screenShorUrlList = new ArrayList<>(); |
| | | |
| | | //从playerIds中获取playerId |
| | |
| | | break; |
| | | } else { |
| | | num++; |
| | | Thread.sleep(500); |
| | | } |
| | | } |
| | | screenShorUrlVO.setShortUrl(url); |
| | |
| | | /** |
| | | * 获取缓存数据 |
| | | * |
| | | * @param list |
| | | * @param |
| | | * @return |
| | | */ |
| | | public List<LedPlayerEntity> setCacheInfo(List<LedPlayerEntity> ledList) { |
| | | List<String> temp = new ArrayList<>(); |
| | | for (LedPlayerEntity item : ledList) { |
| | | String playerId = item.getPlayerId(); |
| | | if (redisUtils.get(VnnoxConstant.REDIS_VOL + playerId) == null |
| | | || redisUtils.get(VnnoxConstant.REDIS_BRIGHTNESS + playerId) == null) { |
| | | temp.add(item.getPlayerId()); |
| | | } |
| | | } |
| | | if (temp.size() > 0) { |
| | | List<List<String>> split = CollectionUtil.split(temp, 100); |
| | | for (List<String> playIds : split) { |
| | | System.out.println(playIds.size()); |
| | | vnnoxAPIUtil.asyncStatus(playIds); |
| | | } |
| | | } |
| | | |
| | | List<List<LedPlayerEntity>> split = CollectionUtil.split(ledList, 100); |
| | | for (List<LedPlayerEntity> list : split) { |
| | | for (LedPlayerEntity playerEntity : list) { |
| | |
| | | result = redisUtils.get(VnnoxConstant.REDIS_VOL + playerId); |
| | | Integer vol = 0; |
| | | if (null != result) { |
| | | vol = Integer.parseInt(result); |
| | | vol = Float.valueOf(result).intValue(); |
| | | |
| | | } |
| | | cache.setVol(vol); |
| | | // 设置屏幕亮度 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_BRIGHTNESS + playerId); |
| | | Integer brightness = 0; |
| | | if (null != result) { |
| | | brightness = Integer.parseInt(result); |
| | | brightness = Float.valueOf(result).intValue(); |
| | | } |
| | | cache.setBrightness(brightness); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public void asyncStatus(List<String> playerIds) { |
| | | VnnoxResultResponse vnnoxResultResponse = vnnoxAPIUtil.asyncStatus(playerIds); |
| | | |
| | | } |
| | | |
| | | } |