下升降机延时问题解决
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Dynamic;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using Aop.Api.Domain;
|
||||
@@ -945,16 +946,47 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
{
|
||||
var strs = dic.Where(p => p.Key == key).First().Value;
|
||||
|
||||
bool re = await GetBoolTag(key, strs[0]);
|
||||
JObject reObj = await GetObjectTag(key, strs[0]);
|
||||
if (reObj == null)
|
||||
continue;
|
||||
bool re = false;
|
||||
DateTime timestamp_judgeCode = DateTime.MinValue;
|
||||
if (reObj.TryGetValue("Value", out JToken valueToken1))
|
||||
{
|
||||
re = bool.Parse(valueToken1.ToString());
|
||||
if (reObj.TryGetValue("TimeStamp", out JToken valueToken2))
|
||||
timestamp_judgeCode = DateTime.Parse(valueToken2.ToString());
|
||||
}
|
||||
|
||||
if (!re)
|
||||
continue;
|
||||
string? result = await GetStringTag(key, strs[1]);
|
||||
|
||||
JObject reObj_code = await GetObjectTag(key, strs[1]);
|
||||
if (reObj_code == null)
|
||||
continue;
|
||||
string? result = "";
|
||||
DateTime timestamp_code = DateTime.MinValue;
|
||||
if (reObj_code.TryGetValue("Value", out JToken valueToken3))
|
||||
{
|
||||
result = valueToken3.ToString();
|
||||
if (reObj_code.TryGetValue("TimeStamp", out JToken valueToken4))
|
||||
timestamp_code = DateTime.Parse(valueToken4.ToString());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
|
||||
if (result.Length < 5)
|
||||
{
|
||||
result = "LX" + result.Replace("\r", "");
|
||||
}
|
||||
|
||||
if (timestamp_judgeCode > timestamp_code)
|
||||
{
|
||||
LoggerSSX.LogInformation($"【定时任务SSXcode】下升降机入中储仓 判定料箱{result}的条码判断请求信号时间{timestamp_judgeCode.ToString("yyyy-MM-dd HH:mm:ss")} 大于条码更新的时间{timestamp_code.ToString("yyyy-MM-dd HH:mm:ss")},将跳过此次执行");
|
||||
continue;
|
||||
}
|
||||
|
||||
var DistaskH = db_SSXcodetimer.Queryable<WmsDistaskH>().Where(p => p.carry_code == result && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).OrderByDescending(p => p.create_time).First();
|
||||
if (DistaskH != null)
|
||||
{
|
||||
@@ -2066,6 +2098,31 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
//return true;
|
||||
}
|
||||
|
||||
|
||||
public async Task<JObject> GetObjectTag(string DevName, string field)
|
||||
{
|
||||
#region
|
||||
try
|
||||
{
|
||||
string jsonString = await _redisData.GetHash(DevName, field);
|
||||
Log.Information($"查询X2Server数据 {DevName} {field}:" + jsonString);
|
||||
JObject jsonObject = JObject.Parse(jsonString);
|
||||
if (jsonObject.TryGetValue("StatusCode", out JToken valueToken1))
|
||||
{
|
||||
if (valueToken1.ToString() == "-1")
|
||||
return null;
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 捕获并处理异常
|
||||
Console.WriteLine($"发生异常: {ex.Message}");
|
||||
}
|
||||
|
||||
return null;
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -2522,41 +2579,41 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
CheckGettimer = new Timer(CheckGet, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
|
||||
Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
|
||||
//CheckGettimer = new Timer(CheckGet, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
|
||||
//Scantimer = new Timer(ScanInStock, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
|
||||
SSXcodetimer = new Timer(SSXcode, null, TimeSpan.Zero, TimeSpan.FromSeconds(10));
|
||||
// 八工位缓存区补充空托盘
|
||||
BGWCarrySupplementtimer = new Timer(BGWCarrySupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//// 八工位缓存区补充空托盘
|
||||
//BGWCarrySupplementtimer = new Timer(BGWCarrySupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
|
||||
// 供料叠盘机空托盘自动入库
|
||||
YCLGLDPJInstocktimer = new Timer(YCLGLDPJInstock, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
|
||||
//// 供料叠盘机空托盘自动入库
|
||||
//YCLGLDPJInstocktimer = new Timer(YCLGLDPJInstock, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
|
||||
|
||||
// 外协叠盘机空托盘自动入库
|
||||
YCLWXDPJInstocktimer = new Timer(YCLWXDPJInstock, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30));
|
||||
//// 外协叠盘机空托盘自动入库
|
||||
//YCLWXDPJInstocktimer = new Timer(YCLWXDPJInstock, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30));
|
||||
|
||||
// 二楼上升降机
|
||||
Floor2UpMachinecodetimer = new Timer(Floor2UpMachinecode, null, TimeSpan.Zero, TimeSpan.FromSeconds(20));
|
||||
//// 二楼上升降机
|
||||
//Floor2UpMachinecodetimer = new Timer(Floor2UpMachinecode, null, TimeSpan.Zero, TimeSpan.FromSeconds(20));
|
||||
|
||||
// 二楼料架配送
|
||||
Floor2timer送空托到上升降区 = new Timer(送空托到上升降区, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
Floor2timer送满托到下升降区 = new Timer(送满托到下升降区, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
|
||||
Floor2timer移走上升降区未生成预任务且满托的料架 = new Timer(移走上升降区未生成预任务且满托的料架, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
Floor2timer移走下升降区未生成预任务且空托的料架 = new Timer(移走下升降区未生成预任务且空托的料架, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
|
||||
//// 二楼料架配送
|
||||
//Floor2timer送空托到上升降区 = new Timer(送空托到上升降区, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//Floor2timer送满托到下升降区 = new Timer(送满托到下升降区, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
|
||||
//Floor2timer移走上升降区未生成预任务且满托的料架 = new Timer(移走上升降区未生成预任务且满托的料架, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//Floor2timer移走下升降区未生成预任务且空托的料架 = new Timer(移走下升降区未生成预任务且空托的料架, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
|
||||
|
||||
GenTaskExecutetimer = new Timer(GenTaskExecute, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//GenTaskExecutetimer = new Timer(GenTaskExecute, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
|
||||
// 停用
|
||||
//PackOutstockServicetimer = new Timer(PackOutstockService, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
|
||||
//// 停用
|
||||
////PackOutstockServicetimer = new Timer(PackOutstockService, null, TimeSpan.Zero, TimeSpan.FromSeconds(60));
|
||||
|
||||
ElevatorTaskExceptionHandleThread = new Thread(ElevatorTaskExceptionHandle);
|
||||
ElevatorTaskExceptionHandleThread.Start();
|
||||
//ElevatorTaskExceptionHandleThread = new Thread(ElevatorTaskExceptionHandle);
|
||||
//ElevatorTaskExceptionHandleThread.Start();
|
||||
|
||||
Floor4DMJ2MJXtimer = new Timer(Floor4DMJ2MJX, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
Floor4MJX2MJCtimer = new Timer(Floor4MJX2MJC, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
Floor4DMC2CPKtimer = new Timer(Floor4DMC2CPK, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//Floor4DMJ2MJXtimer = new Timer(Floor4DMJ2MJX, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//Floor4MJX2MJCtimer = new Timer(Floor4MJX2MJC, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//Floor4DMC2CPKtimer = new Timer(Floor4DMC2CPK, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
|
||||
F2KTPsupplementtimer = new Timer(F2KTPsupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(185));
|
||||
//F2KTPsupplementtimer = new Timer(F2KTPsupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
|
||||
//YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(185));
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user