From 347d8676fb7472d40dfe0018538303d96e6635e9 Mon Sep 17 00:00:00 2001 From: "yang.lee" Date: Tue, 14 Nov 2023 15:44:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=98=E7=82=B9=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E6=96=B0=E5=BB=BA=E9=87=8D=E5=86=99=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs index 7397255a..51565264 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs @@ -93,7 +93,7 @@ namespace Tnb.WarehouseMgr Task.Run(() => FetchDisTasks((a, b) => a.endlocation_id == b.id, filter)) }; List[] disTasks = await Task.WhenAll(queryTasks); - if (disTasks?.Length > 0) + if (disTasks?.Length > 0 && disTasks.All(list => list?.Count > 0)) { throw new AppFriendlyException("该仓库还有未完成的任务,不允许盘点!", 500); } @@ -273,7 +273,8 @@ namespace Tnb.WarehouseMgr private Task> FetchDisTasks(Expression> joinExp, Expression> whereExp) { - return _db.Queryable().InnerJoin(joinExp).Where(whereExp).Select().ToListAsync(); + return _db.CopyNew().Queryable().InnerJoin(joinExp).Where(whereExp).Select().ToListAsync(); + } /// /// 根据盘点类型获取任务明细