From 5613a2fa9eed03e8561012f1d8382398cbcbf1ee Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Mon, 28 Apr 2025 11:45:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=B9=BF=E6=92=AD=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/api/hard_api.dart | 11 +++++++++++ .../utils/sync/sync_take_food_broadcast_tool.dart | 11 ++++++++++- lib/common/values/constants.dart | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/common/api/hard_api.dart b/lib/common/api/hard_api.dart index d418fa0..d7c9e79 100644 --- a/lib/common/api/hard_api.dart +++ b/lib/common/api/hard_api.dart @@ -141,4 +141,15 @@ abstract class HardApi { if (res.data == null) return null; return ServiceBroadcastTodayPage.fromJson(res.data); } + + /// android完成一轮广播 + static Future broadcast( + dynamic formData, + ) async { + final res = await HttpManage() + .dio + .post("/hard/hard-broadcast/ad/broadcast", data: formData); + if (res.data == null) return null; + return ServiceBroadcastTodayPage.fromJson(res.data); + } } diff --git a/lib/common/utils/sync/sync_take_food_broadcast_tool.dart b/lib/common/utils/sync/sync_take_food_broadcast_tool.dart index 722f9db..ec26831 100644 --- a/lib/common/utils/sync/sync_take_food_broadcast_tool.dart +++ b/lib/common/utils/sync/sync_take_food_broadcast_tool.dart @@ -82,7 +82,16 @@ abstract class SyncTakeFoodBroadcastTool { v.broadcastCount++; await broadcastDao.edit(v); } - // 发送mq消息 + // 通知服务端 + if (AppNetworkTool.isAutoNetwork()) { + final serviceCodeList = currentGroup + .map( + (e) => e.serviceCode, + ) + .toList(); + final pa = {"ids": serviceCodeList, "count": 1}; + await HardApi.broadcast(pa); + } } } catch (e, stack) { logger.e("|$_tag|检查广播,广播错误,error:|$e|stack:|$stack|"); diff --git a/lib/common/values/constants.dart b/lib/common/values/constants.dart index 1a7449b..3f0f278 100644 --- a/lib/common/values/constants.dart +++ b/lib/common/values/constants.dart @@ -12,7 +12,7 @@ class Constants { /// 服务 url // static const apiUrl = 'https://stgl.pj.gov.cn/api'; - static const apiUrl = 'http://192.168.101.107:9999'; + static const apiUrl = 'http://192.168.101.123:9999'; /// 静态资源 url static const ossUrl = apiUrl;