| | |
| | | import com.sandu.ximon.admin.dto.nova.PlayerWidget; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.VnnoxProgramAPIUtil; |
| | | import com.sandu.ximon.admin.utils.*; |
| | | import com.sandu.ximon.admin.utils.request.VnnoxScreenStatusType; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxPlayerListResponse; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxPlayerResponse; |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<LedPlayerEntity> setCacheInfo(List<LedPlayerEntity> 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) { |
| | | screenStatus = Integer.parseInt(result); |
| | | } |
| | | cache.setScreenStatus(screenStatus); |
| | | // 设置屏幕音量 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_VOL + playerId); |
| | | Integer vol = 0; |
| | | if (null != result) { |
| | | vol = Integer.parseInt(result); |
| | | } |
| | | cache.setVol(vol); |
| | | // 设置屏幕亮度 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_BRIGHTNESS + playerId); |
| | | Integer brightness = 0; |
| | | if (null != result) { |
| | | brightness = Integer.parseInt(result); |
| | | } |
| | | cache.setBrightness(brightness); |
| | | public List<LedPlayerEntity> setCacheInfo(List<LedPlayerEntity> ledList) { |
| | | List<List<LedPlayerEntity>> split = CollectionUtil.split(ledList, 100); |
| | | for (List<LedPlayerEntity> list : split) { |
| | | 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) { |
| | | screenStatus = Integer.parseInt(result); |
| | | } |
| | | cache.setScreenStatus(screenStatus); |
| | | // 设置屏幕音量 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_VOL + playerId); |
| | | Integer vol = 0; |
| | | if (null != result) { |
| | | vol = Integer.parseInt(result); |
| | | } |
| | | cache.setVol(vol); |
| | | // 设置屏幕亮度 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_BRIGHTNESS + playerId); |
| | | Integer brightness = 0; |
| | | if (null != result) { |
| | | brightness = Integer.parseInt(result); |
| | | } |
| | | cache.setBrightness(brightness); |
| | | |
| | | // 设置缩略图访问路径 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_SCREEN_SHOT + playerId); |
| | | if (null != result) { |
| | | playerEntity.setScreenShotUrl(result); |
| | | } else { |
| | | playerEntity.setScreenShotUrl(""); |
| | | } |
| | | // 设置缩略图访问路径 |
| | | result = redisUtils.get(VnnoxConstant.REDIS_SCREEN_SHOT + playerId); |
| | | if (null != result) { |
| | | playerEntity.setScreenShotUrl(result); |
| | | } else { |
| | | playerEntity.setScreenShotUrl(""); |
| | | } |
| | | |
| | | playerEntity.setPlayerInfo(cache); |
| | | playerEntity.setPlayerInfo(cache); |
| | | } |
| | | } |
| | | return list; |
| | | return ledList; |
| | | } |
| | | |
| | | |
| | |
| | | return widgetList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更新诺瓦屏幕分辨率 |
| | | */ |
| | | public void saveInfo() { |
| | | List<LedPlayerEntity> list = vnnoxAPIUtil.saveCurrentInfo(ledPlayerEntityService.list()); |
| | | boolean b = SpringContextHolder.getBean(LedPlayerEntityService.class).updateBatchById(list); |
| | | if (b) { |
| | | LogUtils.error("更新诺瓦屏幕分辨率成功"); |
| | | } |
| | | } |
| | | |
| | | } |