This commit is contained in:
qianjiawei
2024-03-14 17:28:33 +08:00
parent f37ad2bfa3
commit 501a39dda5
6 changed files with 359 additions and 26 deletions

View File

@@ -250,12 +250,15 @@ namespace Tnb.WarehouseMgr
Dictionary<string, string[]> putdic = new Dictionary<string, string[]>();
putdic.Add("SSX-011-006", new string[] { "YTCS", "AllowEmptyIn_CS06" });
putdic.Add("SSX-021-007", new string[] { "东面提升机输送线", "出库输送线7允许入箱" });
putdic.Add("SSX-121-009", new string[] { "东面提升机输送线", "上升降机9允许入箱" });
putdic.Add("SSX-121-010", new string[] { "东面提升机输送线", "上升降机10允许入箱" });
putdic.Add("SSX-021-003", new string[] { "YTCS", "AllowCtuEmptyIn_CS03" });
putdic.Add("SSX-021-001", new string[] { "YTCS", "AllowCtuEmptyIn_CS01" });
putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowAgvFullIn_CS04", });
putdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AllowAgvFullIn_CS02", });
var strs = new string[] { };
if (!putdic.ContainsKey(input.targetName))
throw new AppFriendlyException("点位" + input.targetName + "不存在", 500);
strs = putdic.Where(p => p.Key == input.targetName).First().Value;
@@ -277,27 +280,98 @@ namespace Tnb.WarehouseMgr
/// </summary>
/// <returns></returns>
public async Task<bool> Check(string code, string action)
{
Dictionary<string, string[]> putdic = new Dictionary<string, string[]>();
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
putdic.Add("ZS-C01-1", new string[] { "hxjC", "A2允许入空箱", });
getdic.Add("ZS-C01-2", new string[] { "hxjC", "A2允许取满箱" });
putdic.Add("ZS-C02-1", new string[] { "hxjC", "A3允许入空箱", });
getdic.Add("ZS-C02-2", new string[] { "hxjC", "A3允许取满箱" });
putdic.Add("ZS-C03-1", new string[] { "hxjC", "A4允许入空箱", });
getdic.Add("ZS-C03-2", new string[] { "hxjC", "A4允许取满箱" });
putdic.Add("ZS-C04-1", new string[] { "hxjC", "A5允许入空箱", });
getdic.Add("ZS-C04-2", new string[] { "hxjC", "A5允许取满箱" });
putdic.Add("ZS-C05-1", new string[] { "hxjC", "A6允许入空箱", });
getdic.Add("ZS-C05-2", new string[] { "hxjC", "A6允许取满箱" });
putdic.Add("ZS-C06-1", new string[] { "hxjC", "A7允许入空箱", });
getdic.Add("ZS-C06-2", new string[] { "hxjC", "A7允许取满箱" });
var strs = new string[] { };
if (action == "LOAD")//取货
{
if (!getdic.ContainsKey(code))
return false;
strs = getdic.Where(p => p.Key == code).First().Value;
bool flag = _redisData.HashExist(strs[0], strs[1]).Result;
if (!flag)
{
return false;
}
string data = _redisData.GetHash(strs[0], strs[1]).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(data);
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
if (!result)
return false;
return true;
}
else if (action == "UNLOAD")//放货
{
if (!putdic.ContainsKey(code))
return false;
strs = putdic.Where(p => p.Key == code).First().Value;
bool flag = _redisData.HashExist(strs[0], strs[1]).Result;
if (!flag)
{
return false;
}
string data = _redisData.GetHash(strs[0], strs[1]).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(data);
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
if (!result)
return false;
return true;
}
return false;
}
public async Task SsxControl(WmsDistaskH disTask, string action)
{
Dictionary<string, string[]> putdic = new Dictionary<string, string[]>();
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
getdic.Add("SSX-021-005", new string[] { "YTCS", "FullOut_CS05Done", "true" });
getdic.Add("SSX-111-011", new string[] { "东面提升机输送线", "下升降机11出箱完毕", "true" });
getdic.Add("SSX-111-012", new string[] { "东面提升机输送线", "下升降机12出箱完毕", "true" });
getdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AgvEmptyOut_CS03Done", "true" });
getdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AgvEmptyOut_CS01Done", "true" });
getdic.Add("SSX-011-008", new string[] { "东面提升机输送线", "入库输送线8出箱完毕", "true" });
getdic.Add("ZS-C01-2", new string[] { "hxjC", "A2AGV允许入满箱", "true" });
getdic.Add("ZS-C02-2", new string[] { "hxjC", "A3AGV允许入满箱", "true" });
getdic.Add("ZS-C03-2", new string[] { "hxjC", "A4AGV允许入满箱", "true" });
getdic.Add("ZS-C04-2", new string[] { "hxjC", "A5AGV允许入满箱", "true" });
getdic.Add("ZS-C05-2", new string[] { "hxjC", "A6AGV允许入满箱", "true" });
getdic.Add("ZS-C06-2", new string[] { "hxjC", "A7AGV允许入满箱", "true" });
putdic.Add("SSX-021-007", new string[] { "东面提升机输送线", "出库输送线7入箱完毕", "true" });
putdic.Add("SSX-011-006", new string[] { "YTCS", "EmptyIn_CS06Done", "true" });
putdic.Add("SSX-021-003", new string[] { "YTCS", "AgvFullIn_CS03Done", "true" });
putdic.Add("SSX-021-001", new string[] { "YTCS", "CtuEmptyIn_CS01Done", "true" });
putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AgvFullIn_CS04Done", "true" });
putdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AgvFullIn_CS02Done", "true" });
putdic.Add("SSX-121-009", new string[] { "东面提升机输送线", "上升降机9入箱完毕", "true" });
putdic.Add("SSX-121-010", new string[] { "东面提升机输送线", "上升降机10入箱完毕", "true" });
putdic.Add("YCLCKBGW", new string[] { "CP8", "PutDoneEmptyBox", "true" });
putdic.Add("ZS-C01-1", new string[] { "hxjC", "A2AGV允许出空箱", "true" });
putdic.Add("ZS-C02-1", new string[] { "hxjC", "A3AGV允许出空箱", "true" });
putdic.Add("ZS-C03-1", new string[] { "hxjC", "A4AGV允许出空箱", "true" });
putdic.Add("ZS-C04-1", new string[] { "hxjC", "A5AGV允许出空箱", "true" });
putdic.Add("ZS-C05-1", new string[] { "hxjC", "A6AGV允许出空箱", "true" });
putdic.Add("ZS-C06-1", new string[] { "hxjC", "A7AGV允许出空箱", "true" });
if (action == "LOAD")//取货
{
if (getdic.Keys.Contains(disTask.startlocation_code))