Commit 926b7d93 authored by 姜春辉's avatar 姜春辉

增加人证比对

增加卡芯片号上传
parent 65fba3a4
...@@ -29,6 +29,14 @@ namespace GS.Terminal.VisitorSelfService.LocalDB ...@@ -29,6 +29,14 @@ namespace GS.Terminal.VisitorSelfService.LocalDB
set { SetPropertyValue("访客证件号", ref _访客证件号, value); } set { SetPropertyValue("访客证件号", ref _访客证件号, value); }
} }
private string _访客证件芯片号;
public string 访客证件芯片号
{
get { return _访客证件芯片号; }
set { SetPropertyValue("访客证件芯片号", ref _访客证件芯片号, value); }
}
private string _预约访客Id; private string _预约访客Id;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<Dictionaries> <Dictionaries>
<Dict Caption="基础配置" Name="defaultconfig"> <Dict Caption="基础配置" Name="defaultconfig">
<Key Caption="人脸识别阀值" Name="FaceMinValue" Value="0.85"/> <Key Caption="人脸识别阀值" Name="FaceMinValue" Value="0.85"/>
<Key Caption="人证比对阀值" Name="FaceCardMatch" Value="0"/>
<Key Caption="心跳端口" Name="HeartPort" Value="18083"/> <Key Caption="心跳端口" Name="HeartPort" Value="18083"/>
<Key Caption="远程认证地址" Name="FaceWebSocket" Value="ws://192.168.1.7:15056/face/sdk2?persontype=访客"/> <Key Caption="远程认证地址" Name="FaceWebSocket" Value="ws://192.168.1.7:15056/face/sdk2?persontype=访客"/>
</Dict> </Dict>
......
...@@ -34,6 +34,26 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -34,6 +34,26 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
photo.Save(ms, ImageFormat.Jpeg); photo.Save(ms, ImageFormat.Jpeg);
photoContent = Convert.ToBase64String(ms.ToArray()); photoContent = Convert.ToBase64String(ms.ToArray());
} }
//人证比对
if (_secondcardphoto != null && LocalSetting.AddonDefaultConfig.FaceCardMatch > 0)
{
var secondcardFeature = FaceRecognization.ExtractFeatures(new System.Drawing.Bitmap(new MemoryStream(_secondcardphoto)));
var liveFeature = FaceRecognization.ExtractFeatures(photo);
if (secondcardFeature != null && liveFeature != null)
{
var score = FaceRecognization.MathFaceData(liveFeature, secondcardFeature);
if (score < LocalSetting.AddonDefaultConfig.FaceCardMatch)
{
MainShell.ShowPrompt("人证比对失败,请刷脸人证或重新登记");
return;
}
}
else
{
MainShell.ShowPrompt("人证比对失败,请重新登记");
return;
}
}
} }
MainShell.ShowLoading("提交中..."); MainShell.ShowLoading("提交中...");
Submit(info.id, photoContent).ContinueWith(task => Submit(info.id, photoContent).ContinueWith(task =>
...@@ -53,6 +73,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -53,6 +73,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{ {
LocalSetting.AppConfig.tCode, LocalSetting.AppConfig.tCode,
appointmentId, appointmentId,
secondcardid = _secondcardid,
livePhoto = photo livePhoto = photo
}); });
if (result == null) if (result == null)
...@@ -80,9 +101,12 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -80,9 +101,12 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
VM.Reset(); VM.Reset();
_ExitView = null; _ExitView = null;
} }
string _secondcardid = "";
internal void ShowDetail(List<Appointment> datas, IViewModel exitView = null) byte[] _secondcardphoto = null;
internal void ShowDetail(List<Appointment> datas, string secondcardid, byte[] idphoto, IViewModel exitView = null)
{ {
_secondcardid = secondcardid;
_secondcardphoto = idphoto;
Handlers.GetHandler<HeadHandler>().Start(); Handlers.GetHandler<HeadHandler>().Start();
if (datas?.Count == 0) if (datas?.Count == 0)
{ {
...@@ -130,6 +154,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -130,6 +154,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
var entity = new 自助登记流水(session) var entity = new 自助登记流水(session)
{ {
访客证件号 = idnum, 访客证件号 = idnum,
访客证件芯片号 = _secondcardid,
预约访客Id = dataid 预约访客Id = dataid
}; };
entity.Save(); entity.Save();
......
...@@ -3,6 +3,7 @@ using GS.Terminal.VisitorSelfService.Logic.ThirdAddon; ...@@ -3,6 +3,7 @@ using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
using GS.Unitive.Framework.Data.Xpo; using GS.Unitive.Framework.Data.Xpo;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -45,12 +46,15 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -45,12 +46,15 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
private async Task<bool> AuthSuccess(AuthenticationMode mode, object data) private async Task<bool> AuthSuccess(AuthenticationMode mode, object data)
{ {
//((dynamic)data).cardid 身份证芯片号 //((dynamic)data).cardid 身份证芯片号
//((dynamic)data).poto 身份证照片
MainShell.ShowLoading("正在查找"); MainShell.ShowLoading("正在查找");
var findResult = await Find(mode == AuthenticationMode.IdCard ? ((dynamic)data).number : data.ToString(), mode); var findResult = await Find(mode == AuthenticationMode.IdCard ? ((dynamic)data).number : data.ToString(), mode);
MainShell.HideLoading(); MainShell.HideLoading();
if (findResult?.Count > 0) if (findResult?.Count > 0)
{ {
Handlers.GetHandler<AppointmentDetailPageHandler>()?.ShowDetail(findResult); Handlers.GetHandler<AppointmentDetailPageHandler>()?.ShowDetail(findResult,
mode == AuthenticationMode.IdCard ? ((dynamic)data).cardid : "",
mode == AuthenticationMode.IdCard ? File.ReadAllBytes(((dynamic)data).poto) : "");
} }
else else
{ {
......
...@@ -34,6 +34,7 @@ namespace GS.Terminal.VisitorSelfService.Logic ...@@ -34,6 +34,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
public class AddonDefaultConfig : IDictSetting public class AddonDefaultConfig : IDictSetting
{ {
public float FaceMinValue { get; set; } public float FaceMinValue { get; set; }
public float FaceCardMatch { get; set; }
public int HeartPort { get; set; } public int HeartPort { get; set; }
public bool DisableVideoDetect { get; set; } public bool DisableVideoDetect { get; set; }
public string FaceWebSocket { get; set; } public string FaceWebSocket { get; set; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment