From fe10e4b4a1cae29cb8217a1750ba2f6ad63aa2a7 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 22 Sep 2022 09:53:26 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E6=AC=84=E4=BD=8D?= =?UTF-8?q?=E5=90=8D=E7=A8=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 54 +++++++++---------- .../ViewModels/PCS/PCS032ViewModel.cs | 4 +- AMESCoreStudio.Web/Views/PCS/PCS022.cshtml | 2 +- AMESCoreStudio.Web/Views/PCS/PCS022V.cshtml | 6 +-- AMESCoreStudio.Web/Views/PCS/PCS032.cshtml | 16 +++--- .../AMES/BarcodeInfoesController.cs | 16 +++--- .../AMES/BarcodeStationController.cs | 1 - .../Controllers/AMES/WipClassController.cs | 6 +-- .../Controllers/AMES/WipStationController.cs | 2 +- .../Controllers/AMES/WipTimeController.cs | 6 +-- .../Controllers/BLL/BarCodeCheckController.cs | 22 ++++---- .../DTO/AMES/InspectionResultDetailDto.cs | 2 +- .../DTO/AMES/RuleStationDto.cs | 2 +- 13 files changed, 69 insertions(+), 70 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index b6457ba5..5ef128f6 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -5060,7 +5060,7 @@ namespace AMESCoreStudio.Web.Controllers { var result_BarcodeStation = await _pcsApi.GetBarcodeStationByBarCodeID(BarcodeInfo.BarcodeID); // 判斷BarcodeStation 有RulseStation資料 代表有刷過 不顯示 - if (result_BarcodeStation.Where(w => w.RuleStationID == ruleStation).Any()) + if (result_BarcodeStation.Where(w => w.StationID == stations).Any()) continue; else { @@ -5072,7 +5072,7 @@ namespace AMESCoreStudio.Web.Controllers // 取得BarInfo 當前站別 else { - stationName = result_RuleStation.Where(w => w.RuleStationID == BarcodeInfo.RuleStationID) + stationName = result_RuleStation.Where(w => w.StationID == BarcodeInfo.StationID) .FirstOrDefault().StationDesc; } } @@ -5363,7 +5363,7 @@ namespace AMESCoreStudio.Web.Controllers wipNo = model.WipNO, barcode = model.Input, barcodeType = "M", - station = model.Station, + stationID = model.Station, line = model.LineID, unitNo = model.UnitNO, inputItems = keyParts, @@ -5678,10 +5678,10 @@ namespace AMESCoreStudio.Web.Controllers } [HttpGet] - public IActionResult PCS022V(int wipID, int ruleStationID) + public IActionResult PCS022V(int wipID, int stationID) { ViewBag.WIP_ID = wipID; - ViewBag.RULE_STATION_ID = ruleStationID; + ViewBag.STATION_ID = stationID; return View(); } @@ -5699,17 +5699,17 @@ namespace AMESCoreStudio.Web.Controllers } [HttpPost] - public async Task PCS022U(int wipID, int ruleStationID) + public async Task PCS022U(int wipID, int StationID) { var result = await _pcsApi.GetBarcodeInfoesByWipID(wipID); - result = result.Where(w => w.RuleStationID == ruleStationID && w.RuleStatus == "P").ToList(); + result = result.Where(w => w.StationID == StationID && w.RuleStatus == "P").ToList(); var FlowRule = result.FirstOrDefault().GetWipInfo.FlowRuleID; var result_RuleStation = await _basApi.GetRuleStationsByFlow(FlowRule, 0); // 只抓標準站 & 排除完工站 result_RuleStation = result_RuleStation.Where(w => w.StationType == "M" && w.StationID != 1000).OrderBy(o => o.Sequence).ToList(); // 當站 - var NowSequence = result_RuleStation.Where(w => w.RuleStationID == ruleStationID).FirstOrDefault().Sequence; + var NowSequence = result_RuleStation.Where(w => w.StationID == StationID && w.FlowRuleID == FlowRule).FirstOrDefault().Sequence; var NextStationID = 0; // 排除當站為最後一站 if (result_RuleStation.Count != NowSequence + 1) @@ -5726,7 +5726,7 @@ namespace AMESCoreStudio.Web.Controllers wipNo = item.GetWipInfo.WipNO, barcode = item.BarcodeNo, barcodeType = "M", - station = NextStationID, + stationID = NextStationID, line = item.GetWipInfo.LineID ?? 0, unitNo = item.GetWipInfo.UnitNO, inputItems = null, @@ -6118,7 +6118,7 @@ namespace AMESCoreStudio.Web.Controllers barcodeItemChange.PartNoOld = item.PartNo; barcodeItemChange.ChangeType = "DR"; barcodeItemChange.ItemNo = item.ItemNo; - barcodeItemChange.RuleStationID = item.RuleStationID; + barcodeItemChange.StationID = item.StationID; barcodeItemChange.WipID = item.WipID; barcodeItemChange.KpItemNo = item.KpItemNo; barcodeItemChange.CreateUserID = GetLogInUserID(); @@ -6288,7 +6288,7 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PCS032Async(PCS032ViewModel model) { - if (model.GoByRuleStation == 0 || model.RetrueRuleStation == 0) + if (model.GoByStation == 0 || model.RetrueStation == 0) { ModelState.AddModelError("error", "請輸入正確資料"); return View(model); @@ -6300,25 +6300,25 @@ namespace AMESCoreStudio.Web.Controllers // 只抓標準站 & 排除完工站 result_RuleStation = result_RuleStation.Where(w => w.StationType == "M" && w.StationID != 1000).OrderBy(o => o.Sequence).ToList(); - var goBySequence = result_RuleStation.Where(w => w.RuleStationID == model.GoByRuleStation).FirstOrDefault().Sequence; - var retrueSequence = result_RuleStation.Where(w => w.RuleStationID == model.RetrueRuleStation).FirstOrDefault().Sequence; + var goBySequence = result_RuleStation.Where(w => w.StationID == model.GoByStation).FirstOrDefault().Sequence; + var retrueSequence = result_RuleStation.Where(w => w.StationID == model.RetrueStation).FirstOrDefault().Sequence; if (retrueSequence >= goBySequence) { var RuleStations = await _basApi.GetRuleStationsByFlow(FlowRule); RuleStations = RuleStations.Where(w => w.StationType == "M" && w.StationID != 1000).OrderBy(o => o.Sequence).ToList(); - var RuleStationList = new List(); + var StationList = new List(); for (int i = 0; i < RuleStations.Count; i++) { - RuleStationList.Add(new SelectListItem(RuleStations[i].Sequence + "-" + RuleStations[i].StationDesc, RuleStations[i].RuleStationID.ToString())); + StationList.Add(new SelectListItem(RuleStations[i].Sequence + "-" + RuleStations[i].StationDesc, RuleStations[i].StationID.ToString())); } if (RuleStations.Count == 0) { - RuleStationList.Add(new SelectListItem("N/A", null)); + StationList.Add(new SelectListItem("N/A", null)); } - ViewBag.GetRuleStationList = RuleStationList; + ViewBag.GetStationList = StationList; ModelState.AddModelError("error", "設定失敗,無法指定通過站後續站別"); return View(model); } @@ -6327,8 +6327,8 @@ namespace AMESCoreStudio.Web.Controllers var result_BarcodeInfo = await _pcsApi.GetBarcodeInfoesByWipNo(model.WipNo.Trim().ToUpper()); if (model.Type == "P") { - var put_BarcodeInfo = result_BarcodeInfo.Where(w => w.RuleStationID == model.GoByRuleStation).ToList(); - put_BarcodeInfo = put_BarcodeInfo.Select(s => { s.RuleStationID = model.RetrueRuleStation; return s; }).ToList(); + var put_BarcodeInfo = result_BarcodeInfo.Where(w => w.StationID == model.GoByStation).ToList(); + put_BarcodeInfo = put_BarcodeInfo.Select(s => { s.StationID = model.RetrueStation; return s; }).ToList(); foreach (var item in put_BarcodeInfo) { await _pcsApi.PutBarcodeInfoes(JsonConvert.SerializeObject(item)); @@ -6338,11 +6338,11 @@ namespace AMESCoreStudio.Web.Controllers else { // 取通過後續的站別 - var goByRuleStations = result_RuleStation.Where(w => w.Sequence >= goBySequence).Select(s => s.RuleStationID).ToList(); - foreach (var RuleStation in goByRuleStations) + var goByStations = result_RuleStation.Where(w => w.Sequence >= goBySequence).Select(s => s.StationID).ToList(); + foreach (var Station in goByStations) { - var put_BarcodeInfo = result_BarcodeInfo.Where(w => w.RuleStationID == RuleStation).ToList(); - put_BarcodeInfo = put_BarcodeInfo.Select(s => { s.RuleStationID = model.RetrueRuleStation; return s; }).ToList(); + var put_BarcodeInfo = result_BarcodeInfo.Where(w => w.StationID == Station).ToList(); + put_BarcodeInfo = put_BarcodeInfo.Select(s => { s.StationID = model.RetrueStation; return s; }).ToList(); foreach (var item in put_BarcodeInfo) { await _pcsApi.PutBarcodeInfoes(JsonConvert.SerializeObject(item)); @@ -6353,8 +6353,8 @@ namespace AMESCoreStudio.Web.Controllers WipReturn wipReturn = new WipReturn { WipNo = model.WipNo.Trim().ToUpper(), - GoruleStationId = model.GoByRuleStation, - ReruleStationId = model.RetrueRuleStation, + GoStationId = model.GoByStation, + ReStationId = model.RetrueStation, Type = model.Type, Memo = model.Memo, CreateUserID = GetLogInUserID() @@ -6498,7 +6498,7 @@ namespace AMESCoreStudio.Web.Controllers barcodeItemChange.PartNoOld = barcodeItemOld.PartNo; barcodeItemChange.ChangeType = "NR"; barcodeItemChange.ItemNo = barcodeItemOld.ItemNo; - barcodeItemChange.RuleStationID = barcodeItemOld.RuleStationID; + barcodeItemChange.StationID = barcodeItemOld.StationID; barcodeItemChange.WipID = barcodeItemOld.WipID; barcodeItemChange.KpItemNo = barcodeItemOld.KpItemNo; barcodeItemChange.CreateUserID = barcodeItemOld.CreateUserID; @@ -6545,7 +6545,7 @@ namespace AMESCoreStudio.Web.Controllers barcodeItemChange.PartNoOld = barcodeItemOld.PartNo; barcodeItemChange.ChangeType = "DR"; barcodeItemChange.ItemNo = barcodeItemOld.ItemNo; - barcodeItemChange.RuleStationID = barcodeItemOld.RuleStationID; + barcodeItemChange.StationID = barcodeItemOld.StationID; barcodeItemChange.WipID = barcodeItemOld.WipID; barcodeItemChange.KpItemNo = barcodeItemOld.KpItemNo; barcodeItemChange.CreateUserID = barcodeItemOld.CreateUserID; diff --git a/AMESCoreStudio.Web/ViewModels/PCS/PCS032ViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/PCS032ViewModel.cs index a4398fb4..c3ac7753 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/PCS032ViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/PCS032ViewModel.cs @@ -23,12 +23,12 @@ namespace AMESCoreStudio.Web.ViewModels.PCS /// /// 經過作業站 /// - public int GoByRuleStation { get; set; } + public int GoByStation { get; set; } /// /// 退回目的地作業站 /// - public int RetrueRuleStation { get; set; } + public int RetrueStation { get; set; } /// /// 備註 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS022.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS022.cshtml index ca41c5f9..1e8e0265 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS022.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS022.cshtml @@ -153,7 +153,7 @@ //通过行tool檢視,lay-event="detail" function detail(obj) { if (obj.data.wipID) { - hg.open('過站條碼資料', '/PCS/PCS022V?wipID=' + obj.data.wipID + '&ruleStationID=' + obj.data.ruleStationID, '800', '500', false); + hg.open('過站條碼資料', '/PCS/PCS022V?wipID=' + obj.data.wipID + '&stationID=' + obj.data.stationID, '800', '500', false); } } //基本数据表格 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS022V.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS022V.cshtml index 2fc39c9f..b2e25504 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS022V.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS022V.cshtml @@ -6,7 +6,7 @@
- +
@@ -61,7 +61,7 @@ hg.confirm("確定要整批過下一站嗎?", function () { $.ajax({ url: '/PCS/PCS022U', - data: { wipID: $("#wip_id").val(), ruleStationID: $("#rule_station_id").val()}, + data: { wipID: $("#wip_id").val(), StationID: $("#stationID").val()}, type: 'POST', success: function (data) { if (data.success) { @@ -81,6 +81,6 @@ } }]; //基本数据表格 - var table = hg.table.datatable('test', '過站條碼資料', '/PCS/PCS022VQuery?wipID=' + wip_id.value +'&ruleStationID='+rule_station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('test', '過站條碼資料', '/PCS/PCS022VQuery?wipID=' + wip_id.value + '&stationID=' + stationID.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/PCS/PCS032.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS032.cshtml index cddfefa7..f8bcacc7 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS032.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS032.cshtml @@ -51,7 +51,7 @@
- +
@@ -63,7 +63,7 @@
- +
@@ -112,17 +112,17 @@ type: 'post', success: function (result) { if (result.success) { - $("#goByRuleStation").empty();//清空下拉框的值 - $("#retureRuleStation").empty();//清空下拉框的值 + $("#goByStation").empty();//清空下拉框的值 + $("#retureStation").empty();//清空下拉框的值 $.each(result.data, function (index, item) { - $("#goByRuleStation").append($("