From 0c1949984e4c59d4ae5f2d96c6b7438364642a08 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 12 十二月 2024 17:25:18 +0800
Subject: [PATCH] 2024年12月12日17:25:15
---
app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java | 4 ++--
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java | 30 ++++++++++++++++++++++++++++--
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java
index dfcc18d..da162bc 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java
@@ -222,7 +222,7 @@
public void getUserInfo_B(CloudCallBeak<BUserInfo> cloudCallBeak) {
String requestUrl = HttpApi.B_POST_GET_USERINFO;
JsonObject json = new JsonObject();
- json.addProperty("userId",UserConfigManage.getInstance().getUserId());
+ json.addProperty("userId", UserConfigManage.getInstance().getUserId());
HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() {
@Override
public void onSuccess(String jsonStr) {
@@ -693,7 +693,7 @@
if (obj != null) {
boolean isUserId = UserConfigManage.getInstance().getUserId().equals(obj.getUserId());
UserConfigManage.getInstance().setTheSameLoginAccount(isUserId);//涓庝笂涓�涓处鍙锋槸鍚﹀悓涓�涓�
- if (!UserConfigManage.getInstance().isTheSameLoginAccount()) {
+ if (!TextUtils.isEmpty(UserConfigManage.getInstance().getUserId()) && !UserConfigManage.getInstance().isTheSameLoginAccount()) {
//涓嶅悓璐﹀彿,鍒犻櫎涔嬪墠鐨勬棫璐﹀彿鏃ュ織淇℃伅;
HdlFileLogic.getInstance().deleteDirectory(HdlFileLogic.getInstance().getCurrentUserRootPath());
}
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 1d0295e..c369bc7 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -2365,8 +2365,9 @@
HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(homeId, new CloudCallBeak<List<GatewayBean>>() {
@Override
public void onSuccess(List<GatewayBean> list) {
+ List<GatewayBean> newList = sortLogic(list);
if (callback != null) {
- uniSuccessCallback(type, list, callback);
+ uniSuccessCallback(type, newList, callback);
}
//EventBus浜嬩欢鍒嗗彂,杩涘叆浣忓畢寮�濮嬭闃呬富棰�
BaseEventBus baseEventBus = new BaseEventBus();
@@ -2375,7 +2376,7 @@
baseEventBus.setData(homeId);
EventBus.getDefault().post(baseEventBus);
//杩涙潵浣忓畢璇︽儏閮借涓婁紶涓�娆id鍒楄〃鍒颁簯绔�;
- HdlDeviceLogic.getInstance().uploadOidDataToCloud(homeId, list, false, null);
+ HdlDeviceLogic.getInstance().uploadOidDataToCloud(homeId, newList, false, null);
}
@Override
@@ -2389,6 +2390,31 @@
}
/**
+ * 杩涜鎺掑簭锛堥�嗗彉鍣�-璐熻浇涓績锛�
+ *
+ * @param list 婧愭暟鎹�
+ * @return 杩斿洖鍒楄〃
+ */
+ private List<GatewayBean> sortLogic(List<GatewayBean> list) {
+ if (list == null || list.size() == 0) {
+ return new ArrayList<>();
+ }
+ List<GatewayBean> newList = new ArrayList<>();
+ List<GatewayBean> inverterList = new ArrayList<>();
+ List<GatewayBean> lcList = new ArrayList<>();
+ for (int i = 0; i < list.size(); i++) {
+ if (list.get(i).getSpk().equals(HdlDeviceLogic.getInstance().INVERTER_DEVICE_SPK)) {
+ inverterList.add(list.get(i));
+ } else {
+ lcList.add(list.get(i));
+ }
+ }
+ newList.addAll(inverterList);
+ newList.addAll(lcList);
+ return newList;
+ }
+
+ /**
* link spk 灞炴�х紪杈�
*
* @param data uni鏁版嵁
--
Gitblit v1.8.0