feat:打印机优化

This commit is contained in:
dzc committed 2025-03-19 20:16:40 +08:00
1 parent 481291884d
commit 32341ef253
5 files changed
+38 -17

No files matched your search

+8 -6
View File
@@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart';
@@ -14,8 +16,8 @@ abstract class SyncPrintTool {
required String historyId,
required String pic,
}) async {
final app = Get.find<AppControl>();
final printHistoryDao = app.dataBase.getPrintHistoryDao;
final appC = Get.find<AppControl>();
final printHistoryDao = appC.dataBase.getPrintHistoryDao;
final saveObj = PrintHistoryEntity(
orderId: androidOrderId,
serviceOrderId: orderId,
@@ -35,9 +37,9 @@ abstract class SyncPrintTool {
logger.i("|$_tag|检查打印,正在打印中");
return;
}
final app = Get.find<AppControl>();
final printHistoryDao = app.dataBase.getPrintHistoryDao;
final printFacility = app.printManage;
final appC = Get.find<AppControl>();
final printHistoryDao = appC.dataBase.getPrintHistoryDao;
final printFacility = appC.printManage;
try {
// 检查有没有需要打印的
final list = await printHistoryDao.getAll(PrintStatus.NONE.name);
@@ -72,7 +74,7 @@ abstract class SyncPrintTool {
if (!isPrint) {
v.status = PrintStatus.ERROR;
await printHistoryDao.edit(v);
throw Error();
throw Exception("|$_tag|打印失败params|${v.toJson()}|");
}
// 更新本地数据库
v.status = PrintStatus.SUCCESS;