From 3924cd556227c4b3c2fc15f6a13a95f23a5b3934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=BD=87=E9=98=B3?= Date: Fri, 31 May 2024 18:00:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPF_Cef/Common/ChunkedUpload.cs | 6 +++--- CPF_Cef/FrmMain.cs | 2 ++ CPF_Cef/MainModel.cs | 38 +++++++++++++++++++++++++++------ CPF_Cef/Parame.cs | 6 +++--- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/CPF_Cef/Common/ChunkedUpload.cs b/CPF_Cef/Common/ChunkedUpload.cs index 29f5542..dd4fa6d 100644 --- a/CPF_Cef/Common/ChunkedUpload.cs +++ b/CPF_Cef/Common/ChunkedUpload.cs @@ -148,6 +148,7 @@ namespace AksWebBrowser.Common { try { + timeout = timeout == 0 ? Parame.timeout : timeout; var client = new HttpClient(); client.Timeout = TimeSpan.FromSeconds(timeout); @@ -268,7 +269,7 @@ namespace AksWebBrowser.Common /// 获取指纹 /// /// - public async Task PostFinger(string type, int typeCode,int timeout) + public async Task PostFinger(string type, int typeCode, int timeout) { try { @@ -370,7 +371,7 @@ namespace AksWebBrowser.Common string base64 = jo4["face_data"].ToString(); if (Parame.isTMZ) { - var faceA =Utils.Base64ByImages(base64); + var faceA = Utils.Base64ByImages(base64); //开启人脸比对 LhtCF lht = new LhtCF(); string stat = lht.LhtCFFace("", faceA); @@ -448,6 +449,5 @@ namespace AksWebBrowser.Common } } } - } } diff --git a/CPF_Cef/FrmMain.cs b/CPF_Cef/FrmMain.cs index 28f0c19..a872fba 100644 --- a/CPF_Cef/FrmMain.cs +++ b/CPF_Cef/FrmMain.cs @@ -121,6 +121,8 @@ namespace AKS.EnterpriseLibrary.WebBrowser { Parame.isGPY = true; } + //开启/关闭纠偏显示 + MainModel.EnableDeskImage(1); } public void Writelog(string str, string dirName = @"logs") diff --git a/CPF_Cef/MainModel.cs b/CPF_Cef/MainModel.cs index cb492bf..1cbbfc7 100644 --- a/CPF_Cef/MainModel.cs +++ b/CPF_Cef/MainModel.cs @@ -3,6 +3,7 @@ using AksWebBrowser.Common; using AksWebBrowser.Devices; using AKSWebBrowser.Commen; using Fleck; +using LibVLCSharp.Shared; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; @@ -588,13 +589,9 @@ namespace AKS.EnterpriseLibrary.WebBrowser } else { - Task.Run(() => { HttpPostResponseBySign("open", 1, param.code, param.timeout); }); + Task.Run(() => {HttpPostResponseBySign("open", 1, param.code, param.timeout); }); @event3.WaitOne(); string result = sginStr; - if (sginStr.Contains("")) - { - result = " {\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "在规定时间内未签字" + "\"}"; - } SubmitLogs(result, "OpenSign"); return result; } @@ -684,7 +681,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser } else { - Task.Run(() => { HttpPostResponseByFinger("open", 1, param.timeout); }); + Task.Run(() => {HttpPostResponseByFinger("open", 1, param.timeout); }); event2.WaitOne(); string result = string.Empty; Log.Info("指纹数据" + fingerStr); @@ -1209,6 +1206,35 @@ namespace AKS.EnterpriseLibrary.WebBrowser } } + /// + /// 开启/关闭纠偏显示 + /// + /// + public static string EnableDeskImage(int idx) + { + //获取设备信息 + string param = "/EnableDeskImage?enable=" + idx; + Task.Run(() => HttpResponse(param)); + @event6.WaitOne(); + if (string.IsNullOrEmpty(gpyStr)) + { + return ""; + } + else + { + JObject jo = (JObject)JsonConvert.DeserializeObject(gpyStr); + if (jo["returnCode"].ToString() == "2" || jo["returnCode"].ToString() == "0") + { + return "200"; + } + else + { + // // Log.Info(jo["returnMsg"].ToString()); + return ""; + } + } + } + /// /// 拍照 /// diff --git a/CPF_Cef/Parame.cs b/CPF_Cef/Parame.cs index 15eeea6..6c95420 100644 --- a/CPF_Cef/Parame.cs +++ b/CPF_Cef/Parame.cs @@ -16,7 +16,7 @@ namespace AksWebBrowser public static TcpClient tcpClient { get; set; } public static VideoView videoV { get; set; } public static CusWebBrowser webBrowser { get; set; } - public static List FuncObject { get; set; } + public static List FuncObject { get; set; } //接口地址 public static string apiUrl = "http://192.168.0.34:92"; //授权key @@ -30,8 +30,8 @@ namespace AksWebBrowser //高拍仪devIndex public static string gpydevIndex = "0"; //签字版、指纹、身份证 - public static string signUrl = "http://127.0.0.1:9399/device"; - public static int timeout= 60; + public static string signUrl = "http://192.168.0.234:9399/device"; + public static int timeout = 3000; //票据打印机 public static string pritPj = "/dev/ttyS7"; //波特率