执行代码清理,修复warning
This commit is contained in:
@@ -11,8 +11,8 @@ namespace Tnb.ProductionMgr
|
||||
//redis定时获取数采数据
|
||||
public class RedisBackGround : IHostedService, IDisposable
|
||||
{
|
||||
private Timer? packtimer;
|
||||
private Timer? limittimer;
|
||||
private readonly Timer? packtimer;
|
||||
private readonly Timer? limittimer;
|
||||
private readonly RedisCache _redisCache;
|
||||
private readonly IPrdInstockService _prdInstockService;
|
||||
public RedisBackGround(RedisCache redisCache, IPrdInstockService prdInstockService)
|
||||
@@ -29,19 +29,24 @@ namespace Tnb.ProductionMgr
|
||||
string sign = "agvMode";
|
||||
foreach (string s in strs)
|
||||
{
|
||||
var dic = _redisCache.HGetAll(s).Result;
|
||||
foreach (var kv in dic)
|
||||
Dictionary<string, string> dic = _redisCache.HGetAll(s).Result;
|
||||
foreach (KeyValuePair<string, string> kv in dic)
|
||||
{
|
||||
if (!kv.Key.Contains(sign))
|
||||
{
|
||||
continue;
|
||||
var res = JsonConvert.DeserializeObject<JObject>(kv.Value);
|
||||
}
|
||||
|
||||
JObject? res = JsonConvert.DeserializeObject<JObject>(kv.Value);
|
||||
if (res != null && res["Value"] != null)
|
||||
{
|
||||
if (int.Parse(res["Value"]!.ToString()) != (int)Eagvmode.无请求 || int.Parse(res["Value"]!.ToString()) != (int)Eagvmode.收到请求)
|
||||
if (int.Parse(res["Value"]!.ToString()) is not ((int)Eagvmode.无请求) or not ((int)Eagvmode.收到请求))
|
||||
{
|
||||
InstockInput instockInput = new InstockInput();
|
||||
instockInput.equip_code = res["TagName"]!.ToString();
|
||||
_prdInstockService.InstockTypeOne(instockInput);
|
||||
InstockInput instockInput = new()
|
||||
{
|
||||
equip_code = res["TagName"]!.ToString()
|
||||
};
|
||||
_ = _prdInstockService.InstockTypeOne(instockInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,19 +61,24 @@ namespace Tnb.ProductionMgr
|
||||
string sign = "AGVFullCall";
|
||||
foreach (string s in strs)
|
||||
{
|
||||
var dic = _redisCache.HGetAll(s).Result;
|
||||
foreach (var kv in dic)
|
||||
Dictionary<string, string> dic = _redisCache.HGetAll(s).Result;
|
||||
foreach (KeyValuePair<string, string> kv in dic)
|
||||
{
|
||||
if (!kv.Key.Contains(sign))
|
||||
{
|
||||
continue;
|
||||
var res = JsonConvert.DeserializeObject<JObject>(kv.Value);
|
||||
}
|
||||
|
||||
JObject? res = JsonConvert.DeserializeObject<JObject>(kv.Value);
|
||||
if (res != null && res["Value"] != null)
|
||||
{
|
||||
if (res.Value<bool>("Value"))
|
||||
{
|
||||
InstockInput instockInput = new InstockInput();
|
||||
instockInput.equip_code = res["TagName"]!.ToString();
|
||||
_prdInstockService.InstockTypeOne(instockInput);
|
||||
InstockInput instockInput = new()
|
||||
{
|
||||
equip_code = res["TagName"]!.ToString()
|
||||
};
|
||||
_ = _prdInstockService.InstockTypeOne(instockInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,12 +93,15 @@ namespace Tnb.ProductionMgr
|
||||
string sign = "AGVCall";
|
||||
foreach (string s in strs)
|
||||
{
|
||||
var dic = _redisCache.HGetAll(s).Result;
|
||||
foreach (var kv in dic)
|
||||
Dictionary<string, string> dic = _redisCache.HGetAll(s).Result;
|
||||
foreach (KeyValuePair<string, string> kv in dic)
|
||||
{
|
||||
if (!kv.Key.Contains(sign))
|
||||
{
|
||||
continue;
|
||||
var res = JsonConvert.DeserializeObject<JObject>(kv.Value);
|
||||
}
|
||||
|
||||
JObject? res = JsonConvert.DeserializeObject<JObject>(kv.Value);
|
||||
if (res != null && res["Value"] != null)
|
||||
{
|
||||
if (res.Value<bool>("Value"))
|
||||
|
||||
Reference in New Issue
Block a user