From 6d3bca8e7a6c42cc905ab092d1f38dd48eca8d34 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 12 May 2022 16:51:44 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E6=A2=9D=E7=A2=BC?= =?UTF-8?q?=E7=94=9F=E7=94=A2=E5=B1=A5=E6=AD=B7:=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8F=8A=E7=89=88=E5=9E=8B=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=202.=20=E5=B7=A5=E5=96=AE=E8=B3=87=E6=96=99=E4=BF=AE=E6=94=B9:?= =?UTF-8?q?=E5=87=BA=E8=B2=A8=E5=BA=8F=E8=99=9F=E8=AE=8A=E6=9B=B4=EF=BC=8C?= =?UTF-8?q?=E7=95=B6=E6=8C=89=E9=88=95=E5=8F=96=E5=87=BA=E8=B2=A8=E5=BA=8F?= =?UTF-8?q?=E8=99=9F=E6=9C=89=E8=B3=87=E6=96=99=E6=99=82=EF=BC=8C=E5=B0=B1?= =?UTF-8?q?=E5=85=88Insert=E5=87=BA=E8=B2=A8=E5=BA=8F=E8=99=9F=E5=88=B0DB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 54 +++++++++++++------ AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 17 +++--- AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml | 28 ++++++---- .../Controllers/AMES/NgInfoController.cs | 15 +++++- AMESCoreStudio.WebApi/DTO/AMES/NGInfoDto.cs | 20 +++++++ 5 files changed, 99 insertions(+), 35 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index abf68597..58d0b9e1 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1358,14 +1358,15 @@ namespace AMESCoreStudio.Web.Controllers /// - /// 取出貨序號 + /// 取出貨序號 取到資料先儲存出貨序號 /// /// 料號 /// 生產序號 /// 生產數量 + /// 工單號碼 /// RuleStation [HttpPost] - public async Task GetBarcodeOther(string itemNo, string lotNo, int num) + public async Task GetBarcodeOther(string itemNo, string lotNo, int num ,string wipNo) { var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num); string StartNO = ""; @@ -1375,6 +1376,24 @@ namespace AMESCoreStudio.Web.Controllers { StartNO = result.Msg.Split('~')[0]; EndNO = result.Msg.Split('~')[1] ?? result.Msg.Split('~')[0]; + + if (!string.IsNullOrWhiteSpace(StartNO) && !string.IsNullOrWhiteSpace(EndNO)) + { + var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); + if (type_no != null) + { + WipBarcodeOther wipBarcodeOther = new WipBarcodeOther + { + WipNO = wipNo, + TypeNO = type_no.TypeNo, + StartNO = StartNO, + EndNO = EndNO, + CreateUserID = GetLogInUserID(), + UpdateUserID = GetLogInUserID() + }; + await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(wipBarcodeOther)); + } + } } return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } }); @@ -2232,20 +2251,20 @@ namespace AMESCoreStudio.Web.Controllers } - // 出貨序號 - if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) - { - var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); - if (type_no != null) - { - model.wipBarcodeOther.WipNO = model.wipInfo.WipNO; - model.wipBarcodeOther.TypeNO = type_no.TypeNo; - if (model.wipBarcodeOther.OtherID != 0) - result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); - else - result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); - } - } + //// 出貨序號 改換點出貨序號時有資料就先儲存 + //if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) + //{ + // var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); + // if (type_no != null) + // { + // model.wipBarcodeOther.WipNO = model.wipInfo.WipNO; + // model.wipBarcodeOther.TypeNO = type_no.TypeNo; + // if (model.wipBarcodeOther.OtherID != 0) + // result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); + // else + // result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); + // } + //} // MAC if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO)) @@ -4556,7 +4575,8 @@ namespace AMESCoreStudio.Web.Controllers } } - WipReturn wipReturn = new WipReturn{ + WipReturn wipReturn = new WipReturn + { WipNo = model.WipNo.Trim().ToUpper(), GoruleStationId = model.GoByRuleStation, ReruleStationId = model.RetrueRuleStation, diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index e5cd4f0a..e8a3dfee 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -273,11 +273,11 @@
- +
-
- +
@@ -310,7 +310,7 @@
- +
@@ -1178,7 +1178,7 @@ $.ajax({ url: '@Url.Action("GetBarcodeOther", "PCS")', dataType: 'json', - data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY }, + data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY ,"wipNo":'@Model.wipInfo.WipNO'}, cache: false, type: "POST", success: function (result) { @@ -1220,8 +1220,13 @@ if (data._msg != undefined) { parent.hg.msg(data._msg); } - $("#wipMAC_StartNO").val(data.mix); - $("#wipMAC_EndNO").val(data.max); + else + { + $("#wipMAC_StartNO").val(data.mix); + $("#wipMAC_EndNO").val(data.max); + $("#wipMAC_StartNO").attr("readonly", "readonly"); + $("#wipMAC_EndNO").attr("readonly", "readonly"); + } }, error: function (jqXHR, textStatus, errorThrown) { alert("Found error when using Ajax!!"); diff --git a/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml index 53f82c93..32fb2365 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml @@ -57,7 +57,7 @@
- +
@@ -67,7 +67,7 @@
- +
@@ -77,7 +77,7 @@
- +
@@ -91,7 +91,7 @@ @foreach (var index in Model.WinInfos) { - + 工單號碼: @@ -140,7 +140,7 @@ 建置日期: - @index.CreateDate + @DateTime.Parse(index.CreateDate).ToString("yyyy/MM/dd HH:mm:ss") DATE CODE: @@ -216,7 +216,7 @@ @index.User - @index.InputDate + @DateTime.Parse(index.InputDate).ToString("yyyy/MM/dd HH:mm:ss") } @@ -243,7 +243,10 @@ 組件料號 - 過站時間 + 綁入人員 + + + 綁入時間 @@ -264,7 +267,7 @@ @index.KpItemNo - @index.CreateDate + @index.CreateDate.ToString("yyyy/MM/dd HH:mm:ss") } @@ -287,6 +290,9 @@ 零件位置 + + 維修代碼 + 維修狀態 @@ -318,7 +324,7 @@ @index.ReplyUser - @index.ReplyDate + @DateTime.Parse(index.ReplyDate).ToString("yyyy/MM/dd HH:mm:ss") } @@ -354,7 +360,7 @@ @index.OutfitNo - @index.InputDate + @DateTime.Parse(index.InputDate).ToString("yyyy/MM/dd HH:mm:ss") } @@ -407,7 +413,7 @@ @index.CreateUser - @index.CreateDate + @index.CreateDate.ToString("yyyy/MM/dd HH:mm:ss") } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs index b185fb65..e930dce3 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NgInfoController.cs @@ -141,12 +141,25 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var q = from q1 in _context.BarcodeInfoes.Where(w => w.BarcodeNo == id) join q2 in _context.NgInfos on q1.BarcodeID equals q2.BarcodeID join q3 in _context.NgComponents on q2.NgID equals q3.NgID + join q4 in _context.NGReasons on q3.NgNo.Replace("$","") equals q4.NGReasonNo + into s + from q4 in s.DefaultIfEmpty() + join q5 in _context.NgRepairs on q3.ComponentID equals q5.ComponentID + into s1 + from q5 in s1.DefaultIfEmpty() + join q6 in _context.RMAReasons on q5.RepairNo equals q6.RMAReasonNo + into s2 + from q6 in s2.DefaultIfEmpty() select new NGInfoDto { StationName = q2.Station.StationName, LocationNo = q3.LocationNo, - NGNo = q3.NgNo, + NGNo = q3.NgNo.Replace("$",""), + NGNoDesc = q4.NGReasonDesc, Status = q3.Status == 0 ? "尚未處理" : q3.Status == 1 ? "已維修處理" : "誤判", + RepairNo = q5.RepairNo, + RepairDesc = q5.RepairDesc, + RepairNoDesc = q6.RMAReasonDesc, ReplyUser = q3.ReplyUserID.ToString(), ReplyDate = q3.ReplyDate.ToString("yyyy/MM/dd") }; diff --git a/AMESCoreStudio.WebApi/DTO/AMES/NGInfoDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/NGInfoDto.cs index 4c586611..194e7642 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/NGInfoDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/NGInfoDto.cs @@ -25,6 +25,11 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// public string NGNo { get; set; } + /// + /// 不良代碼說明 + /// + public string NGNoDesc { get; set; } + /// /// 零件位置 /// @@ -35,6 +40,21 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// public string Status { get; set; } + /// + /// 維修代碼 + /// + public string RepairNo { get; set; } + + /// + /// 維修代碼說明 + /// + public string RepairNoDesc { get; set; } + + /// + /// 維修說明 + /// + public string RepairDesc { get; set; } + /// /// 回覆人員 ///