This commit is contained in:
tongfei
2024-04-08 14:11:10 +08:00
2 changed files with 2 additions and 2 deletions

View File

@@ -114,9 +114,9 @@ namespace WMS.Web.Domain.Services
}
else
{
//有原箱的情况下验证序列号和原箱是否一致
//有原箱的情况下验证序列号和原箱是否一致(排除没有绑定箱的老ops条码数据)
var s = d.Details.SelectMany(s => s.SerialNumbers).ToList();
var boxCount = serialNumberList.Where(w => s.Contains(w.SerialNumber)).GroupBy(s => s.BoxId).Select(s => s.Key).ToList();
var boxCount = serialNumberList.Where(w => !(w.BoxId == 0 && w.Creator == "ops")).Where(w => s.Contains(w.SerialNumber)).GroupBy(s => s.BoxId).Select(s => s.Key).ToList();
if (boxCount.Count() > 1 || (boxCount.Count() == 1 && boxCount[0] != d.SrcBoxId))
return Result.ReFailure(ResultCodes.SerialNumbersSrcBoxError);
}