From b2895f557dd978e6dd43c98b90eae45003c2a869 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 25 Mar 2023 16:28:16 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E8=AA=BF=E6=95=B4KP=E6=8A=93=E5=8F=96?= =?UTF-8?q?=E9=A0=86=E5=BA=8F=202.=20=E5=B7=A5=E5=96=AE=E7=B6=AD=E8=AD=B7(?= =?UTF-8?q?=E7=B3=BB=E7=B5=B1=E8=B3=87=E8=A8=8A)=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E6=8C=89=E9=88=95=20=E5=8F=AF=E4=BB=A5=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=87=92=E6=A9=9F=E8=B3=87=E8=A8=8A=20=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9PLM=E7=94=9F=E7=94=A2=E5=82=99=E8=A8=BB=E6=8A=93?= =?UTF-8?q?=E5=8F=96=E6=AC=84=E4=BD=8D=203.=20=E7=B5=84=E4=BB=B6=E7=B6=AD?= =?UTF-8?q?=E8=AD=B7=E4=BF=AE=E6=94=B9=E7=8B=80=E6=85=8B=E7=82=BA=E5=81=9C?= =?UTF-8?q?=E7=94=A8=E6=99=82=EF=BC=8C=E5=88=AA=E9=99=A4=E6=96=99=E8=99=9F?= =?UTF-8?q?=E5=B0=8D=E6=87=89=E7=B5=84=E4=BB=B6=E5=8F=8A=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E5=B0=8D=E6=87=89=E7=B5=84=E4=BB=B6=E6=9C=89=E5=B0=8D=E6=87=89?= =?UTF-8?q?=E7=9A=84=E7=B7=A8=E8=99=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/KCSController.cs | 6 ++ .../Controllers/PCSController.cs | 18 ++++- AMESCoreStudio.Web/HttpApis/AMES/IKCS.cs | 15 ++++ AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 2 + AMESCoreStudio.Web/Views/BAS/BAS013C.cshtml | 6 +- AMESCoreStudio.Web/Views/BAS/BAS013U.cshtml | 4 +- AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 20 ++--- AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 80 ++++++++++++------- AMESCoreStudio.Web/Views/PCS/PCS034.cshtml | 75 ++++++++++++----- .../Controllers/AMES/MaterialKpController.cs | 19 +++++ .../Controllers/AMES/WipKpsController.cs | 29 +++++++ AMESCoreStudio.WebApi/Enums/EnumPCS.cs | 2 +- .../Models/AMES/WipSystem.cs | 9 +++ 13 files changed, 217 insertions(+), 68 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/KCSController.cs b/AMESCoreStudio.Web/Controllers/KCSController.cs index c22ffac5..bc8710f6 100644 --- a/AMESCoreStudio.Web/Controllers/KCSController.cs +++ b/AMESCoreStudio.Web/Controllers/KCSController.cs @@ -518,6 +518,12 @@ namespace AMESCoreStudio.Web.Controllers if (result.Success) { + if (model.StatusNo == "S") + { + await _kcsApi.DeleteMaterialKpByKpNo(model.ItemNo); + await _kcsApi.DeleteWipKpsByKpNo(model.ItemNo); + } + var _msg = "修改成功!"; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 3d4d33ef..18b41502 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -383,7 +383,7 @@ namespace AMESCoreStudio.Web.Controllers var result = await _pcsApi.GetItems(); // 只有狀態是啟用的 - result = result.Where(w => w.StatusNo == "A").ToList(); + result = result.Where(w => w.StatusNo == "A").OrderBy(o => o.ItemName).ToList(); var ItemsList = new List(); ItemsList.Add(new SelectListItem("請選擇", "")); @@ -894,7 +894,7 @@ namespace AMESCoreStudio.Web.Controllers var result = await _kcsApi.GetItems(); // 只有狀態是啟用的 - result = result.Where(w => w.StatusNo == "A").ToList(); + result = result.Where(w => w.StatusNo == "A").OrderBy(o => o.ItemName).ToList(); var Items = new List(); for (int i = 0; i < result.Count; i++) @@ -1215,7 +1215,7 @@ namespace AMESCoreStudio.Web.Controllers var result = await _kcsApi.GetItems(); // 只有狀態是啟用的 - result = result.Where(w => w.StatusNo == "A").ToList(); + result = result.Where(w => w.StatusNo == "A").OrderBy(o => o.ItemName).ToList(); var KpItems = new List(); for (int i = 0; i < result.Count; i++) @@ -1495,6 +1495,18 @@ namespace AMESCoreStudio.Web.Controllers var result = await _pcsApi.DeleteWipInfoBlobByFileName(wipNo, fileName); return Json(new Result() { success = result.Success, msg = result.Msg, data = null }); } + + /// + /// 取得燒機相關資料 + /// + /// 工單料號 + /// + [HttpPost] + public async Task GetRuninTimeByItemNo(string itemNo) + { + var result = await _basApi.GetRuninTime(itemNo); + return Json(new Result() { success = true, data = result.FirstOrDefault() }); + } #endregion ///// diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IKCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IKCS.cs index 1abcc256..30c6537d 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IKCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IKCS.cs @@ -134,6 +134,21 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/KPLinks")] ITask> GetKPLinks(int page = 0, int limit = 10); + /// + /// 刪除料號組件 (組件停用) + /// + /// + /// + [WebApiClient.Attributes.HttpDelete("api/MaterialKp/ByKpNo/{id}")] + ITask> DeleteMaterialKpByKpNo(string id); + + /// + /// 刪除工單組件 (組件停用) + /// + /// + /// + [WebApiClient.Attributes.HttpDelete("api/WipKps/ByKpNo/{id}")] + ITask> DeleteWipKpsByKpNo(string id); #endregion #region KCS006 組件類別維護 diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 04326589..36f22da3 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -1532,5 +1532,7 @@ namespace AMESCoreStudio.Web ITask> PutWipClearDetail(int id, [FromBody, RawJsonContent] string model); #endregion + + } } diff --git a/AMESCoreStudio.Web/Views/BAS/BAS013C.cshtml b/AMESCoreStudio.Web/Views/BAS/BAS013C.cshtml index d83e666e..1e868a5f 100644 --- a/AMESCoreStudio.Web/Views/BAS/BAS013C.cshtml +++ b/AMESCoreStudio.Web/Views/BAS/BAS013C.cshtml @@ -52,9 +52,9 @@ - - + + diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index 2a76ab4a..ef396398 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -718,28 +718,28 @@
- +
-
+
-
- +
+
-
+
小時
-
- +
+
- +
@@ -763,11 +763,11 @@
- +
- +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 19c564a5..de4a1fa2 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -746,32 +746,34 @@
- +
- -
+
- - -
+
小時
-
+
+
@@ -794,11 +796,11 @@
- +
- +
@@ -1207,7 +1209,7 @@ else $("#divDeleteBarcodeOther").hide(); - + // DIV keyPartsExcel @if (Model.wipInfo.WipNO.StartsWith("981")) { @@ -1375,7 +1377,7 @@ else { var contactdiv = '' + `${data.mix} - ${data.max}`; + ${data.max}`; $('#MACTable').append(contactdiv); } }, @@ -1442,19 +1444,19 @@ // PowerMode - layui.autocomplete({ - element: '#wipSystem_PowerMode', - display: 'meterialNo', - shortcut: 'modelName', - num: 2, - count: 10, - url: '/PCS/getPLMMeterialAutoComplete', - query: {}, - resArray: 'data', - done: function (item) { - $('#wipSystem_PowerMode_Desc').val(item.productionMemo); - } - }); + //layui.autocomplete({ + // element: '#wipSystem_PowerMode', + // display: 'meterialNo', + // shortcut: 'modelName', + // num: 2, + // count: 10, + // url: '/PCS/getPLMMeterialAutoComplete', + // query: {}, + // resArray: 'data', + // done: function (item) { + // $('#wipSystem_PowerMode_Desc').val(item.productionMemo); + // } + //}); form.on('select(flow)', function (data) { $("#flowId").val(data.value); @@ -1976,8 +1978,6 @@ success: function (result) { if (result.success) { var result_msg = result.msg; - console.log(result_msg); - console.log('@Model.wipAtt.ECN'); if ('@Model.wipAtt.ECN' != result_msg) { layer.confirm('比對與PLM ECN/ECR不一樣,確定更新ECN/ECR嗎?', { btn: ['確定', '取消'] @@ -1997,6 +1997,32 @@ } }); } + + // 更新燒機資訊 + function GetRuinTime() { + $.ajax({ + url: "@Url.Action("GetRuninTimeByItemNo", "PCS")", + type: "Post", + async: true, + data: { "itemNo": '@Model.wipAtt.ItemNO' }, + success: function (result) { + if (result.success) { + if (result.data != null) { + $("#wipSystem_BiRatio").val(result.data.ratio); + $("#wipSystem_BiTime").val(result.data.time); + $("#wipSystem_BiTemperature").val(result.data.temperature); + $("#wipSystem_BI_OS").val(result.data.runinSoftware); + layui.form.render("select");//重新渲染 固定写法 + } + else { + parent.hg.msg(`找不到相關料號燒機維護資訊`); + } + } + }, + error: function (result) { + parent.hg.msg(`呼叫API失敗`); + } + }); + } } - diff --git a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml index e71df14b..c7dbf3cb 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml @@ -729,30 +729,34 @@
- +
-
+
- -
+
小時
-
+
+
@@ -775,11 +779,11 @@
- +
- +
@@ -1274,7 +1278,7 @@ else { var contactdiv = '' + `${data.mix} - ${data.max}`; + ${data.max}`; $('#MACTable').append(contactdiv); } }, @@ -1338,20 +1342,20 @@ } }); }) - // PowerMode - layui.autocomplete({ - element: '#wipSystem_PowerMode', - display: 'meterialNo', - shortcut: 'modelName', - num: 2, - count: 10, - url: '/PCS/getPLMMeterialAutoComplete', - query: {}, - resArray: 'data', - done: function (item) { - $('#wipSystem_PowerMode_Desc').val(item.productionMemo); - } - }); + //// PowerMode + //layui.autocomplete({ + // element: '#wipSystem_PowerMode', + // display: 'meterialNo', + // shortcut: 'modelName', + // num: 2, + // count: 10, + // url: '/PCS/getPLMMeterialAutoComplete', + // query: {}, + // resArray: 'data', + // done: function (item) { + // $('#wipSystem_PowerMode_Desc').val(item.productionMemo); + // } + //}); form.on('select(flow)', function (data) { $("#flowId").val(data.value); @@ -1804,6 +1808,33 @@ } }); } + + // 更新燒機資訊 + function GetRuinTime() { + $.ajax({ + url: "@Url.Action("GetRuninTimeByItemNo", "PCS")", + type: "Post", + async: true, + data: { "itemNo": '@Model.wipAtt.ItemNO' }, + success: function (result) { + if (result.success) { + if (result.data != null) { + $("#wipSystem_BiRatio").val(result.data.ratio); + $("#wipSystem_BiTime").val(result.data.time); + $("#wipSystem_BiTemperature").val(result.data.temperature); + $("#wipSystem_BI_OS").val(result.data.runinSoftware); + layui.form.render("select");//重新渲染 固定写法 + } + else { + parent.hg.msg(`找不到相關料號燒機維護資訊`); + } + } + }, + error: function (result) { + parent.hg.msg(`呼叫API失敗`); + } + }); + } } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/MaterialKpController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/MaterialKpController.cs index c6440dba..d6d81678 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/MaterialKpController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/MaterialKpController.cs @@ -203,6 +203,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES result.Msg = "OK"; return result; } + /// /// 刪除料號KP By 料號ID /// @@ -221,5 +222,23 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES result.Msg = "OK"; return result; } + + /// + /// 刪除料號KP By KpNo(停用) + /// + /// KpNo + /// + [HttpDelete("ByKpNo/{id}")] + public async Task> DeleteMaterialKpByKpNo(string id) + { + ResultModel result = new ResultModel(); + var MaterialKp = await _context.MaterialKps.Where(m => m.KpNo == id).ToListAsync(); + + _context.MaterialKps.RemoveRange(MaterialKp); + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + return result; + } } } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipKpsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipKpsController.cs index e5a79d33..d448513d 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipKpsController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipKpsController.cs @@ -199,6 +199,35 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return result; } + /// + /// 刪除工單KP資訊資料檔 By KpNo(停用) + /// + /// KpNo + /// + [HttpDelete("ByKpNo/{id}")] + public async Task> DeleteWipKpByKpNo(string id) + { + ResultModel result = new ResultModel(); + var wipKp = await _context.WipKps.Where(w => w.KpNo == id).ToListAsync(); + + try + { + if (wipKp.Count != 0) + { + _context.WipKps.RemoveRange(wipKp); + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.InnerException.Message; + } + return result; + } + private bool WipKpExists(int id) { return _context.WipKps.Any(e => e.WipKpID == id); diff --git a/AMESCoreStudio.WebApi/Enums/EnumPCS.cs b/AMESCoreStudio.WebApi/Enums/EnumPCS.cs index 2d712cd7..e7c27f96 100644 --- a/AMESCoreStudio.WebApi/Enums/EnumPCS.cs +++ b/AMESCoreStudio.WebApi/Enums/EnumPCS.cs @@ -287,7 +287,7 @@ namespace AMESCoreStudio.WebApi.Enum /// /// Power onoff+Burnin test /// - [Display(Name = "Power onoff + Burnin test")] + [Display(Name = "Power onoff+Burnin test")] E = 5, /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs index f3423a3c..4104b0c7 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs @@ -262,6 +262,15 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Display(Name = "DMI燒入說明")] public string DmiBiMemo { get; set; } + /// + /// 備註 + /// + [Column("MEMO")] + [StringLength(300)] + [DataMember] + [Display(Name = "備註")] + public string Memo { get; set; } + /// /// JUMPER設定 ///