Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -2008,9 +2008,15 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
// 一托货
|
||||
else if (group.Count() == 1)
|
||||
{
|
||||
// 如果当前电梯没有执行中的任务 则呼叫电梯下
|
||||
if (db_ElevatorTaskExceptionHandle.Queryable<WmsDistaskH>().Where(r => r.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID
|
||||
&& r.status != WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID && r.endlocation_id == wmsDistaskHs[0].startlocation_id).Count() == 0)
|
||||
// 如果当前电梯没有执行中且货位不同的任务 则呼叫电梯下
|
||||
List<WmsDistaskH> _wmsDistaskHs = await db_ElevatorTaskExceptionHandle.Queryable<WmsDistaskH>()
|
||||
.InnerJoin<WmsElevatorcacheArea>((a, b) => a.startlocation_id == b.location_id)
|
||||
.Where((a, b) => a.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID
|
||||
&& a.status != WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID && a.endlocation_id == wmsDistaskHs[0].startlocation_id
|
||||
&& !wmsElevator.innerpos.Contains(b.name)
|
||||
).ToListAsync();
|
||||
|
||||
if (_wmsDistaskHs.Count() == 0)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
@@ -2020,8 +2026,10 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】呼叫电梯 {e.elevator_code}");
|
||||
await _wareHouseService.ExecuteTargetFloorTask(wmsDistaskHs, db_ElevatorTaskExceptionHandle);
|
||||
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】呼叫电梯 {e.elevator_code}执行完成");
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】等待 {string.Join(',', _wmsDistaskHs.Select(r => r.carry_code ))}");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2467,6 +2475,13 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
{
|
||||
if (s_taskFloor4DMC2CPKService.CurrentCount == 0)
|
||||
return;
|
||||
var Floor4DMC2CPK = await db_Floor4DMC2CPK.Queryable<BasFactoryConfig>().Where(p => p.key == "Floor4DMC2CPK").FirstAsync();
|
||||
// 0则不进行移转
|
||||
if (Floor4DMC2CPK != null && Floor4DMC2CPK.value == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await s_taskFloor4DMC2CPKService.WaitAsync();
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
@@ -2504,11 +2519,16 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
continue;
|
||||
}
|
||||
|
||||
BasLocation startlocation = await db_Floor4DMC2CPK.Queryable<BasLocation>().Where(r => r.id == wmsCarryH.location_id).FirstAsync();
|
||||
|
||||
if (startlocation.is_lock == 1)
|
||||
{
|
||||
LoggerFloor4DMC2CPK.LogWarning($"【四楼待灭菌线到灭菌仓】 起点库位{startlocation.location_code}已锁定");
|
||||
continue;
|
||||
}
|
||||
await db_Floor4DMC2CPK.Ado.BeginTranAsync();
|
||||
|
||||
|
||||
BasLocation startlocation = await db_Floor4DMC2CPK.Queryable<BasLocation>().Where(r => r.id == wmsCarryH.location_id).FirstAsync();
|
||||
|
||||
InStockStrategyQuery inStockStrategyInput = new()
|
||||
{
|
||||
warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID,
|
||||
|
||||
@@ -436,6 +436,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 如果当前所放梯内货位已占用
|
||||
if (wmsElevatorH.innerpos.Contains(wmsElevatorcacheArea.name))
|
||||
{
|
||||
Logger.LogInformation($"电梯{devName}内托盘{dis.carry_code}当前准备放置的货位已有货!");
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, $"电梯{devName}内托盘{dis.carry_code}当前准备放置的货位已有货!");
|
||||
}
|
||||
|
||||
|
||||
@@ -2565,8 +2565,10 @@ namespace Tnb.WarehouseMgr
|
||||
await db.Updateable(carryHs).ExecuteCommandAsync();
|
||||
#region 电梯第三次改动
|
||||
|
||||
// 一托下的时候切换首选电梯
|
||||
if (disTaskIds.Count == 1)
|
||||
var _floor3FirstSelectElevator = await db_agvElevatorTaskExceptionHandles.Queryable<BasFactoryConfig>().Where(p => p.key == "floor3FirstSelectElevator").FirstAsync();
|
||||
// 一托下且当前电梯还没有后续任务且首选电梯为当前电梯的情况下,切换首选电梯为另一部
|
||||
int task_nums = db.Queryable<WmsElevatorH>().Where(r => r.elevator_code == devName).Sum(r => r.task_nums);
|
||||
if (disTaskIds.Count == 1 && task_nums == 1 && devName == _floor3FirstSelectElevator.value)
|
||||
{
|
||||
await ChangeSelectedElevator(db);
|
||||
}
|
||||
@@ -4539,7 +4541,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
List<BasLocation> locations = await db_agvElevatorTaskExceptionHandles.Queryable<BasLocation>()
|
||||
.InnerJoin<WmsElevatorcacheArea>((a, b) => a.id == b.location_id)
|
||||
.Where((a, b) => b.name == YCLInnerTransfer.value && a.is_use == "1" && a.is_lock == 0).OrderBy("a.location_code").ToListAsync();
|
||||
.Where((a, b) => b.name == 切换发货区 && a.is_use == "1" && a.is_lock == 0).OrderBy("a.location_code").ToListAsync();
|
||||
|
||||
startloc = locations.FirstOrDefault();
|
||||
#region 如果当前侧没有可用库位 切换另一侧继续发货,但是因为不能同时发两托同侧的货到同个电梯,所以必须保证当前优先级电梯是接第一托货
|
||||
|
||||
Reference in New Issue
Block a user