|
|
@ -20,11 +20,13 @@ using System.Net; |
|
|
|
using System.Net.Http; |
|
|
|
using System.Net.Http; |
|
|
|
using System.Net.WebSockets; |
|
|
|
using System.Net.WebSockets; |
|
|
|
using System.Reflection.Metadata; |
|
|
|
using System.Reflection.Metadata; |
|
|
|
|
|
|
|
using System.Security.Cryptography; |
|
|
|
using System.Text; |
|
|
|
using System.Text; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Web; |
|
|
|
using System.Web; |
|
|
|
|
|
|
|
using System.Xml.Linq; |
|
|
|
using static System.Net.Mime.MediaTypeNames; |
|
|
|
using static System.Net.Mime.MediaTypeNames; |
|
|
|
|
|
|
|
|
|
|
|
namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
|
namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
@ -159,6 +161,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
|
case "aks100116": |
|
|
|
case "aks100116": |
|
|
|
result = BurnFile(content); |
|
|
|
result = BurnFile(content); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
//读取问答:{ "code":"aks100117", "PetitionId": "34", "PId": "", "Name": "", "PageIndex": 1,"PageSize": 10} |
|
|
|
|
|
|
|
case "aks100117": |
|
|
|
|
|
|
|
result = ReadQuestionAnswer(content); |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}"; |
|
|
|
result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}"; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -1194,6 +1200,52 @@ namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// aks100117 读取问答 (已国产化) |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <param name="filename"></param> |
|
|
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
|
|
public static string ReadQuestionAnswer(string content) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var param = content.ConvertToAnonymousType(new |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
code = default(string), |
|
|
|
|
|
|
|
PetitionId = default(string), |
|
|
|
|
|
|
|
PId = default(string), |
|
|
|
|
|
|
|
Name = default(string), |
|
|
|
|
|
|
|
PageIndex = default(int), |
|
|
|
|
|
|
|
PageSize = default(int) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (param == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Task.Run(async () => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QuestionAnswer(param.PetitionId, param.PId, param.Name, param.PageIndex, param.PageSize); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
@event10.WaitOne(); |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(qwStr)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "获取数据失败" + "\"}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + param.code + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"" + qwStr + "\"}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
//Log.Error("唤醒键盘异常: " + ex.Message + ""); |
|
|
|
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 执行文件 |
|
|
|
/// 执行文件 |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
@ -1680,6 +1732,24 @@ namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//读取问答 |
|
|
|
|
|
|
|
private static string qwStr = string.Empty; |
|
|
|
|
|
|
|
private static AutoResetEvent @event10 = new AutoResetEvent(false); |
|
|
|
|
|
|
|
private static async void QuestionAnswer(string PetitionId, string PId, string Name, int PageIndex, int PageSize) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var httpClient = new HttpClient(); |
|
|
|
|
|
|
|
var uploader = new ChunkedUpload(httpClient); |
|
|
|
|
|
|
|
qwStr = await uploader.GetQuestionAnswer(PetitionId, PId, Name, PageIndex, PageSize); |
|
|
|
|
|
|
|
@event10.Set(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
//Log.Error("上传本地文件中转异常:" + ex.Message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//根据程序名称杀死进程 |
|
|
|
//根据程序名称杀死进程 |
|
|
|
public static void KillProcessByName(string processName) |
|
|
|
public static void KillProcessByName(string processName) |
|
|
|
{ |
|
|
|
{ |
|
|
|