增加注释

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)
{
// 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<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderListById(id);
// 查询工单非空数量必须为1个
if (lstWorkorder != null && lstWorkorder.Count == 1)
{
string isArrange = "0";