Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -1895,11 +1895,16 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
try
|
||||
{
|
||||
string jsonString = await _redisData.GetHash(DevName, field);
|
||||
Log.Information($"查询X2Server数据 {DevName} {field}:" + jsonString);
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
return false;
|
||||
|
||||
JObject jsonObject = JObject.Parse(jsonString);
|
||||
|
||||
if (jsonObject.TryGetValue("StatusCode", out JToken valueToken1))
|
||||
{
|
||||
if (valueToken1.ToString() == "-1")
|
||||
return false;
|
||||
}
|
||||
if (jsonObject.TryGetValue("Value", out JToken valueToken2))
|
||||
{
|
||||
return bool.Parse(valueToken2.ToString());
|
||||
@@ -1920,59 +1925,59 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
public async Task<string> GetStringTag(string DevName, string field)
|
||||
{
|
||||
#region
|
||||
//try
|
||||
//{
|
||||
// string jsonString = await _redisData.GetHash(DevName, field);
|
||||
|
||||
// JObject jsonObject = JObject.Parse(jsonString);
|
||||
// if (jsonObject.TryGetValue("StatusCode", out JToken valueToken1))
|
||||
// {
|
||||
// if (valueToken1.ToString() == "-1")
|
||||
// return "";
|
||||
// }
|
||||
// if (jsonObject.TryGetValue("Value", out JToken valueToken2))
|
||||
// {
|
||||
// return valueToken2.ToString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine($"未找到匹配项 {DevName} {field}");
|
||||
// }
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// // 捕获并处理异常
|
||||
// Console.WriteLine($"发生异常: {ex.Message}");
|
||||
//}
|
||||
|
||||
//return $"未找到匹配项 {DevName} {field}";
|
||||
#endregion
|
||||
|
||||
try
|
||||
{
|
||||
string jsonString = await _redisData.GetHash(DevName, field);
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
return "";
|
||||
|
||||
string pattern = "\"Value\":\"(.*?)\"";
|
||||
|
||||
System.Text.RegularExpressions.Match match = Regex.Match(jsonString, pattern);
|
||||
if (match.Success)
|
||||
Log.Information($"查询X2Server数据 {DevName} {field}:" + jsonString);
|
||||
JObject jsonObject = JObject.Parse(jsonString);
|
||||
if (jsonObject.TryGetValue("StatusCode", out JToken valueToken1))
|
||||
{
|
||||
|
||||
return match.Groups[1].Value;
|
||||
if (valueToken1.ToString() == "-1")
|
||||
return "";
|
||||
}
|
||||
if (jsonObject.TryGetValue("Value", out JToken valueToken2))
|
||||
{
|
||||
return valueToken2.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"未找到匹配项{DevName} {field}");
|
||||
Console.WriteLine($"未找到匹配项 {DevName} {field}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"未找到匹配项{DevName} {field}");
|
||||
// 捕获并处理异常
|
||||
Console.WriteLine($"发生异常: {ex.Message}");
|
||||
}
|
||||
|
||||
return $"未找到匹配项 {DevName} {field}";
|
||||
#endregion
|
||||
|
||||
//try
|
||||
//{
|
||||
// string jsonString = await _redisData.GetHash(DevName, field);
|
||||
// if (string.IsNullOrEmpty(jsonString))
|
||||
// return "";
|
||||
|
||||
// string pattern = "\"Value\":\"(.*?)\"";
|
||||
|
||||
// System.Text.RegularExpressions.Match match = Regex.Match(jsonString, pattern);
|
||||
// if (match.Success)
|
||||
// {
|
||||
|
||||
// return match.Groups[1].Value;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine($"未找到匹配项{DevName} {field}");
|
||||
// }
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// Console.WriteLine($"未找到匹配项{DevName} {field}");
|
||||
//}
|
||||
|
||||
//return $"未找到匹配项 {DevName} {field}";
|
||||
}
|
||||
|
||||
private async Task<bool> Floor2UpDownMachinecode_SetTag(string tag, string value)
|
||||
@@ -2524,7 +2529,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
|
||||
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.Zero, TimeSpan.FromSeconds(180));
|
||||
//YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.Zero, TimeSpan.FromSeconds(180));
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user