111
This commit is contained in:
1 parent
ecf4c32ca6
commit
e150f96f3a
3 files changed
+33
-25
No files matched your search
@@ -112,27 +112,28 @@ class AppMqTool {
|
||||
}
|
||||
break;
|
||||
case MqtActionEnum.FACE:
|
||||
final msg = MqttInvoiceMsg.fromJson(json.decode(orgStr));
|
||||
final storagePath = await AppFileTool.getFacePath();
|
||||
if (ObjectUtil.isEmpty(storagePath)) {
|
||||
logger.e("|$_tag|mq同步人脸错误,创建人脸存储路径错误");
|
||||
return;
|
||||
}
|
||||
final sysSetting = await AppSettingTool.getSysSetting();
|
||||
var merchantDeptId = sysSetting.merchantDeptId;
|
||||
if (ObjectUtil.isEmpty(storagePath)) {
|
||||
logger.e("|$_tag|mq同步人脸错误,merchantId为空");
|
||||
return;
|
||||
}
|
||||
await SyncFaceTool.syncGroupFace(
|
||||
pageNo: 1,
|
||||
userId: msg.userId,
|
||||
merchantDeptId: merchantDeptId!,
|
||||
storagePath: storagePath!,
|
||||
isGlobalFace: msg.isGlobalFace,
|
||||
);
|
||||
mqUpdateEventBus.fire(MqtActionEnum.FACE);
|
||||
break;
|
||||
return;
|
||||
// final msg = MqttInvoiceMsg.fromJson(json.decode(orgStr));
|
||||
// final storagePath = await AppFileTool.getFacePath();
|
||||
// if (ObjectUtil.isEmpty(storagePath)) {
|
||||
// logger.e("|$_tag|mq同步人脸错误,创建人脸存储路径错误");
|
||||
// return;
|
||||
// }
|
||||
// final sysSetting = await AppSettingTool.getSysSetting();
|
||||
// var merchantDeptId = sysSetting.merchantDeptId;
|
||||
// if (ObjectUtil.isEmpty(storagePath)) {
|
||||
// logger.e("|$_tag|mq同步人脸错误,merchantId为空");
|
||||
// return;
|
||||
// }
|
||||
// await SyncFaceTool.syncGroupFace(
|
||||
// pageNo: 1,
|
||||
// userId: msg.userId,
|
||||
// merchantDeptId: merchantDeptId!,
|
||||
// storagePath: storagePath!,
|
||||
// isGlobalFace: msg.isGlobalFace,
|
||||
// );
|
||||
// mqUpdateEventBus.fire(MqtActionEnum.FACE);
|
||||
// break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -107,6 +107,8 @@ class SteelyardController extends GetxController {
|
||||
widget.value = 0;
|
||||
callbackWidget.value = 0;
|
||||
price.value = 0;
|
||||
_noUpdateTimer?.cancel();
|
||||
_noUpdateTimer = null;
|
||||
}
|
||||
|
||||
// 打开称串口
|
||||
@@ -141,7 +143,9 @@ class SteelyardController extends GetxController {
|
||||
appC.srialSteelyardManage.listen((event) {
|
||||
final w = appC.srialSteelyardManage.parseWidget(event);
|
||||
if (ObjectUtil.isEmpty(w)) return;
|
||||
callbackWidget.value = w!;
|
||||
// 保留两位小数并向上取整
|
||||
final roundedWeight = (w! * 100).ceil() / 100;
|
||||
callbackWidget.value = roundedWeight;
|
||||
});
|
||||
interval(
|
||||
callbackWidget,
|
||||
@@ -166,7 +170,6 @@ class SteelyardController extends GetxController {
|
||||
time: const Duration(milliseconds: 100),
|
||||
);
|
||||
} catch (e) {
|
||||
_closeStatus();
|
||||
_closeStatus();
|
||||
logger.e("|$_tag|打开并监听称串口失败error|$e|");
|
||||
}
|
||||
|
||||
@@ -351,15 +351,19 @@ class SupermarketOrderController extends GetxController with OrderMixin {
|
||||
// 校验购物车
|
||||
bool _validateShopCar() {
|
||||
bool flag = true;
|
||||
if (ObjectUtil.isEmptyList(shopCardList)) {
|
||||
TtsManage.speak("校验购物车失败,商品为空");
|
||||
return false;
|
||||
}
|
||||
for (final v in shopCardList) {
|
||||
if (v.nature == ProductNature.DEFAULT) {
|
||||
if (v.productNumber <= 0) {
|
||||
Toast.error(msg: "校验购物车失败,未选择商品");
|
||||
TtsManage.speak("校验购物车失败,未选择商品");
|
||||
return false;
|
||||
}
|
||||
} else if (v.nature == ProductNature.WEIGHT) {
|
||||
if (v.productWidget <= 0) {
|
||||
Toast.error(msg: "校验购物车失败,商品未称重");
|
||||
TtsManage.speak("校验购物车失败,商品未称重");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user