生产退料,暂存仓配送优化

This commit is contained in:
2024-06-29 13:23:21 +08:00
parent 4d890e2ca2
commit 958d1deb25
11 changed files with 172 additions and 64 deletions

View File

@@ -96,7 +96,7 @@ namespace Tnb.ProductionMgr
private readonly ISqlSugarClient db_BGWCarrySupplementtimer;
private readonly ISqlSugarClient db_YCLGLDPJInstocktimer;
private readonly ISqlSugarClient db_YCLWXDPJInstocktimer;
private readonly ISqlSugarClient db_Floor2UpMachinecodetimer;
private ISqlSugarClient db_Floor2UpMachinecodetimer;
private readonly ISqlSugarClient db_Floor2timer送空托到上升降区;
private readonly ISqlSugarClient db_Floor2timer送满托到下升降区;
private readonly ISqlSugarClient db_Floor2timer移走上升降区未生成预任务且满托的料架;
@@ -941,6 +941,21 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
// 料箱信息
WmsCarryH LX = db_Floor2UpMachinecodetimer.Queryable<WmsCarryH>().Where(r => r.carry_code == barcode).ToList()[0];
// 绑定料箱到料架
CarryBindInput carryBindInput = new();
carryBindInput.carry_id = target.rackid;
carryBindInput.carry_code = target.rackcode;
carryBindInput.membercarry_id = LX.id;
carryBindInput.membercarry_code = LX.carry_code;
carryBindInput.carrystd_id = rack.carrystd_id;
carryBindInput.source_code = target.outbill;
Tnb.WarehouseMgr.Entities.Dto.Outputs.Result bindResult = await _wmsCarryBindService.CarryBind(carryBindInput);
if (bindResult.code != JNPF.Common.Enums.HttpStatusCode.OK)
{
throw new Exception(bindResult.msg);
}
// 开始码垛
bool result_开始码垛 = await Floor2UpDownMachinecode_SetTag(MechanicalArmConsts., target.stackingposition.ToString());
LoggerFloor2UpDownMachine.LogInformation($@"【上升降机】码垛结果 {result_开始码垛}");
@@ -964,22 +979,18 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
}).Where(r => r.id == WmsMaterialTransfer.id).ExecuteCommandAsync();
LoggerFloor2UpDownMachine.LogInformation($@"【上升降机】回写转库单的剩余可绑定料架数量");
// 绑定料箱到料架
CarryBindInput carryBindInput = new();
carryBindInput.carry_id = target.rackid;
carryBindInput.carry_code = target.rackcode;
carryBindInput.membercarry_id = LX.id;
carryBindInput.membercarry_code = LX.carry_code;
carryBindInput.carrystd_id = rack.carrystd_id;
carryBindInput.source_code = target.outbill;
await _wmsCarryBindService.CarryBind(carryBindInput);
await db_Floor2UpMachinecodetimer.Ado.CommitTranAsync();
}
}
catch (Exception ex)
{
// 测试代码 无问题后期删
if (ex.Message.Contains("Connection is busy"))
{
db_Floor2UpMachinecodetimer = db_Floor2UpMachinecodetimer.CopyNew();
}
LoggerFloor2UpDownMachine.LogError(ex.ToString());
LoggerFloor2UpDownMachine.LogError(ex.StackTrace);
await db_Floor2UpMachinecodetimer.Ado.RollbackTranAsync();
@@ -987,6 +998,9 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
finally
{
s_taskExecuteFloor2UpMachinecodetimer.Release();
if (!db_Floor2UpMachinecodetimer.Ado.Transaction.IsNull())
await db_Floor2UpMachinecodetimer.Ado.CommitTranAsync();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行Floor2UpMachinecode {stopwatch.ElapsedMilliseconds} ms");
LoggerTimer.LogInformation($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行Floor2UpMachinecode {stopwatch.ElapsedMilliseconds} ms");
@@ -1121,6 +1135,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
finally
{
s_task送空托到上升降区.Release();
if (!db_Floor2timer送空托到上升降区.Ado.Transaction.IsNull())
await db_Floor2timer送空托到上升降区.Ado.CommitTranAsync();
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行送空托到上升降区 {stopwatch.ElapsedMilliseconds} ms");
@@ -1283,6 +1299,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
finally
{
s_task送满托到下升降区.Release();
if (!db_Floor2timer送满托到下升降区.Ado.Transaction.IsNull())
await db_Floor2timer送满托到下升降区.Ado.CommitTranAsync();
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行送满托到下升降区 {stopwatch.ElapsedMilliseconds} ms");
@@ -1387,6 +1405,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
finally
{
s_task移走上升降区未生成预任务且满托的料架.Release();
if (!db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.Transaction.IsNull())
await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.CommitTranAsync();
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行移走上升降区未生成预任务且满托的料架 {stopwatch.ElapsedMilliseconds} ms");
@@ -1466,7 +1486,11 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
carryBindInput.carry_code = wmsMechanicalArmH.rackcode;
carryBindInput.source_code = wmsMechanicalArmH.outbill;
await _wmsCarryUnbindService.CarryUnbind(carryBindInput);
Tnb.WarehouseMgr.Entities.Dto.Outputs.Result unbindResult = await _wmsCarryUnbindService.CarryUnbind(carryBindInput);
if (unbindResult.code != JNPF.Common.Enums.HttpStatusCode.OK)
{
throw new Exception(unbindResult.msg);
}
// 锁住终点库位
await db_Floor2timer移走下升降区未生成预任务且空托的料架.Updateable<BasLocation>(r => new BasLocation
@@ -1495,6 +1519,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
finally
{
s_task移走下升降区未生成预任务且空托的料架.Release();
if (!db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.Transaction.IsNull())
await db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.CommitTranAsync();
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行移走下升降区未生成预任务且空托的料架 {stopwatch.ElapsedMilliseconds} ms");