This commit is contained in:
杰 朱
2021-06-16 09:06:27 +08:00

View File

@@ -23,11 +23,18 @@ namespace NX.ERP.U8.MES
} }
foreach (var detail in info.OrderDetails) foreach (var detail in info.OrderDetails)
{ {
var momOrderDetail = momOrder.ProductDtlLst.First(m => { return m.ProductOrderDtlId == detail.SourceDetailId; }); //校验明细行合法性
var momOrderDetail = momOrder.ProductDtlLst.FirstOrDefault(m => { return m.ProductOrderDtlId == detail.SourceDetailId; });
if (momOrderDetail == null || momOrderDetail.ProductOrderDtlId <= 0) if (momOrderDetail == null || momOrderDetail.ProductOrderDtlId <= 0)
{ {
throw new Exception($"非法的生产明细[{detail.SourceDetailId}]"); throw new Exception($"非法的生产明细[{detail.SourceDetailId}]");
} }
//校验SN合法性
var lstExcept = detail.SnList.Except(momOrderDetail.SN).ToList();
if (lstExcept.Count > 0)
{
throw new Exception($"包含非法的序列号[{string.Join(",", lstExcept.ToArray())}]");
}
} }
#endregion #endregion