diff --git a/AMESCoreStudio.Web/Controllers/REPController.cs b/AMESCoreStudio.Web/Controllers/REPController.cs index b1999d8d..fe5c1884 100644 --- a/AMESCoreStudio.Web/Controllers/REPController.cs +++ b/AMESCoreStudio.Web/Controllers/REPController.cs @@ -562,17 +562,25 @@ namespace AMESCoreStudio.Web.Controllers inputItems = items }; + var barcode_result = new ResultModel(); try { - var barcode_result = await _pcsApi.PassIngByCheck(JsonConvert.SerializeObject(barCode)); + barcode_result = await _pcsApi.PassIngByCheck(JsonConvert.SerializeObject(barCode)); } catch { } - //更新NG_INFO - //var ng_info = await _repApi.GetNgInfo((int)model.ngInfo.NgID); - //ng_info[0].Status = 1; - model.ngInfo.Status = 1; - result = await _repApi.PutNgInfo(JsonConvert.SerializeObject(model.ngInfo)); + if (barcode_result.Success) + { + //更新NG_INFO + //var ng_info = await _repApi.GetNgInfo((int)model.ngInfo.NgID); + //ng_info[0].Status = 1; + model.ngInfo.Status = 1; + 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) @@ -583,7 +591,7 @@ namespace AMESCoreStudio.Web.Controllers } else { - if (result.Errors.Count > 0) + if (result.Errors != null) { ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); }