This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user