From 1ef1f5ed247c449840a51423381d0df3d7a14243 Mon Sep 17 00:00:00 2001 From: Yiru Date: Fri, 25 Aug 2023 21:11:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E8=B2=A8=E5=BA=8F?= =?UTF-8?q?=E8=99=9F=E5=8F=96=E8=99=9F=E4=BF=AE=E6=94=B9=E6=99=82=E5=A4=9A?= =?UTF-8?q?=E5=8D=80=E9=96=93=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 9 ++++++--- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 5 ++++- AMESCoreStudio.Web/Views/PCS/PCS040.cshtml | 2 +- .../AMES/WipBarcodeOthersController.cs | 19 +++++++++++++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 0654a907..acc35079 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -9493,7 +9493,10 @@ namespace AMESCoreStudio.Web.Controllers if (result.Success) { _msg = "修改成功!"; - return RedirectToAction("Refresh", "Home", new { wipNo = model.WipInfo.WipNO, msg = _msg }); + return RedirectToAction("Refresh", "Home", new { wipNo = model.WipInfo.WipNO, msg = _msg }); + // return RedirectToAction("PCS040R", "PCS", new { id = model.WipInfo.WipNO,Rule = model.WipAtt.ModelNO, serialRuleitem = model.SerialRuleItem }); + // return RedirectToAction("PCS040Query", "PCS", new { wipNo = model.WipInfo.WipNO }); + } else { @@ -9506,7 +9509,7 @@ namespace AMESCoreStudio.Web.Controllers } - public async Task PCS040R(string id, string rule,string serialRuleitem, string msg = null) + public async Task PCS040R(string id, string rule,string serialRuleitem, int otherID, string msg = null) { ViewBag.Msg = msg; @@ -9516,7 +9519,7 @@ namespace AMESCoreStudio.Web.Controllers { model.WipInfo = q.FirstOrDefault(); model.WipAtt = await _pcsApi.GetWipAtt(model.WipInfo.WipNO); - model.WipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.WipInfo.WipNO); + model.WipBarcodeOther = await _pcsApi.GetWipBarcodeOtherByotherID(otherID); model.WipAtt.ModelNO = rule; model.SerialRuleItem = serialRuleitem; diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 5efb9c06..74092a7d 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -1798,12 +1798,15 @@ namespace AMESCoreStudio.Web /// - /// 刪除工單出貨條碼區間 by OTHERID + ///查詢工單出貨條碼區間 by OTHERID /// /// [WebApiClient.Attributes.HttpDelete("api/WipBarcodeOther/byOhterID/{id}")] ITask> DeleteWipBarcodeOtherByOtherID(int id); + [WebApiClient.Attributes.HttpGet("api/WipBarcodeOther/ByOtherID/{id}")] + ITask GetWipBarcodeOtherByotherID(int id); + #endregion #region OutfitInfoes 設備資料檔 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS040.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS040.cshtml index e66b0a34..4e16a35f 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS040.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS040.cshtml @@ -157,7 +157,7 @@ //通过行tool編輯,lay-event="edit" function edit(obj) { if (obj.data.wipNo) { - hg.open('修改工單資料', '/PCS/PCS040R?id=' + obj.data.wipNo + '&rule=' + obj.data.rule + '&serialRuleitem=' + obj.data.itemRule, 740, 350); + hg.open('修改工單資料', '/PCS/PCS040R?id=' + obj.data.wipNo + '&rule=' + obj.data.rule + '&serialRuleitem=' + obj.data.itemRule + '&otherID=' + obj.data.otherID, 740, 350); } } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs index 1c552c20..0eaaa4a9 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs @@ -172,6 +172,25 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return result; } + /// + /// 使用ID尋找 + /// + /// + /// + [HttpGet("ByOtherID/{id}")] + public async Task> GetWipBarcodeOtherByOtherID(int id) + { + IQueryable q = _context.WipBarcodeOthers; + + var wipBarcodeOther = await q.Where(p => p.OtherID == id).FirstOrDefaultAsync(); + + //if (wipBarcodeOther == null) + //{ + // return NotFound(); + //} + + return wipBarcodeOther; + } /// /// 新增工單出貨條碼區間設定檔