执行代码清理,修复warning

This commit is contained in:
2023-11-06 19:59:12 +08:00
parent c6b8dfc861
commit 1dbb17f103
118 changed files with 5046 additions and 4111 deletions

View File

@@ -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"))