dao/src/main/java/com/sandu/ximon/dao/domain/LedPlayerEntity.java
@@ -11,7 +11,7 @@ /** * * @TableName led * @TableName led诺瓦 */ @Data @TableName(value = "led") ximon-admin/src/main/java/com/sandu/ximon/admin/config/VnnoxConstant.java
@@ -17,8 +17,8 @@ public static final Long REDIS_MAX_SAVE_TIME = 180 * 24 * 60 * 60L; public static final Long SCREEN_SHOT_TIMEOUT = 30 * 60L; public static final String NOTIFY_URL = "http://47.106.172.9:8888/machine-fast/serv/vnnox/progress"; public static final String SCREEN_SHOT_NOTIFY_URL = "http://47.106.172.9:8888/machine-fast/serv/vnnox/screenshot"; public static final String NOTIFY_URL = "http://112.74.63.130:6379/XMPoleManager/serv/vnnox/progress"; public static final String SCREEN_SHOT_NOTIFY_URL = "http://112.74.63.130:6379/XMPoleManager/serv/vnnox/screenshot"; //要改 public static final String username = "zhxm"; public static final String password = "xm2512209."; ximon-admin/src/main/java/com/sandu/ximon/admin/controller/IpVolumeFileController.java
@@ -41,7 +41,7 @@ @PostMapping("/delete/{fileId}") public ResponseVO<Object> deleteFile(@PathVariable Long fileId){ List<BroadcastV2TaskFile> list = v2TaskFileService.list(Wrappers.lambdaQuery(BroadcastV2TaskFile.class).eq(BroadcastV2TaskFile::getFileId, fileId)); if(list!=null){ if(list.size()!=0){ throw new BusinessException("此文件正在被其他任务占用"); } return ResponseUtil.success(ipVolumeFileService.deleteFile(fileId)); ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.api.R; import com.github.pagehelper.PageHelper; import com.sandu.common.domain.ResponseVO; import com.sandu.common.object.BaseConditionVO; @@ -50,6 +51,9 @@ @GetMapping("/screenShot") public ResponseVO<Object> screenShot(@RequestBody VnnoxParam vnnoxWebRequest) { Map<String, String> map = vnnoxService.getScreenShotUrl(vnnoxWebRequest.getId()); if(map.get("code").equals("500")) { return ResponseUtil.fail(map.get("msg")); } return ResponseUtil.success(map.get("url")); } @@ -136,9 +140,14 @@ //wrapper.eq(LedPlayerEntity::get) return ResponseUtil.success(""); // todo } else { wrapper.like(LedPlayerEntity::getPlayerName, keyword); wrapper.like(LedPlayerEntity::getPlayerName, keyword) .or( querywrapper->{ querywrapper.like(LedPlayerEntity::getName, keyword); } ); List<LedPlayerEntity> list = ledPlayerEntityService.list(wrapper); List<LedPlayerEntity> entities = vnnoxAPIUtil.syncCurrentInfo(list); List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); return ResponseUtil.success(entities); } } @@ -155,7 +164,7 @@ } else { wrapper.like(LedPlayerEntity::getPlayerName, keyword); List<LedPlayerEntity> list = ledPlayerEntityService.list(wrapper); List<LedPlayerEntity> entities = vnnoxAPIUtil.syncCurrentInfo(list); List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); List<LedPlayerEntity> online = new ArrayList<>(); for (LedPlayerEntity ledPlayer : entities) { if (ledPlayer.getOnlineStatus() == 1) { ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
@@ -113,28 +113,12 @@ program.setPages(JSON.parseObject(pushToLed.getPages(), List.class)); program.setSchedule(JSON.parseObject(pushToLed.getSchedule(), Map.class)); program.setNoticeUrl(VnnoxConstant.NOTIFY_URL); /* Map schedule = JSON.parseObject(pushToLed.getSchedule(), Map.class); Map<String,Object> push=new HashMap<>(); push.put("playerIds",playerIds); push.put("pages",pages); push.put("schedule",schedule); push.put("noticeUrl", VnnoxConstant.SCREEN_SHOT_NOTIFY_URL); */ VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.normalProgram(program); VnnoxResult vnnoxResult = vnnoxAPIUtil.volChange(playerIds, Integer.valueOf(one.getVolume()).intValue()); // VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.normalProgram(push); List<String> success = new ArrayList<>(); List<String> fail = new ArrayList<>(); // List<String> success=new ArrayList<>(); // if(vnnoxResultResponse.getData().getSuccess()!=null&&vnnoxResultResponse.getData()!=null){ // success = vnnoxResultResponse.getData().getSuccess(); // } // //success.addAll(vnnoxResult.getSuccess()); // if(vnnoxResultResponse.getData().getFail()!=null&vnnoxResultResponse.getData()!=null){ // fail= vnnoxResultResponse.getData().getFail(); // } if (vnnoxResultResponse.getData() != null) { success = vnnoxResultResponse.getData().getSuccess(); fail = vnnoxResultResponse.getData().getFail(); ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java
@@ -1,7 +1,9 @@ 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; @@ -9,6 +11,7 @@ import com.sandu.ximon.admin.utils.response.VnnoxPlayerResponse; import com.sandu.ximon.admin.utils.response.VnnoxResult; import com.sandu.ximon.dao.domain.LedPlayerEntity; import com.sandu.ximon.dao.domain.LedPlayerInfoEntity; import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -199,9 +202,54 @@ } LedPlayerEntity led = new LedPlayerEntity(); led.setId(id); led.setName(name); led.setPlayerName(name); return ledPlayerEntityService.updateById(led); } /** * 获取缓存数据 * @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); // 设置缩略图访问路径 result = redisUtils.get(VnnoxConstant.REDIS_SCREEN_SHOT + playerId); System.out.println(playerId+"的路径结果:-----------------------------"+result); if(null != result) { playerEntity.setScreenShotUrl(result); } else { playerEntity.setScreenShotUrl(""); } playerEntity.setPlayerInfo(cache); } return list; } }