Browse Source

1. 修正工單檢視錯誤

PTD
Ray 3 years ago
parent
commit
6467a59ff0
  1. 123
      AMESCoreStudio.Web/Controllers/PCSController.cs

123
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -1840,22 +1840,48 @@ namespace AMESCoreStudio.Web.Controllers
model.wipSystem.Engineer_Name = UserInof.UserName;
}
if (!string.IsNullOrWhiteSpace(model.wipSystem.Ec))
{
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;
}
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);
if (model.wipMAC != null)
@ -1936,22 +1962,48 @@ namespace AMESCoreStudio.Web.Controllers
model.wipSystem = await _pcsApi.GetWipSystem(model.wipInfo.WipNO);
if (model.wipSystem != null)
{
if (!string.IsNullOrWhiteSpace(model.wipSystem.Ec))
{
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;
}
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<IActionResult> PCS031Asnyc(PCS031ViewModel model)
//{
//}
[HttpPost]
public async Task<IActionResult> PCS031QueryAsnyc(string wipNo)
{
var result = new ResultModel<string>();
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)
{

Loading…
Cancel
Save