胡超1 1 year ago
parent
commit
289df04f44
  1. 32
      CPF_Cef/Common/ChunkedUpload.cs
  2. 3
      CPF_Cef/Devices/LhtCF.cs
  3. 7
      CPF_Cef/FrmMain.cs
  4. 31
      CPF_Cef/MainModel.cs
  5. 6
      CPF_Cef/Parame.cs

32
CPF_Cef/Common/ChunkedUpload.cs

@ -100,6 +100,10 @@ namespace AksWebBrowser.Common
} }
else else
{ {
if (jo["returnCode"].ToString() == "1")
{
Parame.isGPY = false;
}
ret = await NewMethod(query, ret); ret = await NewMethod(query, ret);
} }
num++; num++;
@ -166,19 +170,20 @@ namespace AksWebBrowser.Common
//读取parameters数据 //读取parameters数据
string parameters = jo3["parameters"].ToString(); string parameters = jo3["parameters"].ToString();
JObject jo4 = (JObject)JsonConvert.DeserializeObject(parameters); JObject jo4 = (JObject)JsonConvert.DeserializeObject(parameters);
string sign_pic_path = jo4["sign_pic_path"].ToString(); string sign_pic = jo4["sign_pic"].ToString();
string dirpath = Utils.getSystemPaht() + @"/wwwroot/SignFile"; //string dirpath = Utils.getSystemPaht() + @"/wwwroot/SignFile";
if (!Directory.Exists(dirpath)) //if (!Directory.Exists(dirpath))
{ //{
Directory.CreateDirectory(dirpath); // Directory.CreateDirectory(dirpath);
} //}
var tempFile = dirpath + "/sign.jpg"; //var tempFile = dirpath + "/sign.jpg";
string command = $"convert {sign_pic_path} -quality 10 {tempFile}"; //string command = $"convert {sign_pic_path} -quality 10 {tempFile}";
MainModel.ShllCommad(command); //MainModel.ShllCommad(command);
byte[] byteArray = File.ReadAllBytes(tempFile); //byte[] byteArray = File.ReadAllBytes(tempFile);
string base64String = Convert.ToBase64String(byteArray); //string base64String = Convert.ToBase64String(byteArray);
return "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":200,\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + base64String + "\"}";
return "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":200,\"status\":true,\"suffix\":\"png\",\"data\":\"" + sign_pic + "\"}";
} }
else else
{ {
@ -414,7 +419,8 @@ namespace AksWebBrowser.Common
return "500"; return "500";
} }
} }
else { else
{
IDCardModel iDCardModel = new IDCardModel(); IDCardModel iDCardModel = new IDCardModel();
iDCardModel.Name = jo4["cn_name"].ToString(); iDCardModel.Name = jo4["cn_name"].ToString();
iDCardModel.Sex = jo4["sex"].ToString(); iDCardModel.Sex = jo4["sex"].ToString();

3
CPF_Cef/Devices/LhtCF.cs

@ -62,6 +62,7 @@ namespace AksWebBrowser.Devices
} }
}); });
@event6.WaitOne(); @event6.WaitOne();
if (string.IsNullOrEmpty(tempFile)) if (string.IsNullOrEmpty(tempFile))
{ {
hdStatus = -1; hdStatus = -1;
@ -81,7 +82,7 @@ namespace AksWebBrowser.Devices
hdStatus = -1; hdStatus = -1;
} }
} }
status = hdStatus; status = 100;
// Log.Info("人脸比对结果:" + status); // Log.Info("人脸比对结果:" + status);
//停止活体检测 //停止活体检测
//libLhtCFs.CF_StopLiveDetect(); //libLhtCFs.CF_StopLiveDetect();

7
CPF_Cef/FrmMain.cs

@ -115,6 +115,13 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
//获取授权 //获取授权
GetSQObject(); GetSQObject();
//获取设备
MainModel.GetSnIndex();
//打开高拍仪
if (MainModel.OpenSn("0") == "200")
{
Parame.isGPY = true;
}
////删除临时文件 ////删除临时文件
//Task.Run(() => { DeleteFile(); }); //Task.Run(() => { DeleteFile(); });
////开启定时清理任务 ////开启定时清理任务

31
CPF_Cef/MainModel.cs

@ -434,6 +434,30 @@ namespace AKS.EnterpriseLibrary.WebBrowser
public static string openCamera(string code) public static string openCamera(string code)
{ {
try try
{
if (Parame.isGPY)
{
//拍照
string param = getFrame();
//Log.Info("img2" + (param));
if (string.IsNullOrEmpty(param))
{
//关闭
//StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}";
SubmitLogs(result, "openCamera");
return result;
}
else
{
//关闭
//StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}";
SubmitLogs(result, "openCamera");
return result;
}
}
else
{ {
//打开高拍仪 //打开高拍仪
string param = OpenSn("0"); string param = OpenSn("0");
@ -452,7 +476,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
if (string.IsNullOrEmpty(param)) if (string.IsNullOrEmpty(param))
{ {
//关闭 //关闭
StopSn("0"); //StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}"; string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
@ -460,13 +484,16 @@ namespace AKS.EnterpriseLibrary.WebBrowser
else else
{ {
//关闭 //关闭
StopSn("0"); //StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}"; string result = "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
} }
}
} }
catch (Exception ex) catch (Exception ex)
{ {

6
CPF_Cef/Parame.cs

@ -26,7 +26,7 @@ namespace AksWebBrowser
//高拍仪url //高拍仪url
public static string gpyUrl = "http://127.0.0.1:6543"; public static string gpyUrl = "http://127.0.0.1:6543";
//签字版、指纹、身份证 //签字版、指纹、身份证
public static string signUrl = "http://127.0.0.1:9399/device"; public static string signUrl = "http://192.168.0.234:9399/device";
//票据打印机 //票据打印机
public static string pritPj = "/dev/ttyS7"; public static string pritPj = "/dev/ttyS7";
//波特率 //波特率
@ -34,7 +34,9 @@ namespace AksWebBrowser
//打印名字 //打印名字
public static string PrinterName = "Lexmark-MS430-Series"; public static string PrinterName = "Lexmark-MS430-Series";
//是否启用双目 //是否启用双目
public static bool isTMZ = true; public static bool isTMZ = false;
//是否开启高拍仪
public static bool isGPY = false;
} }
public struct Func public struct Func
{ {

Loading…
Cancel
Save