2024-11-25 10:46:38 +08:00
|
|
|
|
using System.Runtime;
|
|
|
|
|
|
using System.Text.RegularExpressions;
|
2024-11-23 09:35:06 +08:00
|
|
|
|
using CirculateTool.Attribute;
|
2024-11-15 11:37:55 +08:00
|
|
|
|
using WcsMain.ApiClient.AGV;
|
|
|
|
|
|
using WcsMain.ApiClient.Shuttle;
|
|
|
|
|
|
using WcsMain.Constant.Enum.General;
|
|
|
|
|
|
using WcsMain.Constant.Enum.Stacker;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
using WcsMain.DataBase.Dao;
|
|
|
|
|
|
using WcsMain.DataBase.TableEntity;
|
|
|
|
|
|
using WcsMain.EquipOperation.StackerConvey;
|
|
|
|
|
|
|
2024-11-15 11:37:55 +08:00
|
|
|
|
namespace WcsMain.CirculationJob.Stacker;
|
2024-10-07 09:59:48 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/// 执行仓库任务
|
2024-10-07 09:59:48 +08:00
|
|
|
|
/// </summary>
|
2024-11-14 12:06:40 +08:00
|
|
|
|
[Circulation]
|
2024-11-15 11:37:55 +08:00
|
|
|
|
public class ExecuteWmsTask(AppWmsTaskDao wmsTaskDao, StackerConveyOperation stackerConveyOperation, AGVWebApiAction agvAction, ShuttleWebApiAction containerAction, AppLiftInfoDao liftInfoDao)
|
2024-10-07 09:59:48 +08:00
|
|
|
|
{
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 开始执行任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[Circulation("执行任务", 1000)]
|
|
|
|
|
|
public bool ExecuteWmsTaskStarter()
|
|
|
|
|
|
{
|
|
|
|
|
|
/* 执行任务列表任务 */
|
|
|
|
|
|
List<AppWmsTask>? wmsTasks = wmsTaskDao.Select(new AppWmsTask() { TaskStatus = (int)WmsTaskStatusEnum.create });
|
2024-11-15 11:37:55 +08:00
|
|
|
|
if (wmsTasks == default)
|
2024-11-14 12:06:40 +08:00
|
|
|
|
{
|
|
|
|
|
|
ConsoleLog.Error("【异常】解析Wms任务时拉取任务列表失败,与数据库连接中断");
|
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
wmsTasks.ForEach(ExecuteTask);
|
|
|
|
|
|
/* 出库站台发送AGV接续任务 */
|
|
|
|
|
|
ExecuteAGVOutTask();
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 执行对应的任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="wmsTask"></param>
|
|
|
|
|
|
private void ExecuteTask(AppWmsTask wmsTask)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (wmsTask.TaskType)
|
|
|
|
|
|
{
|
|
|
|
|
|
case (int)WmsTaskTypeEnum.agv: // AGV 点对点搬运
|
|
|
|
|
|
ExecuteAGVTask(wmsTask);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case (int)WmsTaskTypeEnum.outTask:
|
|
|
|
|
|
ExecuteOutTask(wmsTask);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case (int)WmsTaskTypeEnum.inTask:
|
|
|
|
|
|
ExecuteInTask(wmsTask);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case (int)WmsTaskTypeEnum.moveTask:
|
|
|
|
|
|
ExecuteMoveTask(wmsTask);
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 执行 AGV 任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="wmsTask"></param>
|
|
|
|
|
|
private void ExecuteAGVTask(AppWmsTask wmsTask)
|
|
|
|
|
|
{
|
2024-11-25 10:46:38 +08:00
|
|
|
|
string[] stand = ["FaaZHG", "kzxhes", "yDN8ZZ", "6cDXzi", "ranQyi", "SxjX8e", "jC6x3C", "MSP3te"];
|
|
|
|
|
|
if (string.IsNullOrEmpty(wmsTask.Destination)) return;
|
|
|
|
|
|
if (stand.Contains(wmsTask.Destination))
|
|
|
|
|
|
{
|
|
|
|
|
|
// 获取终点的任务,没有任务可以发送
|
|
|
|
|
|
List<AppWmsTask> tasks = [];
|
|
|
|
|
|
tasks.AddRange(wmsTaskDao.SelectRunningTask(wmsTask.Destination) ?? []);
|
|
|
|
|
|
if (tasks == default || tasks.Count > 0) return;
|
|
|
|
|
|
}
|
2024-11-14 12:06:40 +08:00
|
|
|
|
string errText = agvAction.Send_NO_VERIFY_BUCKET_MOVE(wmsTask);
|
2024-11-15 11:37:55 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(errText))
|
2024-11-14 12:06:40 +08:00
|
|
|
|
{
|
|
|
|
|
|
ConsoleLog.Warning($"【警告】AGV点对点搬运请求AGV服务失败,任务号:{wmsTask.TaskId},异常信息:{errText}");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
ConsoleLog.Success($"AGV点对点搬运请求AGV服务成功,任务号:{wmsTask.TaskId}");
|
|
|
|
|
|
/* 更新任务状态为执行中 */
|
2024-11-18 20:43:35 +08:00
|
|
|
|
var updateResult = wmsTaskDao.Update(new() { TaskId = wmsTask.TaskId, TaskStatus = (int)WmsTaskStatusEnum.running, StartTime = DateTime.Now, ModifyTime = DateTime.Now });
|
2024-11-14 12:06:40 +08:00
|
|
|
|
ConsoleLog.Success($"更新任务状态结果:{(updateResult > 0 ? "成功" : "失败")},任务号:{wmsTask.TaskId}");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-18 20:48:41 +08:00
|
|
|
|
/// 执行入库任务 --- AGV搬运
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="wmsTask"></param>
|
|
|
|
|
|
private void ExecuteInTask(AppWmsTask wmsTask)
|
|
|
|
|
|
{
|
2024-11-20 22:35:08 +08:00
|
|
|
|
string? midPoint = wmsTask.MidPoint;
|
2024-11-23 09:35:06 +08:00
|
|
|
|
if (string.IsNullOrEmpty(wmsTask.Origin) || Regex.IsMatch(wmsTask.Origin, "^\\d+$")) return;
|
2024-11-20 22:35:08 +08:00
|
|
|
|
if (string.IsNullOrEmpty(midPoint))
|
|
|
|
|
|
{
|
|
|
|
|
|
midPoint = GetEmptyInLift(wmsTask.Destination);
|
|
|
|
|
|
}
|
2024-11-14 12:06:40 +08:00
|
|
|
|
if (string.IsNullOrEmpty(midPoint)) return; // 没有可用的站台
|
|
|
|
|
|
/* 发送AGV 搬运任务 */
|
2024-11-20 22:35:08 +08:00
|
|
|
|
string errText = agvAction.Send_AGV_TASK(wmsTask.TaskId, wmsTask.Origin, midPoint, 1);
|
2024-11-15 11:37:55 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(errText))
|
|
|
|
|
|
{
|
2024-11-14 12:06:40 +08:00
|
|
|
|
ConsoleLog.Warning($"【警告】入库请求AGV搬运失败,任务号:{wmsTask.TaskId},异常信息:{errText}");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
ConsoleLog.Success($"入库搬运请求AGV成功,任务号:{wmsTask.TaskId}");
|
|
|
|
|
|
/* 更新任务状态为前往中间点,更新中间点 */
|
2024-11-18 20:43:35 +08:00
|
|
|
|
var updateResult = wmsTaskDao.Update(new() { TaskId = wmsTask.TaskId, MidPoint = midPoint, TaskStatus = (int)WmsTaskStatusEnum.toMid, StartTime = DateTime.Now, ModifyTime = DateTime.Now });
|
2024-11-14 12:06:40 +08:00
|
|
|
|
ConsoleLog.Success($"更新任务状态结果:{(updateResult > 0 ? "成功" : "失败")},任务号:{wmsTask.TaskId}");
|
|
|
|
|
|
/* 四向车任务有接口返回给四向车 */
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 执行出库任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="wmsTask"></param>
|
2024-11-15 11:37:55 +08:00
|
|
|
|
private void ExecuteOutTask(AppWmsTask wmsTask)
|
2024-11-14 12:06:40 +08:00
|
|
|
|
{
|
2024-11-18 20:48:41 +08:00
|
|
|
|
string? midPoint = wmsTask.MidPoint;
|
|
|
|
|
|
if(string.IsNullOrEmpty(midPoint))
|
|
|
|
|
|
{
|
|
|
|
|
|
midPoint = GetEmptyOutLift(wmsTask.Origin);
|
|
|
|
|
|
}
|
2024-11-15 11:37:55 +08:00
|
|
|
|
if (string.IsNullOrEmpty(midPoint)) return; // 没有可用站台
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/* 发送四向车搬运任务 */
|
2024-11-18 20:43:35 +08:00
|
|
|
|
string? errText = containerAction.ExecuteOutTask(wmsTask.WcsId, wmsTask.Origin, midPoint, wmsTask.VehicleNo);
|
2024-11-14 12:06:40 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(errText))
|
|
|
|
|
|
{
|
2024-11-16 09:25:44 +08:00
|
|
|
|
ConsoleLog.Warning($"【警告】出库请求四向车搬运失败,任务号:{wmsTask.TaskId},异常信息:{errText}");
|
2024-11-14 12:06:40 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-11-18 20:43:35 +08:00
|
|
|
|
ConsoleLog.Success($"出库搬运请求四向车成功,任务号:{wmsTask.TaskId}/{wmsTask.WcsId}");
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/* 更新任务状态为前往中间点,更新中间点 */
|
2024-11-18 20:43:35 +08:00
|
|
|
|
var updateResult = wmsTaskDao.Update(new() { TaskId = wmsTask.TaskId, MidPoint = midPoint, TaskStatus = (int)WmsTaskStatusEnum.toMid, StartTime = DateTime.Now, ModifyTime = DateTime.Now });
|
2024-11-14 12:06:40 +08:00
|
|
|
|
ConsoleLog.Success($"更新任务状态结果:{(updateResult > 0 ? "成功" : "失败")},任务号:{wmsTask.TaskId}");
|
|
|
|
|
|
/* AGV接续任务由定时器触发 */
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 执行 四向车库移库任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="wmsTask"></param>
|
|
|
|
|
|
private void ExecuteMoveTask(AppWmsTask wmsTask)
|
|
|
|
|
|
{
|
|
|
|
|
|
string errText = containerAction.ExecuteMoveTask(wmsTask);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(errText))
|
|
|
|
|
|
{
|
2024-11-18 20:43:35 +08:00
|
|
|
|
ConsoleLog.Warning($"四向车移库任务请求四向车服务失败,任务号:{wmsTask.TaskId}/{wmsTask.WcsId},异常信息:{errText}");
|
2024-11-14 12:06:40 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-11-18 20:43:35 +08:00
|
|
|
|
ConsoleLog.Success($"四向车移库任务请求四向车服务成功,任务号:{wmsTask.TaskId}/{wmsTask.WcsId}");
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/* 更新任务状态为执行中 */
|
2024-11-18 20:43:35 +08:00
|
|
|
|
var updateResult = wmsTaskDao.Update(new() { TaskId = wmsTask.TaskId, TaskStatus = (int)WmsTaskStatusEnum.running, StartTime = DateTime.Now, ModifyTime = DateTime.Now });
|
2024-11-14 12:06:40 +08:00
|
|
|
|
ConsoleLog.Success($"更新任务状态结果:{(updateResult > 0 ? "成功" : "失败")},任务号:{wmsTask.TaskId}");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 执行AGV出库任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void ExecuteAGVOutTask()
|
|
|
|
|
|
{
|
|
|
|
|
|
List<AppLiftInfo>? liftInfos = liftInfoDao.Query(new() { Status = (int)TrueFalseEnum.TRUE });
|
|
|
|
|
|
if (liftInfos == default || liftInfos.Count < 1) return;
|
|
|
|
|
|
foreach (var liftInfo in liftInfos)
|
|
|
|
|
|
{
|
|
|
|
|
|
(string errText, short model, short allowAction, short errCode, string code) = stackerConveyOperation.GetLiftInfo(liftInfo.LiftId ?? "");
|
|
|
|
|
|
if (!string.IsNullOrEmpty(errText))
|
|
|
|
|
|
{
|
2024-11-20 22:35:08 +08:00
|
|
|
|
//ConsoleLog.Warning($"【警告】提升机站台信息获取失败,异常信息:{errText}");
|
2024-11-14 12:06:40 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (model != 2 || allowAction != (short)TrueFalseEnum.TRUE || errCode != 0) continue; // 不满足执行条件
|
|
|
|
|
|
/* 查找出库任务 */
|
|
|
|
|
|
List<AppWmsTask>? tasks = wmsTaskDao.Select(new() { VehicleNo = code, TaskStatus = (int)WmsTaskStatusEnum.arriveMid })?.OrderByDescending(o => o.CreateTime).ToList();
|
2024-11-15 11:37:55 +08:00
|
|
|
|
if (tasks == null || tasks.Count == 0) continue;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
var task = tasks.First();
|
2024-11-18 20:48:41 +08:00
|
|
|
|
if (string.IsNullOrEmpty(task.Destination)) continue;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/* 下发任务 */
|
2024-11-20 22:35:08 +08:00
|
|
|
|
string agvErrText = agvAction.Send_AGV_TASK(task.TaskId, GetAgvNo(task.MidPoint), task.Destination);
|
2024-11-14 12:06:40 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(agvErrText))
|
|
|
|
|
|
{
|
|
|
|
|
|
ConsoleLog.Warning($"【警告】AGV出库任务请求AGV服务失败,任务号:{task.TaskId},异常信息:{agvErrText}");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
/* 更新任务状态为前往终点 */
|
|
|
|
|
|
var updateResult = wmsTaskDao.Update(new() { TaskId = task.TaskId, TaskStatus = (int)WmsTaskStatusEnum.toDestination, ModifyTime = DateTime.Now });
|
|
|
|
|
|
ConsoleLog.Success($"更新任务状态结果:{(updateResult > 0 ? "成功" : "失败")},任务号:{task.TaskId}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取一个空闲的入库站台
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="destination"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private string? GetEmptyInLift(string? destination)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(destination)) return default;
|
|
|
|
|
|
List<AppLiftInfo>? liftInfos = liftInfoDao.Query(new() { Status = (int)TrueFalseEnum.TRUE });
|
|
|
|
|
|
if (liftInfos == default || liftInfos.Count < 1) return default;
|
|
|
|
|
|
foreach (var liftInfo in liftInfos)
|
|
|
|
|
|
{
|
|
|
|
|
|
(string errText, short model, short allowAction, short errCode, string code) = stackerConveyOperation.GetLiftInfo(liftInfo.LiftId ?? "");
|
2024-11-15 11:37:55 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(errText))
|
2024-11-14 12:06:40 +08:00
|
|
|
|
{
|
2024-11-20 22:35:08 +08:00
|
|
|
|
//ConsoleLog.Warning($"【警告】提升机站台信息获取失败,异常信息:{errText}");
|
2024-11-14 12:06:40 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (model != 1 || allowAction != (short)TrueFalseEnum.TRUE || errCode != 0) continue;
|
|
|
|
|
|
/* 检验任务是否是第一层,若是不是第一层不能分配第一层出入口 */
|
2024-11-25 10:46:38 +08:00
|
|
|
|
if (!destination.EndsWith('1'))
|
2024-11-14 12:06:40 +08:00
|
|
|
|
{
|
2024-11-25 10:46:38 +08:00
|
|
|
|
if (liftInfo.LiftMode == 2) continue;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
/* 获取这个站台的任务.没有占用任务即可重新使用 */
|
2024-11-22 08:08:45 +08:00
|
|
|
|
List<AppWmsTask> tasks = [];
|
|
|
|
|
|
tasks.AddRange(wmsTaskDao.Select(new() { MidPoint = liftInfo.Tag!.Split(',')[0], TaskStatus = (int)WmsTaskStatusEnum.toMid }) ?? []);
|
|
|
|
|
|
tasks.AddRange(wmsTaskDao.Select(new() { MidPoint = liftInfo.Tag!.Split(',')[1], TaskStatus = (int)WmsTaskStatusEnum.toMid }) ?? []);
|
2024-11-25 10:46:38 +08:00
|
|
|
|
tasks.AddRange(wmsTaskDao.Select(new() { MidPoint = liftInfo.Tag!.Split(',')[0], TaskStatus = (int)WmsTaskStatusEnum.arriveMid }) ?? []);
|
|
|
|
|
|
tasks.AddRange(wmsTaskDao.Select(new() { MidPoint = liftInfo.Tag!.Split(',')[1], TaskStatus = (int)WmsTaskStatusEnum.arriveMid }) ?? []);
|
2024-11-14 12:06:40 +08:00
|
|
|
|
if (tasks == default || tasks.Count > 0) continue;
|
2024-11-16 09:25:44 +08:00
|
|
|
|
string location = "";
|
|
|
|
|
|
if (!string.IsNullOrEmpty(liftInfo.Tag))
|
|
|
|
|
|
{
|
|
|
|
|
|
location = liftInfo.Tag.Split(',')[1];
|
|
|
|
|
|
}
|
|
|
|
|
|
return location;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
return default;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取一个空闲的出库站台
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="origin"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private string? GetEmptyOutLift(string? origin)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(origin)) return default;
|
|
|
|
|
|
Dictionary<string, int> liftTaskCount = [];
|
|
|
|
|
|
List<AppLiftInfo>? liftInfos = liftInfoDao.Query(new() { Status = (int)TrueFalseEnum.TRUE });
|
|
|
|
|
|
if (liftInfos == default || liftInfos.Count < 1) return default;
|
|
|
|
|
|
foreach (var liftInfo in liftInfos)
|
|
|
|
|
|
{
|
|
|
|
|
|
(string errText, short model, short allowAction, short errCode, string code) = stackerConveyOperation.GetLiftInfo(liftInfo.LiftId ?? "");
|
|
|
|
|
|
if (!string.IsNullOrEmpty(errText))
|
|
|
|
|
|
{
|
2024-11-20 22:35:08 +08:00
|
|
|
|
//ConsoleLog.Warning($"【警告】提升机站台信息获取失败,异常信息:{errText}");
|
2024-11-14 12:06:40 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2024-11-18 20:43:35 +08:00
|
|
|
|
if (model != 2 || allowAction != (short)TrueFalseEnum.FALSE || errCode != 0) continue;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
/* 检验任务是否是第一层,若是不是第一层不能分配第一层出入口 */
|
2024-11-25 10:46:38 +08:00
|
|
|
|
if (!origin.EndsWith('1'))
|
2024-11-14 12:06:40 +08:00
|
|
|
|
{
|
2024-11-18 20:43:35 +08:00
|
|
|
|
if (liftInfo.LiftMode == 2) continue;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
/* 获取这个站台的任务.并计数 */
|
2024-11-22 08:08:45 +08:00
|
|
|
|
List<AppWmsTask> tasks = [];
|
|
|
|
|
|
tasks.AddRange(wmsTaskDao.Select(new() { MidPoint = liftInfo.Tag!.Split(',')[0], TaskStatus = (int)WmsTaskStatusEnum.toMid }) ?? []);
|
|
|
|
|
|
tasks.AddRange(wmsTaskDao.Select(new() { MidPoint = liftInfo.Tag!.Split(',')[1], TaskStatus = (int)WmsTaskStatusEnum.toMid }) ?? []);
|
2024-11-14 12:06:40 +08:00
|
|
|
|
if (tasks == default) continue;
|
2024-11-16 09:25:44 +08:00
|
|
|
|
string location = "";
|
|
|
|
|
|
if(!string.IsNullOrEmpty(liftInfo.Tag))
|
|
|
|
|
|
{
|
|
|
|
|
|
location = liftInfo.Tag.Split(',')[0];
|
|
|
|
|
|
}
|
|
|
|
|
|
liftTaskCount.TryAdd(location, tasks.Count);
|
2024-11-14 12:06:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
var sortLiftInfos = liftTaskCount.OrderBy(o => o.Value).ToDictionary();
|
2024-11-15 11:37:55 +08:00
|
|
|
|
if (sortLiftInfos.Count > 0) return sortLiftInfos.First().Key;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
return default;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-07 09:59:48 +08:00
|
|
|
|
|
2024-11-20 22:35:08 +08:00
|
|
|
|
|
|
|
|
|
|
private string? GetAgvNo(string? lift)
|
|
|
|
|
|
{
|
|
|
|
|
|
List<AppLiftInfo>? liftInfos = liftInfoDao.Query(new() { Status = (int)TrueFalseEnum.TRUE });
|
|
|
|
|
|
if (liftInfos == default || liftInfos.Count < 1) return default;
|
|
|
|
|
|
AppLiftInfo? appLiftInfo = liftInfos.Find(f => f.Tag!.Contains(lift!));
|
|
|
|
|
|
if (appLiftInfo == null) return default;
|
|
|
|
|
|
return appLiftInfo.Tag?.Split(',')[1];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-07 09:59:48 +08:00
|
|
|
|
}
|