From 04fa70b5c61f927e4b5e3c85e9fe9e116d79102e Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 18 十一月 2025 17:09:10 +0800
Subject: [PATCH] 2025年11月18日17:09:03
---
app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java | 94 ++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 88 insertions(+), 6 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java
index 05d0f10..c63c146 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java
+++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlMessageLogic.java
@@ -311,7 +311,7 @@
* @param cloudCallBeak -
*/
public void getMessageUntreatedCount(String homeId, CloudCallBeak<UnCountBean> cloudCallBeak) {
- String requestUrl = HttpApi.POST_Message_UntreatedCount;
+ String requestUrl = HttpApi.POST_Message_Plan_UntreatedCount;
JsonObject json = new JsonObject();
if (!TextUtils.isEmpty(homeId)) {
json.addProperty("homeId", homeId);
@@ -378,7 +378,7 @@
* @param cloudCallBeak -
*/
private void getMessageList(String messageStateType, CloudCallBeak<List<MessageBean>> cloudCallBeak) {
- String requestUrl = HttpApi.POST_Message_List;
+ String requestUrl = HttpApi.POST_Message_Plan_List;
JsonObject json = new JsonObject();
if (!MessageStateType.all.equals(messageStateType)) {
@@ -462,7 +462,7 @@
* @param cloudCallBeak -
*/
public void getPageNoMessageList(int pageNo, String messageStateType, CloudCallBeak<MessageListClass> cloudCallBeak) {
- String requestUrl = HttpApi.POST_Message_List;
+ String requestUrl = HttpApi.POST_Message_Plan_List;
JsonObject json = new JsonObject();
if (!MessageStateType.all.equals(messageStateType)) {
@@ -524,7 +524,7 @@
String timeType_filter_key,
String timeType_filter_value,
String search_title, CloudCallBeak<MessageListClass> cloudCallBeak) {
- String requestUrl = HttpApi.POST_Message_List;
+ String requestUrl = HttpApi.POST_Message_Plan_List;
JsonObject json = new JsonObject();
if (!TextUtils.isEmpty(homeId)) {
json.addProperty("homeId", homeId);
@@ -582,7 +582,7 @@
* @param cloudCallBeak -
*/
public void getMessageInfo(String msgId, CloudCallBeak<MessageBean> cloudCallBeak) {
- String requestUrl = HttpApi.POST_Message_Info;
+ String requestUrl = HttpApi.POST_Message_Plan_Info;
JsonObject json = new JsonObject();
json.addProperty("msgId", msgId);
HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() {
@@ -647,7 +647,7 @@
* @param cloudCallBeak -
*/
public void messageAllRead(String homeId, CloudCallBeak<Boolean> cloudCallBeak) {
- String requestUrl = HttpApi.POST_Message_AllRead;
+ String requestUrl = HttpApi.POST_Message_Plan_AllRead;
JsonObject json = new JsonObject();
if (!TextUtils.isEmpty(homeId)) {
json.addProperty("homeId", homeId);
@@ -672,6 +672,88 @@
}
+ /**
+ * 鑾峰彇娑堟伅浣忓畢鍒楄〃
+ *
+ * @param homeName 鐢电珯鍚嶇О锛堟悳绱㈢敤鐨勶級,濡傛灉鏄┖瀛楃涓查粯璁よ鍙栧叏閮�
+ * @param cloudCallBeak -
+ */
+ public void getMessageHouseList(String homeName, CloudCallBeak<List<MessageBean>> cloudCallBeak) {
+ String requestUrl = HttpApi.POST_Message_Plan_homeListByPage;
+ JsonObject json = new JsonObject();
+
+ if (!TextUtils.isEmpty(homeName)) {
+ json.addProperty("homeName", homeName);
+ }
+ json.addProperty("pageNo", 1);//椤电爜
+ json.addProperty("pageSize", 500);//椤垫暟
+
+ final List<MessageBean> list = new ArrayList<>();
+ HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() {
+ @Override
+ public void onSuccess(String jsonStr) {
+ if (TextUtils.isEmpty(jsonStr)) {
+ if (cloudCallBeak != null) {
+ cloudCallBeak.onSuccess(new ArrayList<>());
+ }
+ return;
+ }
+ Gson gson = new Gson();
+ MessageListClass oldMessageListClass = gson.fromJson(jsonStr, MessageListClass.class);
+ list.addAll(oldMessageListClass.getList());
+ //鎬诲叡鏈夊灏戦〉
+ long totalPage = oldMessageListClass.totalPage;
+ if (totalPage < 2) {
+ if (cloudCallBeak != null) {
+ cloudCallBeak.onSuccess(list);
+ }
+ return;
+ }
+ //璁板綍璇锋眰鏉℃暟
+ AtomicInteger atomicInteger = new AtomicInteger(0);
+ //浠庣浜岄〉鑾峰彇鏁版嵁
+ for (int i = 2; i <= totalPage; i++) {
+ json.addProperty("pageNo", i);//鏇存柊椤电爜
+ HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() {
+ @Override
+ public void onSuccess(String jsonStr) {
+ atomicInteger.set(atomicInteger.get() + 1);
+ MessageListClass newMessageListClass = gson.fromJson(jsonStr, MessageListClass.class);
+ list.addAll(newMessageListClass.getList());
+ if (atomicInteger.get() == totalPage - 1) {
+ //鏈�鍚庝竴鏉¢��鍑�
+ if (cloudCallBeak != null) {
+ cloudCallBeak.onSuccess(list);
+ }
+ }
+ }
+
+ @Override
+ public void onFailure(HDLException e) {
+ atomicInteger.set(atomicInteger.get() + 1);
+ if (atomicInteger.get() == totalPage - 1) {
+ //鏈�鍚庝竴鏉¢��鍑�
+ if (cloudCallBeak != null) {
+ cloudCallBeak.onSuccess(list);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ @Override
+ public void onFailure(HDLException e) {
+ if (cloudCallBeak != null) {
+ cloudCallBeak.onFailure(e);
+ }
+ }
+ });
+
+
+ }
+
+
public static class MessageListClass {
//鎬绘潯鏁�
--
Gitblit v1.8.0