From 427656e55ac25ec9a52bae213b1d9c2473ce818c Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 25 Mar 2022 18:13:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E6=96=99=E8=99=9FSOP?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=202.=20=E5=B7=A5=E5=96=AE=E8=B3=87=E6=96=99?= =?UTF-8?q?=E7=B6=AD=E8=AD=B7WipKP=E6=94=B9=E7=94=A8=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=81=B8=E5=96=AE=EF=BC=8C=E5=8A=A0=E5=85=A5=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E8=B2=A0=E8=B2=AC=E4=BA=BA=E5=93=A1=E5=8F=8A=E5=88=A4=E6=96=B7?= =?UTF-8?q?MAC=E6=8C=89=E9=88=95=E9=9A=B1=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 106 ++- AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 604 ++++++------------ AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 69 +- AMESCoreStudio.Web/Views/PCS/PCS030C.cshtml | 2 - .../Controllers/AMES/ItemsController.cs | 2 +- AMESCoreStudio.WebApi/Models/AMES/WipBoard.cs | 17 + .../Models/AMES/WipSystem.cs | 19 +- 7 files changed, 377 insertions(+), 442 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index b96d2356..4b2427bb 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -20,6 +20,8 @@ using System.Threading.Tasks; namespace AMESCoreStudio.Web.Controllers { + + public class PCSController : Controller { private readonly ILogger _logger; @@ -28,11 +30,12 @@ namespace AMESCoreStudio.Web.Controllers public readonly IBAS _basApi; public readonly IPPS _ppsApi; public readonly IFQC _fqcApi; + public readonly IKCS _kcsApi; public readonly IFileServerProvider _fileServerProvider; private readonly IWebHostEnvironment _env; public PCSController(ILogger logger, ISYS sysApi, IPCS pcsApi, IBAS basApi, IPPS ppsApi, IFQC fqcApi - , IFileServerProvider fileServerProvider, IWebHostEnvironment env) + , IFileServerProvider fileServerProvider, IWebHostEnvironment env, IKCS kcsApi) { _logger = logger; _sysApi = sysApi; @@ -40,6 +43,7 @@ namespace AMESCoreStudio.Web.Controllers _basApi = basApi; _ppsApi = ppsApi; _fqcApi = fqcApi; + _kcsApi = kcsApi; _fileServerProvider = fileServerProvider; _env = env; } @@ -119,19 +123,7 @@ namespace AMESCoreStudio.Web.Controllers !string.IsNullOrWhiteSpace(model.BiTime) || !string.IsNullOrWhiteSpace(model.BiMemo) || !string.IsNullOrWhiteSpace(model.Checksum) || - !string.IsNullOrWhiteSpace(model.Cpu) || - !string.IsNullOrWhiteSpace(model.DmiBi) || - !string.IsNullOrWhiteSpace(model.Bios) || - !string.IsNullOrWhiteSpace(model.Ec) || - !string.IsNullOrWhiteSpace(model.Fw) || - !string.IsNullOrWhiteSpace(model.Fw) || - !string.IsNullOrWhiteSpace(model.Fw1) || - !string.IsNullOrWhiteSpace(model.Fw2) || - !string.IsNullOrWhiteSpace(model.Jumper) || - !string.IsNullOrWhiteSpace(model.Memo) || - !string.IsNullOrWhiteSpace(model.OsVer) || - !string.IsNullOrWhiteSpace(model.PowerMode) || - !string.IsNullOrWhiteSpace(model.Ram)) + !string.IsNullOrWhiteSpace(model.Bios)) { if (string.IsNullOrWhiteSpace(model.BiTemperature)) Msg += model.GetAttributeFrom(nameof(model.BiTemperature)).Name + ","; @@ -139,15 +131,12 @@ namespace AMESCoreStudio.Web.Controllers if (string.IsNullOrWhiteSpace(model.BiTime)) Msg += model.GetAttributeFrom(nameof(model.BiTime)).Name + ","; + if (string.IsNullOrWhiteSpace(model.BiTime)) + Msg += model.GetAttributeFrom(nameof(model.BiMemo)).Name + ","; + if (string.IsNullOrWhiteSpace(model.Checksum)) Msg += model.GetAttributeFrom(nameof(model.Checksum)).Name + ","; - if (string.IsNullOrWhiteSpace(model.Cpu)) - Msg += model.GetAttributeFrom(nameof(model.Cpu)).Name + ","; - - if (string.IsNullOrWhiteSpace(model.Ram)) - Msg += model.GetAttributeFrom(nameof(model.Ram)).Name + ","; - if (string.IsNullOrWhiteSpace(model.Bios)) Msg += model.GetAttributeFrom(nameof(model.Bios)).Name + ","; @@ -860,6 +849,29 @@ namespace AMESCoreStudio.Web.Controllers //TempData["GetLockReasonTypeList"] = LockReasonType; ViewBag.GetLockReasonTypeList = LockReasonType; } + + /// + /// KP Items + /// + /// + private async Task GetItemsList() + { + var result = await _kcsApi.GetItems(); + + var Items = new List(); + for (int i = 0; i < result.Count; i++) + { + Items.Add(new SelectListItem(result[i].ItemName, result[i].ItemNo.ToString())); + } + + if (result.Count == 0) + { + Items.Add(new SelectListItem("N/A", null)); + } + + ViewBag.ItemsList = Items; + } + #endregion #region CheckboxList @@ -954,7 +966,7 @@ namespace AMESCoreStudio.Web.Controllers #region resut Ajax JSON /// - /// 生產單位 + /// 生產單位 Json /// /// [HttpPost] @@ -978,6 +990,18 @@ namespace AMESCoreStudio.Web.Controllers FactoryUnit = FactoryUnit.Where(w => w.Text.ToUpper().Contains(search.ToUpper()) || w.Value.ToUpper().Contains(search.ToUpper())).ToList(); } + //var result = await _kcsApi.GetItems(); + + //var FactoryUnit = new List(); + //for (int i = 0; i < result.Count; i++) + //{ + // FactoryUnit.Add(new SelectListItem(result[i].ItemName, result[i].ItemNo.ToString())); + //} + + //if (result.Count == 0) + //{ + // FactoryUnit.Add(new SelectListItem("N/A", null)); + //} //将数据Json化并传到前台视图 return Json(new { data = FactoryUnit }); @@ -1046,6 +1070,30 @@ namespace AMESCoreStudio.Web.Controllers return Json(new { data = result }); } + /// + /// KP Items Json + /// + /// + [HttpPost] + public async Task getKpItemsJson() + { + var result = await _kcsApi.GetItems(); + + var KpItems = new List(); + for (int i = 0; i < result.Count; i++) + { + KpItems.Add(new SelectListItem(result[i].ItemName, result[i].ItemNo.ToString())); + } + + if (result.Count == 0) + { + KpItems.Add(new SelectListItem("N/A", null)); + } + + //将数据Json化并传到前台视图 + return Json(new { data = KpItems }); + } + public async Task MaterialKpQueryAsync(string itemno = null, string station = null) { @@ -1496,6 +1544,7 @@ namespace AMESCoreStudio.Web.Controllers model.WipSops = await _pcsApi.GetWipSopByWipNo(model.wipInfo.WipNO); } + await GetItemsList(); await GetProductType(); await GetFactoryInfo(); await GetFactoryUnit(); @@ -1563,6 +1612,7 @@ namespace AMESCoreStudio.Web.Controllers model.WipSops = await _pcsApi.GetWipSopByWipNo(model.wipInfo.WipNO); } + await GetItemsList(); await GetProductType(); await GetFactoryInfo(); await GetFactoryUnit(); @@ -1593,7 +1643,9 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PCS003Async(WipDataViewModel model, string action) { + #region 選單 + await GetItemsList(); await GetProductType(); await GetFactoryInfo(); await GetFactoryUnit(); @@ -1618,6 +1670,7 @@ namespace AMESCoreStudio.Web.Controllers GetCheckboxCompanyLogo(); GetCheckboxPrintMode(); GetCheckboxWipAttr(); + GetWipSystemPMTypeSelect(); #endregion model.ruleStations = await _pcsApi.GetRuleStationByWipNo(model.wipInfo.WipNO); @@ -1662,6 +1715,14 @@ namespace AMESCoreStudio.Web.Controllers return View("PCS003", model); } + // 判斷WipKp 順序是否重複 + if (model.WipKps.GroupBy(g => g.KpSeq).Where(w => w.Count() > 1).Any()) + { + ModelState.AddModelError("error", "KeyParts 順序有重複"); + + return View("PCS003", model); + } + result = await _pcsApi.PutWipInfo(JsonConvert.SerializeObject(model.wipInfo)); if (result.Success) { @@ -1814,6 +1875,7 @@ namespace AMESCoreStudio.Web.Controllers } } + WipCheck wipCheck = new WipCheck { WipNo = model.wipInfo.WipNO @@ -3757,7 +3819,7 @@ namespace AMESCoreStudio.Web.Controllers } return View("PCS030U", model); - + } [HttpGet] diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index e327e4c5..e2fea220 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -373,8 +373,7 @@ @index.KpName - - @index.KpNo + @@ -438,484 +437,297 @@ @* 板卡-工程資訊sheet *@ -
-
-
- -
- - -
- - -
- - -
-
+
+
+ +
+
- @*
-
- -
- - -
-
-
*@ - - - @*
- -
- -
-
*@ - -
-
- -
- -
-
+ +
+
+
-
-
- -
- -
- - +
+
+ +
+
+
-
-
- -
- -
-
- -
- -
-
- +
+
+ +
+
+ +
+
-
-
- -
- -
+
+
+ +
+
-
- +
+
- +
+
+
-
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
+
-
-
- -
- -
+
+
+ +
+
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
+
+ +
+
+
-
-
- -
- - -
- -
- - -
+
+
+ +
+
+
- @*
-
- -
- - -
+
+
+
+ +
+
- -
-
- -
- - -
+
+ +
+
- -
-
- -
- - -
-
-
*@ - - @*
-
- -
- - -
-
-
*@ - - - @*
- +
+
- +
-
*@ +
+
- @* 系統-工程資訊sheet *@ -
-
-
- -
- - -
- - -
- - -
+
+
+ +
+ + +
+ +
+ +
+
+
-
-
- -
- - -
+ @* 系統-工程資訊sheet *@ +
+
+
+ +
+
-
-
- -
- + +
+
+
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
+
+
+ +
+ +
+
+
+
-
-
- -
- -
- - -
- -
-
+
+ +
+
+
-
-
- -
- -
- -
- -
- -
- +
+
+
+ +
+
-
- -
-
- -
- +
+ +
+
-
- -
-
- -
- +
+ +
+
+ +
+ +
+
-
-
- -
- -
+
+
+ +
+
-
-
-
- -
- -
+ +
+
+
- -
-
- -
- -
+
+
+ +
+ +
+ +
+ +
+ +
+
+
-
-
- -
- -
+
+
+ +
+
+
-
-
- -
- -
+
+
+ +
+
+
- @*
-
- -
- -
- -
- - -
- -
- - -
-
+
+
+ +
+
+
+
-
-
- -
- -
- -
- - -
- -
- - -
-
+
+
+ +
+
+
+
-
-
- -
- -
- -
- - -
- -
- - -
-
-
-
-
- -
- -
- -
- - -
- -
- - -
-
+
+
+ +
+
+
+
- -
-
- -
- - -
-
+
+
+ +
+
+
+
- -
-
- -
- - -
- -
- - -
- -
- - -
-
+
+
+ +
+
+
+
-
-
- -
- -
-
-
*@ - -
- -
- -
+
+ +
+
+
@* 標籤選項sheet *@
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index b8de647c..32e0934a 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -328,7 +328,7 @@ - + @@ -417,19 +417,15 @@ @* 板卡-工程資訊sheet *@
-
-
- -
- - -
+
+ +
+ +
- -
- - -
+ +
+
@@ -552,16 +548,14 @@
- +
- - +
- - +
@@ -913,6 +907,11 @@