|
@@ -548,8 +548,10 @@ namespace WCS.WorkEngineering.Systems
|
|
|
["3"] = ("3301", "3501")
|
|
|
};
|
|
|
|
|
|
+ var oldWarehouseCode = task.WarehouseCode;
|
|
|
// 检查是否需要更新 warehouseCode
|
|
|
if (task.BusType == TaskBusType.皮盘入库.GetDescription() || task.BusType == TaskBusType.车间叫料.GetDescription())
|
|
|
+ {
|
|
|
task.WarehouseCode = task.MaterialCode switch
|
|
|
{
|
|
|
"分拣库1北" => "1N",
|
|
@@ -560,6 +562,7 @@ namespace WCS.WorkEngineering.Systems
|
|
|
"分拣库3南" => "3S",
|
|
|
_ => task.WarehouseCode
|
|
|
};
|
|
|
+ }
|
|
|
|
|
|
// 确定站台初始值
|
|
|
if (stationMap.TryGetValue(task.WarehouseCode[0].ToString(), out var stationPair))
|
|
@@ -595,6 +598,7 @@ namespace WCS.WorkEngineering.Systems
|
|
|
// 判断是否需要在三个分拣中心中选取任务数量较少的一侧进行分配
|
|
|
currentTaskCount = GetStationTaskCount(db, sta);
|
|
|
if (currentTaskCount > num)
|
|
|
+ {
|
|
|
sta = db.Default.Queryable<WCS_AgvTaskInfo>()
|
|
|
.NoLock()
|
|
|
.Where(v => v.Status >= AGVTaskStatus.Confirm && v.Status < AGVTaskStatus.Complete1 &&
|
|
@@ -606,7 +610,9 @@ namespace WCS.WorkEngineering.Systems
|
|
|
.Select(g => new { Station = g.Key, Count = g.Count() })
|
|
|
.OrderBy(x => x.Count)
|
|
|
.FirstOrDefault()?.Station ?? defaultStation;
|
|
|
+ }
|
|
|
|
|
|
+ task.WarehouseCode = oldWarehouseCode;
|
|
|
return sta;
|
|
|
}
|
|
|
|