| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.log.Log; |
| | | import com.sandu.ximon.admin.config.VnnoxConstant; |
| | | import com.sandu.ximon.admin.utils.LogUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.request.VnnoxScreenStatusType; |
| | |
| | | return map; |
| | | } |
| | | |
| | | // //重启 |
| | | // public VnnoxResult reboot(List<LedPlayerEntity> playerList) { |
| | | // return vnnoxAPIUtil.reboot( |
| | | // playerList.stream().map( |
| | | // item -> item.getPlayerId() |
| | | // ).collect(Collectors.toList()) |
| | | // ); |
| | | // } |
| | | |
| | | //重启 |
| | | public VnnoxResult reboot(List<LedPlayerEntity> playerList) { |
| | | return vnnoxAPIUtil.reboot( |
| | | playerList.stream().map( |
| | | item -> item.getPlayerId() |
| | | ).collect(Collectors.toList()) |
| | | ); |
| | | public VnnoxResult reboot(List<String> playerList) { |
| | | return vnnoxAPIUtil.reboot(playerList); |
| | | } |
| | | |
| | | /** |
| | | * 同步播放 |
| | | * @param |
| | | * @return |
| | | */ |
| | | public VnnoxResult syncPlay(List<String> playerList,Integer option) { |
| | | return vnnoxAPIUtil.syncPlay(playerList,option); |
| | | } |
| | | |
| | | /** |
| | | * 对时 |
| | | * @param |
| | | * @return |
| | | */ |
| | | public VnnoxResult ntpSync(List<String> playerList,boolean enable) { |
| | | return vnnoxAPIUtil.ntpSync(playerList,enable); |
| | | } |
| | | |
| | | |
| | | public boolean updateDataName(Long id, String name) { |
| | | LedPlayerEntity byId = ledPlayerEntityService.getById(id); |
| | |
| | | |
| | | /** |
| | | * 获取缓存数据 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<LedPlayerEntity> setCacheInfo(List<LedPlayerEntity> list) { |
| | | for(LedPlayerEntity playerEntity: list) { |
| | | for (LedPlayerEntity playerEntity : list) { |
| | | String playerId = playerEntity.getPlayerId(); |
| | | LedPlayerInfoEntity cache = new LedPlayerInfoEntity(); |
| | | // 设置屏幕状态 |
| | | String result = redisUtils.get(VnnoxConstant.REDIS_SCREEN_STATUS + playerId); |
| | | Integer screenStatus = 1; |
| | | if(null != result) { |
| | | if (null != result) { |
| | | screenStatus = Integer.parseInt(result); |
| | | } |
| | | cache.setScreenStatus(screenStatus); |
| | | // 设置屏幕音量 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_VOL + playerId); |
| | | Integer vol = 0; |
| | | if(null != result) { |
| | | if (null != result) { |
| | | vol = Integer.parseInt(result); |
| | | } |
| | | cache.setVol(vol); |
| | | // 设置屏幕亮度 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_BRIGHTNESS + playerId); |
| | | Integer brightness = 0; |
| | | if(null != result) { |
| | | if (null != result) { |
| | | brightness = Integer.parseInt(result); |
| | | } |
| | | cache.setBrightness(brightness); |
| | | |
| | | // 设置缩略图访问路径 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_SCREEN_SHOT + playerId); |
| | | System.out.println(playerId+"的路径结果:-----------------------------"+result); |
| | | if(null != result) { |
| | | System.out.println(playerId + "的路径结果:-----------------------------" + result); |
| | | if (null != result) { |
| | | playerEntity.setScreenShotUrl(result); |
| | | } else { |
| | | playerEntity.setScreenShotUrl(""); |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |