This commit is contained in:
jl
2024-12-05 14:36:37 +08:00
parent 261fde99ce
commit 4e4c0dbb59
5 changed files with 69 additions and 16 deletions

View File

@ -12,6 +12,8 @@ namespace Epost.Common
public class AgvHelper
{
string agvSchedulingTaskUrl = ConfigurationManager.AppSettings["agvSchedulingTaskUrl"];
string bindCtnrAndBinUrl = ConfigurationManager.AppSettings["bindCtnrAndBinUrl"];
HttpHelper http = new HttpHelper();
#region
public AgvResultModel genAgvSchedulingTask(AgvSchedulingTaskModel model)
@ -103,5 +105,44 @@ namespace Epost.Common
}
#endregion
#region
public bindCtnrAndBinResponse bindCtnrAndBin(string agvloc, string type)
{
bindCtnrAndBinReq reqModel = new bindCtnrAndBinReq();
bindCtnrAndBinResponse resmodel = new bindCtnrAndBinResponse();
reqModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
reqModel.ctnrTyp = "1";//agv提供
reqModel.indBind = "1";
reqModel.stgBinCode = agvloc;
reqModel.ctnrCode = agvloc;
string reqstr = JsonHelper.SerializeObject(reqModel);
LogHelper.WriteLogInfo("调用AGV绑定解绑接口请求参数" + reqstr, LogHelper.Log_Type.INFO);
string resultStr = http.HttpPost_Old(bindCtnrAndBinUrl, reqstr);
LogHelper.WriteLogInfo("调用AGV绑定解绑接口返回" + resultStr, LogHelper.Log_Type.INFO);
if (!string.IsNullOrEmpty(resultStr))
{
resmodel = JsonHelper.DeserializeObject<bindCtnrAndBinResponse>(resultStr);
if (resmodel.code == "0")
{
LogHelper.WriteLogInfo("调用AGV绑定解绑接口成功", LogHelper.Log_Type.INFO);
}
else
{
LogHelper.WriteLogInfo("调用AGV绑定解绑接口失败" + resmodel.data, LogHelper.Log_Type.ERROR);
}
}
else
{
LogHelper.WriteLogInfo("调用AGV绑定解绑接口返回失败", LogHelper.Log_Type.ERROR);
}
return resmodel;
}
#endregion
}
}