diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index eabdffe4..8afd27da 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -197,22 +197,25 @@ namespace Tnb.WarehouseMgr { x.is_chain = 0; }); - items[^items.Count].groups = $"{groupCode}-1"; + items[0].groups = groupCode; + items[0].bill_code = $"{groupCode}-1"; } 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; - int start = 0, end = moveNum; - var arrary = items.ToArray(); var itemsCount = items.Count; + var start = 0; + var end = Math.Min(itemsCount, moveNum); + var arrary = items.ToArray(); for (int i = 1; i <= mod; i++) { if (start >= itemsCount) break; var subArray = arrary[start..end]; for (int j = 0, arrLen = subArray.Length; j < arrLen; j++) { - subArray[j].groups = $"{groupCode}-{i}"; + subArray[j].groups = groupCode; + subArray[j].bill_code = $"{groupCode}-{i}"; } start = end; if ((end + moveNum) >= arrary.Length) @@ -255,7 +258,7 @@ namespace Tnb.WarehouseMgr { items[i].id = SnowflakeIdHelper.NextId(); items[i].status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID; - items[i].bill_code = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE); + //items[i].groups = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE); } if (moveNum == 1) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs index 35b71c63..c224d1a2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs @@ -341,20 +341,6 @@ namespace Tnb.WarehouseMgr if (input.IsNull()) throw new ArgumentNullException(nameof(input)); try { - //var kittingOut = input[^1]; - //if ((!kittingOut.carry_id.IsNullOrEmpty() || !kittingOut.carry_code.IsNullOrEmpty()) && !kittingOut.location_code.IsNullOrEmpty()) - //{ - // WmsCarryH? curCarry = null; - // if (!kittingOut.carry_id.IsNullOrEmpty()) - // curCarry = await _db.Queryable().SingleAsync(it => it.id == kittingOut.carry_id); - // else - // curCarry = await _db.Queryable().FirstAsync(it => it.carry_code == kittingOut.carry_code); - - // var endLocation = await _db.Queryable().SingleAsync(it => it.id == kittingOut.location_code); - // var isMatch = await IsCarryAndLocationMatchByCarryStd(curCarry, endLocation); - // if (!isMatch) throw new AppFriendlyException("该载具无法放置到目标库位", 500); - - //} await _db.Ado.BeginTranAsync();