From 44e197973562db7de9b0a340e312239785ecacd7 Mon Sep 17 00:00:00 2001 From: ray Date: Sun, 16 Jan 2022 23:16:15 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E6=9B=B4=E6=8F=9B=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E7=B6=81SOP=E7=9B=B8=E9=97=9CTable=20=E5=90=8D=E7=A8=B1=202.?= =?UTF-8?q?=20=E4=BF=AE=E6=AD=A3=E9=81=8E=E7=AB=99=E9=82=8F=E8=BC=AF?= =?UTF-8?q?=E5=88=A4=E6=96=B7=203.=20=E6=96=B0=E5=A2=9EFQC007=20FQC?= =?UTF-8?q?=E6=8A=BD=E9=A9=97=E8=B3=87=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 41 ++-- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 41 ++-- .../ViewModels/PCS/PCS001RViewModel.cs | 2 +- AMESCoreStudio.Web/ViewModels/WipViewModel.cs | 2 +- AMESCoreStudio.Web/Views/PCS/PCS001.cshtml | 2 +- AMESCoreStudio.Web/Views/PCS/PCS021.cshtml | 13 +- AMESCoreStudio.Web/Views/PCS/PCS027.cshtml | 4 +- AMESCoreStudio.Web/Views/PCS/PCS030.cshtml | 4 +- AMESCoreStudio.Web/Views/PCS/PCS030C.cshtml | 4 +- .../AMES/FqcInhouseMasterController.cs | 61 ++++++ .../Controllers/AMES/MaterialSopController.cs | 185 +++++++++++++++++ .../Controllers/AMES/WipSopController.cs | 193 +++++++++--------- .../Controllers/AMES/WipSopLogController.cs | 181 ---------------- AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs | 160 +++++++++++++++ .../AMES/{WipSopDto.cs => MaterialSopDto.cs} | 8 +- .../Models/AMES/FqcInhouseDetail.cs | 1 + .../Models/AMES/FqcResultMaster.cs | 2 +- .../Models/AMES/MaterialSop.cs | 124 +++++++++++ AMESCoreStudio.WebApi/Models/AMES/WipSop.cs | 81 ++------ .../Models/AMES/WipSopLog.cs | 86 -------- AMESCoreStudio.WebApi/Models/AMESContext.cs | 8 +- 21 files changed, 719 insertions(+), 484 deletions(-) create mode 100644 AMESCoreStudio.WebApi/Controllers/AMES/MaterialSopController.cs delete mode 100644 AMESCoreStudio.WebApi/Controllers/AMES/WipSopLogController.cs create mode 100644 AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs rename AMESCoreStudio.WebApi/DTO/AMES/{WipSopDto.cs => MaterialSopDto.cs} (89%) create mode 100644 AMESCoreStudio.WebApi/Models/AMES/MaterialSop.cs delete mode 100644 AMESCoreStudio.WebApi/Models/AMES/WipSopLog.cs diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 6ec61f98..4138816e 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1069,12 +1069,12 @@ namespace AMESCoreStudio.Web.Controllers } } - // 工單對應SOP Log - var q = await _pcsApi.GetWipSopQuery(itemNo: model.wipAtt.ItemNO, unitNo: model.wipInfo.UnitNO, state: "Y"); + // 工單對應SOP + var q = await _pcsApi.GetMaterialSopQuery(itemNo: model.wipAtt.ItemNO, unitNo: model.wipInfo.UnitNO, state: "Y"); if (q.Data.Count() != 0) { - model.wipSopLog.WipSopID = q.Data.FirstOrDefault().WipSopID; - await _pcsApi.PostWipSopLog(JsonConvert.SerializeObject(model.wipSopLog)); + model.wipSop.MaterialSopID = q.Data.FirstOrDefault().MaterialSopID; + await _pcsApi.PostWipSop(JsonConvert.SerializeObject(model.wipSop)); } // 內部條碼 @@ -1155,8 +1155,8 @@ namespace AMESCoreStudio.Web.Controllers model.ruleStation = await _basApi.GetRuleStationsByFlow(model.wipInfo.FlowRuleID); model.ruleStation = model.ruleStation.OrderBy(o => o.Sequence); - var q1 = await _pcsApi.GetWipSopQuery(itemNo: model.wipAtt.ItemNO); - model.wipSop = q1.Data; + var q1 = await _pcsApi.GetMaterialSopQuery(itemNo: model.wipAtt.ItemNO); + model.materialSop = q1.Data; model.materialKp = await _pcsApi.GetMaterialKpQuery(itemno: model.wipAtt.ItemNO); @@ -2094,10 +2094,10 @@ namespace AMESCoreStudio.Web.Controllers } } - var wipsop = await _pcsApi.GetWipSopLog(q.FirstOrDefault().WipID); + var wipsop = await _pcsApi.GetWipSop(q.FirstOrDefault().WipID); if (wipsop != null) { - model.SopPath = wipsop.GetWipSop.FilePath + wipsop.GetWipSop.NewName; + model.SopPath = wipsop.GetMaterialSop.FilePath + wipsop.GetMaterialSop.NewName; } } @@ -2270,6 +2270,9 @@ namespace AMESCoreStudio.Web.Controllers await _pcsApi.PostBarcodeStation(JsonConvert.SerializeObject(barcodeStation)); // 新增 BarCodeItem + // 先查詢已綁定組件數量 + var BarCodeItems = await _pcsApi.GetBarcodeItemByBarCodeID(model.BarCodeID); + int KpItemQty = BarCodeItems.Count(); for (int i = 0; i < Kp.Count(); i++) { @@ -2282,7 +2285,7 @@ namespace AMESCoreStudio.Web.Controllers BarcodeID = model.BarCodeID, WipID = model.WipID, RuleStationID = model.RuleStation, - ItemNo = model.MaterialKps[i].KpNo, + ItemNo = model.MaterialKps[i + KpItemQty].KpNo, PartNo = Kp[i], SysType = "S", CreateUserID = 0, @@ -2608,7 +2611,7 @@ namespace AMESCoreStudio.Web.Controllers public async Task PCS030QueryAsync(string itemNo, string unitNo , string fileName, string state, string date_str, string date_end) { - IResultModel result = await _pcsApi.GetWipSopQuery(itemNo: itemNo, unitNo: unitNo + IResultModel result = await _pcsApi.GetMaterialSopQuery(itemNo: itemNo, unitNo: unitNo , fileName: fileName, state: state, date_str: date_str, date_end: date_end); if (result.Data.Count() != 0) @@ -2619,14 +2622,14 @@ namespace AMESCoreStudio.Web.Controllers } [HttpPost] - public async Task PCS030StateAsync(int wipSopID, bool state) + public async Task PCS030StateAsync(int MaterialSopID, bool state) { //IResultModel result; if (!state) - await _pcsApi.PutWipSop(wipSopID, "N"); + await _pcsApi.PutMaterialSop(MaterialSopID, "N"); else - await _pcsApi.PutWipSop(wipSopID, "Y"); + await _pcsApi.PutMaterialSop(MaterialSopID, "Y"); var _msg = "修改成功!"; return Json(_msg); @@ -2640,7 +2643,7 @@ namespace AMESCoreStudio.Web.Controllers } [HttpPost] - public async Task PCS030CAsync(WipSop model, IFormFile formFile) + public async Task PCS030CAsync(MaterialSop model, IFormFile formFile) { string FileName = string.Empty; string NewName = string.Empty; @@ -2681,10 +2684,10 @@ namespace AMESCoreStudio.Web.Controllers model.NewName = NewName; model.FilePath = FilePath;// fileInfo.PhysicalPath; - result = await _pcsApi.PostWipSop(JsonConvert.SerializeObject(model)); + result = await _pcsApi.PostMaterialSop(JsonConvert.SerializeObject(model)); if (result.Success) { - var _msg = model.WipSopID == 0 ? "新增成功!" : "修改成功!"; + var _msg = model.MaterialSopID == 0 ? "新增成功!" : "修改成功!"; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } else @@ -2945,7 +2948,7 @@ namespace AMESCoreStudio.Web.Controllers } [HttpPost] - public async Task PCS027CAsync(WipSop model, IFormFile formFile) + public async Task PCS027CAsync(MaterialSop model, IFormFile formFile) { string FileName = string.Empty; string NewName = string.Empty; @@ -2986,10 +2989,10 @@ namespace AMESCoreStudio.Web.Controllers model.NewName = NewName; model.FilePath = FilePath;// fileInfo.PhysicalPath; - result = await _pcsApi.PostWipSop(JsonConvert.SerializeObject(model)); + result = await _pcsApi.PostMaterialSop(JsonConvert.SerializeObject(model)); if (result.Success) { - var _msg = model.WipSopID == 0 ? "新增成功!" : "修改成功!"; + var _msg = model.MaterialSopID == 0 ? "新增成功!" : "修改成功!"; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } else diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 7f4e5c14..a35a3f3c 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -237,6 +237,15 @@ namespace AMESCoreStudio.Web #endregion + #region BarcodeItem BarCode組件維護 PCS021 + /// + /// 查詢組件序號 by BarCodeID + /// + /// + [WebApiClient.Attributes.HttpGet("api/BarcodeItems/ByBarCodeID")] + ITask> GetBarcodeItemByBarCodeID(int barcodeID); + #endregion + #region NgInfo 測試不良基本資料檔 PCS021 [WebApiClient.Attributes.HttpPost("api/NgInfo")] ITask> PostNgInfo([FromBody, RawJsonContent] string model); @@ -490,13 +499,13 @@ namespace AMESCoreStudio.Web ITask> GetMaterialStationsItemByItemID(int id); #endregion - #region SOP文件維護 + #region MaterialSop SOP文件維護 /// /// SOP文件查詢 /// /// - [WebApiClient.Attributes.HttpGet("api/WipSop/{id}")] - ITask GetWipSop(int id); + [WebApiClient.Attributes.HttpGet("api/MaterialSop/{id}")] + ITask GetMaterialSop(int id); /// @@ -512,41 +521,41 @@ namespace AMESCoreStudio.Web /// 鎖定日期迄 /// /// - [WebApiClient.Attributes.HttpGet("api/WipSop/GetWipSopQuery")] - ITask> GetWipSopQuery(string itemNo = null, string unitNo = null + [WebApiClient.Attributes.HttpGet("api/MaterialSop/GetMaterialSopQuery")] + ITask> GetMaterialSopQuery(string itemNo = null, string unitNo = null , string fileName = null, string state = null, string date_str = null, string date_end = null); /// /// 新增SOP文件 /// /// - [WebApiClient.Attributes.HttpPost("api/WipSop")] - ITask> PostWipSop([FromBody, RawJsonContent] string model); + [WebApiClient.Attributes.HttpPost("api/MaterialSop")] + ITask> PostMaterialSop([FromBody, RawJsonContent] string model); /// /// SOP文件變更狀態 /// /// - [WebApiClient.Attributes.HttpPut("api/WipSop/{id}/{state}")] - ITask> PutWipSop(int id, string state); + [WebApiClient.Attributes.HttpPut("api/MaterialSop/{id}/{state}")] + ITask> PutMaterialSop(int id, string state); #endregion - #region WipSopLog 工單對應SOP log + #region WipSop 工單對應SOP /// /// 查詢工單對應SOP log /// /// /// - [WebApiClient.Attributes.HttpGet("api/WipSopLog/{id}")] - ITask GetWipSopLog(int id); + [WebApiClient.Attributes.HttpGet("api/WipSop/{id}")] + ITask GetWipSop(int id); /// - /// 新增工單對應SOP log + /// 新增工單對應SOP /// /// - [WebApiClient.Attributes.HttpPost("api/WipSopLog")] - ITask> PostWipSopLog([FromBody, RawJsonContent] string model); + [WebApiClient.Attributes.HttpPost("api/WipSop")] + ITask> PostWipSop([FromBody, RawJsonContent] string model); #endregion #region PCS024組件維護相關 @@ -702,7 +711,7 @@ namespace AMESCoreStudio.Web /// 生產單位ID /// 過站刷入組件序號 [WebApiClient.Attributes.HttpGet("api/BarCodeCheck/BarCodeKP")] - ITask> CheckBarCodeKP(string wipno , string barcode , string unitNo, List inputKP); + ITask> CheckBarCodeKP(string wipno, string barcode, string unitNo, List inputKP); #endregion diff --git a/AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs index ad0da06e..e050b1e4 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs @@ -22,7 +22,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS public IEnumerable ruleStation { get; set; } - public IEnumerable wipSop { get; set; } + public IEnumerable materialSop { get; set; } public IEnumerable materialKp { get; set; } diff --git a/AMESCoreStudio.Web/ViewModels/WipViewModel.cs b/AMESCoreStudio.Web/ViewModels/WipViewModel.cs index c572c1b9..04f6eec1 100644 --- a/AMESCoreStudio.Web/ViewModels/WipViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/WipViewModel.cs @@ -40,7 +40,7 @@ namespace AMESCoreStudio.Web.ViewModels public FactoryUnit factoryUnit { get; set; } - public WipSopLog wipSopLog { get; set; } + public WipSop wipSop { get; set; } public WipLabel wipLabel { get; set; } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml index e684c5d9..1d864887 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml @@ -19,7 +19,7 @@
- +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml index c094f2fc..939445b7 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS021.cshtml @@ -86,12 +86,6 @@
- -
- -
-
@@ -99,6 +93,13 @@
+ +
+ +
+ +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS027.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS027.cshtml index b97c811a..78bcd698 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS027.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS027.cshtml @@ -1,4 +1,4 @@ -@model AMESCoreStudio.WebApi.Models.AMES.WipSop +@model AMESCoreStudio.WebApi.Models.AMES.MaterialSop @{ ViewData["Title"] = "PCS030C"; @@ -15,7 +15,7 @@
- +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS030.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS030.cshtml index 0c1fcbd0..f0644c6d 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS030.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS030.cshtml @@ -110,7 +110,7 @@ @section Scripts{