From 004f6210bd6f0681bceda7a5fbe351e86a7f3d70 Mon Sep 17 00:00:00 2001 From: "xiaowei.song" Date: Thu, 16 Nov 2023 09:52:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/mes/pro/ProWorkplanController.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs index d6dc1f28..8cf88aa6 100644 --- a/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs @@ -179,12 +179,14 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro public IActionResult UpdateWorkorder([FromBody] ProWorkorder proWorkorder) { // TODO 判断更新的数量是否超过计划数 + int data = 0; - if (proWorkorder != null) + if (proWorkorder != null) // 工单对象不为空 { string workPlanId = proWorkorder.FkProPlanId; string workorderId = proWorkorder.Id; + // 判断计划ID,工单ID要非空 if (!string.IsNullOrEmpty(workPlanId) && !string.IsNullOrEmpty(workorderId)) { string isArrange = "0"; @@ -196,9 +198,9 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro ProWorkorder currentWorkorder = null; foreach (ProWorkorder item in lstWorkorder) { - if(item.Id.Equals(workorderId) && !string.IsNullOrEmpty(item.Isarrange)) + if(item.Id.Equals(workorderId)) // 找到当前工单ID的对象 { - isArrange = item.Isarrange; + if(!string.IsNullOrEmpty(item.Isarrange)) isArrange = item.Isarrange; currentWorkorder = item; break; } @@ -260,6 +262,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro // 查询所有生产工单,根据生产计划ID List lstWorkorder = proWorkplanService.GetWorkorderListById(id); + // 查询工单非空,数量必须为1个 if (lstWorkorder != null && lstWorkorder.Count == 1) { string isArrange = "0";