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

增加人证比对

增加卡芯片号上传
parent 65fba3a4
......@@ -29,6 +29,14 @@ namespace GS.Terminal.VisitorSelfService.LocalDB
set { SetPropertyValue("访客证件号", ref _访客证件号, value); }
}
private string _访客证件芯片号;
public string 访客证件芯片号
{
get { return _访客证件芯片号; }
set { SetPropertyValue("访客证件芯片号", ref _访客证件芯片号, value); }
}
private string _预约访客Id;
......
......@@ -3,6 +3,7 @@
<Dictionaries>
<Dict Caption="基础配置" Name="defaultconfig">
<Key Caption="人脸识别阀值" Name="FaceMinValue" Value="0.85"/>
<Key Caption="人证比对阀值" Name="FaceCardMatch" Value="0"/>
<Key Caption="心跳端口" Name="HeartPort" Value="18083"/>
<Key Caption="远程认证地址" Name="FaceWebSocket" Value="ws://192.168.1.7:15056/face/sdk2?persontype=访客"/>
</Dict>
......@@ -11,10 +12,10 @@
<Key Caption="二代证识别" Name="EnableIdCard" Value="false"/>
<Key Caption="二维码识别" Name="EnableQRCode" Value="false"/>
<!--0是人脸识别 1是二代证识别 2是二维码识别-->
<Key Caption="默认识别方式" Name="DefaultAuthMode" Value="1"/>
<Key Caption="默认识别方式" Name="DefaultAuthMode" Value="1"/>
</Dict>
</Dictionaries>
<Structures>
<Structures>
<Structure Caption="服务地址配置" Name="ServiceList">
<Declare>
<Property Caption="服务描述" Name="Description"/>
......
......@@ -34,6 +34,26 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
photo.Save(ms, ImageFormat.Jpeg);
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("提交中...");
Submit(info.id, photoContent).ContinueWith(task =>
......@@ -53,6 +73,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{
LocalSetting.AppConfig.tCode,
appointmentId,
secondcardid = _secondcardid,
livePhoto = photo
});
if (result == null)
......@@ -80,9 +101,12 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
VM.Reset();
_ExitView = null;
}
internal void ShowDetail(List<Appointment> datas, IViewModel exitView = null)
string _secondcardid = "";
byte[] _secondcardphoto = null;
internal void ShowDetail(List<Appointment> datas, string secondcardid, byte[] idphoto, IViewModel exitView = null)
{
_secondcardid = secondcardid;
_secondcardphoto = idphoto;
Handlers.GetHandler<HeadHandler>().Start();
if (datas?.Count == 0)
{
......@@ -130,6 +154,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
var entity = new 自助登记流水(session)
{
访客证件号 = idnum,
访客证件芯片号 = _secondcardid,
预约访客Id = dataid
};
entity.Save();
......
......@@ -3,6 +3,7 @@ using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
using GS.Unitive.Framework.Data.Xpo;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -45,12 +46,15 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
private async Task<bool> AuthSuccess(AuthenticationMode mode, object data)
{
//((dynamic)data).cardid 身份证芯片号
//((dynamic)data).poto 身份证照片
MainShell.ShowLoading("正在查找");
var findResult = await Find(mode == AuthenticationMode.IdCard ? ((dynamic)data).number : data.ToString(), mode);
MainShell.HideLoading();
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
{
......
......@@ -34,6 +34,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
public class AddonDefaultConfig : IDictSetting
{
public float FaceMinValue { get; set; }
public float FaceCardMatch { get; set; }
public int HeartPort { get; set; }
public bool DisableVideoDetect { 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