|
|
@@ -7,6 +7,8 @@ using System.Text.RegularExpressions;
|
|
7
|
7
|
using System.Net;
|
|
8
|
8
|
using System.IO;
|
|
9
|
9
|
using System.Net.NetworkInformation;
|
|
|
10
|
+using CallCenterApi.DB;
|
|
|
11
|
+using System.Collections.Generic;
|
|
10
|
12
|
|
|
11
|
13
|
namespace CallCenterApi.Common
|
|
12
|
14
|
{
|
|
|
@@ -324,5 +326,71 @@ namespace CallCenterApi.Common
|
|
324
|
326
|
|
|
325
|
327
|
return inUse;
|
|
326
|
328
|
}
|
|
|
329
|
+
|
|
|
330
|
+
|
|
|
331
|
+ /// <summary>
|
|
|
332
|
+ /// ///// 12345来源是110平台的工单结案时调用这个接口更新110的表的数据
|
|
|
333
|
+ /// </summary>
|
|
|
334
|
+ /// <param name="workorderid"></param>
|
|
|
335
|
+ public static void pushresult(string workorderid)
|
|
|
336
|
+ {
|
|
|
337
|
+ string url = Configs.GetValue("PushAyResultUrl");
|
|
|
338
|
+ // string url = "http://localhost:51927/api/BusWorkorder/update";
|
|
|
339
|
+
|
|
|
340
|
+ Model.T_Bus_WorkOrder oldmodel = new BLL.T_Bus_WorkOrder().GetModel(workorderid);
|
|
|
341
|
+
|
|
|
342
|
+ //根据工单编号获取110的报警单编号
|
|
|
343
|
+ string jjdbh = "";
|
|
|
344
|
+ var objorderid = DbHelperSQL.GetSingle("select jjdbh from dy_jjdb where workorderId='" + workorderid + "'");
|
|
|
345
|
+ if (objorderid != null)
|
|
|
346
|
+ {
|
|
|
347
|
+ jjdbh = objorderid.ToString();
|
|
|
348
|
+ }
|
|
|
349
|
+ else
|
|
|
350
|
+ {
|
|
|
351
|
+
|
|
|
352
|
+ return;
|
|
|
353
|
+ }
|
|
|
354
|
+
|
|
|
355
|
+ Dictionary<string, object> dic = new Dictionary<string, object>();
|
|
|
356
|
+ dic.Add("jjdbh", jjdbh);
|
|
|
357
|
+ dic.Add("F_Result", oldmodel.F_Result);
|
|
|
358
|
+
|
|
|
359
|
+ var result = Post(url, dic);
|
|
|
360
|
+
|
|
|
361
|
+ }
|
|
|
362
|
+ public static string Post(string url, Dictionary<string, object> dic)
|
|
|
363
|
+ {
|
|
|
364
|
+ string result = "";
|
|
|
365
|
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
|
|
366
|
+ req.Method = "POST";
|
|
|
367
|
+ req.ContentType = "application/x-www-form-urlencoded";
|
|
|
368
|
+ #region 添加Post 参数
|
|
|
369
|
+ StringBuilder builder = new StringBuilder();
|
|
|
370
|
+ int i = 0;
|
|
|
371
|
+ foreach (var item in dic)
|
|
|
372
|
+ {
|
|
|
373
|
+ if (i > 0)
|
|
|
374
|
+ builder.Append("&");
|
|
|
375
|
+ builder.AppendFormat("{0}={1}", item.Key, item.Value);
|
|
|
376
|
+ i++;
|
|
|
377
|
+ }
|
|
|
378
|
+ byte[] data = Encoding.UTF8.GetBytes(builder.ToString());
|
|
|
379
|
+ req.ContentLength = data.Length;
|
|
|
380
|
+ using (Stream reqStream = req.GetRequestStream())
|
|
|
381
|
+ {
|
|
|
382
|
+ reqStream.Write(data, 0, data.Length);
|
|
|
383
|
+ reqStream.Close();
|
|
|
384
|
+ }
|
|
|
385
|
+ #endregion
|
|
|
386
|
+ HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
|
|
387
|
+ Stream stream = resp.GetResponseStream();
|
|
|
388
|
+ //获取响应内容
|
|
|
389
|
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
|
|
|
390
|
+ {
|
|
|
391
|
+ result = reader.ReadToEnd();
|
|
|
392
|
+ }
|
|
|
393
|
+ return result;
|
|
|
394
|
+ }
|
|
327
|
395
|
}
|
|
328
|
396
|
}
|