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/other/HdlResidenceLogic.java | 107 ++++++++++++++++++++---------------------------------
1 files changed, 41 insertions(+), 66 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
index d2dca00..f6d35ae 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
@@ -11,6 +11,7 @@
import com.hdl.linkpm.sdk.core.exception.HDLException;
import com.hdl.photovoltaic.config.AppConfigManage;
import com.hdl.photovoltaic.config.UserConfigManage;
+import com.hdl.photovoltaic.enums.PowerStationType;
import com.hdl.photovoltaic.enums.ProjectOperation;
import com.hdl.photovoltaic.internet.HttpClient;
import com.hdl.photovoltaic.internet.api.HttpApi;
@@ -19,6 +20,7 @@
import com.hdl.photovoltaic.ui.bean.HouseInfoBean;
import com.hdl.photovoltaic.ui.bean.HouseIdBean;
import com.hdl.photovoltaic.ui.bean.StatusOverviewBean;
+import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.sdk.link.core.config.HDLLinkConfig;
import com.hdl.sdk.link.core.utils.mqtt.MqttRecvClient;
@@ -391,10 +393,11 @@
* @param installedCapacityMax 鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
* @param debugStatus 璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯)
* @param powerStationStatus 鐢电珯鐘舵�� (鍏ㄩ儴 锛�"";1 锛� 姝e父;2 锛� 绂荤嚎; 3 锛� 寰呮帴鍏�;4 锛� 鏁呴殰)
+ * @param powerStationType 鐢电珯绫诲瀷(INV = 閫嗗彉鍣ㄧ數绔�;BMS = BMS鐢电珯)
* @param pageNo 椤电爜
* @param pageSize 椤垫暟锛堜竴椤靛灏戞暟鎹級
*/
- public void getResidenceIdList(String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String debugStatus, String powerStationStatus, long pageNo, long pageSize, CloudCallBeak<HouseBeanClass> cloudCallBeak) {
+ public void getResidenceIdList(String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String debugStatus, String powerStationStatus, String powerStationType, long pageNo, long pageSize, CloudCallBeak<HouseBeanClass> cloudCallBeak) {
String requestUrl = HttpApi.POST_PowerStation_List;
JsonObject json = new JsonObject();
@@ -425,6 +428,12 @@
try {
int value = Integer.parseInt(powerStationStatus);
json.addProperty("powerStationStatus", value);
+ } catch (Exception ignored) {
+ }
+ }
+ if (!TextUtils.isEmpty(powerStationType)) {
+ try {
+ json.addProperty("powerStationType", powerStationType);
} catch (Exception ignored) {
}
}
@@ -616,8 +625,9 @@
* @param debugStatus (璋冭瘯鐘舵��:Debugging = 璋冭瘯涓�,WAIT_DELIVERED = 璋冭瘯瀹屾垚,Delivered = 宸蹭氦浠�,SECONDARY_DEBUGGIN = 鎺堟潈璋冭瘯)
* @param installedCapacityMin 鏈�灏忕粍涓插閲�(瑁呮満瀹归噺)
* @param installedCapacityMax 鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
+ * @param powerStationType 鐢电珯绫诲瀷锛堥�嗗彉鍣紝BMS锛�
*/
- public void getStatusOverview(String debugStatus, String installedCapacityMin, String installedCapacityMax, CloudCallBeak<StatusOverviewBean> cloudCallBeak) {
+ public void getStatusOverview(String debugStatus, String installedCapacityMin, String installedCapacityMax, String powerStationType, CloudCallBeak<StatusOverviewBean> cloudCallBeak) {
String requestUrl = HttpApi.POST_statusOverview;
JsonObject json = new JsonObject();
if (!TextUtils.isEmpty(installedCapacityMin)) {
@@ -628,6 +638,10 @@
}
if (!TextUtils.isEmpty(debugStatus)) {
json.addProperty("debugStatus", debugStatus);
+ }
+
+ if (!TextUtils.isEmpty(powerStationType)) {
+ json.addProperty("powerStationType", powerStationType);
}
@@ -934,6 +948,7 @@
// HdlFileLogic.getInstance().deleteDirectory(HdlFileLogic.getInstance().getCurrentHomeRootPath());
//閲嶆柊璁剧疆浣忓畢id
UserConfigManage.getInstance().setHomeId(houseIdBean.getHomeId());
+ UserConfigManage.getInstance().setPowerStationType(houseIdBean.getPowerStationType());
UserConfigManage.getInstance().setHomeName(houseIdBean.getHomeName());
//閲嶆柊璁剧疆鏈湴閫氳绉橀挜
UserConfigManage.getInstance().setLocalSecret(houseIdBean.getLocalSecret());
@@ -947,6 +962,30 @@
HdlDeviceLogic.getInstance().searchCurrentHomeGateway(houseIdBean.getHomeId(), null);
}
+ /**
+ * 鎵撳紑鐢电珯璇︽儏(uni鐣岄潰)
+ *
+ * @param houseIdBean 浣忓畢Id瀵硅薄
+ */
+ public void openPowerStationDetails(HouseIdBean houseIdBean) {
+ if (UserConfigManage.getInstance().isBAccount()) {
+ if (houseIdBean.getPowerStationType().equals(PowerStationType.BMS)) {
+ String path = HDLUniMP.UNI_EVENT_OPEN_BMSPLANT_DETAILS + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&isInstaller=true";
+ HdlUniLogic.getInstance().openUniMP(path, null);
+ } else {
+ String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&powerStationStatus=" + houseIdBean.getPowerStationStatus();
+ HdlUniLogic.getInstance().openUniMP(path, null);
+ }
+ } else {
+ if (houseIdBean.getPowerStationType().equals(PowerStationType.BMS)) {
+ String path = HDLUniMP.UNI_EVENT_OPEN_BMSPLANT_DETAILS + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&isInstaller=false";
+ HdlUniLogic.getInstance().openUniMP(path, null);
+ } else {
+ String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS_C + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&powerStationStatus=" + houseIdBean.getPowerStationStatus();
+ HdlUniLogic.getInstance().openUniMP(path, null);
+ }
+ }
+ }
/**
* 鐢电珯鏁版嵁(缁熻)
@@ -1140,70 +1179,6 @@
}
- /**
- * 娣诲姞鎺ㄩ�乀oken
- *
- * @param cloudCallBeak -
- */
- public void pushAdd(CloudCallBeak<String> cloudCallBeak) {
- String requestUrl = HttpApi.POST_push_add;
- JsonObject json = new JsonObject();
- json.addProperty("deviceName", Build.MODEL);//璁惧鍚嶇О
- json.addProperty("deviceType", "Android");//璁惧绫诲瀷
- json.addProperty("produce", AppConfigManage.isIsOnlineServer());//琛ㄧず鏄惁鏄寮忔湇鍔″櫒
- json.addProperty("pushToken", UserConfigManage.getInstance().getRegistrationID());//App鐨勬帹閫乀oken锛屽湪鏋佸厜涓篟egId
- json.addProperty("software", "PHOTOVOLTAIC");//杞欢鏉ユ簮
-
- HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() {
- @Override
- public void onSuccess(String jsonStr) {
- if (cloudCallBeak != null) {
- cloudCallBeak.onSuccess(jsonStr);
- }
-
- }
-
- @Override
- public void onFailure(HDLException e) {
- if (cloudCallBeak != null) {
- cloudCallBeak.onFailure(e);
- }
- }
- });
-
-
- }
-
- /**
- * 鍒犻櫎鎺ㄩ�乀oken
- *
- * @param cloudCallBeak -
- */
- public void pushDel(CloudCallBeak<String> cloudCallBeak) {
- String requestUrl = HttpApi.POST_push_del;
- JsonObject json = new JsonObject();
- json.addProperty("pushId", UserConfigManage.getInstance().getPushId());
- json.addProperty("pushToken", UserConfigManage.getInstance().getRegistrationID());
-
- HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() {
- @Override
- public void onSuccess(String jsonStr) {
- if (cloudCallBeak != null) {
- cloudCallBeak.onSuccess(jsonStr);
- }
-
- }
-
- @Override
- public void onFailure(HDLException e) {
- if (cloudCallBeak != null) {
- cloudCallBeak.onFailure(e);
- }
- }
- });
-
-
- }
public static class HouseBeanClass {
--
Gitblit v1.8.0