调整盘点任务,新建重写的逻辑代码
This commit is contained in:
@@ -93,7 +93,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
Task.Run(() => FetchDisTasks((a, b) => a.endlocation_id == b.id, filter))
|
Task.Run(() => FetchDisTasks((a, b) => a.endlocation_id == b.id, filter))
|
||||||
};
|
};
|
||||||
List<WmsDistaskH>[] disTasks = await Task.WhenAll(queryTasks);
|
List<WmsDistaskH>[] disTasks = await Task.WhenAll(queryTasks);
|
||||||
if (disTasks?.Length > 0)
|
if (disTasks?.Length > 0 && disTasks.All(list => list?.Count > 0))
|
||||||
{
|
{
|
||||||
throw new AppFriendlyException("该仓库还有未完成的任务,不允许盘点!", 500);
|
throw new AppFriendlyException("该仓库还有未完成的任务,不允许盘点!", 500);
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
private Task<List<WmsDistaskH>> FetchDisTasks(Expression<Func<WmsDistaskH, BasLocation, bool>> joinExp, Expression<Func<WmsDistaskH, BasLocation, bool>> whereExp)
|
private Task<List<WmsDistaskH>> FetchDisTasks(Expression<Func<WmsDistaskH, BasLocation, bool>> joinExp, Expression<Func<WmsDistaskH, BasLocation, bool>> whereExp)
|
||||||
{
|
{
|
||||||
return _db.Queryable<WmsDistaskH>().InnerJoin<BasLocation>(joinExp).Where(whereExp).Select<WmsDistaskH>().ToListAsync();
|
return _db.CopyNew().Queryable<WmsDistaskH>().InnerJoin<BasLocation>(joinExp).Where(whereExp).Select<WmsDistaskH>().ToListAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据盘点类型获取任务明细
|
/// 根据盘点类型获取任务明细
|
||||||
|
|||||||
Reference in New Issue
Block a user