优化
This commit is contained in:
@@ -73,8 +73,13 @@ namespace WMS.Web.Domain.Services
|
|||||||
//回退上下架:不能扫同样的箱,按箱入库时候
|
//回退上下架:不能扫同样的箱,按箱入库时候
|
||||||
if (dto.Details != null && dto.Details.Count != 0 && dto.Method== (int)InventoryInOutMethod.Box)
|
if (dto.Details != null && dto.Details.Count != 0 && dto.Method== (int)InventoryInOutMethod.Box)
|
||||||
{
|
{
|
||||||
if (dto.Details.Select(x => x.BoxId).Distinct().Count() != dto.Details.Select(x => x.BoxId).Count())
|
var mIds = dto.Details.GroupBy(g => g.MaterialNumber).Select(s => s.Key).ToList();
|
||||||
return Result<InStock>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
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.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
IDbContextTransaction _transaction = _basicsRepositories.GetTransaction();
|
IDbContextTransaction _transaction = _basicsRepositories.GetTransaction();
|
||||||
bool isRollback = false;
|
bool isRollback = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user