From 63ff4119d8073843257c485f8b5a051bb03f3b0b Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期三, 20 九月 2023 14:51:16 +0800
Subject: [PATCH] 联调版本
---
app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
index 047566b..763cabb 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
@@ -28,6 +28,8 @@
import com.hdl.sdk.link.common.exception.HDLLinkCode;
import com.hdl.sdk.link.common.exception.HDLLinkException;
import com.hdl.sdk.link.core.bean.gateway.GatewayBean;
+import com.hdl.sdk.link.core.bean.request.BaseLocalRequest;
+import com.hdl.sdk.link.core.bean.response.BaseLocalResponse;
import com.hdl.sdk.link.core.callback.GatewayCallBack;
import com.hdl.sdk.link.core.callback.HDLLinkCallBack;
import com.hdl.sdk.link.gateway.HDLLinkLocalGateway;
@@ -55,6 +57,8 @@
GatewayBean gatewayBean = list.get(i);
if (gatewayBean.getMaster().equals("true")
&& gatewayBean.getHomeId().equals(UserConfigManage.getInstance().getHomeId())) {
+ if("0101050217BBC400".equals(gatewayBean.getOid()))//娴嬭瘯鏃惰繃婊ゆ帀鏃犳晥鐨勶紝鍚庨潰杩欏姞浠g爜瑕佸垹闄�
+ continue;
newList.add(gatewayBean);
}
}
@@ -394,11 +398,17 @@
return;
}
Gson gson = new Gson();
- Type typeOfT = new TypeToken<List<OidBean>>() {
+ Type typeOfT = new TypeToken<BaseLocalResponse<List<OidBean>>>() {
}.getType();
- List<OidBean> list = gson.fromJson(json, typeOfT);
- if (linkCallBack != null) {
- linkCallBack.onSuccess(list);
+ BaseLocalResponse<List<OidBean>> baseLocalResponse = gson.fromJson(json, typeOfT);
+
+ if (linkCallBack == null) {
+ return;
+ }
+ if (baseLocalResponse == null || baseLocalResponse.getObjects() == null) {
+ linkCallBack.onSuccess(new ArrayList<>());
+ } else {
+ linkCallBack.onSuccess(baseLocalResponse.getObjects());
}
}
--
Gitblit v1.8.0