ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java
@@ -226,7 +226,7 @@ ); } List<PoleLightemitEntity> list = poleLightemitService.list(wrapper); if(isOnLine){ if (isOnLine) { List<PoleLightemitEntity> results = poleLightemitService.ledOnline(list); CommonPage commonPage = CommonPage.restPage(results); int size = results.size(); @@ -236,7 +236,7 @@ commonPage.setTotalPage(size / baseConditionVO.getPageSize()); } return ResponseUtil.success(commonPage); }else { } else { poleLightemitService.ledOnlineCheck(list); return ResponseUtil.success(list); } @@ -248,8 +248,8 @@ */ @PostMapping("/setScreenOpen") public ResponseVO<Object> setScreenOpen(@RequestBody SetScreenOpenParam setScreenOpenEntity){ if(setScreenOpenEntity.getIds() == null || setScreenOpenEntity.getIds().length == 0 || setScreenOpenEntity.getBool() == null){ public ResponseVO<Object> setScreenOpen(@RequestBody SetScreenOpenParam setScreenOpenEntity) { if (setScreenOpenEntity.getIds() == null || setScreenOpenEntity.getIds().length == 0 || setScreenOpenEntity.getBool() == null) { throw new BusinessException("未选择LED屏"); } Collection poleLightemitControllers = poleLightemitService.listByIds(Arrays.asList(setScreenOpenEntity.getIds())); @@ -263,15 +263,15 @@ //结果查询 String result = lightemitUtils.setScreenOpen(poleLightemitEntity.getLightemitControlCode(), setScreenOpenEntity.getBool()); System.out.println("result:---------------------"+result); if(result.isEmpty() || !"true".equals(result)){ System.out.println("result:---------------------" + result); if (result.isEmpty() || !"true".equals(result)) { } map.put(poleLightemitEntity.getLightemitId(), result); } return ResponseUtil.success(map); }else { } else { throw new BusinessException("未正确选择LED屏"); } } ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleLightemitService.java
@@ -185,14 +185,7 @@ } */ public List<PoleLightemitEntity> ledList() { // Wrappers.lambdaQuery() List<PoleLightemitEntity> list = list(); return ledOnlineCheck(list); } public List<PoleLightemitEntity> ledOnlineCheck(List<PoleLightemitEntity> list) { public List<PoleLightemitEntity> ledOnline(List<PoleLightemitEntity> list) { List<PoleLightemitEntity> onLineList = new ArrayList<>(); for (PoleLightemitEntity poleLightemitEntity : list) { poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true")); @@ -204,6 +197,14 @@ } public void ledOnlineCheck(List<PoleLightemitEntity> list) { for (PoleLightemitEntity poleLightemitEntity : list) { poleLightemitEntity.setIsOpen(lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()).contains("true")); } } public void savePoleLightemit(PoleLightemitEntity poleLightemit) { boolean save = this.save(poleLightemit); // 绑定灯杆 ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -35,7 +35,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.RequestParam; import java.text.SimpleDateFormat; import java.util.ArrayList; ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java
@@ -30,11 +30,11 @@ @AllArgsConstructor public class VnnoxService { // @Autowired // @Autowired private VnnoxAPIUtil vnnoxAPIUtil; // @Autowired // @Autowired private RedisUtils redisUtils; // @Autowired // @Autowired private LedPlayerEntityService ledPlayerEntityService; /** @@ -44,7 +44,7 @@ * @return */ @Transactional(rollbackFor = Exception.class) public LedV2RegisterResultEntity validateSN(String name,String sn) throws URISyntaxException { public LedV2RegisterResultEntity validateSN(String name, String sn) throws URISyntaxException { LedV2RegisterResultEntity ledV2RegisterResultEntity = new LedV2RegisterResultEntity(); // 判断数据库是否存在,若不存在,判断是否已经注册到Vnnox服务器 @@ -61,13 +61,13 @@ Integer limit = 100; List<VnnoxPlayerResponse> playerList; // 获取Vnnox服务器列表 VnnoxPlayerListResponse response = vnnoxAPIUtil.getPlayerList(limit, page,name); VnnoxPlayerListResponse response = vnnoxAPIUtil.getPlayerList(limit, page, name); playerList = response.getRows(); Integer total = response.getTotal() - limit; while (total > 0) { page = page + 1; total = total - limit; response = vnnoxAPIUtil.getPlayerList(limit, page,name); response = vnnoxAPIUtil.getPlayerList(limit, page, name); playerList.addAll(response.getRows()); } ledPlayerEntity = new LedPlayerEntity(); @@ -141,6 +141,7 @@ } //截屏 public Map<String, String> getScreenShotUrl(Integer id) { Map<String, String> map = new HashMap(); @@ -182,7 +183,7 @@ return map; } //重启 public VnnoxResult reboot(List<LedPlayerEntity> playerList) { return vnnoxAPIUtil.reboot( playerList.stream().map( @@ -191,12 +192,12 @@ ); } public boolean updateDataName(Long id, String name){ public boolean updateDataName(Long id, String name) { LedPlayerEntity byId = ledPlayerEntityService.getById(id); if(byId==null){ if (byId == null) { throw new BusinessException("未找到该设备"); } LedPlayerEntity led=new LedPlayerEntity(); LedPlayerEntity led = new LedPlayerEntity(); led.setId(id); led.setName(name); return ledPlayerEntityService.updateById(led);