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); } } });