From c4ae4589c6c001329ebb731589b209e8ddcbf7ca Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 24 三月 2026 16:03:59 +0800
Subject: [PATCH] 2026年03月24日16:03:57
---
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java | 118 ++++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 72 insertions(+), 46 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 09815a2..253e4cf 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);
}
});
}
@@ -296,12 +307,11 @@
houseInfoAdapter.setNoOnclickListener(new HouseInfoAdapter.OnclickListener() {
@Override
public void onClick(int position, HouseIdBean houseIdBean) {
+ HdlLogLogic.print("鐐瑰嚮浣忓畢璇︽儏---" + new Gson().toJson(houseIdBean), false);
//鐐瑰嚮浣忓畢璇︽儏
UserConfigManage.getInstance().setUniBottomSafeDistanceBackgroundColor(0);
HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true);
- String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&powerStationStatus=" + houseIdBean.getPowerStationStatus();
- HdlUniLogic.getInstance().openUniMP(path, null);
- HdlLogLogic.print("鐐瑰嚮浣忓畢璇︽儏---" + new Gson().toJson(houseIdBean), false);
+ HdlResidenceLogic.getInstance().openPowerStationDetails(houseIdBean);
}
@Override
@@ -354,8 +364,7 @@
delayedConfirmationCancelDialog.dismiss();
if (isWaitDelivered) {
showLoading();
- String flowRecordContent = UserConfigManage.getInstance().isZh() ? "鏂扮壒閿愯兘app鍙戣捣鐢电珯閲嶆柊璋冭瘯" : "The Xenterra app initiates the re-commissioning of the power station";
- HdlResidenceLogic.getInstance().setUpdateProjectDebugStatus(houseIdBean.getHomeId(), houseIdBean.getCommunityId(), flowRecordContent, ProjectOperation.DEBUGGING_AGAIN.toString(), new CloudCallBeak<Boolean>() {
+ HdlResidenceLogic.getInstance().setUpdateProjectDebugStatus(houseIdBean.getHomeId(), houseIdBean.getCommunityId(), getString(R.string.re_commissioning_power_station), ProjectOperation.DEBUGGING_AGAIN.toString(), new CloudCallBeak<Boolean>() {
@Override
public void onSuccess(Boolean list) {
hideLoading();
@@ -378,26 +387,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(), houseIdBean.getPowerStationType(), 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);
+// }
}
}
});
@@ -419,7 +429,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);
}
});
//棰濆畾鍔熺巼绛涢��
@@ -431,7 +441,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);
}
});
//鐢电珯鐢垫睜瀹归噺绛涢��
@@ -443,7 +453,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);
}
});
//鐢电珯褰撴棩鍙戠數閲忕瓫閫�
@@ -455,7 +465,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);
}
});
//璁惧鐐瑰嚮
@@ -574,6 +584,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);
@@ -604,7 +621,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) {
@@ -614,7 +635,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) {
@@ -698,7 +723,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())) {
// 鍙栨秷绮樻�т簨浠�
@@ -741,7 +766,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);
@@ -759,7 +784,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);
@@ -778,7 +803,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) {
@@ -812,10 +837,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();
@@ -832,7 +858,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() {
@@ -1169,7 +1195,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();
@@ -1196,7 +1222,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