This commit is contained in:
qianjiawei
2024-02-02 10:29:12 +08:00
parent bee26d9a92
commit 02dafc3c74
3 changed files with 76 additions and 50 deletions

View File

@@ -273,35 +273,13 @@ namespace Tnb.WarehouseMgr
/// 判断CTU是否可以取货
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpGet]
[AllowAnonymous]
public async Task<dynamic> CheckGet()
public async Task Test()
{
try
{
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
getdic.Add("SSX-021-005", new string[] { "YTCS", "AllowFullOut_CS05", "LiftCode" });
var strs = getdic.First().Value;
string data = await _redisData.GetHash(strs[0], strs[1]);
JObject? res = JsonConvert.DeserializeObject<JObject>(data);
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
if (result)
{
string codedata = _redisData.GetHash(strs[0], strs[2]).Result;
JObject? coderes = JsonConvert.DeserializeObject<JObject>(codedata);
string coderesult = coderes != null && coderes["Value"] != null ? coderes.Value<string>("Value")! : "";
return new { flag =true, code = coderesult };
}
else
{
return new { flag = false, code = "" };
}
}
catch (Exception ex)
{
throw new AppFriendlyException($"接口请求异常", 500);
}
var a = _db.Queryable<WmsDistaskH>().Where(p => p.id == "31900194166806").First();
await SsxControl(a, "UNLOAD");
}
public async Task SsxControl(WmsDistaskH disTask, string action)
{
@@ -309,6 +287,7 @@ namespace Tnb.WarehouseMgr
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
getdic.Add("SSX-021-005", new string[] { "YTCS", "FullOut_CS05Done", "true" });
putdic.Add("SSX-011-006", new string[] { "YTCS", "EmptyIn_CS06Done", "true" });
putdic.Add("YCLCKBGW", new string[] { "CP8", "PutDoneEmptyBox", "true" });
if (action == "LOAD")//取货
{
if (getdic.Keys.Contains(disTask.startlocation_code))
@@ -321,7 +300,8 @@ namespace Tnb.WarehouseMgr
["TagName"] = strarr[1],
["Value"] = strarr[2],
};
var str= await HttpClientHelper.GetAsync(_eleCtlCfg.WriteTagUrl, pars: dicCommand);
Logger.Information($"SsxControlLOAD:{dicCommand}");
var str= await HttpClientHelper.GetAsync(_eleCtlCfg.WriteTagUrl, new Dictionary<string, string>(), dicCommand);
Logger.Information($"SsxControlLOAD:{str}");
}
}
@@ -337,7 +317,8 @@ namespace Tnb.WarehouseMgr
["TagName"] = strarr[1],
["Value"] = strarr[2],
};
var str = await HttpClientHelper.GetAsync(_eleCtlCfg.WriteTagUrl, pars: dicCommand);
Logger.Information($"SsxControlUNLOAD:{dicCommand}");
var str = await HttpClientHelper.GetAsync(_eleCtlCfg.WriteTagUrl, new Dictionary<string, string>(), dicCommand);
Logger.Information($"SsxControlUNLOAD:{str}");
}
}