This commit is contained in:
2023-11-23 15:53:18 +08:00
7 changed files with 75 additions and 21 deletions

View File

@@ -5,9 +5,9 @@
/// </summary>
public enum EnumTaskChainType
{
AGV = 1,
CTU = 1,
KIVA = 2,
CTU = 3,
AGV = 3,
= 4,
线 = 5,
}

View File

@@ -238,14 +238,17 @@ namespace Tnb.WarehouseMgr
List<WmsElevatorH> elevatorList = await db.Queryable<WmsElevatorH>().InnerJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
.Select((a, b) => new WmsElevatorH
{
bill_id = b.bill_id,
location_id = b.location_id,
location_code = b.location_code,
point_id = b.point_id,
point_code = b.point_code,
floor = b.floor
}, true).ToListAsync();
Logger.Information($"elevatorList:{JsonConvert.SerializeObject(elevatorList)}");
//获取所有未下发的预任务申请
List<WmsPretaskH> preTasks = await db.Queryable<WmsPretaskH>().InnerJoin<WmsCarryH>((a, b) => a.startlocation_id == b.location_id && a.carry_id == b.id)
@@ -370,6 +373,9 @@ namespace Tnb.WarehouseMgr
if (endPointIds?.Count > 0)
{
elevatorList = elevatorList.FindAll(x => endPointIds.Contains(x.point_id));
Logger.Information($"过滤后的elevatorList{JsonConvert.SerializeObject(elevatorList)}");
if (elevatorList?.Count > 0)
{
foreach (WmsElevatorH? e in elevatorList)
@@ -460,11 +466,12 @@ namespace Tnb.WarehouseMgr
private async Task CallingLanding(List<(string endlocation_code, string device_id, string id, string floorNO)> endLocCodes)
{
Logger.Information($" 开始呼梯操作.............");
Logger.Information($"电梯信息:{JsonConvert.SerializeObject(s_elevatorMap)}");
try
{
foreach ((_, string devId, string disTaskId, string floorNO) in endLocCodes)
{
Logger.Information($"devId:{devId}");
if (!s_elevatorMap.TryGetValue(devId, out object? elevatorCode))
{
continue;
@@ -1041,22 +1048,18 @@ namespace Tnb.WarehouseMgr
{
if (points.FindAll(x => x.location_code != null && x.location_code.Contains("dt", StringComparison.OrdinalIgnoreCase))?.Count > 0)
{
Logger.Information("获取当前电梯点");
//查询当前电梯点
List<WmsElevatorD> curEleDs = await _db.Queryable<WmsElevatorD>().Where(it => points.Select(x => x.id).Contains(it.point_id)).ToListAsync();
Logger.Information($"当前电梯点:{string.Join(",",curEleDs.Select(x=>x.point_code))}");
//如果有电梯点,则会进行电梯的均匀分配
if (curEleDs?.Count > 0)
{
//当前电梯
WmsElevatorH curEle = await _db.Queryable<WmsElevatorH>().SingleAsync(it => it.id == curEleDs.First().bill_id && it.enabled == 1);
Logger.Debug($"档期电梯信息:{JsonConvert.SerializeObject(curEle)}");
//同电梯组电梯
List<WmsElevatorH> sGpEle = await _db.Queryable<WmsElevatorH>().Where(it => it.elevator_group == curEle.elevator_group && it.id != curEle.id && it.enabled == 1).ToListAsync();
Logger.Debug($"同电梯组电梯:{JsonConvert.SerializeObject(sGpEle)}");
if (curEle == null && sGpEle?.Count > 0)
{