From 1dc37a61ba7b8233a2140c8747b0989d286709df Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 21 Jul 2023 17:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=EF=BC=8C=E4=BB=BB=E5=8A=A1=E9=93=BE=E7=BC=96=E5=8F=B7=E8=B5=8B?= =?UTF-8?q?=E5=80=BC=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 8afd27da..c0b294a5 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -203,8 +203,8 @@ namespace Tnb.WarehouseMgr else if ((moveNum > areaPreTasks.Count && areaPreTasks.Count > 1) || moveNum < areaPreTasks.Count) { items.ForEach(x => x.is_chain = 1); - var mod = items.Count % moveNum > 0 ? items.Count / moveNum + 1 : items.Count / moveNum; var itemsCount = items.Count; + var mod = items.Count % moveNum > 0 ? itemsCount / moveNum + 1 : itemsCount / moveNum; var start = 0; var end = Math.Min(itemsCount, moveNum); var arrary = items.ToArray(); @@ -218,14 +218,7 @@ namespace Tnb.WarehouseMgr subArray[j].bill_code = $"{groupCode}-{i}"; } start = end; - if ((end + moveNum) >= arrary.Length) - { - end = arrary.Length; - } - else - { - end = end + moveNum; - } + end = Math.Min((end + moveNum), arrary.Length); } } });