From 46f45f42abf00acf70e8160e73faa71aec3df13d Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期一, 01 七月 2024 13:46:30 +0800
Subject: [PATCH] 2024年07月01日13:46:18

---
 app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java |   41 +++++++++++++++++++++++++++++++++--------
 1 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
index 00244ba..4c33f55 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
@@ -91,6 +91,17 @@
 
     private final long pageSize = 20;//椤垫暟
 
+    /**
+     * 杩樺師鏉′欢鐨勫垵濮嬪寲鐘舵��
+     */
+    private void InitializationState() {
+        key = SortValue.all;
+        value = SortValue.all;
+        installedCapacityMinValue = "";
+        installedCapacityMaxValue = "";
+        gridTypeValue = "";
+        powerStationStatusValue = PowerStationStatus.All;
+    }
 
     @Override
     public Object getContentView() {
@@ -119,6 +130,7 @@
                 }
                 isClickPowerStationLabel = true;
                 selectedTitleLabelStyle();
+                InitializationState();
                 getStatusOverview();
                 loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
 
@@ -633,7 +645,7 @@
         } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE.equals(eventBus.getTopic())) {
             // 鍙栨秷绮樻�т簨浠�
             EventBus.getDefault().removeStickyEvent(eventBus);
-            //鏄湪鐢电珯鍒楄〃椤垫墠杩涙潵杩欓噷
+            //鏄湪锛堢數绔欙級妯″潡涓斿湪锛堢數绔欙級鏍囩椤垫墠杩涙潵杩欓噷
             if (HdlCommonLogic.lowerTagType == LowerTagType.power_station && isClickPowerStationLabel) {
                 //uin鍏抽棴浣忓畢璇︽儏鐣岄潰閫氱煡
                 if (MqttRecvClient.getInstance() != null) {
@@ -653,20 +665,33 @@
                 //瀛楃涓叉槸鑷繁鎸夎鍒欐嫾鎺ョ殑,閲岄潰娉ㄥ唽涓婚鏃朵細瑙f瀽瀛楃涓�,鍙嬁getGatewayId()鍊�;
                 String topic = "/user/" + gatewayId + "/#";
                 //杩涘幓浣忓畢璇︽儏寮�濮嬭闃呬富棰�
-                MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topic);
+                MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topic);//璁㈤槄銆愰�嗗彉鍣ㄣ�戞秷鎭�
+
             }
+            String topicHome = "/user/" + UserConfigManage.getInstance().getHomeId() + "/#";
+            MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topicHome);//璁㈤槄銆愮數绔欍�戞秷鎭�
+
+
         } else if (eventBus.getTopic().equals(ConstantManage.homepage_title_tab_switch)) {
             //鎺ユ敹澶栭儴鐐瑰嚮浜嬩欢
             if (eventBus.getType().equals(HomepageTitleTabSwitch.powerstation.toString())) {
                 // 鍙栨秷绮樻�т簨浠�
                 EventBus.getDefault().removeStickyEvent(eventBus);
                 HdlLogLogic.print("姝e湪鐐瑰嚮銆愮數绔欍��");
-                if (!isReadData) {
-                    //1锛屼粠棣栭〉-鏁呴殰-杩涙潵-鐢电珯锛堜笉璇诲彇锛�
-                    //2锛屼粠鐢电珯-杩涙潵-鐢电珯锛堣鍙栦竴娆�,鍚庨潰杩涙潵涓嶅湪璇诲彇锛�
-                    loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
-                    getStatusOverview();
-                }
+//                if (!isReadData) {
+//                    //1锛屼粠棣栭〉-鏁呴殰-杩涙潵-鐢电珯锛堜笉璇诲彇锛�
+//                    //2锛屼粠鐢电珯-杩涙潵-鐢电珯锛堣鍙栦竴娆�,鍚庨潰杩涙潵涓嶅湪璇诲彇锛�
+//                    loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
+//                    getStatusOverview();
+//                }
+                //2024骞�06鏈�24鏃�14:34:01 浜у搧缁忕悊瑕佹眰杩涘幓鐢电珯鍒楄〃閮借璇诲彇 涓旈粯璁よ繘鍘婚兘鏄粯璁ょ數绔欐爣绛�
+                isClickPowerStationLabel = true;
+                selectedTitleLabelStyle();
+                InitializationState();
+                getStatusOverview();
+                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
+
+
             } else if (eventBus.getType().equals(PowerStationStatus.All)) {
                 isClickPowerStationLabel = true;
                 selectedTitleLabelStyle();

--
Gitblit v1.8.0