Browse Source

1.修改维修资料输入,增加判断维修过站是否成功?

PTD
Marvin 3 years ago
parent
commit
b38fb9444b
  1. 12
      AMESCoreStudio.Web/Controllers/REPController.cs

12
AMESCoreStudio.Web/Controllers/REPController.cs

@ -562,18 +562,26 @@ namespace AMESCoreStudio.Web.Controllers
inputItems = items inputItems = items
}; };
var barcode_result = new ResultModel<string>();
try try
{ {
var barcode_result = await _pcsApi.PassIngByCheck(JsonConvert.SerializeObject(barCode)); barcode_result = await _pcsApi.PassIngByCheck(JsonConvert.SerializeObject(barCode));
} }
catch { } catch { }
if (barcode_result.Success)
{
//更新NG_INFO //更新NG_INFO
//var ng_info = await _repApi.GetNgInfo((int)model.ngInfo.NgID); //var ng_info = await _repApi.GetNgInfo((int)model.ngInfo.NgID);
//ng_info[0].Status = 1; //ng_info[0].Status = 1;
model.ngInfo.Status = 1; model.ngInfo.Status = 1;
result = await _repApi.PutNgInfo(JsonConvert.SerializeObject(model.ngInfo)); result = await _repApi.PutNgInfo(JsonConvert.SerializeObject(model.ngInfo));
} }
else
{
return RedirectToAction("Refresh", "Home", new { id = model.ngComponent.NgID, msg = barcode_result.Msg });
}
}
if (result.Success) if (result.Success)
{ {
@ -583,7 +591,7 @@ namespace AMESCoreStudio.Web.Controllers
} }
else else
{ {
if (result.Errors.Count > 0) if (result.Errors != null)
{ {
ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg);
} }

Loading…
Cancel
Save