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; }