feat:辅助条码

This commit is contained in:
dzc committed 2025-03-20 14:32:07 +08:00
1 parent 6b3ee0e8d1
commit 93f9ec7cfd
10 files changed
+130 -52

No files matched your search

+19 -16
View File
@@ -74,26 +74,29 @@ abstract class SyncPrintTool {
}
final app = Get.find<AppControl>();
final printHistoryDao = app.dataBase.getPrintHistoryDao;
try {
final list = await printHistoryDao.getAll(PrintStatus.SUCCESS.name);
if (ObjectUtil.isEmptyList(list)) {
_isSync = false;
return;
}
for (final v in list) {
final printPa = {
"orderId": v.serviceOrderId,
"historyId": v.servicePrintId,
};
await HardApi.printInvoice(printPa);
final list = await printHistoryDao.getAll(PrintStatus.SUCCESS.name);
if (ObjectUtil.isEmptyList(list)) {
_isSync = false;
return;
}
for (final v in list) {
final printPa = {
"orderId": v.serviceOrderId,
"historyId": v.servicePrintId,
};
try {
final flag = await HardApi.printInvoice(printPa);
if (!flag) Exception("|$_tag|同步失败api错误params|${v.toJson()}|");
v.status = PrintStatus.SYNC;
v.syncTime = DateTime.now();
await printHistoryDao.edit(v);
} catch (e) {
logger.e("|$_tag|检查同步,打印错误,error:|$e|");
v.status = PrintStatus.ERROR;
await printHistoryDao.edit(v);
} finally {
_isSync = false;
}
} catch (e) {
logger.e("|$_tag|检查打印,打印错误,error:|$e|");
} finally {
_isSync = false;
}
}