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/BPowerStationActivity.java | 62 +++++++++++++++++++++++++------
1 files changed, 50 insertions(+), 12 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/BPowerStationActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/BPowerStationActivity.java
index e70dad0..4f23843 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/BPowerStationActivity.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/BPowerStationActivity.java
@@ -37,6 +37,7 @@
import com.hdl.photovoltaic.enums.LowerTagType;
import com.hdl.photovoltaic.enums.NetworkType;
import com.hdl.photovoltaic.listener.CloudCallBeak;
+import com.hdl.photovoltaic.other.HdlAiLogic;
import com.hdl.photovoltaic.other.HdlCommonLogic;
import com.hdl.photovoltaic.other.HdlDeviceLogic;
import com.hdl.photovoltaic.other.HdlESLocalJsonLogic;
@@ -49,6 +50,9 @@
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.other.HdlUniLogic;
import com.hdl.photovoltaic.push.PushMessageInfoBean;
+import com.hdl.photovoltaic.ui.bean.ChatInfoBean;
+import com.hdl.photovoltaic.ui.bean.ChatMessageListBean;
+import com.hdl.photovoltaic.ui.bean.ChatMessagePageBean;
import com.hdl.photovoltaic.ui.bean.DeviceRemoteInfo;
import com.hdl.photovoltaic.ui.bean.MessageBean;
import com.hdl.photovoltaic.ui.bean.OidBean;
@@ -141,7 +145,7 @@
this.getUnreadCount();
//鑾峰彇浜戠鑴氭湰
HdlESLocalJsonLogic.getInstance().getAllHdlESLocalJson();
-
+ this.getChatInfo();
}
@@ -371,6 +375,40 @@
@Override
public void onFailure(HDLException e) {
HdlLogLogic.print("娣诲姞浠ょ墝鍒颁簯绔け璐� PushToken:" + UserConfigManage.getInstance().getPushToken() + " 閿欒锛�" + e.getMessage(), true);
+ }
+ });
+ }
+
+ /**
+ * 鏌ョ湅鏅鸿兘浣撹鎯�
+ *
+ */
+ private void getChatInfo() {
+ HdlAiLogic.getInstance().getChatInfo(new CloudCallBeak<ChatInfoBean>() {
+ @Override
+ public void onSuccess(ChatInfoBean chatInfoBean) {
+ UserConfigManage.getInstance().setAgentSecret(chatInfoBean.getAgentSecret());
+ UserConfigManage.getInstance().setAgentUrl(chatInfoBean.getAgentUrl());
+ UserConfigManage.getInstance().Save();
+ HdlAiLogic.getInstance().chatMessagesList(new CloudCallBeak<ChatMessagePageBean>() {
+ @Override
+ public void onSuccess(ChatMessagePageBean obj) {
+ if (obj != null && !obj.getData().isEmpty()) {
+ UserConfigManage.getInstance().setConversationId(obj.getData().get(0).getId());
+ UserConfigManage.getInstance().Save();
+ }
+ }
+
+ @Override
+ public void onFailure(HDLException e) {
+
+ }
+ });
+ }
+
+ @Override
+ public void onFailure(HDLException e) {
+ HdlLogLogic.print("鑾峰彇鏅鸿兘浣揂ppKey澶辫触 Pu" + e.getMessage(), true);
}
});
}
@@ -787,7 +825,7 @@
public void run() {
//闃叉app鍚姩鐨勬椂鍊欐病鏈夌綉缁�(app涔熺櫥褰曚笉浜�),瀵艰嚧鑾峰彇涓嶄簡mqtt杩滅▼杩炴帴淇℃伅;
initMqttClient();
- HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(UserConfigManage.getInstance().getHomeId(), new CloudCallBeak<List<GatewayBean>>() {
+ HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(UserConfigManage.getInstance().getHomeId(), UserConfigManage.getInstance().getPowerStationType(), new CloudCallBeak<List<GatewayBean>>() {
@Override
public void onSuccess(List<GatewayBean> obj) {
// AppManagerUtils.getAppManager().hideLoading();
@@ -878,16 +916,16 @@
*/
private void clickNotificationMessageTab() {
//瑙﹀彂娑堟伅鐐瑰嚮浜嬩欢
-// viewBinding.myMessageBottomIl2.clickTv.performClick();
- if (currentFragmentIndex == 2) {
- HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house);
- return;
- }
- currentFragmentIndex = 2;
- bottomViewChangeOfStyle();
- showFragment();
- HdlCommonLogic.lowerTagType = LowerTagType.message;
- HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house);
+ viewBinding.myMessageBottomIl2.clickTv.performClick();
+// if (currentFragmentIndex == 2) {
+// HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house);
+// return;
+// }
+// currentFragmentIndex = 2;
+// bottomViewChangeOfStyle();
+// showFragment();
+// HdlCommonLogic.lowerTagType = LowerTagType.message;
+// HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house);
}
--
Gitblit v1.8.0