电梯优化

This commit is contained in:
2024-08-22 14:53:21 +08:00
parent 4ce0a58715
commit 20043b879d
10 changed files with 264 additions and 130 deletions

View File

@@ -13,6 +13,7 @@ using JNPF.EventHandler;
using JNPF.Logging;
using JNPF.Systems.Entitys.System;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
@@ -382,11 +383,11 @@ namespace Tnb.WarehouseMgr
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
}
if (doorStatus == (int)EnumDoorStatus. && s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.)
{
Logger.Information($"【UnloadConfirm】 电梯当前在s_eleUseStatusDic中的状态为占用");
await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
}
//if (doorStatus == (int)EnumDoorStatus.开门到位保持 && s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus.占用)
//{
// Logger.Information($"【UnloadConfirm】 电梯当前在s_eleUseStatusDic中的状态为占用");
// await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
//}
//电梯到达目标楼层后,判断当前电梯门状态是否为开门到位保持状态
if (doorStatus != (int)EnumDoorStatus. && s_eleUseStatusDic[elevator.device_id] == (int)EnumElevatorUseStatus. && curFloor == floorNo) //判断目标楼层与电梯所在楼层在同一层才可开门放货
{
@@ -398,6 +399,17 @@ namespace Tnb.WarehouseMgr
bool canEnter = false;
if (devName == "Elevator3" || devName == "Elevator4")
{
string sno = devName.Match(@"\d+");
List<WmsDistaskH> elevatorTasks = _db.Queryable<WmsDistaskH>()
.Where(r => r.startlocation_code == $"DT-3-{sno}" && r.endlocation_code == $"DT-1-{sno}" && r.act_start_date == null && r.act_end_date == null
&& r.status != WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID && r.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).ToList();
List<WmsDistaskH> elevatorTasks2 = _db.Queryable<WmsDistaskH>()
.Where(r => r.startlocation_code.Contains($"DT-3") && r.endlocation_code.Contains($"DT-1") && r.act_start_date == null && r.act_end_date == null
&& r.status != WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID && r.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).ToList();
if (elevatorTasks.Count >= 2)
{
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯内已有两托货!");
}
canEnter = true;
}