| | |
| | | catch (Exception ex) |
| | | { |
| | | //取消当前操作 |
| | | ResetScan(); |
| | | ResetTrans(); |
| | | //action.CatchExceptionWithLog(ex, $"扫描[{input.SN}]异常"); |
| | | action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.Scan.ScanException", input.SN)); |
| | | } |
| | |
| | | }); |
| | | |
| | | //完成所有处理后使用事务保存数据 |
| | | action = DoIfFinish(action, input.Locale); |
| | | action = DoIfFinish(action, input.Locale, () => |
| | | { |
| | | if (!OrderList.Contains(CurSn.First().ORDER_NO)) |
| | | { |
| | | OrderList.Add(CurSn.First().ORDER_NO); |
| | | } |
| | | ScanList.AddRange(CurSn); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //取消当前操作 |
| | | ResetScan(); |
| | | ResetTrans(); |
| | | //action.CatchExceptionWithLog(ex, $"扫描条码[{0}]复核异常"); |
| | | action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.ScanItem.ScanException", input.SN)); |
| | | } |
| | |
| | | /// 完成所有处理后使用事务保存数据 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <param name="locale"></param> |
| | | /// <param name="doAfterSave"></param> |
| | | /// <returns></returns> |
| | | public ApiAction<ScanOutput> DoIfFinish(ApiAction<ScanOutput> action, string locale) |
| | | public ApiAction<ScanOutput> DoIfFinish(ApiAction<ScanOutput> action, string locale, Action doAfterSave = null) |
| | | { |
| | | //保存数据库 |
| | | SaveCommitListToDB(); |
| | | |
| | | if (!OrderList.Contains(CurSn.First().ORDER_NO)) |
| | | { |
| | | OrderList.Add(CurSn.First().ORDER_NO); |
| | | } |
| | | ScanList.AddRange(CurSn); |
| | | //保存数据成功后执行 |
| | | doAfterSave?.Invoke(); |
| | | |
| | | // 返回数据 |
| | | action.Data.Data = ScanList; |
| | |
| | | action.LocaleMsg = Biz.L("WMS.Count_BIZ_U9_ASN.CountSuccess", CurSn.First().SN); |
| | | |
| | | //重置工序 |
| | | ResetScan(); |
| | | ResetTrans(); |
| | | return SetOutPutMqttMsg(action, locale); ; |
| | | } |
| | | |
| | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 重置当前操作,有需要则重写此方法 |
| | | /// 重置事务数据,有需要则重写此方法 |
| | | /// </summary> |
| | | public override void ResetTrans() |
| | | { |
| | | ResetScan(); |
| | | CurScanShelf = null; |
| | | base.ResetTrans(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重置本次扫码信息 |
| | | /// </summary> |
| | | public override void ResetScan() |
| | | { |
| | | base.ResetScan(); |
| | | Command = null; |
| | | Command = "Normal"; |
| | | CurInvItem = null; |
| | | CurScanShelf = null; |
| | | CurSn = null; |
| | | base.ResetScan(); |
| | | } |
| | | |
| | | public override bool Close(bool needSaveHistoryLog = false) |