From b38fb9444bee3fdf883c5d94c878af7e6203be8f Mon Sep 17 00:00:00 2001 From: Marvin Date: Tue, 12 Apr 2022 21:40:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=BB=B4=E4=BF=AE=E8=B5=84?= =?UTF-8?q?=E6=96=99=E8=BE=93=E5=85=A5=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=BB=B4=E4=BF=AE=E8=BF=87=E7=AB=99=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=88=90=E5=8A=9F=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/REPController.cs | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) 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); }