优化
This commit is contained in:
@@ -259,8 +259,13 @@ namespace WMS.Web.Domain.Services
|
||||
//入库的时候:不能扫同样的箱
|
||||
if (dto.Details != null && dto.Details.Count != 0)
|
||||
{
|
||||
if (dto.Details.Select(x => x.BoxId).Distinct().Count() != dto.Details.Select(x => x.BoxId).Count())
|
||||
return Result<InStock>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
||||
var mIds = dto.Details.GroupBy(g => g.MaterialNumber).Select(s => s.Key).ToList();
|
||||
foreach (var m in mIds)
|
||||
{
|
||||
var d_boxIds = dto.Details.Where(w => w.MaterialNumber == m).Select(s => s.BoxId);
|
||||
if (d_boxIds.Distinct().Count() != d_boxIds.Count())
|
||||
return Result<InStock>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
||||
}
|
||||
}
|
||||
|
||||
//1.获取来源单
|
||||
|
||||
Reference in New Issue
Block a user