| | |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/RePrintLabel/ScanItem")] |
| | | public async Task<IActionResult> RePrintLabel_ScanItemAsync([FromBody] ApiAction<BaseInput> action) |
| | | [Route("api/[controller]/RePrintLabel/Scan")] |
| | | public async Task<IActionResult> RePrintLabel_ScanAsync([FromBody] ApiAction<BaseInput> action) |
| | | { |
| | | ApiAction response; |
| | | IRePrintLabel trans = null; |
| | |
| | | return Ok(response); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 扫描入库 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/RePrintLabel/ScanItem")] |
| | | public async Task<IActionResult> RePrintLabel_ScanItemAsync([FromBody] ApiAction<BaseInput> action) |
| | | { |
| | | ApiAction response; |
| | | IRePrintLabel trans = null; |
| | | try |
| | | { |
| | | if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID)) |
| | | { |
| | | trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IRePrintLabel; |
| | | if (!trans.IsFinished) |
| | | { |
| | | if (action.IsAsync) |
| | | { |
| | | response = action.GetResponse(await trans.Scan(action.Data)); |
| | | } |
| | | else |
| | | { |
| | | lock (trans.TransLock) { response = action.GetResponse(trans.ScanItem(action.Data).Result); } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 标准上架事务[ID:{action.ID}]已经关闭,请重新打开标准上架功能", false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 标准上架事务[ID:{action.ID}]数据丢失,请重新打开标准上架功能", false); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | response = action.GetResponse().CatchExceptionWithLog(ex); |
| | | } |
| | | trans?.AddHistory(Request, action); |
| | | return Ok(response); |
| | | } |
| | | } |
| | | } |