From c7c07eaa32ca7b137b1ac028d17beee0ebcf9a0b Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 26 三月 2024 15:22:15 +0800
Subject: [PATCH] 2024年03月26日15:22:09

---
 app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java |   62 ++++++++++---------------------
 1 files changed, 20 insertions(+), 42 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java b/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java
index 7c2523b..90096df 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java
@@ -11,8 +11,6 @@
 import androidx.recyclerview.widget.RecyclerView;
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.google.gson.JsonObject;
 import com.hdl.linkpm.sdk.core.exception.HDLException;
 import com.hdl.photovoltaic.R;
@@ -100,11 +98,11 @@
             public void onClick(View v) {
                 clearCacheData();
                 HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
-                uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_USERINFO);
+                uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_REFRESH_UNREAD_NUMBER);
                 JsonObject jsonObject = new JsonObject();
                 jsonObject.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
                 uniCallBackBaseBean.setData(jsonObject);
-                HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_REFRESH_UNREAD_NUMBER, uniCallBackBaseBean);
+                HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean);
                 finish();
             }
         });
@@ -117,7 +115,8 @@
                     @Override
                     public void onSuccess(Boolean obj) {
                         hideLoading();
-                        loadNextPageMessageList(1, true, mFilterKye, mFilterValue);
+                        HdlMessageLogic.getInstance().setAllRead(true);
+                        updateListData();
                     }
 
                     @Override
@@ -322,7 +321,7 @@
         } else {
             messageStateType = MessageStateType.processed;
         }
-        HdlMessageLogic.getInstance().getPageNoMessageList_C(pageNo, messageStateType, filter_key, filter_value, new CloudCallBeak<HdlMessageLogic.MessageListClass>() {
+        HdlMessageLogic.getInstance().getPageNoMessageList_C(UserConfigManage.getInstance().getHomeId(), pageNo, messageStateType, filter_key, filter_value, new CloudCallBeak<HdlMessageLogic.MessageListClass>() {
             @Override
             public void onSuccess(HdlMessageLogic.MessageListClass messageListClass) {
                 if (messageListClass != null) {
@@ -355,42 +354,6 @@
         });
 
 
-    }
-
-    /**
-     * 璇诲彇娑堟伅銆愭湭璇绘暟閲忋��
-     */
-    private void getUnreadCount() {
-        HdlMessageLogic.getInstance().getMessageUntreatedCount(new CloudCallBeak<String>() {
-            @Override
-            public void onSuccess(String data) {
-
-                HdlThreadLogic.runMainThread(new Runnable() {
-                    @Override
-                    public void run() {
-                        JSONObject jsonObject = JSON.parseObject(data);
-                        if (jsonObject.containsKey("untreatedCount")) {
-                            //鏈鐞嗘暟閲�
-                            String untreatedCount = jsonObject.getString("untreatedCount");
-                            refreshCount();
-                        }
-                        if (jsonObject.containsKey("unreadCount")) {
-                            //鏈鏁伴噺
-                            String unreadCount = jsonObject.getString("unreadCount");
-                        }
-                    }
-                });
-
-            }
-
-            @Override
-            public void onFailure(HDLException e) {
-                TextView textView = _mActivity.findViewById(R.id.my_message_bottom_il2).findViewById(R.id.red_count_tv);
-                if (textView != null) {
-                    textView.setVisibility(View.GONE);
-                }
-            }
-        });
     }
 
 
@@ -589,4 +552,19 @@
         }
         return stringList;
     }
+
+    /**
+     * 鐗╃悊鎸夐敭杩斿洖浜嬩欢
+     */
+    @Override
+    public void onBackPressed() {
+        clearCacheData();
+        HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
+        uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_REFRESH_UNREAD_NUMBER);
+        JsonObject jsonObject = new JsonObject();
+        jsonObject.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
+        uniCallBackBaseBean.setData(jsonObject);
+        HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean);
+        super.onBackPressed();
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0