From f233ba26bbf8703fcc4e86a5dbb9d6026f91e7d6 Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期五, 04 三月 2022 18:14:03 +0800
Subject: [PATCH] C3充电桩
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 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 5a7ff63..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;
@@ -29,11 +30,11 @@
@AllArgsConstructor
public class VnnoxService {
- // @Autowired
+ // @Autowired
private VnnoxAPIUtil vnnoxAPIUtil;
- // @Autowired
+ // @Autowired
private RedisUtils redisUtils;
- // @Autowired
+ // @Autowired
private LedPlayerEntityService ledPlayerEntityService;
/**
@@ -43,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鏈嶅姟鍣�
@@ -60,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();
@@ -140,6 +141,7 @@
}
+ //鎴睆
public Map<String, String> getScreenShotUrl(Integer id) {
Map<String, String> map = new HashMap();
@@ -181,7 +183,7 @@
return map;
}
-
+ //閲嶅惎
public VnnoxResult reboot(List<LedPlayerEntity> playerList) {
return vnnoxAPIUtil.reboot(
playerList.stream().map(
@@ -190,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