From 0db7df744d3d79a9b0f914bebf01705cd71e60b8 Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 10 Apr 2023 23:42:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=81=8E=E7=AB=99=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=B8=8D=E8=89=AF=E4=BB=A3=E7=A2=BC=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/BLL/BarCodeCheckController.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index 8f446d73..f72fc73f 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -966,9 +966,25 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var NgItem = barCodeCheckDto.inputItems.Where(w => w.inputData.Contains("$")).ToList(); var result = new ResultModel() { Success = true }; var result_NgComponent = new ResultModel(); + // 新增 NgInfo if (NgItem.Count != 0) { + // 判斷是否不良代碼 + IQueryable q = _context.NGReasons; + foreach (var item in NgItem.Select(s => s.inputData)) + { + if (!q.Where(w => w.NGReasonNo.Trim().ToUpper() == item.Replace("$", "").Trim().ToUpper() + && w.Status == "A").Any()) + { + result.Success = false; + result.Msg = $"查無不良代碼【{item.Replace("$", "").Trim().ToUpper()}】"; + return result; + } + } + + + NgInfo ngInfo = new NgInfo { TypeNo = _context.Stationses.Where(w => w.StationID == barCodeCheckDto.stationID).FirstOrDefault().TestType, @@ -1682,7 +1698,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (CheckNowFirstStation(wipNo, unitNo, stationID) == "Y") { var FirstWipInfo = WipNoItem.FirstOrDefault(); - if (FirstWipInfo.CompleteQTY >= FirstWipInfo.PlanQTY) + if (FirstWipInfo.CompleteQTY >= FirstWipInfo.PlanQTY) { resultModel.Msg = "工單號碼【" + wipNo + "】,已投入數量>=工單數量,請在確認"; return resultModel;