From 6467a59ff0361815becddd1f16152f09ce83c4a5 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 10 May 2022 11:02:33 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E6=AA=A2=E8=A6=96=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 155 ++++++++++++++---- 1 file changed, 125 insertions(+), 30 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 7f386196..33c30ce9 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1840,21 +1840,47 @@ namespace AMESCoreStudio.Web.Controllers model.wipSystem.Engineer_Name = UserInof.UserName; } - var Ec_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Ec).InvokeAsync().Result; - var Fw_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw).InvokeAsync().Result; - var Fw1_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw1).InvokeAsync().Result; - var Fw2_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw2).InvokeAsync().Result; - var Bios_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Bios).InvokeAsync().Result; - var Os_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.OsVer).InvokeAsync().Result; - var PowerMode_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.PowerMode).InvokeAsync().Result; - - model.wipSystem.Ec_Desc = Ec_Desc == null ? "" : Ec_Desc.MeterialDesc; - model.wipSystem.Fw_Desc = Fw_Desc == null ? "" : Fw_Desc.MeterialDesc; - model.wipSystem.Fw1_Desc = Fw1_Desc == null ? "" : Fw1_Desc.MeterialDesc; - model.wipSystem.Fw2_Desc = Fw2_Desc == null ? "" : Fw2_Desc.MeterialDesc; - model.wipSystem.Bios_Desc = Bios_Desc == null ? "" : Bios_Desc.MeterialDesc; - model.wipSystem.OsVer_Desc = Os_Desc == null ? "" : Os_Desc.MeterialDesc; - model.wipSystem.PowerMode_Desc = PowerMode_Desc == null ? "" : PowerMode_Desc.ProductionMemo; + if (!string.IsNullOrWhiteSpace(model.wipSystem.Ec)) + { + var Ec_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Ec).InvokeAsync().Result; + model.wipSystem.Ec_Desc = Ec_Desc == null ? "" : Ec_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Fw)) + { + var Fw_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw).InvokeAsync().Result; + model.wipSystem.Fw_Desc = Fw_Desc == null ? "" : Fw_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Fw1)) + { + var Fw1_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw1).InvokeAsync().Result; + model.wipSystem.Fw1_Desc = Fw1_Desc == null ? "" : Fw1_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Fw2)) + { + var Fw2_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw2).InvokeAsync().Result; + model.wipSystem.Fw2_Desc = Fw2_Desc == null ? "" : Fw2_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Bios)) + { + var Bios_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Bios).InvokeAsync().Result; + model.wipSystem.Bios_Desc = Bios_Desc == null ? "" : Bios_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.OsVer)) + { + var Os_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.OsVer).InvokeAsync().Result; + model.wipSystem.OsVer_Desc = Os_Desc == null ? "" : Os_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.PowerMode)) + { + var PowerMode_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.PowerMode).InvokeAsync().Result; + model.wipSystem.PowerMode_Desc = PowerMode_Desc == null ? "" : PowerMode_Desc.ProductionMemo; + } } model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); @@ -1937,21 +1963,47 @@ namespace AMESCoreStudio.Web.Controllers model.wipSystem = await _pcsApi.GetWipSystem(model.wipInfo.WipNO); if (model.wipSystem != null) { - var Ec_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Ec).InvokeAsync().Result; - var Fw_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw).InvokeAsync().Result; - var Fw1_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw1).InvokeAsync().Result; - var Fw2_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw2).InvokeAsync().Result; - var Bios_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Bios).InvokeAsync().Result; - var Os_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.OsVer).InvokeAsync().Result; - var PowerMode_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.PowerMode).InvokeAsync().Result; - - model.wipSystem.Ec_Desc = Ec_Desc == null ? "" : Ec_Desc.MeterialDesc; - model.wipSystem.Fw_Desc = Fw_Desc == null ? "" : Fw_Desc.MeterialDesc; - model.wipSystem.Fw1_Desc = Fw1_Desc == null ? "" : Fw1_Desc.MeterialDesc; - model.wipSystem.Fw2_Desc = Fw2_Desc == null ? "" : Fw2_Desc.MeterialDesc; - model.wipSystem.Bios_Desc = Bios_Desc == null ? "" : Bios_Desc.MeterialDesc; - model.wipSystem.OsVer_Desc = Os_Desc == null ? "" : Os_Desc.MeterialDesc; - model.wipSystem.PowerMode_Desc = PowerMode_Desc == null ? "" : PowerMode_Desc.ProductionMemo; + if (!string.IsNullOrWhiteSpace(model.wipSystem.Ec)) + { + var Ec_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Ec).InvokeAsync().Result; + model.wipSystem.Ec_Desc = Ec_Desc == null ? "" : Ec_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Fw)) + { + var Fw_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw).InvokeAsync().Result; + model.wipSystem.Fw_Desc = Fw_Desc == null ? "" : Fw_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Fw1)) + { + var Fw1_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw1).InvokeAsync().Result; + model.wipSystem.Fw1_Desc = Fw1_Desc == null ? "" : Fw1_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Fw2)) + { + var Fw2_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Fw2).InvokeAsync().Result; + model.wipSystem.Fw2_Desc = Fw2_Desc == null ? "" : Fw2_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.Bios)) + { + var Bios_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.Bios).InvokeAsync().Result; + model.wipSystem.Bios_Desc = Bios_Desc == null ? "" : Bios_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.OsVer)) + { + var Os_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.OsVer).InvokeAsync().Result; + model.wipSystem.OsVer_Desc = Os_Desc == null ? "" : Os_Desc.MeterialDesc; + } + + if (!string.IsNullOrWhiteSpace(model.wipSystem.PowerMode)) + { + var PowerMode_Desc = _pcsApi.GetPlmMeterialInfo(model.wipSystem.PowerMode).InvokeAsync().Result; + model.wipSystem.PowerMode_Desc = PowerMode_Desc == null ? "" : PowerMode_Desc.ProductionMemo; + } if (!string.IsNullOrWhiteSpace(model.wipSystem.Engineer)) { @@ -4433,6 +4485,49 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Result() { success = result.Success, msg = result.Msg }); } + #region PCS031 工單生產重新過站 + public ActionResult PCS031() + { + return View(); + } + + //[HttpPost] + //public async Task PCS031Asnyc(PCS031ViewModel model) + //{ + + + //} + + [HttpPost] + public async Task PCS031QueryAsnyc(string wipNo) + { + var result = new ResultModel(); + var result_Wip = await _pcsApi.GetWipInfoByWipNO(wipNo.Trim().ToUpper()); + + if (result_Wip.Count == 0) + { + result.Success = false; + result.Msg = "找不到工單號碼【" + wipNo + "】建立資料"; + } + else if (result_Wip.Count != 1) + { + result.Success = false; + result.Msg = "工單號碼【" + wipNo + "】有開立多張工單維護資料,無法使用生產序號退回"; + } + else + { + var FlowRule = result_Wip.FirstOrDefault().FlowRuleID; + var result_RuleStation = await _pcsApi.GetRuleStationByFlow(FlowRule); + } + + if (result.Data.Count() != 0) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = 0 }); + } + + return Json(result); + } + #endregion [HttpPost] public JsonResult TestFunc(string number) {