MES成品提交接口,增加SN合法性校验
This commit is contained in:
@@ -23,11 +23,18 @@ namespace NX.ERP.U8.MES
|
||||
}
|
||||
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)
|
||||
{
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user