| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Scan(ApiAction(BaseInput)) |
| | | /// 扫描入口 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | |
| | | return Ok(response); |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// GetPrepInfo(ApiAction) |
| | | /// 获取当前所有单据信息 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/Out_PREP/GetPrepInfo")] |
| | | public async Task<IActionResult> Out_BIZ_WMS_PREP_GetPrepInfoAsync([FromBody] ApiAction action) |
| | | { |
| | | ApiAction response; |
| | | IOut_BIZ_WMS_PREP trans = null; |
| | | try |
| | | { |
| | | if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID)) |
| | | { |
| | | trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IOut_BIZ_WMS_PREP; |
| | | if (!trans.IsFinished) |
| | | { |
| | | response = action.GetResponse(await trans.GetPrepInfo()); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// GetCurPrepItem(ApiAction) |
| | | /// 获取当前所有单据信息 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/Out_PREP/GetCurPrepItem")] |
| | | public async Task<IActionResult> Out_BIZ_WMS_PREP_GetCurPrepItemAsync([FromBody] ApiAction action) |
| | | { |
| | | ApiAction response; |
| | | IOut_BIZ_WMS_PREP trans = null; |
| | | try |
| | | { |
| | | if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID)) |
| | | { |
| | | trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IOut_BIZ_WMS_PREP; |
| | | if (!trans.IsFinished) |
| | | { |
| | | response = action.GetResponse(await trans.GetCurPrepItem()); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// GenerateDlvyBatch(ApiAction(BaseInput)) |
| | | /// 创建发料批次以完成本次发料,调用发料单据的ERP接口 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/Out_PREP/GenerateDlvyBatch")] |
| | | public async Task<IActionResult> Out_BIZ_WMS_PREP_GenerateDlvyBatchAsync([FromBody] ApiAction<BaseInput> action) |
| | | { |
| | | ApiAction response; |
| | | IOut_BIZ_WMS_PREP trans = null; |
| | | try |
| | | { |
| | | if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID)) |
| | | { |
| | | trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IOut_BIZ_WMS_PREP; |
| | | if (!trans.IsFinished) |
| | | { |
| | | if (action.IsAsync) |
| | | { |
| | | response = action.GetResponse(await trans.GenerateDlvyBatch(action.Data)); |
| | | } |
| | | else |
| | | { |
| | | lock (trans.TransLock) { response = action.GetResponse(trans.GenerateDlvyBatch(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); |
| | | } |
| | | }//endClass |
| | | } |