feat: 更新广播间隔、数据库版本及广播逻辑

- 将广播间隔从10分钟缩短至3分钟
- 更新数据库版本至2,并调整相关实体和查询逻辑
- 修复广播记录保存和查询时的字段初始化问题
- 在广播消息中添加时间段类型字段
- 优化广播记录的UI显示和操作逻辑
This commit is contained in:
dzc committed 2025-04-23 15:51:00 +08:00
1 parent 45c2ea384d
commit cc98644cb5
13 files changed
+89 -44

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ class SyncCheckTool {
Duration printInterval = const Duration(seconds: 60 * 10);
Duration broadcastInterval = const Duration(seconds: 60 * 10);
Duration broadcastInterval = const Duration(seconds: 60 * 3);
Timer? mqTimer;
@@ -13,18 +13,23 @@ abstract class SyncTakeFoodBroadcastTool {
final broadcastDao = appC.dataBase.getBroadcastDao;
final saveObj = BroadcastEntity(
content: msg.content,
broadcastCount: 0,
broadcastMaxCount: msg.broadcastMaxCount,
isBroadcast: true,
isDone: false,
productDesc: msg.productDesc,
serviceCode: msg.id,
userId: msg.userId,
username: msg.username,
userMobile: msg.userMobile,
payPrice: msg.payPrice,
hourType:
ProductHourType.values.fromCode(msg.hourType) ?? ProductHourType.NOON,
enable: true,
createTime: DateTime.now(),
);
await broadcastDao.save(saveObj);
logger.i("|$_tag|添加到打印记录到本地数据库,json:|${saveObj.toJson()}|");
logger.i("|$_tag|添加到广播记录到本地数据库,json:|${saveObj.toJson()}|");
await SyncTakeFoodBroadcastTool.doCheckBroadcast();
}