From b63ff58e2c415bae2fb4741aebe710fa3576ff66 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 23 三月 2026 13:11:47 +0800
Subject: [PATCH] 2026年03月23日13:11:38 备份代码
---
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java | 110 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 69 insertions(+), 41 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 834f475..190aca2 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
@@ -32,8 +32,10 @@
import com.hdl.photovoltaic.enums.DebugType;
import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch;
import com.hdl.photovoltaic.enums.Languages;
+import com.hdl.photovoltaic.enums.LogoutType;
import com.hdl.photovoltaic.enums.LowerTagType;
import com.hdl.photovoltaic.enums.PowerStationStatus;
+import com.hdl.photovoltaic.enums.PowerStationType;
import com.hdl.photovoltaic.enums.ProjectOperation;
import com.hdl.photovoltaic.enums.ShowErrorMode;
import com.hdl.photovoltaic.enums.SortType;
@@ -41,6 +43,7 @@
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.listener.LinkCallBack;
import com.hdl.photovoltaic.listener.OnCallBeak;
+import com.hdl.photovoltaic.other.HdlAccountLogic;
import com.hdl.photovoltaic.other.HdlCommonLogic;
import com.hdl.photovoltaic.other.HdlDeviceLogic;
import com.hdl.photovoltaic.other.HdlDialogLogic;
@@ -107,6 +110,7 @@
private String installedCapacityMaxValue = "";//鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
private String screeningConditionStatus = DebugStatus.All;//绛涢�夋潯浠剁姸鎬�
private String powerStationStatusValue = PowerStationStatus.All;//鐢电珯鐘舵��(鍏ㄩ儴 涓嶄紶璇ヨ繃婊ゅ弬鏁�,1:姝e父(杩愯),2:绂荤嚎,3:寰呮帴鍏�,4:鏁呴殰)
+ private String powerStationTypeValue = PowerStationType.All;//鐢电珯绫诲瀷(INV = 閫嗗彉鍣ㄧ數绔�;BMS = BMS鐢电珯)
private final long pageSize = 100;//涓�椤靛ぇ灏�
@@ -120,6 +124,7 @@
installedCapacityMaxValue = "";
screeningConditionStatus = DebugStatus.All;
powerStationStatusValue = PowerStationStatus.All;
+ powerStationTypeValue = PowerStationType.All;
}
@Override
@@ -139,7 +144,12 @@
}
private void initEvent() {
-
+ viewBinding.exitTv.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ HdlAccountLogic.getInstance().logout(LogoutType.NormalLogout);
+ }
+ });
//鐢电珯鏍囩
viewBinding.powerStationLabel.setOnClickListener(new View.OnClickListener() {
@Override
@@ -151,7 +161,7 @@
selectedTitleLabelStyle();
initializationState();
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true);
}
});
@@ -177,7 +187,7 @@
powerStationStatusValue = PowerStationStatus.All;
stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv);
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true);
}
});
//鏁呴殰
@@ -190,7 +200,7 @@
powerStationStatusValue = PowerStationStatus.malfunction;
stationStatusStyle(viewBinding.faultsLl, viewBinding.faultsDesTv);
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true);
}
});
//绂荤嚎
@@ -203,7 +213,7 @@
powerStationStatusValue = PowerStationStatus.off;
stationStatusStyle(viewBinding.offlineLl, viewBinding.offlineDesTv);
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true);
}
});
//寰呮帴鍏�
@@ -216,7 +226,7 @@
powerStationStatusValue = PowerStationStatus.connecting;
stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv);
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true);
}
});
@@ -279,15 +289,16 @@
public void onClick(View v) {
DefaultFilteringDialog defaultFilteringDialog = new DefaultFilteringDialog(_mActivity);
defaultFilteringDialog.show();
- defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus);
+ defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus,powerStationTypeValue);
defaultFilteringDialog.setOnClickListener(new DefaultFilteringDialog.OnClickListener() {
@Override
- public void confirm(String min, String max, String state) {
+ public void confirm(String min, String max, String state, String powerStationType) {
installedCapacityMinValue = min;//鏈�灏忕粍涓插閲�(瑁呮満瀹归噺)
installedCapacityMaxValue = max;//鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
screeningConditionStatus = state;//璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯)
+ powerStationTypeValue = powerStationType;//鐢电珯绫诲瀷(INV = 閫嗗彉鍣ㄧ數绔�;BMS = BMS鐢电珯)
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true);
}
});
}
@@ -377,26 +388,27 @@
});
} else {
showLoading(getString(R.string.deleting_please_wait));
- if (houseIdBean.getDebugType().equals(DebugType.NORMAL)) {
- //銆愬父瑙勬柟寮忋�戝彂璧峰垹闄ょ數绔欐寚浠�
- HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() {
- @Override
- public void onSuccess(List<GatewayBean> list) {
- //鍙戣捣鍒犻櫎鐢电珯鎸囦护
- deleteResidence(position, houseIdBean, list);
+// if (houseIdBean.getDebugType().equals(DebugType.NORMAL)) {
+ //銆愬父瑙勬柟寮忋�戝彂璧峰垹闄ょ數绔欐寚浠わ紙鎼滅储缃戝叧鏄�冨埌缃戝叧娌℃湁杩炴帴鍒颁簯绔紝浣跨敤鏈湴鍙戦�佸垵濮嬪寲鎸囦护锛�
+ // 纭欢閭h竟鍙柊鍥轰欢涔熷彂鍒濆鍖� 2025骞�10鏈�14鏃�10:55:18
+ HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() {
+ @Override
+ public void onSuccess(List<GatewayBean> list) {
+ //鍙戣捣鍒犻櫎鐢电珯鎸囦护
+ deleteResidence(position, houseIdBean, list);
- }
+ }
- @Override
- public void onFailure(HDLException e) {
- //鍙戣捣鍒犻櫎鐢电珯鎸囦护
- deleteResidence(position, houseIdBean, null);
- }
- });
- } else {
- //銆愮畝鏄撴柟寮忋�戝彂璧峰垹闄ょ數绔欐寚浠�
- deleteResidence(position, houseIdBean, null);
- }
+ @Override
+ public void onFailure(HDLException e) {
+ //鍙戣捣鍒犻櫎鐢电珯鎸囦护
+ deleteResidence(position, houseIdBean, null);
+ }
+ });
+// } else {
+// //銆愮畝鏄撴柟寮忋�戝彂璧峰垹闄ょ數绔欐寚浠�
+// deleteResidence(position, houseIdBean, null);
+// }
}
}
});
@@ -418,7 +430,7 @@
key = SortType.installedCapacitySort;
value = isSelected ? SortValue.ascending : SortValue.descending;
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue,1, true);
}
});
//棰濆畾鍔熺巼绛涢��
@@ -430,7 +442,7 @@
key = SortType.invPowerSort;
value = isSelected ? SortValue.ascending : SortValue.descending;
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue,1, true);
}
});
//鐢电珯鐢垫睜瀹归噺绛涢��
@@ -442,7 +454,7 @@
key = SortType.batteryCapacitySort;
value = isSelected ? SortValue.ascending : SortValue.descending;
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue,1, true);
}
});
//鐢电珯褰撴棩鍙戠數閲忕瓫閫�
@@ -454,7 +466,7 @@
key = SortType.todayElectricitySort;
value = isSelected ? SortValue.ascending : SortValue.descending;
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue,powerStationTypeValue, 1, true);
}
});
//璁惧鐐瑰嚮
@@ -573,6 +585,13 @@
private void initView() {
+ if (UserConfigManage.getInstance().isTourist_mode()) {
+ viewBinding.addIv.setVisibility(View.GONE);
+ viewBinding.exitTv.setVisibility(View.VISIBLE);
+ } else {
+ viewBinding.addIv.setVisibility(View.VISIBLE);
+ viewBinding.exitTv.setVisibility(View.GONE);
+ }
viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE);
viewBinding.deviceLabelParent.setVisibility(View.GONE);
@@ -603,7 +622,11 @@
viewBinding.powerStationLabel.setTextAppearance(R.style.Text18Style);
viewBinding.deviceLabel.setTextAppearance(R.style.Text14Style);
// viewBinding.editIv.setVisibility(View.VISIBLE);//缂栬緫鍥炬爣闅愯棌
- viewBinding.addIv.setVisibility(View.VISIBLE);//娣诲姞鍥炬爣闅愯棌
+ if (UserConfigManage.getInstance().isTourist_mode()) {
+ viewBinding.addIv.setVisibility(View.GONE);//娣诲姞鍥炬爣闅愯棌
+ } else {
+ viewBinding.addIv.setVisibility(View.VISIBLE);//娣诲姞鍥炬爣闅愯棌
+ }
viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE);//鐢电珯鏍囩銆愮埗瀹瑰櫒銆戞樉绀�
viewBinding.deviceLabelParent.setVisibility(View.GONE);//璁惧鏍囩銆愮埗瀹瑰櫒銆戦殣钘�
if (viewBinding.deviceNullDataIc.getRoot().getVisibility() == View.VISIBLE) {
@@ -613,7 +636,11 @@
viewBinding.deviceLabel.setTextAppearance(R.style.Text18Style);
viewBinding.powerStationLabel.setTextAppearance(R.style.Text14Style);
// viewBinding.editIv.setVisibility(View.GONE);//缂栬緫鍥炬爣闅愯棌
- viewBinding.addIv.setVisibility(View.GONE);//娣诲姞鍥炬爣闅愯棌
+ if (UserConfigManage.getInstance().isTourist_mode()) {
+ viewBinding.addIv.setVisibility(View.GONE);//娣诲姞鍥炬爣闅愯棌
+ } else {
+ viewBinding.addIv.setVisibility(View.GONE);//娣诲姞鍥炬爣闅愯棌
+ }
viewBinding.powerStationLabelParent.setVisibility(View.GONE);//鐢电珯鏍囩銆愮埗瀹瑰櫒銆戦殣钘�
viewBinding.deviceLabelParent.setVisibility(View.VISIBLE);//璁惧鏍囩銆愮埗瀹瑰櫒銆戞樉绀�
if (viewBinding.homeNullDataIc.getRoot().getVisibility() == View.VISIBLE) {
@@ -697,7 +724,7 @@
// MqttRecvClient.getInstance().removeAllTopic();
// }
- loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue,powerStationTypeValue, 1, true);
}
} else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) {
// 鍙栨秷绮樻�т簨浠�
@@ -740,7 +767,7 @@
initializationState();
stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv);
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue,powerStationTypeValue, 1, true);
} else if (eventBus.getType().equals(ConstantManage.station_page)) {
// 鍙栨秷绮樻�т簨浠�
EventBus.getDefault().removeStickyEvent(eventBus);
@@ -758,7 +785,7 @@
stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv);
}
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue,powerStationTypeValue, 1, true);
} else if (eventBus.getType().equals(ConstantManage.station_edit)) {
//缂栬緫鍚庢洿鏂颁竴涓嬩綇瀹呭垪琛�
//loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
@@ -777,7 +804,7 @@
* 鐢电珯鐘舵�佹瑙�
*/
private void getStatusOverview() {
- HdlResidenceLogic.getInstance().getStatusOverview(screeningConditionStatus, installedCapacityMinValue, installedCapacityMaxValue, new CloudCallBeak<StatusOverviewBean>() {
+ HdlResidenceLogic.getInstance().getStatusOverview(screeningConditionStatus, installedCapacityMinValue, installedCapacityMaxValue,powerStationTypeValue, new CloudCallBeak<StatusOverviewBean>() {
@Override
public void onSuccess(StatusOverviewBean statusOverviewBean) {
if (statusOverviewBean == null) {
@@ -811,10 +838,11 @@
* @param installedCapacityMax 鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
* @param gridType 璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯)
* @param powerStationStatus 鐢电珯鐘舵�� (鍏ㄩ儴 锛�"";1 锛� 姝e父;2 锛� 绂荤嚎; 3 锛� 寰呮帴鍏�;4 锛� 鏁呴殰)
+ * @param powerStationType 鐢电珯绫诲瀷(INV = 閫嗗彉鍣ㄧ數绔�;BMS = BMS鐢电珯)
* @param pageNo 椤电爜
* @param isClear 鏄惁娓呴櫎鏁版嵁
*/
- private void loadNextPageHouseList(boolean isRefreshing, String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String gridType, String powerStationStatus, long pageNo, boolean isClear) {
+ private void loadNextPageHouseList(boolean isRefreshing, String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String gridType, String powerStationStatus, String powerStationType, long pageNo, boolean isClear) {
isReadData = true;
if (isClear) {
clearData();
@@ -831,7 +859,7 @@
}
//鑾峰彇浣忓畢(鐢电珯)ID鍒楄〃
- HdlResidenceLogic.getInstance().getResidenceIdList(key, keyValue, installedCapacityMin, installedCapacityMax, gridType, powerStationStatus, pageNo, pageSize, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() {
+ HdlResidenceLogic.getInstance().getResidenceIdList(key, keyValue, installedCapacityMin, installedCapacityMax, gridType, powerStationStatus, powerStationType, pageNo, pageSize, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() {
@Override
public void onSuccess(HdlResidenceLogic.HouseBeanClass houseBeanClass) {
HdlThreadLogic.runMainThread(new Runnable() {
@@ -1168,7 +1196,7 @@
// 鎵ц浠诲姟锛堝鏇存柊UI銆佽烦杞瓑锛�
viewBinding.fragmentHouseSrl.endRefreshing();
//鍔犺浇鏈�鏂版暟鎹畬鎴�
- loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue,1, true);
getStatusOverview();
}
}.execute();
@@ -1195,7 +1223,7 @@
viewBinding.fragmentHouseSrl.endLoadingMore();
if (!isHouseLoadingMore) {
// 婊戝姩鍒颁簡搴曢儴锛屾墽琛岀浉搴旂殑鎿嶄綔
- loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, ++currentHouseListPage, false);
+ loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue,powerStationTypeValue, ++currentHouseListPage, false);
}
}
}.execute();
--
Gitblit v1.8.0