|
@@ -8,6 +8,7 @@ using System.Web; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
using System.Net.Http; |
|
|
using System.Net.Http; |
|
|
using System.Configuration; |
|
|
using System.Configuration; |
|
|
|
|
|
using System.Security.Cryptography; |
|
|
|
|
|
|
|
|
namespace BPASmartClient.AGV |
|
|
namespace BPASmartClient.AGV |
|
|
{ |
|
|
{ |
|
@@ -15,10 +16,10 @@ namespace BPASmartClient.AGV |
|
|
{ |
|
|
{ |
|
|
public static AGVHelper _Instance { get; set; } |
|
|
public static AGVHelper _Instance { get; set; } |
|
|
public static AGVHelper GetInstance => _Instance ?? (_Instance = new AGVHelper()); |
|
|
public static AGVHelper GetInstance => _Instance ?? (_Instance = new AGVHelper()); |
|
|
|
|
|
|
|
|
public AGVHelper() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AGVHelper() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 获取配置文件信息 |
|
|
/// 获取配置文件信息 |
|
@@ -39,7 +40,7 @@ namespace BPASmartClient.AGV |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
public string HttpRequest(string url, string head, string body) |
|
|
public string HttpRequest(string url, string head, string body) |
|
|
{ |
|
|
|
|
|
|
|
|
{ |
|
|
return PostData(url, head, body); |
|
|
return PostData(url, head, body); |
|
|
} |
|
|
} |
|
|
public string PostData(string url, string head, string body) |
|
|
public string PostData(string url, string head, string body) |
|
@@ -71,10 +72,28 @@ namespace BPASmartClient.AGV |
|
|
return retString;//返回响应报文 |
|
|
return retString;//返回响应报文 |
|
|
} |
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
|
|
|
/// MD5哈希摘要转16进制 |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
/// <param name="body"></param> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
public string MD5Deal(string body) |
|
|
|
|
|
{ |
|
|
|
|
|
//如果启用签名 用MD5 哈希摘要 再转16进制 |
|
|
|
|
|
MD5 md5 = MD5.Create(); |
|
|
|
|
|
byte[] bte = md5.ComputeHash(Encoding.UTF8.GetBytes(body)); |
|
|
|
|
|
StringBuilder build = new StringBuilder(); |
|
|
|
|
|
for (int i = 0; i < bte.Length; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
build.Append(bte[i].ToString("X")); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return build.ToString(); |
|
|
|
|
|
} |
|
|
|
|
|
/// <summary> |
|
|
/// AGV去1号线体装桶 |
|
|
/// AGV去1号线体装桶 |
|
|
/// </summary> |
|
|
/// </summary> |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public string AgvToLineOneLoadRoller(string robotJobId) |
|
|
|
|
|
|
|
|
public string AgvToLineOneLoadRoller(string robotJobId) |
|
|
{ |
|
|
{ |
|
|
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; |
|
|
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; |
|
|
////请求报文头 |
|
|
////请求报文头 |
|
@@ -85,7 +104,7 @@ namespace BPASmartClient.AGV |
|
|
//HttpRequestHeaderModel.GetInstance.version = "2.8"; |
|
|
//HttpRequestHeaderModel.GetInstance.version = "2.8"; |
|
|
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); |
|
|
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); |
|
|
////请求报文体 |
|
|
////请求报文体 |
|
|
//AGVModel.GetInstance.robotJobId =robotJobId ;//上游提供 |
|
|
|
|
|
|
|
|
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 |
|
|
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 |
|
|
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 |
|
|
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 |
|
|
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 |
|
|
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 |
|
|
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 |
|
@@ -100,7 +119,8 @@ namespace BPASmartClient.AGV |
|
|
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; |
|
|
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; |
|
|
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
//// string newBody = String.Join(",\r\n", bodyData.Split(','));//格式处理,看需求 |
|
|
|
|
|
|
|
|
//// string newBody = String.Join(",\r\n", body.Split(','));//格式处理,看需求 |
|
|
|
|
|
|
|
|
////货位到货位 |
|
|
////货位到货位 |
|
|
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 |
|
|
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 |
|
|
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 |
|
|
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 |
|
@@ -110,6 +130,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -157,6 +179,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data= HttpRequest(url, head, body); |
|
|
//string data= HttpRequest(url, head, body); |
|
|
//object objData= JsonConvert.DeserializeObject(data); |
|
|
//object objData= JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -204,6 +228,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -251,6 +277,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -298,6 +326,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -345,6 +375,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -392,6 +424,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -439,6 +473,8 @@ namespace BPASmartClient.AGV |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); |
|
|
|
|
|
////启用签名 |
|
|
|
|
|
////url = url + "?sign=" + MD5Deal(body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//string data = HttpRequest(url, head, body); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//object objData = JsonConvert.DeserializeObject(data); |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
|
//if (objData != null && objData is HttpResponseModel response) |
|
@@ -465,6 +501,8 @@ namespace BPASmartClient.AGV |
|
|
AGVTaskCancelModel.GetInstance.robotJobId = robotJobId; |
|
|
AGVTaskCancelModel.GetInstance.robotJobId = robotJobId; |
|
|
AGVTaskCancelModel.GetInstance.warehouseId = 123;//仓库编号 |
|
|
AGVTaskCancelModel.GetInstance.warehouseId = 123;//仓库编号 |
|
|
string body = JsonConvert.SerializeObject(AGVTaskCancelModel.GetInstance); |
|
|
string body = JsonConvert.SerializeObject(AGVTaskCancelModel.GetInstance); |
|
|
|
|
|
//启用签名 |
|
|
|
|
|
//url = url + "?sign=" + MD5Deal(body); |
|
|
string data = HttpRequest(url, head, body); |
|
|
string data = HttpRequest(url, head, body); |
|
|
object objData = JsonConvert.DeserializeObject(data); |
|
|
object objData = JsonConvert.DeserializeObject(data); |
|
|
if (objData != null && objData is HttpResponseModel response) |
|
|
if (objData != null && objData is HttpResponseModel response) |
|
@@ -490,7 +528,9 @@ namespace BPASmartClient.AGV |
|
|
//请求报文体 |
|
|
//请求报文体 |
|
|
AGVTaskCompleteNotifyModel.GetInstance.robotJobId = robotJobId; |
|
|
AGVTaskCompleteNotifyModel.GetInstance.robotJobId = robotJobId; |
|
|
AGVTaskCompleteNotifyModel.GetInstance.warehouseId = 123;//仓库编号 |
|
|
AGVTaskCompleteNotifyModel.GetInstance.warehouseId = 123;//仓库编号 |
|
|
string body=JsonConvert.SerializeObject(AGVTaskCompleteNotifyModel.GetInstance); |
|
|
|
|
|
|
|
|
string body = JsonConvert.SerializeObject(AGVTaskCompleteNotifyModel.GetInstance); |
|
|
|
|
|
//启用签名 |
|
|
|
|
|
//url = url + "?sign=" + MD5Deal(body); |
|
|
string data = HttpRequest(url, head, body); |
|
|
string data = HttpRequest(url, head, body); |
|
|
object objData = JsonConvert.DeserializeObject(data); |
|
|
object objData = JsonConvert.DeserializeObject(data); |
|
|
if (objData != null && objData is HttpResponseModel response) |
|
|
if (objData != null && objData is HttpResponseModel response) |
|
@@ -506,7 +546,7 @@ namespace BPASmartClient.AGV |
|
|
/// <param name="jobId">任务编号</param> |
|
|
/// <param name="jobId">任务编号</param> |
|
|
/// <param name="msgId">消息编号</param> |
|
|
/// <param name="msgId">消息编号</param> |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public string UpDownFeedBack(string agvCode,string jobId,string msgId) |
|
|
|
|
|
|
|
|
public string UpDownFeedBack(string agvCode, string jobId, string msgId) |
|
|
{ |
|
|
{ |
|
|
string url = AGVRequestUrl.GetInstance.TaskCompleteUrl; |
|
|
string url = AGVRequestUrl.GetInstance.TaskCompleteUrl; |
|
|
//请求报文头 |
|
|
//请求报文头 |
|
@@ -518,9 +558,11 @@ namespace BPASmartClient.AGV |
|
|
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); |
|
|
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); |
|
|
//请求报文体 |
|
|
//请求报文体 |
|
|
AGVLoadInteracteModel.GetInstance.agvCode = agvCode; |
|
|
AGVLoadInteracteModel.GetInstance.agvCode = agvCode; |
|
|
AGVLoadInteracteModel.GetInstance.jobId = jobId; |
|
|
|
|
|
AGVLoadInteracteModel.GetInstance.msgId= msgId; |
|
|
|
|
|
string body=JsonConvert.SerializeObject(AGVLoadInteracteModel.GetInstance); |
|
|
|
|
|
|
|
|
AGVLoadInteracteModel.GetInstance.jobId = jobId; |
|
|
|
|
|
AGVLoadInteracteModel.GetInstance.msgId = msgId; |
|
|
|
|
|
string body = JsonConvert.SerializeObject(AGVLoadInteracteModel.GetInstance); |
|
|
|
|
|
//启用签名 |
|
|
|
|
|
//url = url + "?sign=" + MD5Deal(body); |
|
|
string data = HttpRequest(url, head, body); |
|
|
string data = HttpRequest(url, head, body); |
|
|
object objData = JsonConvert.DeserializeObject(data); |
|
|
object objData = JsonConvert.DeserializeObject(data); |
|
|
if (objData != null && objData is HttpResponseModel response) |
|
|
if (objData != null && objData is HttpResponseModel response) |
|
|