From 93d6fdb255ebd9d33adebc4e96ecc5f74b6281ea Mon Sep 17 00:00:00 2001
From: liuhaonan <konodioda2333@vip.qq.com>
Date: 星期二, 08 三月 2022 14:11:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java
index bec5dee..fb78b52 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java
@@ -1,5 +1,6 @@
 package com.sandu.ximon.admin.service;
 
+import com.sandu.common.execption.BusinessException;
 import com.sandu.ximon.admin.config.VnnoxConstant;
 import com.sandu.ximon.admin.utils.RedisUtils;
 import com.sandu.ximon.admin.utils.VnnoxAPIUtil;
@@ -13,6 +14,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.net.URISyntaxException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -28,11 +30,11 @@
 @AllArgsConstructor
 public class VnnoxService {
 
-   // @Autowired
+    // @Autowired
     private VnnoxAPIUtil vnnoxAPIUtil;
-   // @Autowired
+    // @Autowired
     private RedisUtils redisUtils;
-   // @Autowired
+    // @Autowired
     private LedPlayerEntityService ledPlayerEntityService;
 
     /**
@@ -42,7 +44,7 @@
      * @return
      */
     @Transactional(rollbackFor = Exception.class)
-    public LedV2RegisterResultEntity validateSN(String sn) {
+    public LedV2RegisterResultEntity validateSN(String name, String sn) throws URISyntaxException {
         LedV2RegisterResultEntity ledV2RegisterResultEntity = new LedV2RegisterResultEntity();
 
         //  鍒ゆ柇鏁版嵁搴撴槸鍚﹀瓨鍦紝鑻ヤ笉瀛樺湪锛屽垽鏂槸鍚﹀凡缁忔敞鍐屽埌Vnnox鏈嶅姟鍣�
@@ -56,16 +58,16 @@
         }
 
         Integer page = 0;
-        Integer limit = 200;
+        Integer limit = 100;
         List<VnnoxPlayerResponse> playerList;
         //  鑾峰彇Vnnox鏈嶅姟鍣ㄥ垪琛�
-        VnnoxPlayerListResponse response = vnnoxAPIUtil.getPlayerList(limit, page);
+        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);
+            response = vnnoxAPIUtil.getPlayerList(limit, page, name);
             playerList.addAll(response.getRows());
         }
         ledPlayerEntity = new LedPlayerEntity();
@@ -139,6 +141,7 @@
 
     }
 
+    //鎴睆
     public Map<String, String> getScreenShotUrl(Integer id) {
         Map<String, String> map = new HashMap();
 
@@ -180,7 +183,7 @@
         return map;
     }
 
-
+    //閲嶅惎
     public VnnoxResult reboot(List<LedPlayerEntity> playerList) {
         return vnnoxAPIUtil.reboot(
                 playerList.stream().map(
@@ -189,4 +192,16 @@
         );
     }
 
+    public boolean updateDataName(Long id, String name) {
+        LedPlayerEntity byId = ledPlayerEntityService.getById(id);
+        if (byId == null) {
+            throw new BusinessException("鏈壘鍒拌璁惧");
+        }
+        LedPlayerEntity led = new LedPlayerEntity();
+        led.setId(id);
+        led.setName(name);
+        return ledPlayerEntityService.updateById(led);
+    }
+
+
 }

--
Gitblit v1.9.3