| | |
| | | }); |
| | | |
| | | //完成所有处理后使用事务保存数据 |
| | | 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) |
| | | { |
| | |
| | | /// 完成所有处理后使用事务保存数据 |
| | | /// </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; |