|
|
|
@ -49,6 +49,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("读取身份证设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取身份证设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"1\",\"param\":{\"data\":\"" + "" + "\"}}"; |
|
|
|
@ -87,6 +91,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("打印排队票据设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印排队票据设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
string paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"2\",\"param\":{\"ph\":\"" + ph + "\",\"ddrs\":\"" + ddrs + "\",\"qrcode\":\"" + qrcode + "\",\"ywmc\":\"" + ywmc + "\"}}"; |
|
|
|
@ -127,6 +135,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("文字语音播报设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "文字语音播报设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
string paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"3\",\"param\":{\"text\":\"" + text + "\",\"ispaye\":\"" + ispaye + "\"}}"; |
|
|
|
@ -228,6 +240,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("发送短信设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "发送短信设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
string paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"4\",\"param\":{\"content\":\"" + content + "\",\"phone\":\"" + phone + "\"}}"; |
|
|
|
@ -263,6 +279,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("高拍仪设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "高拍仪设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
string paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"5\",\"param\":{\"url\":\"" + url + "\"}}"; |
|
|
|
@ -270,9 +290,9 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
string base64 = str2Base64(paramsString); |
|
|
|
|
string str = tcpClients.SendDataWithHeader(Parame.tcpClient.GetStream(), base64); |
|
|
|
|
string data = Base64str2(str); |
|
|
|
|
if (data == "400") |
|
|
|
|
if (data == "400" || data.Contains("fali")) |
|
|
|
|
{ |
|
|
|
|
string result = "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "扫描文件失败" + "\"}"; |
|
|
|
|
string result = "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "扫描文件失败,请重新扫描!" + "\"}"; |
|
|
|
|
SubmitLogs(result, "openCamera"); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
@ -308,6 +328,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("签字版设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "签字版设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"6\",\"param\":{\"data\":\"" + "" + "\"}}"; |
|
|
|
@ -343,6 +367,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("签字版设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "签字版设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"7\",\"param\":{\"data\":\"" + "" + "\"}}"; |
|
|
|
@ -378,6 +406,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("签字版设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "签字版设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
string paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"8\",\"param\":{\"url\":\"" + url + "\"}}"; |
|
|
|
@ -385,7 +417,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
string base64 = str2Base64(paramsString); |
|
|
|
|
string str = tcpClients.SendDataWithHeader(Parame.tcpClient.GetStream(), base64); |
|
|
|
|
string data = Base64str2(str); |
|
|
|
|
if (data == "400") |
|
|
|
|
if (data == "400"|| data.Contains("fali")) |
|
|
|
|
{ |
|
|
|
|
string result = "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "获取签字失败" + "\"}"; |
|
|
|
|
SubmitLogs(result, "OpenSign"); |
|
|
|
@ -426,6 +458,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("录音设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "录音设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
string paramsString = "{\"callback\":\"" + callback + "\",\"type\":\"11\",\"param\":{\"isopen\":\"" + isopen + "\",\"url\":\"" + url + "\"}}"; |
|
|
|
@ -436,7 +472,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
if (!string.IsNullOrEmpty(url) && !isopen) |
|
|
|
|
{ |
|
|
|
|
string tt = Base64str2(str); |
|
|
|
|
Log.Info(tt); |
|
|
|
|
Log.Info("结束录音上传文件"+tt); |
|
|
|
|
//下载文件 |
|
|
|
|
DateTime dateTime = DateTime.Now; |
|
|
|
|
string time = DateTime.Now.ToString( |
|
|
|
@ -447,7 +483,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Directory.CreateDirectory(dirpath); |
|
|
|
|
} |
|
|
|
|
var filepath = System.IO.Path.Combine(dirpath, time); |
|
|
|
|
string path = dirpath + @"/" + time + ".wav" ; |
|
|
|
|
string path = dirpath + @"/" + time + ".wav"; |
|
|
|
|
WebRequest request = WebRequest.Create(tt); |
|
|
|
|
WebResponse response = request.GetResponse(); |
|
|
|
|
using (Stream stream = response.GetResponseStream()) |
|
|
|
@ -459,7 +495,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
} |
|
|
|
|
response.Close(); |
|
|
|
|
//上传文件 |
|
|
|
|
Task.Run(async () =>{UploadInfo(url, path);}); |
|
|
|
|
Task.Run(async () => { UploadInfo(url, path); }); |
|
|
|
|
@event2.WaitOne(); |
|
|
|
|
Regex re = new Regex(@"(((?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(:[0-9]+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)"); |
|
|
|
|
MatchCollection mc = re.Matches(url);//获取的是一个数组 |
|
|
|
@ -501,6 +537,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("打印机设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印机设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Task.Run(async () => |
|
|
|
@ -529,15 +569,6 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
string command = $"lp -d {PrinterName} {path}"; |
|
|
|
|
ShllCommad(command); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//string id = Guid.NewGuid().ToString(); |
|
|
|
|
////通过文件发送数据 |
|
|
|
|
//com.NewMethod(path, id); |
|
|
|
|
//string paramsString = "{\"callback\":\"" + callback + "\",\"bsid\":\"" + id + "\",\"type\":\"9\",\"param\":{\"url\":\"" + url + "\",\"ext\":\"" + ext + "\"}}"; |
|
|
|
|
//Log.Info("根据文件地址在线打印: " + paramsString + ""); |
|
|
|
|
//string base64_1 = str2Base64(paramsString); |
|
|
|
|
//string str = com.SendData(base64_1, callback); |
|
|
|
|
//return Base64str2(str); |
|
|
|
|
string result = "{\"callback\":\"" + callback + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "打印成功" + "\"}"; |
|
|
|
|
SubmitLogs(result, "PrintFile"); |
|
|
|
|
return result; |
|
|
|
@ -569,6 +600,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("打印机设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印机设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Task.Run(async () => |
|
|
|
@ -643,10 +678,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
Utils.MessagesBox("音频设备未授权使用"); |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "音频设备未授权使用" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else if (Parame.tcpClient == null) |
|
|
|
|
{ |
|
|
|
|
return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "硬件服务未启动" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Log.Info("播放音频文件: " + url + ""); |
|
|
|
|
Log.Info("是否播放: " + ispaly + ""); |
|
|
|
|
if (ispaly) |
|
|
|
|
{ |
|
|
|
|
Task.Run(() => |
|
|
|
|