REDIS
This commit is contained in:
17
ProductionMgr/Tnb.ProductionMgr.Entities/Enums/Eagvmode.cs
Normal file
17
ProductionMgr/Tnb.ProductionMgr.Entities/Enums/Eagvmode.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.ProductionMgr.Entities.Enums
|
||||||
|
{
|
||||||
|
public enum Eagvmode
|
||||||
|
{
|
||||||
|
无请求=0,
|
||||||
|
空框请求=1,
|
||||||
|
满框请求=2,
|
||||||
|
空满框请求=3,
|
||||||
|
收到请求=4
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,8 @@ using Newtonsoft.Json;
|
|||||||
using UAParser;
|
using UAParser;
|
||||||
using Tnb.ProductionMgr.Interfaces;
|
using Tnb.ProductionMgr.Interfaces;
|
||||||
using Tnb.ProductionMgr.Entities.Dto;
|
using Tnb.ProductionMgr.Entities.Dto;
|
||||||
|
using JNPF.ClayObject.Extensions;
|
||||||
|
using Tnb.ProductionMgr.Entities.Enums;
|
||||||
|
|
||||||
namespace Tnb.ProductionMgr
|
namespace Tnb.ProductionMgr
|
||||||
{
|
{
|
||||||
@@ -25,37 +27,84 @@ namespace Tnb.ProductionMgr
|
|||||||
_redisCache = redisCache;
|
_redisCache = redisCache;
|
||||||
_prdInstockService = prdInstockService;
|
_prdInstockService = prdInstockService;
|
||||||
}
|
}
|
||||||
//获取装箱状态
|
//获取注塑装箱状态
|
||||||
private void GetPackStatus(object state)
|
private void GetZSPackStatus(object state)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
// Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||||
Console.WriteLine($"获取装箱状态");
|
// Console.WriteLine($"获取注塑装箱状态");
|
||||||
/*
|
string[] strs = new string[1] { "TY4C-ZHUSU1" };
|
||||||
var data = _redisCache.GetHash("TY4C-JICHU", "weight_4").Result;
|
string sign = "agvMode";
|
||||||
var res = JsonConvert.DeserializeObject<JObject>(data);
|
foreach (string s in strs)
|
||||||
if (res != null && res["Value"] != null)
|
|
||||||
{
|
{
|
||||||
InstockInput instockInput = new InstockInput();
|
var dic = _redisCache.HGetAll(s).Result;
|
||||||
instockInput.equip_code = res["Value"]!.ToString();
|
foreach (var kv in dic)
|
||||||
_prdInstockService.InstockTypeOne(instockInput);
|
{
|
||||||
Console.WriteLine(decimal.Parse(res["Value"]!.ToString()));
|
if (!kv.Key.Contains(sign))
|
||||||
}*/
|
continue;
|
||||||
|
var 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.收到请求)
|
||||||
|
{
|
||||||
|
InstockInput instockInput = new InstockInput();
|
||||||
|
instockInput.equip_code = res["TagName"]!.ToString();
|
||||||
|
_prdInstockService.InstockTypeOne(instockInput);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取挤出装箱状态
|
||||||
|
private void GetJCPackStatus(object state)
|
||||||
|
{
|
||||||
|
// Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||||
|
// Console.WriteLine($"获取挤出装箱状态");
|
||||||
|
string[] strs = new string[1] { "TY4C-SHUSONG-JC" };
|
||||||
|
string sign = "AGVFullCall";
|
||||||
|
foreach (string s in strs)
|
||||||
|
{
|
||||||
|
var dic = _redisCache.HGetAll(s).Result;
|
||||||
|
foreach (var kv in dic)
|
||||||
|
{
|
||||||
|
if (!kv.Key.Contains(sign))
|
||||||
|
continue;
|
||||||
|
var 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//获取限位状态
|
//获取限位状态
|
||||||
private void GetLimitStatus(object state)
|
private void GetLimitStatus(object state)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
// Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||||
Console.WriteLine($"获取限位状态");
|
// Console.WriteLine($"获取限位状态");
|
||||||
/*
|
string[] strs = new string[1] { "TY4C-WAIBAO" };
|
||||||
var data = _redisCache.GetHash("TY4C-JICHU", "weight_4").Result;
|
string sign = "AGVCall";
|
||||||
var res = JsonConvert.DeserializeObject<JObject>(data);
|
foreach (string s in strs)
|
||||||
if (res != null && res["Value"] != null)
|
|
||||||
{
|
{
|
||||||
InstockInput instockInput = new InstockInput();
|
var dic = _redisCache.HGetAll(s).Result;
|
||||||
instockInput.equip_code = res["Value"]!.ToString();
|
foreach (var kv in dic)
|
||||||
_prdInstockService.InstockTypeOne(instockInput);
|
{
|
||||||
Console.WriteLine(decimal.Parse(res["Value"]!.ToString()));
|
if (!kv.Key.Contains(sign))
|
||||||
}*/
|
continue;
|
||||||
|
var res = JsonConvert.DeserializeObject<JObject>(kv.Value);
|
||||||
|
if (res != null && res["Value"] != null)
|
||||||
|
{
|
||||||
|
if (res.Value<bool>("Value"))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user