From 95382034c06ed5725193c9535f7d3db215ac20cc Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 19 Apr 2022 19:50:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E9=81=8E=E7=AB=99?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=AB=99=E5=8F=AF=E4=BB=A5=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E5=88=B7=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml | 2 +- .../Controllers/BLL/BarCodeCheckController.cs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml index dd61aabf..7597ffac 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml @@ -159,7 +159,7 @@ Remarks: - + @index.Remarks diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index 0c854688..003d4a95 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -1261,7 +1261,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES int wipID = q1.WipID; int flowRuleID = q1.FlowRuleID; - resultModel = (ResultModel)await GetBarCodeLastStopRuleStationID(wipID, BarCodeID, station, flowRuleID); + resultModel = (ResultModel)await GetBarCodeLastStopRuleStationID(wipID, BarCodeID, station, flowRuleID, RuleStationID); if (!resultModel.Success) return resultModel; @@ -1769,8 +1769,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// BarCodeID /// 目前作業站ID /// 工單流程ID + /// 目前作業站ID(RuleStation) /// true:false - private async Task GetBarCodeLastStopRuleStationID(int wipID, int barCodeID, int stationID, int flowRuleID) + private async Task GetBarCodeLastStopRuleStationID(int wipID, int barCodeID, int stationID, int flowRuleID, int? RuleStationID) { ResultModel resultModel = new ResultModel { Success = false }; WipInfosController wipInfosController = new WipInfosController(_context); @@ -1806,6 +1807,15 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return resultModel; } } + else // 防止第一站重複刷入 + { + if (_context.BarcodeStation.Where(w => w.BarcodeID == barCodeID + && w.RuleStationID == RuleStationID).Any()) + { + resultModel.Msg = "該內部序號已刷過此站"; + return resultModel; + } + } resultModel.Success = true; return resultModel; }