|
@@ -144,7 +144,7 @@ namespace UAS_MES.PublicMethod
|
|
|
if (!dic.ContainsKey("erpaccount"))
|
|
|
{
|
|
|
oMsg = dic["code"].ToString();
|
|
|
- LogManager.DoLog("oMsg:"+ oMsg);
|
|
|
+ //LogManager.DoLog("oMsg:"+ oMsg);
|
|
|
if (oMsg.Contains("200"))
|
|
|
{
|
|
|
return true;
|
|
@@ -164,6 +164,69 @@ namespace UAS_MES.PublicMethod
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ public static bool resetOutBoxStatus(string outBoxCode, out string oMsg)
|
|
|
+ {
|
|
|
+ oMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string url = "http://172.16.100.18:7010/openApi/npt/mes/resetOutBoxStatus?outBoxCode=" + outBoxCode;//html调用的地址
|
|
|
+ LogManager.DoLog(url);
|
|
|
+ HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
|
|
|
+ if (webrequest == null)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ webrequest.Method = "GET";
|
|
|
+ webrequest.Timeout = 1000;
|
|
|
+ webrequest.ContentType = "application/json; charset=utf-8";
|
|
|
+ System.Collections.Hashtable pars = new System.Collections.Hashtable();
|
|
|
+ string buffer = "";
|
|
|
+ //发送POST数据
|
|
|
+ if (!(pars == null || pars.Count == 0))
|
|
|
+ {
|
|
|
+ foreach (string key in pars.Keys)
|
|
|
+ {
|
|
|
+ buffer = buffer + "&" + key + "=" + pars[key].ToString();
|
|
|
+ }
|
|
|
+ byte[] data = Encoding.UTF8.GetBytes(buffer);
|
|
|
+ using (Stream stream = webrequest.GetRequestStream())
|
|
|
+ {
|
|
|
+ stream.Write(data, 0, data.Length);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ string[] values = webrequest.Headers.GetValues("Content-Type");
|
|
|
+ WebResponse myResponse = webrequest.GetResponse();
|
|
|
+
|
|
|
+ using (Stream resStream = myResponse.GetResponseStream())//得到回写的流
|
|
|
+ {
|
|
|
+ StreamReader newReader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
|
|
|
+ string Content = newReader.ReadToEnd();
|
|
|
+ Dictionary<string, object> dic = new Dictionary<string, object>();
|
|
|
+ dic = BaseUtil.ToDictionary(Content);
|
|
|
+ if (!dic.ContainsKey("erpaccount"))
|
|
|
+ {
|
|
|
+ oMsg = dic["message"].ToString();
|
|
|
+ LogManager.DoLog("oMsg:" + oMsg+":"+ oMsg.Equals("").ToString());
|
|
|
+ if (oMsg.Equals(""))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newReader.Close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ LogManager.DoLog(ex.Message.ToString());
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static void SendMessage(string iUserID, string iUserName, string iContext)
|
|
|
{
|