dep
wangsr 1 year ago
commit cd3cee5246

@ -16,6 +16,10 @@ namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking
}
public class GetLGResJson
{
public int code { get; set; }

@ -1,4 +1,8 @@
using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
@ -24,10 +28,39 @@ namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking
}
public string GetLGInfo()
public Dictionary<int, string> GetLGInfo()
{
string stry = new GetLGInfoEntity().JsonTo();
return Post("http://192.168.202.34:30000/prod-api/open/openInterface/getLGInfo", stry);
Dictionary<int, string> dic = new Dictionary<int, string>();
for (int i = 1; i <= 8; i++)
{
dic.Add(i, "");
}
try
{
string stry = new GetLGInfoEntity().JsonTo();
var str = Post("http://192.168.202.34:30000/prod-api/open/openInterface/getLGInfo", stry);
var job = JObject.Parse(str);
if (job["code"].ToString()== "200")
{
JArray arr = job["data"] as JArray;
foreach (JObject item in arr)
{
var key = Convert.ToInt32(item["bucketCode"].ToString().Replace("L", ""));
var value = item["materialCode"].ToString() == "mix01" ? "有烟" : "无烟";
dic[key] = value;
}
}
return dic;
}
catch (Exception ex)
{
return dic;
}
}

@ -16,7 +16,7 @@ using ICSharpCode.Core;
using log4net;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.InterfaceDocking;
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
using Mesnac.Action.ChemicalWeighing.MinAn;
using Mesnac.Action.ChemicalWeighing.Report;
@ -43,7 +43,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test
public void theout(object source, EventArgs e)
{
// ReportReadDb.Read();
}
public void Run(RuntimeParameter runtime)
@ -81,7 +81,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test
private void MCButton_Click(object sender, EventArgs e)
{
ReportReadDb.Read();
new HttpResponse().GetLGInfo();
}
}
}

Loading…
Cancel
Save