From e9530a6caef3da0d3aeb33642de6a4b369bd70df Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 19 二月 2025 22:33:53 +0800 Subject: [PATCH] 雅达-新增 In_SemiProd 类及其相关接口和方法 --- Tiger.Controllers.WMS/Controllers/WMSController.RePrintLabel.cs | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 46 insertions(+), 2 deletions(-) diff --git a/Tiger.Controllers.WMS/Controllers/WMSController.RePrintLabel.cs b/Tiger.Controllers.WMS/Controllers/WMSController.RePrintLabel.cs index 10e6f72..c656426 100644 --- a/Tiger.Controllers.WMS/Controllers/WMSController.RePrintLabel.cs +++ b/Tiger.Controllers.WMS/Controllers/WMSController.RePrintLabel.cs @@ -98,8 +98,8 @@ /// <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; @@ -137,5 +137,49 @@ 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); + } } } \ No newline at end of file -- Gitblit v1.9.3