| | |
| | | return Ok(response); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// GetOrderList(ApiAction(BasePageInput)) |
| | | /// 获取需要上架的收货单列表(带分页) |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/In_U9Receipt/GetOrderList")] |
| | | public async Task<IActionResult> In_BIZ_U9_RECEIPT_GetOrderListAsync([FromBody] ApiAction<BaseInputWithPage> action) |
| | | { |
| | | ApiAction response; |
| | | IIn_BIZ_U9_RECEIPT trans = null; |
| | | try |
| | | { |
| | | if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID)) |
| | | { |
| | | trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IIn_BIZ_U9_RECEIPT; |
| | | if (!trans.IsFinished) |
| | | { |
| | | if (action.IsAsync) |
| | | { |
| | | response = action.GetResponse(await trans.GetOrderList(action.Data)); |
| | | } |
| | | else |
| | | { |
| | | lock (trans.TransLock) { response = action.GetResponse(trans.GetOrderList(action.Data).Result); } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 收货单(U9)上架事务[ID:{action.ID}]已经关闭,请重新打开收货单(U9)上架功能", false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 收货单(U9)上架事务[ID:{action.ID}]数据丢失,请重新打开收货单(U9)上架功能", false); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | response = action.GetResponse().CatchExceptionWithLog(ex); |
| | | } |
| | | trans?.AddHistory(Request, action); |
| | | return Ok(response); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// GetCurOrder(ApiAction) |
| | | /// 获取当前收货单信息 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/In_U9Receipt/GetCurOrder")] |
| | | public async Task<IActionResult> In_BIZ_U9_RECEIPT_GetCurOrderAsync([FromBody] ApiAction<BaseInput> action) |
| | | { |
| | | ApiAction response; |
| | | IIn_BIZ_U9_RECEIPT trans = null; |
| | | try |
| | | { |
| | | if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID)) |
| | | { |
| | | trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IIn_BIZ_U9_RECEIPT; |
| | | if (!trans.IsFinished) |
| | | { |
| | | if (action.IsAsync) |
| | | { |
| | | response = action.GetResponse(await trans.GetCurOrder()); |
| | | } |
| | | else |
| | | { |
| | | lock (trans.TransLock) { response = action.GetResponse(trans.GetCurOrder().Result); } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 收货单(U9)上架事务[ID:{action.ID}]已经关闭,请重新打开收货单(U9)上架功能", false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 收货单(U9)上架事务[ID:{action.ID}]数据丢失,请重新打开收货单(U9)上架功能", false); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | response = action.GetResponse().CatchExceptionWithLog(ex); |
| | | } |
| | | trans?.AddHistory(Request, action); |
| | | return Ok(response); |
| | | } |
| | | |
| | | } |
| | | } |