From 69505b151d43533ac025adf405753752144300a4 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 1 Feb 2023 17:02:12 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=B7=A5=E5=96=AE=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E7=B7=9A=E5=88=A5=E8=87=AA=E5=8B=95=E5=B8=B6=E9=A0=90=E8=A8=AD?= =?UTF-8?q?=EF=BC=8C=E5=BB=A0=E5=88=A5=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/BASController.cs | 2 +- .../Controllers/PCSController.cs | 33 +++++++++---------- AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml | 4 +-- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/BASController.cs b/AMESCoreStudio.Web/Controllers/BASController.cs index 75714b7c..5be0613d 100644 --- a/AMESCoreStudio.Web/Controllers/BASController.cs +++ b/AMESCoreStudio.Web/Controllers/BASController.cs @@ -280,7 +280,7 @@ namespace AMESCoreStudio.Web.Controllers public async Task GetUnitLineJson(string unit_no) { var result = await _basApi.GetLineInfoByUnit(unit_no); - result = result.OrderBy(o => o.LineID).ToList(); + result = result.Where(w => w.StatusNo == "A").OrderBy(o => o.LineID).ToList(); var item = new List(); for (int i = 0; i < result.Count; i++) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 6f1e974b..5327db2e 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -307,7 +307,7 @@ namespace AMESCoreStudio.Web.Controllers private async Task GetLineInfo() { var result = await _pcsApi.GetLineInfo(); - + result = result.Where(w => w.StatusNo == "A").OrderBy(o => o.LineID).ToList(); var LineInfo = new List(); for (int i = 0; i < result.Count; i++) { @@ -329,7 +329,7 @@ namespace AMESCoreStudio.Web.Controllers private async Task GetFactoryInfo() { var result = await _pcsApi.GetFactoryInfo(); - + result = result.Where(w => w.StatusNo == "A").OrderBy(o => o.FactoryID).ToList(); var FactoryInfo = new List(); for (int i = 0; i < result.Count; i++) { @@ -1667,6 +1667,19 @@ namespace AMESCoreStudio.Web.Controllers } } + // 判斷WipKp 順序是否重複 + if (model.WipKps.Where(w => w.WipKpID != -1).GroupBy(g => g.KpSeq).Where(w => w.Count() > 1).Any()) + { + Msg += " KeyParts 順序有重複 "; + } + + // 判斷MAC是否正確 + var CheckMACMsg = CheckMACData(model); + if (!string.IsNullOrWhiteSpace(CheckMACMsg)) + { + Msg += CheckMACMsg; + } + if (!string.IsNullOrWhiteSpace(Msg)) { model.wipInfo.ECNCheck = model.wipInfo.ECNCheck == "Y" ? "true" : "false"; @@ -1681,22 +1694,6 @@ namespace AMESCoreStudio.Web.Controllers return View("PCS001N", model); } - // 判斷WipKp 順序是否重複 - if (model.WipKps.Where(w => w.WipKpID != -1).GroupBy(g => g.KpSeq).Where(w => w.Count() > 1).Any()) - { - ModelState.AddModelError("error", "KeyParts 順序有重複"); - - return View("PCS001N", model); - } - - // 判斷MAC是否正確 - var CheckMACMsg = CheckMACData(model); - if (!string.IsNullOrWhiteSpace(CheckMACMsg)) - { - ModelState.AddModelError("error", CheckMACMsg); - return View("PCS001N", model); - } - model.wipInfo.CreateUserID = UserID; result = await _pcsApi.PostWipInfo(JsonConvert.SerializeObject(model.wipInfo)); if (result.Success) diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml index 9071f113..96470dcc 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml @@ -399,7 +399,7 @@ $("#GetMAC").hide(); } - getLineInfoList($("#unitNo").val()); + getLineInfoList($("#unit").val()); // 產生條碼 $('#GetBarCode').click(function () { @@ -584,7 +584,7 @@ { url: "@Url.Action("GetUnitLineJson", "BAS")", dataType: 'json', - data: { "unit_no": $("#unitNo").val()}, + data: { "unit_no": data}, type: 'post', success: function (result) {