Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2024-07-05 15:17:25 +08:00
4 changed files with 129 additions and 50 deletions

View File

@@ -432,7 +432,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
catch (Exception ex)
{
Console.WriteLine("【ScanInStock】" + ex.Message);
LoggerBGWCarrySupplement.LogInformation($"【ScanInStock】 八工位扫到码发送入库请求发生异常:{ex}");
LoggerBGWCarrySupplement.LogError($"【ScanInStock】 八工位扫到码发送入库请求发生异常:{ex}");
}
finally
{
@@ -547,11 +547,19 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
await db_BGWCarrySupplementtimer.Ado.CommitTranAsync();
}
catch (ObjectDisposedException ex)
{
LoggerBGWCarrySupplement.LogError($"【BGWCarrySupplementtimer】 数据库连接异常:{ex.Message}");
LoggerBGWCarrySupplement.LogError($"【BGWCarrySupplementtimer】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_BGWCarrySupplementtimer = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
Console.WriteLine("【BGWCarrySupplement】" + ex.Message);
LoggerBGWCarrySupplement.LogInformation($"【BGWCarrySupplementtimer】 八工位空托盘补充发生异常:{ex}");
await db_BGWCarrySupplementtimer.Ado.RollbackTranAsync();
LoggerBGWCarrySupplement.LogError($"【BGWCarrySupplementtimer】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_BGWCarrySupplementtimer.Ado.RollbackTranAsync(); } catch { };
}
finally
{
@@ -637,11 +645,19 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
}
await db_YCLGLDPJInstocktimer.Ado.CommitTranAsync();
}
catch (ObjectDisposedException ex)
{
LoggerYCLGLDPJInstock.LogError($"【YCLGLDPJInstock】 数据库连接异常:{ex.Message}");
LoggerYCLGLDPJInstock.LogError($"【YCLGLDPJInstock】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_YCLGLDPJInstocktimer = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
Console.WriteLine("【YCLGLDPJInstock】" + ex.Message);
LoggerYCLGLDPJInstock.LogInformation($"【YCLGLDPJInstock】 三工位叠盘机空托入库发生异常:{ex}");
await db_YCLGLDPJInstocktimer.Ado.RollbackTranAsync();
LoggerYCLGLDPJInstock.LogError($"【YCLGLDPJInstock】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_YCLGLDPJInstocktimer.Ado.RollbackTranAsync(); } catch { };
}
finally
{
@@ -724,10 +740,19 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
}
await db_YCLWXDPJInstocktimer.Ado.CommitTranAsync();
}
catch (ObjectDisposedException ex)
{
LoggerYCLGLDPJInstock.LogError($"【YCLWXDPJInstock】 数据库连接异常:{ex.Message}");
LoggerYCLGLDPJInstock.LogError($"【YCLWXDPJInstock】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_YCLWXDPJInstocktimer = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
LoggerYCLGLDPJInstock.LogInformation($"【YCLWXDPJInstock】 外协叠盘机空托入库发生异常:{ex}");
await db_YCLWXDPJInstocktimer.Ado.RollbackTranAsync();
Console.WriteLine("【YCLGLDPJInstock】" + ex.Message);
LoggerYCLGLDPJInstock.LogError($"【YCLWXDPJInstock】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_YCLWXDPJInstocktimer.Ado.RollbackTranAsync(); } catch { };
}
finally
{
@@ -1005,25 +1030,25 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
await db_Floor2UpMachinecodetimer.Ado.CommitTranAsync();
}
}
catch (ObjectDisposedException ex)
{
LoggerFloor2UpDownMachine.LogError($"【上升降机】 数据库连接异常:{ex.Message}");
LoggerFloor2UpDownMachine.LogError($"【上升降机】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_Floor2UpMachinecodetimer = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
// 测试代码 无问题后期删
if (ex.Message.Contains("Exception while reading from stream"))
{
LoggerFloor2UpDownMachine.LogError("【测试】重置连接");
db_Floor2UpMachinecodetimer.Close();
db_Floor2UpMachinecodetimer = _repository.CopyNew();
}
LoggerFloor2UpDownMachine.LogError(ex.ToString());
LoggerFloor2UpDownMachine.LogError(ex.StackTrace);
await db_Floor2UpMachinecodetimer.Ado.RollbackTranAsync();
Console.WriteLine("【上升降机】" + ex.Message);
LoggerFloor2UpDownMachine.LogError($"【上升降机】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_Floor2UpMachinecodetimer.Ado.RollbackTranAsync(); } catch { };
}
finally
{
s_taskExecuteFloor2UpMachinecodetimer.Release();
if (!db_Floor2UpMachinecodetimer.Ado.Transaction.IsNull())
await db_Floor2UpMachinecodetimer.Ado.CommitTranAsync();
try { await db_Floor2UpMachinecodetimer.Ado.CommitTranAsync(); } catch { };
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行Floor2UpMachinecode {stopwatch.ElapsedMilliseconds} ms");
@@ -1150,17 +1175,25 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
await db_Floor2timer送空托到上升降区.Ado.CommitTranAsync();
}
}
catch (ObjectDisposedException ex)
{
LoggerFloor2RackDelivery.LogError($"【送空托到上升降区】 数据库连接异常:{ex.Message}");
LoggerFloor2RackDelivery.LogError($"【送空托到上升降区】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_Floor2timer送空托到上升降区 = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
LoggerFloor2RackDelivery.LogInformation($"【送空托到上升降区】 {ex.Message}");
LoggerFloor2RackDelivery.LogInformation($"【送空托到上升降区】 {ex.StackTrace}");
await db_Floor2timer送空托到上升降区.Ado.RollbackTranAsync();
Console.WriteLine("【上升降机】" + ex.Message);
LoggerFloor2RackDelivery.LogError($"【送空托到上升降区】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_Floor2timer送空托到上升降区.Ado.RollbackTranAsync(); } catch { };
}
finally
{
s_task送空托到上升降区.Release();
if (!db_Floor2timer送空托到上升降区.Ado.Transaction.IsNull())
await db_Floor2timer送空托到上升降区.Ado.CommitTranAsync();
try { await db_Floor2timer送空托到上升降区.Ado.CommitTranAsync(); } catch { };
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行送空托到上升降区 {stopwatch.ElapsedMilliseconds} ms");
@@ -1310,17 +1343,25 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
await db_Floor2timer送满托到下升降区.Ado.CommitTranAsync();
}
}
catch (ObjectDisposedException ex)
{
LoggerFloor2RackDelivery.LogError($"【送满托到下升降区】 数据库连接异常:{ex.Message}");
LoggerFloor2RackDelivery.LogError($"【送满托到下升降区】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_Floor2timer送满托到下升降区 = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
LoggerFloor2RackDelivery.LogInformation($"【送满托到下升降区】 {ex.Message}");
LoggerFloor2RackDelivery.LogInformation($"【送满托到下升降区】 {ex.StackTrace}");
await db_Floor2timer送满托到下升降区.Ado.RollbackTranAsync();
Console.WriteLine("【上升降机】" + ex.Message);
LoggerFloor2RackDelivery.LogError($"【送满托到下升降区】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_Floor2timer送满托到下升降区.Ado.RollbackTranAsync(); } catch { };
}
finally
{
s_task送满托到下升降区.Release();
if (!db_Floor2timer送满托到下升降区.Ado.Transaction.IsNull())
await db_Floor2timer送满托到下升降区.Ado.CommitTranAsync();
try { await db_Floor2timer送满托到下升降区.Ado.CommitTranAsync(); } catch { };
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行送满托到下升降区 {stopwatch.ElapsedMilliseconds} ms");
@@ -1416,17 +1457,26 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.CommitTranAsync();
}
}
catch (ObjectDisposedException ex)
{
LoggerFloor2RackDelivery.LogError($"【移走上升降区未生成预任务且满托的料架】 数据库连接异常:{ex.Message}");
LoggerFloor2RackDelivery.LogError($"【移走上升降区未生成预任务且满托的料架】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_Floor2timer移走上升降区未生成预任务且满托的料架 = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
LoggerFloor2RackDelivery.LogInformation($"【移走上升降区未生成预任务且满托的料架】 {ex.Message}");
LoggerFloor2RackDelivery.LogInformation($"【移走上升降区未生成预任务且满托的料架】 {ex.StackTrace}");
await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.RollbackTranAsync();
Console.WriteLine("【上升降机】" + ex.Message);
LoggerFloor2RackDelivery.LogError($"【移走上升降区未生成预任务且满托的料架】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.RollbackTranAsync(); } catch { };
}
finally
{
s_task移走上升降区未生成预任务且满托的料架.Release();
if (!db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.Transaction.IsNull())
await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.CommitTranAsync();
// 数据库连接断开时会报错
try { await db_Floor2timer移走上升降区未生成预任务且满托的料架.Ado.CommitTranAsync(); } catch { };
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行移走上升降区未生成预任务且满托的料架 {stopwatch.ElapsedMilliseconds} ms");
@@ -1537,17 +1587,25 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
}
}
}
catch (ObjectDisposedException ex)
{
LoggerFloor2RackDelivery.LogError($"【移走下升降区空托的料架】 数据库连接异常:{ex.Message}");
LoggerFloor2RackDelivery.LogError($"【移走下升降区空托的料架】 数据库连接异常:{ex.StackTrace}");
if (ex.Source == "Npgsql")
db_Floor2timer移走下升降区未生成预任务且空托的料架 = _repository.AsSugarClient().CopyNew();
}
catch (Exception ex)
{
LoggerFloor2RackDelivery.LogInformation($"【移走下升降区空托的料架】 {ex.Message}");
LoggerFloor2RackDelivery.LogInformation($"【移走下升降区空托的料架】 {ex.StackTrace}");
await db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.RollbackTranAsync();
Console.WriteLine("【上升降机】" + ex.Message);
LoggerFloor2RackDelivery.LogError($"【移走下升降区空托的料架】 数据库连接异常:{ex}");
// 数据库连接断开时会报错
try { await db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.RollbackTranAsync(); } catch { };
}
finally
{
s_task移走下升降区未生成预任务且空托的料架.Release();
if (!db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.Transaction.IsNull())
await db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.CommitTranAsync();
try { await db_Floor2timer移走下升降区未生成预任务且空托的料架.Ado.CommitTranAsync(); } catch { };
_wareHouseService.GenTaskExecute();
stopwatch.Stop();
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 结束执行移走下升降区未生成预任务且空托的料架 {stopwatch.ElapsedMilliseconds} ms");
@@ -1720,7 +1778,6 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
Floor2timer移走上升降区未生成预任务且满托的料架 = new Timer(, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
Floor2timer移走下升降区未生成预任务且空托的料架 = new Timer(, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
return Task.CompletedTask;
}