From 6929b9da81b317ee962affc3712b991c25652fb4 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 24 Feb 2022 18:15:49 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E5=BB=BA=E7=AB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.Web/Views/PCS/PCS001.cshtml | 101 +++------------ .../Controllers/BLL/BarCodeCheckController.cs | 117 +++++++++--------- AMESCoreStudio.WebApi/Models/AMES/WipKp.cs | 8 ++ 3 files changed, 82 insertions(+), 144 deletions(-) diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml index 1d864887..88d9b9fa 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml @@ -22,8 +22,8 @@ -
- +
+
@@ -138,7 +138,7 @@
-
+
@@ -287,7 +287,7 @@
@* Keypart組合sheet *@ -
+ @@ -310,24 +310,6 @@
- @*
-
- -
- - -
-
-
*@ - - - @*
- -
- -
-
*@ -
@@ -444,54 +426,6 @@
- - @*
-
- -
- - -
-
-
- -
-
- -
- - -
-
-
- -
-
- -
- - -
-
-
*@ - - @*
-
- -
- - -
-
-
*@ - - - @*
- -
- -
-
*@ @* 系統-工程資訊sheet *@ @@ -820,7 +754,7 @@ @* SOP文件 sheet *@ -
+ @@ -829,7 +763,7 @@ @Html.ValidationMessage("error")
-
+
@@ -852,7 +786,11 @@ $("#system").hide(); $("#board").show(); } - }); + + var error = '@Html.ValidationMessage("error")'; + if ($(error).text() != '') { + parent.hg.msg(error); + }; function getFlowRuleList(data) { @@ -948,12 +886,6 @@ }); - $(document).ready(function () { - var error = '@Html.ValidationMessage("error")'; - if ($(error).text() != '') { - parent.hg.msg(error); - } - $('#GetBarCode').click(function () { var wipNO = $('#wipInfo_WipNO').val(); var planQTY = $('#wipInfo_PlanQTY').val(); @@ -1038,7 +970,6 @@ }); }; @* KeyParts文件 sheet *@ - hg.form.onsubmit('queryKeyParts', function (data) { var item = $("#wipAtt_ItemNO").val(); if ($.trim(item) == '' || item == undefined) { @@ -1085,7 +1016,7 @@ width: 150 }] ]; - var tableKeyParts = hg.table.datatable('keyparts', 'KeyParts查詢', '/PCS/MaterialKpQuery?itemNo=' + item, {}, tableCols_keyParts, false, 'full-100'); + var tableKeyParts = hg.table.datatable('keyparts', 'KeyParts查詢', '/PCS/MaterialKpQuery?itemNo=' + item, {}, tableCols_keyParts,'', false, 'full-100'); hg.msghide("重新載入資料.."); tableKeyParts ; }); @@ -1149,6 +1080,10 @@ }); function RuleStation(id) { + if (id == null) { + id = 1; + } + var tableCols_rule = [[ { field: 'stationDesc', @@ -1168,10 +1103,8 @@ sort: true }] ]; - var tableruleStation = hg.table.datatable('ruleStation', '', '/BAS/GetRuleStationsByFlow?flowId='+id, {}, tableCols_rule, false, 'full-100'); + var tableruleStation = hg.table.datatable('ruleStation', '', '/BAS/GetRuleStationsByFlow?flowId='+id, {}, tableCols_rule,'', false, 'full-100'); tableruleStation; } - - } diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index 30e6ca5b..3aa45eb2 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -536,7 +536,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES NgInfo ngInfo = new NgInfo { - TypeNo ="N", + TypeNo = "N", OperatorID = 0, FixtureNo = "NA", BarcodeID = barCodeCheckDto.barcodeID, @@ -642,7 +642,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var resut = new ResultModel(); // 取ClassID - int ClassID = 0; + int ClassID = -1; ClassInfoesController classInfoesController = new ClassInfoesController(_context); var classInfo = await classInfoesController.GetClassInfoByUnit(barCodeCheckDto.unitNo); if (classInfo.Value.Count() != 0) @@ -656,41 +656,40 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } } - if (ClassID != 0) - { - // 判斷是否有資料 - var queryWipClass = await wipClassController.GetWipClassByData(barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); - queryWipClass = queryWipClass.Value.Where(w => w.CreateDate.ToString("yyyy/MM/dd") == DateTime.Now.ToString("yyyy/MM/dd")).ToList(); - // 有資料加1 後續判斷第一次過站 - if (queryWipClass.Value.Where(w => w.ClassID == ClassID).Any()) + // 判斷是否有資料 + var queryWipClass = await wipClassController.GetWipClassByData(barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); + queryWipClass = queryWipClass.Value.Where(w => w.CreateDate.ToString("yyyy/MM/dd") == DateTime.Now.ToString("yyyy/MM/dd")).ToList(); + + // 有資料加1 後續判斷第一次過站 + if (queryWipClass.Value.Where(w => w.ClassID == ClassID).Any()) + { + wipClass = queryWipClass.Value.FirstOrDefault(); + BarcodeStationController barcodeStationController = new BarcodeStationController(_context); + var barcodeStation = await barcodeStationController.GetBarcodeStationByKey(barCodeCheckDto.barcodeID, + barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); + if (barcodeStation.Value == null) { - wipClass = queryWipClass.Value.FirstOrDefault(); - BarcodeStationController barcodeStationController = new BarcodeStationController(_context); - var barcodeStation = await barcodeStationController.GetBarcodeStationByKey(barCodeCheckDto.barcodeID, - barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); - if (barcodeStation.Value == null) - { - wipClass.FirstCnt += 1; - } - wipClass.PassCnt += 1; - resut = await wipClassController.PutWipClass(wipClass); + wipClass.FirstCnt += 1; } - else + wipClass.PassCnt += 1; + resut = await wipClassController.PutWipClass(wipClass); + } + else + { + wipClass = new WipClass { - wipClass = new WipClass - { - WipID = barCodeCheckDto.wipID, - RuleStatus = barCodeCheckDto.ruleStatus, - RuleStationID = barCodeCheckDto.ruleStationID, - ClassID = ClassID, - FirstCnt = 1, - PassCnt = 1 - }; - resut = await wipClassController.PostWipClass(wipClass); - } + WipID = barCodeCheckDto.wipID, + RuleStatus = barCodeCheckDto.ruleStatus, + RuleStationID = barCodeCheckDto.ruleStationID, + ClassID = ClassID, + FirstCnt = 1, + PassCnt = 1 + }; + resut = await wipClassController.PostWipClass(wipClass); } + return resut; } @@ -705,7 +704,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var resut = new ResultModel(); // 取SegmentID - int SegmentID = 0; + int SegmentID = -1; TimeSegmentsController timeSegmentsController = new TimeSegmentsController(_context); var timeSegment = await timeSegmentsController.GetTimeSegment(); if (timeSegment.Value.Count() != 0) @@ -721,38 +720,36 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } - if (SegmentID != 0) + + // 判斷是否有資料 + var queryWipTime = await wipTimeController.GetWipTimeByData(barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); + queryWipTime = queryWipTime.Value.Where(w => w.CreateDate.ToString("yyyy/MM/dd") == DateTime.Now.ToString("yyyy/MM/dd")).ToList(); + // 有資料加1 後續判斷第一次過站 + if (queryWipTime.Value.Where(w => w.SegmentID == SegmentID).Any()) { - // 判斷是否有資料 - var queryWipTime = await wipTimeController.GetWipTimeByData(barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); - queryWipTime = queryWipTime.Value.Where(w => w.CreateDate.ToString("yyyy/MM/dd") == DateTime.Now.ToString("yyyy/MM/dd")).ToList(); - // 有資料加1 後續判斷第一次過站 - if (queryWipTime.Value.Where(w => w.SegmentID == SegmentID).Any()) + wipTime = queryWipTime.Value.FirstOrDefault(); + BarcodeStationController barcodeStationController = new BarcodeStationController(_context); + var barcodeStation = await barcodeStationController.GetBarcodeStationByKey(barCodeCheckDto.barcodeID, + barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); + if (barcodeStation.Value == null) { - wipTime = queryWipTime.Value.FirstOrDefault(); - BarcodeStationController barcodeStationController = new BarcodeStationController(_context); - var barcodeStation = await barcodeStationController.GetBarcodeStationByKey(barCodeCheckDto.barcodeID, - barCodeCheckDto.wipID, barCodeCheckDto.ruleStationID, barCodeCheckDto.ruleStatus); - if (barcodeStation.Value == null) - { - wipTime.FirstCnt += 1; - } - wipTime.PassCnt += 1; - resut = await wipTimeController.PutWipTime(wipTime); + wipTime.FirstCnt += 1; } - else + wipTime.PassCnt += 1; + resut = await wipTimeController.PutWipTime(wipTime); + } + else + { + wipTime = new WipTime { - wipTime = new WipTime - { - WipID = barCodeCheckDto.wipID, - RuleStatus = barCodeCheckDto.ruleStatus, - RuleStationID = barCodeCheckDto.ruleStationID, - SegmentID = SegmentID, - FirstCnt = 1, - PassCnt = 1 - }; - resut = await wipTimeController.PostWipTime(wipTime); - } + WipID = barCodeCheckDto.wipID, + RuleStatus = barCodeCheckDto.ruleStatus, + RuleStationID = barCodeCheckDto.ruleStationID, + SegmentID = SegmentID, + FirstCnt = 1, + PassCnt = 1 + }; + resut = await wipTimeController.PostWipTime(wipTime); } return resut; diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipKp.cs b/AMESCoreStudio.WebApi/Models/AMES/WipKp.cs index 73ccfd25..a7ce5a31 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipKp.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipKp.cs @@ -25,6 +25,14 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] public int WipKpID { get; set; } + /// + /// 工單ID + /// + [Column("WIP_ID")] + [Required] + [DataMember] + public int WipID { get; set; } + /// /// 料號 ///