From 89c38fa6f118d56cb163c245905de8f1c0a75a7c Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 19 三月 2024 18:03:50 +0800
Subject: [PATCH] 2024年03月19日18:03:44

---
 app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
index b923df1..541edcf 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -67,6 +67,7 @@
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Objects;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -115,8 +116,9 @@
                 return;
             }
             String type = getKeyValue("type", data);//灏忕被
+            String logTag = getKeyValue("logTag", data);//鏍囪uni鎸囦护
             String mode_type = "澶х被->" + topic + "--->" + "灏忕被->" + type;//鐢ㄦ潵鎵撳嵃鐨�
-            HdlLogLogic.print("uni--->鍙戦��--->" + mode_type + "\r\n" + data, true);
+            HdlLogLogic.print(logTag + ":" + "uni--->鍙戦��--->" + mode_type + "\r\n" + data, true);
             if (HDLUniMP.UNI_EVENT_REPLY_USER_MODEL.equals(topic)) {
                 //鐢ㄦ埛妯″潡
                 switch (type) {
@@ -124,6 +126,7 @@
                     case HDLUniMP.UNI_EVENT_REPLY_USER_INFO: {
                         this.uniGetUserInfo(mode_type, data, callback);
                     }
+                    break;
                     //鐢ㄦ埛澶村儚锛堟棫骞冲彴閫昏緫鏄ご鍍忓崟鐙幏鍙栦笅杞藉湴鍧�锛�
                     case HDLUniMP.UNI_EVENT_REPLY_USER_IMAGE: {
                         uniGetImageKey(mode_type, data, callback);
@@ -1133,7 +1136,7 @@
 
                         @Override
                         public void onFailure(HDLException e) {
-                            uniCallbackData(type, null, e.getCode(), e.getMsg(), callback);
+                            uniCallbackData(type, cUserInfo, callback);
                         }
                     });
                 }
@@ -1379,7 +1382,7 @@
                                 atomicInteger.set(atomicInteger.get() + 1);
                                 //鏈�鍚庝竴鏉℃墠鍋氭坊鍔犻�嗗彉鍣ㄩ�昏緫澶勭悊
                                 if (atomicInteger.get() == list.size()) {
-                                    HdlDeviceLogic.getInstance().addAllInverterDeviceToCloud(homeId, gatewayBean.getDevice_mac(), list, new CloudCallBeak<Boolean>() {
+                                    HdlDeviceLogic.getInstance().addAllInverterDeviceToCloud(homeId, list, new CloudCallBeak<Boolean>() {
                                         @Override
                                         public void onSuccess(Boolean obj) {
                                             uniCallbackData(type, null, callback);
@@ -1448,7 +1451,7 @@
     private void uniSearchGateway(String type, DCUniMPJSCallback callback) {
 
 
-        HdlDeviceLogic.getInstance().searchCurrentHomeGateway(new GatewayCallBack() {
+        HdlDeviceLogic.getInstance().searchAllNetworkGateway(new GatewayCallBack() {
             @Override
             public void onSuccess(List<GatewayBean> gatewayBeanList) {
                 uniCallbackData(type, gatewayBeanList, callback);
@@ -1550,7 +1553,7 @@
             @Override
             public void onError(HDLLinkException e) {
                 uniCallbackData(type, null, e.getCode(), e.getMsg(), callback);
-                //HdlLogLogic.print("uni--->鎺ユ敹--->ModBus--->" + e.getMsg() + "(" + e.getCode() + ")", true);
+//                HdlLogLogic.print("uni--->鎺ユ敹--->ModBus--->" + e.getMsg() + "(" + e.getCode() + ")", true);
             }
         });
     }

--
Gitblit v1.8.0