增加注释

This commit is contained in:
xiaowei.song
2023-11-16 09:52:16 +08:00
parent 1db36d34d9
commit 004f6210bd

View File

@@ -179,12 +179,14 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
public IActionResult UpdateWorkorder([FromBody] ProWorkorder proWorkorder) public IActionResult UpdateWorkorder([FromBody] ProWorkorder proWorkorder)
{ {
// TODO 判断更新的数量是否超过计划数 // TODO 判断更新的数量是否超过计划数
int data = 0; int data = 0;
if (proWorkorder != null) if (proWorkorder != null) // 工单对象不为空
{ {
string workPlanId = proWorkorder.FkProPlanId; string workPlanId = proWorkorder.FkProPlanId;
string workorderId = proWorkorder.Id; string workorderId = proWorkorder.Id;
// 判断计划ID工单ID要非空
if (!string.IsNullOrEmpty(workPlanId) && !string.IsNullOrEmpty(workorderId)) if (!string.IsNullOrEmpty(workPlanId) && !string.IsNullOrEmpty(workorderId))
{ {
string isArrange = "0"; string isArrange = "0";
@@ -196,9 +198,9 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
ProWorkorder currentWorkorder = null; ProWorkorder currentWorkorder = null;
foreach (ProWorkorder item in lstWorkorder) 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; currentWorkorder = item;
break; break;
} }
@@ -260,6 +262,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
// 查询所有生产工单根据生产计划ID // 查询所有生产工单根据生产计划ID
List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderListById(id); List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderListById(id);
// 查询工单非空数量必须为1个
if (lstWorkorder != null && lstWorkorder.Count == 1) if (lstWorkorder != null && lstWorkorder.Count == 1)
{ {
string isArrange = "0"; string isArrange = "0";