From fa2c6bc596778480e57a9df64ea1aa925ed1f8b4 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 26 五月 2025 09:31:20 +0800
Subject: [PATCH] 2025年05月26日09:31:18

---
 app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java |   62 +++++++++++-------------------
 1 files changed, 23 insertions(+), 39 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 f947370..8e018b0 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
@@ -1,20 +1,16 @@
 package com.hdl.photovoltaic.ui.powerstation;
 
 import android.Manifest;
-import android.app.Dialog;
 import android.content.Context;
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.location.LocationManager;
 import android.os.AsyncTask;
 import android.os.Bundle;
-import android.os.SystemClock;
 import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
-import android.view.Window;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
@@ -49,7 +45,6 @@
 import com.hdl.photovoltaic.other.HdlDeviceLogic;
 import com.hdl.photovoltaic.other.HdlDialogLogic;
 import com.hdl.photovoltaic.other.HdlLogLogic;
-import com.hdl.photovoltaic.other.HdlOtaLogic;
 import com.hdl.photovoltaic.other.HdlResidenceLogic;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
 import com.hdl.photovoltaic.other.HdlUniLogic;
@@ -61,7 +56,6 @@
 import com.hdl.photovoltaic.uni.HDLUniMP;
 import com.hdl.photovoltaic.utils.GPSManagerUtils;
 import com.hdl.photovoltaic.utils.PermissionUtils;
-import com.hdl.photovoltaic.utils.ProcessManagerUtils;
 import com.hdl.photovoltaic.utils.URLEncodingUtils;
 import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
 import com.hdl.photovoltaic.widget.DefaultFilteringDialog;
@@ -261,6 +255,7 @@
                         installedCapacityMinValue = min;//鏈�灏忕粍涓插閲�(瑁呮満瀹归噺)
                         installedCapacityMaxValue = max;//鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
                         screeningConditionStatus = state;//璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯)
+                        getStatusOverview();
                         loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
                     }
                 });
@@ -363,14 +358,7 @@
 
             }
         });
-//        //鐢电珯缂栬緫鎸夐挳
-//        viewBinding.editIv.setOnClickListener(new View.OnClickListener() {
-//            @Override
-//            public void onClick(View v) {
-//                startActivity(HouseListEditActivity.class);
-//            }
-//        });
-        //鐢电珯鍚嶇О绛涢��
+        //PV绛涢��
         viewBinding.stationNameRl.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -378,10 +366,11 @@
                 screeningConditionStyle(viewBinding.stationNameRl, viewBinding.stationNameIv, isSelected);
                 key = SortType.installedCapacitySort;
                 value = isSelected ? SortValue.ascending : SortValue.descending;
+                getStatusOverview();
                 loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
             }
         });
-        //鐢电珯鍙戠數鍔熺巼绛涢��
+        //棰濆畾鍔熺巼绛涢��
         viewBinding.stationPowerRl.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -413,17 +402,7 @@
                 screeningConditionStyle(viewBinding.stationDayRl, viewBinding.stationDayIv, isSelected);
                 key = SortType.todayElectricitySort;
                 value = isSelected ? SortValue.ascending : SortValue.descending;
-                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
-            }
-        });
-        //鐢电珯鐢垫睜瀹归噺绛涢��
-        viewBinding.stationMonthRl.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                boolean isSelected = !v.isSelected();
-                screenIconState(viewBinding.stationMonthRl, viewBinding.stationMonthIv, isSelected);
-                key = SortType.batteryCapacitySort;
-                value = isSelected ? SortValue.ascending : SortValue.descending;
+                getStatusOverview();
                 loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
             }
         });
@@ -613,15 +592,18 @@
             if (HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION.equals(eventBus.getType())) {
                 // 鍙栨秷绮樻�т簨浠�
                 EventBus.getDefault().removeStickyEvent(eventBus);
-                //uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡
-                loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
-                if (eventBus.getData() != null) {
-                    Gson gson = new Gson();
-                    String json = eventBus.getData().toString();
-                    HouseIdBean houseIdBean = gson.fromJson(json, HouseIdBean.class);
-                    HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true);
-
-                }
+//                HdlLogLogic.print("杩涙潵浜�---11111" + eventBus.getData().toString());
+//                //uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡
+//                loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+//                if (eventBus.getData() != null) {
+//                    HdlLogLogic.print("杩涙潵浜�---" + eventBus.getData().toString());
+//                    Gson gson = new Gson();
+//                    String json = eventBus.getData().toString();
+//                    HouseIdBean houseIdBean = gson.fromJson(json, HouseIdBean.class);
+//                    HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true);
+//                    HdlLogLogic.print("杩涙潵浜�---缁撴潫" + eventBus.getData().toString());
+//
+//                }
             } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_EDIT.equals(eventBus.getType())) {
                 // 鍙栨秷绮樻�т簨浠�
                 EventBus.getDefault().removeStickyEvent(eventBus);
@@ -658,6 +640,7 @@
 //                if (MqttRecvClient.getInstance() != null) {
 //                    MqttRecvClient.getInstance().removeAllTopic();
 //                }
+
                 loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
             }
         } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) {
@@ -672,8 +655,8 @@
             }
             String homeId = eventBus.getData().toString();
             //杩涘幓浣忓畢璇︽儏uni璇诲彇閫嗗彉鍣ㄥ垪琛ㄦ垚鍔熷悗閫氱煡
-            for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId, null).size(); i++) {
-                String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId, null).get(i).getGatewayId();
+            for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).size(); i++) {
+                String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).get(i).getGatewayId();
                 //瀛楃涓叉槸鑷繁鎸夎鍒欐嫾鎺ョ殑,閲岄潰娉ㄥ唽涓婚鏃朵細瑙f瀽瀛楃涓�,鍙嬁getGatewayId()鍊�;
                 String topic = "/user/" + gatewayId + "/#";
                 //杩涘幓浣忓畢璇︽儏寮�濮嬭闃呬富棰�
@@ -831,7 +814,7 @@
                         if (isRefreshing) {
                             hideLoading();
                         }
-
+                        HdlThreadLogic.toast(_mActivity, e.getMsg() + "(" + e.getCode() + ")");
                     }
                 }, _mActivity, ShowErrorMode.YES);
             }
@@ -900,6 +883,7 @@
                         if (isRefreshing) {
                             hideLoading();
                         }
+                        HdlThreadLogic.toast(_mActivity, e.getMsg() + "(" + e.getCode() + ")");
                     }
                 }, _mActivity, ShowErrorMode.YES);
             }
@@ -1211,4 +1195,4 @@
     }
 
 
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0