Commit 4f337a8f authored by 姜春辉's avatar 姜春辉

feat: 增加防疫信息获取

parent 084c8037
...@@ -47,6 +47,8 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -47,6 +47,8 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// <param name="cardMsg"></param> /// <param name="cardMsg"></param>
public static void CardCallback(dynamic cardMsg) public static void CardCallback(dynamic cardMsg)
{ {
if (Program.Loading) return;
string cardNum = cardMsg.OperaDeviceData.Message; string cardNum = cardMsg.OperaDeviceData.Message;
#if DEBUG #if DEBUG
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#endregion #endregion
using GS.EnterpriseIdentification.ServiceModel; using GS.EnterpriseIdentification.ServiceModel;
using GS.Terminal.Frame.AddonServices;
using GS.Terminal.Identification.Enterprise.Logic.Core; using GS.Terminal.Identification.Enterprise.Logic.Core;
using GS.Unitive.Framework.Core; using GS.Unitive.Framework.Core;
using IdentificationViewModels; using IdentificationViewModels;
...@@ -39,7 +40,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -39,7 +40,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
internal static void OnRecognized(string key, float score) internal static void OnRecognized(string key, float score)
{ {
if (Program.Loading) return;
try try
{ {
ViewModel.IsStandby = false; ViewModel.IsStandby = false;
...@@ -50,7 +51,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -50,7 +51,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
if (visitor != null) if (visitor != null)
{ {
Program.speakService.VoiceBySoundPlayer("识别成功"); Program.speakService.VoiceBySoundPlayer("识别成功");
LogicHandler.HandlerIdentify(visitor, false, score); LogicHandler.HandlerIdentify(visitor, false, score);
return; return;
} }
...@@ -58,7 +59,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -58,7 +59,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
if (employee != null) if (employee != null)
{ {
Program.speakService.VoiceBySoundPlayer("已识别"); Program.speakService.VoiceBySoundPlayer("已识别");
LogicHandler.HandlerIdentify(employee, false, score); LogicHandler.HandlerIdentify(employee, false, score);
return; return;
} }
...@@ -66,7 +67,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -66,7 +67,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
if (temp != null) if (temp != null)
{ {
Program.speakService.VoiceBySoundPlayer("已识别"); Program.speakService.VoiceBySoundPlayer("已识别");
LogicHandler.HandlerIdentify(temp, false, score); LogicHandler.HandlerIdentify(temp, false, score);
return; return;
} }
...@@ -84,5 +85,32 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -84,5 +85,32 @@ namespace GS.Terminal.Identification.Enterprise.Logic
MainHandler.CleanViewTimer.Start(); MainHandler.CleanViewTimer.Start();
} }
} }
internal static HealthStatus CheckStatus(VisitInfo visitInfo = null, Employee employee = null, TemporaryStaff temporaryStaff = null)
{
try
{
Program.Loading = true;
MainShell.ShowLoading("健康码核验中,请稍后....");
if (visitInfo != null)
{
return Heath.GetEmployeeStatus(visitInfo.VisitorName, visitInfo.VisitorIdNum);
}
else if (employee != null)
{
return Heath.GetEmployeeStatus(employee.Id);
}
else if (temporaryStaff != null)
{
return Heath.GetEmployeeStatus(temporaryStaff.id);
}
return null;
}
finally
{
MainShell.HideLoading();
Program.Loading = false;
}
}
} }
} }
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
using GalaSoft.MvvmLight.Threading; using GalaSoft.MvvmLight.Threading;
using GS.EnterpriseIdentification.ServiceModel; using GS.EnterpriseIdentification.ServiceModel;
using GS.Terminal.Frame.AddonServices;
using GS.Terminal.Identification.DbHandler; using GS.Terminal.Identification.DbHandler;
using GS.Terminal.Identification.Enterprise.Logic.Core; using GS.Terminal.Identification.Enterprise.Logic.Core;
using GS.Terminal.Identification.LocalDbModel; using GS.Terminal.Identification.LocalDbModel;
...@@ -40,6 +41,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -40,6 +41,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// </summary> /// </summary>
public class LogicHandler public class LogicHandler
{ {
private static MainPageViewModel ViewModel => Program.locator.MainPage; private static MainPageViewModel ViewModel => Program.locator.MainPage;
/// <summary> /// <summary>
...@@ -68,12 +72,13 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -68,12 +72,13 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// <param name="human"></param> /// <param name="human"></param>
internal static void AddToHistory(Human human) internal static void AddToHistory(Human human)
{ {
var size = Program.config.LogicConfig.HealthScope == Config.HealthScope.不核验 ? 8 : 4;
DispatcherHelper.RunAsync(() => DispatcherHelper.RunAsync(() =>
{ {
ViewModel.VisitHistory.Insert(0, human); ViewModel.VisitHistory.Insert(0, human);
if (ViewModel.VisitHistory.Count > 8) if (ViewModel.VisitHistory.Count > size)
{ {
ViewModel.VisitHistory.RemoveAt(8); ViewModel.VisitHistory.RemoveAt(size);
} }
}); });
} }
...@@ -83,7 +88,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -83,7 +88,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// </summary> /// </summary>
/// <param name="human"></param> /// <param name="human"></param>
/// <param name="employee"></param> /// <param name="employee"></param>
private static void InsertToDb(Human human, Employee employee, double faceResult) private static void InsertToDb(Human human, Employee employee, double faceResult, HealthStatus status)
{ {
var id = Guid.NewGuid(); var id = Guid.NewGuid();
Task.Run(() => Task.Run(() =>
...@@ -104,6 +109,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -104,6 +109,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic
是否访客 = false, 是否访客 = false,
面部识别对比结果 = faceResult, 面部识别对比结果 = faceResult,
进出标识 = human.Tag, 进出标识 = human.Tag,
健康码颜色 = status?.healthcolor,
核酸检测结果 = status != null ? status.nat : 0,
疫苗接种剂次 = status != null ? status.inoculationtimes : 0,
现场照片 = Program.config.LogicConfig.IsTakePhoto ? Tools.SaveFile(ViewModel.ActiveVideo) : null, 现场照片 = Program.config.LogicConfig.IsTakePhoto ? Tools.SaveFile(ViewModel.ActiveVideo) : null,
}); });
} }
...@@ -273,13 +281,21 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -273,13 +281,21 @@ namespace GS.Terminal.Identification.Enterprise.Logic
//处理本次识别 //处理本次识别
var human = GenHuman(identifyVisit, isCard); var human = GenHuman(identifyVisit, isCard);
human.Tag = identityTag; human.Tag = identityTag;
HealthStatus status = null;
#if DEBUG if (Program.config.LogicConfig.HealthScope.HasFlag(Config.HealthScope.验证访客))
///测试人脸阈值 {
//human.Name += faceResult.ToString("f2"); status = Heath.GetEmployeeStatus(identifyVisit.VisitEmplyName, identifyVisit.VisitorIdNum);
///测试人脸阈值 if (!status.success)
#endif {
MainShell.ShowPrompt(status.message);
Program.speakService.VoiceBySoundPlayer(status.message);
}
else
{
Program.speakService.VoiceBySoundPlayer(status.message);
}
human.SetHealth(status);
}
ViewModel.ActiveHuman = human; ViewModel.ActiveHuman = human;
AddToHistory(human); AddToHistory(human);
...@@ -310,15 +326,26 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -310,15 +326,26 @@ namespace GS.Terminal.Identification.Enterprise.Logic
//处理本次识别 //处理本次识别
var human = GenHuman(identifyEmployee, isCard); var human = GenHuman(identifyEmployee, isCard);
human.Tag = identityTag; human.Tag = identityTag;
#if DEBUG
//测试人脸阈值
human.Name += faceResult.ToString("f2");
///测试人脸阈值
#endif
ViewModel.ActiveHuman = human; ViewModel.ActiveHuman = human;
HealthStatus status = null;
if (Program.config.LogicConfig.HealthScope.HasFlag(Config.HealthScope.验证员工))
{
status = Heath.GetEmployeeStatus(identifyEmployee.Id);
if (!status.success)
{
MainShell.ShowPrompt(status.message);
Program.speakService.VoiceBySoundPlayer(status.message);
}
else
{
Program.speakService.VoiceBySoundPlayer(status.message);
}
human.SetHealth(status);
}
AddToHistory(human); AddToHistory(human);
InsertToDb(human, identifyEmployee, faceResult); InsertToDb(human, identifyEmployee, faceResult, status);
} }
} }
...@@ -345,16 +372,89 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -345,16 +372,89 @@ namespace GS.Terminal.Identification.Enterprise.Logic
//处理本次识别 //处理本次识别
var human = GenHuman(identifyEmployee, isCard); var human = GenHuman(identifyEmployee, isCard);
human.Tag = identityTag; human.Tag = identityTag;
#if DEBUG HealthStatus status = null;
//测试人脸阈值 if (Program.config.LogicConfig.HealthScope.HasFlag(Config.HealthScope.验证临时人员))
human.Name += faceResult.ToString("f2"); {
///测试人脸阈值 status = Heath.GetEmployeeStatus(identifyEmployee.id);
#endif if (!status.success)
{
MainShell.ShowPrompt(status.message);
Program.speakService.VoiceBySoundPlayer(status.message);
}
else
{
Program.speakService.VoiceBySoundPlayer(status.message);
}
human.SetHealth(status);
}
ViewModel.ActiveHuman = human; ViewModel.ActiveHuman = human;
AddToHistory(human); AddToHistory(human);
InsertToDb(human, identifyEmployee, faceResult); InsertToDb(human, identifyEmployee, faceResult);
} }
} }
} }
public static class HumanExtendsion
{
public const string GRAY = "#b7b7b7";
public const string BLUE = "#4cb5f5";
public const string GREEN = "#23b601";
public const string YELLOW = "#f9ab15";
public const string RED = "#FF0000";
public static void SetHealth(this Human human, HealthStatus healthStatus)
{
human.ShowHealthColor = Program.config.LogicConfig.HealthItem.HasFlag(Config.HealthItemType.健康码) ? Visibility.Visible : Visibility.Collapsed;
human.ShowNat = Program.config.LogicConfig.HealthItem.HasFlag(Config.HealthItemType.核酸) ? Visibility.Visible : Visibility.Collapsed;
human.ShowInoculationt = Program.config.LogicConfig.HealthItem.HasFlag(Config.HealthItemType.疫苗接种剂次) ? Visibility.Visible : Visibility.Collapsed;
human.HealthColor = healthStatus.healthcolor;
human.NatTime_Date = healthStatus.nattime == DateTime.MinValue ? "- -" : healthStatus.nattime.ToString("MM-dd");
human.NatTime_Time = healthStatus.nattime == DateTime.MinValue ? "--:--:--" : healthStatus.nattime.ToString("HH:mm:ss");
if (healthStatus.nat == -99)
{
human.Nat = "阳";
human.NatUnit = "";
human.NatColor = RED;
}
if (healthStatus.nat > 168)
{ human.Nat = "7"; human.NatUnit = "d"; }
if (healthStatus.nat <= 168)
{ human.Nat = "4"; human.NatUnit = "d"; }
if (healthStatus.nat <= 48)
{ human.Nat = "48"; human.NatUnit = "h"; }
human.NatColor = Program.config.LogicConfig.NATExpirationHours >= healthStatus.nat ? BLUE : YELLOW;
if (healthStatus.nat == -1)
{
human.Nat = "无";
human.NatUnit = "";
human.NatColor = GRAY;
}
if (healthStatus.nat == -99)
{
human.Nat = "阳";
human.NatColor = RED;
}
switch (healthStatus.inoculationtimes)
{
case 0:
human.InoculationtText = "未接种疫苗";
break;
case 1:
human.InoculationtText = "已接种1剂次";
break;
case 2:
human.InoculationtText = "已接种2剂次";
break;
case 3:
human.InoculationtText = "已全程接种";
break;
default:
human.InoculationtText = "无数据";
break;
}
}
}
} }
...@@ -2,10 +2,31 @@ ...@@ -2,10 +2,31 @@
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.Identification.Enterprise.Logic"> <Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.Identification.Enterprise.Logic">
<Dictionaries> <Dictionaries>
<Dict Caption="业务逻辑基本配置" Name="LogicConfig"> <Dict Caption="业务逻辑基本配置" Name="LogicConfig">
<Key Caption="同一个人面部识别间隔" Choice="" Name="IdentifyTimeSpan" Value="15"/> <Key Caption="同一个人面部识别间隔" Choice="" Name="IdentifyTimeSpan" Value="3"/>
<Key Caption="面部识别阈值" Choice="" Name="FaceCompareValue" Value="0.8"/> <Key Caption="面部识别阈值" Choice="" Name="FaceCompareValue" Value="0.8"/>
<Key Caption="是否拍照" Choice="" Name="IsTakePhoto" Value="true"/> <Key Caption="是否拍照" Choice="" Name="IsTakePhoto" Value="true"/>
<Key Caption="自动待机延时(秒)" Choice="" Name="CleanViewDelay" Value="15"/> <Key Caption="自动待机延时(秒)" Choice="" Name="CleanViewDelay" Value="15"/>
<Key Caption="疫情核验开关" Choice="" Name="HealthScope" Value="7">
<![CDATA[
0: 不核验
1: 验证员工
2: 验证临时人员
4: 验证访客
支持按位与组合
]]>
</Key>
<Key Caption="疫情核验项" Choice="" Name="HealthItem" Value="7">
<![CDATA[
1: 健康码
2: 核酸
4: 疫苗接种剂次
支持按位与组合
]]>
</Key>
<Key Caption="核酸过期小时数" Choice="" Name="NATExpirationHours" Value="96">
<![CDATA[
]]>
</Key>
</Dict> </Dict>
</Dictionaries> </Dictionaries>
...@@ -37,6 +58,7 @@ ...@@ -37,6 +58,7 @@
<Datas> <Datas>
<Data ServiceKey="SaveIdentityBatch" ServiceName="批量上传员工识别记录" ServiceUrl="/api/GS.WebApi.Terminal.Identification.Enterprise/Record/EmployeeUpload"/> <Data ServiceKey="SaveIdentityBatch" ServiceName="批量上传员工识别记录" ServiceUrl="/api/GS.WebApi.Terminal.Identification.Enterprise/Record/EmployeeUpload"/>
<Data ServiceKey="SaveVisitorIdentifyBatch" ServiceName="批量上传访客识别记录" ServiceUrl="/api/GS.WebApi.Terminal.Visitor/Identification/UploadRecord"/> <Data ServiceKey="SaveVisitorIdentifyBatch" ServiceName="批量上传访客识别记录" ServiceUrl="/api/GS.WebApi.Terminal.Visitor/Identification/UploadRecord"/>
<Data ServiceKey="QrCodeParse" ServiceName="获取用户健康码状态" ServiceUrl="/api/GS.WebApi.Terminal/IdentityQRCode/Parse"/>
</Datas> </Datas>
</Structure> </Structure>
</Structures> </Structures>
......
...@@ -49,6 +49,21 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config ...@@ -49,6 +49,21 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
} }
} }
private string _QrCodeParse;
public string QrCodeParse
{
get
{
if (_QrCodeParse == null)
{
_QrCodeParse = getConfigUrlByKey("QrCodeParse", "/api/GS.WebApi.Terminal/IdentityQRCode/Parse");
}
return _QrCodeParse;
}
}
private string getConfigUrlByKey(string key, string defaultUrl) private string getConfigUrlByKey(string key, string defaultUrl)
{ {
......
...@@ -73,6 +73,8 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config ...@@ -73,6 +73,8 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
/// 资源文件地址 /// 资源文件地址
/// </summary> /// </summary>
public string ResourcePath { get; set; } public string ResourcePath { get; set; }
} }
public class LogicConfig : IDictSetting public class LogicConfig : IDictSetting
...@@ -95,6 +97,12 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config ...@@ -95,6 +97,12 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
/// 自动待机延时(秒) /// 自动待机延时(秒)
/// </summary> /// </summary>
public int CleanViewDelay { get; set; } public int CleanViewDelay { get; set; }
public HealthScope HealthScope { get; set; }
public HealthItemType HealthItem { get; set; }
public int NATExpirationHours { get; set; }
} }
public class DataSyncConfig : IStructureSetting<DataSyncConfigItem> public class DataSyncConfig : IStructureSetting<DataSyncConfigItem>
...@@ -113,5 +121,29 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config ...@@ -113,5 +121,29 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
public bool Enable { get; set; } public bool Enable { get; set; }
} }
public enum HealthScope
{
/*
* 0: 不核验
1: 验证员工
2: 验证临时人员
4: 验证访客
*/
不核验 = 0,
验证员工 = 1,
验证临时人员 = 2,
验证访客 = 4
}
public enum HealthItemType
{
/*
* 1: 健康码
2: 核酸
4: 疫苗接种剂次
*/
健康码 = 1,
核酸 = 2,
疫苗接种剂次 = 4
}
} }
using GS.Terminal.Frame.Network.WebApiModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GS.Terminal.Identification.Enterprise.Logic.Core
{
public static class Heath
{
public static HealthStatus GetEmployeeStatus(Guid userid)
{
CancellationTokenSource cancellationToken = new CancellationTokenSource();
var code = $"GSUID{userid:N}";
Task.Delay(2000, cancellationToken.Token).ContinueWith(task =>
{
if (!task.IsCanceled)
{
Program.locator.MainPage.ExtendInfoLoading = true;
}
});
var result = Program.WebApiClient.Post<SuccessObject<QrCodeResult>>(Program.serviceListing.QrCodeParse, new
{
tcode = Program.config.GlobalConfig.tCode,
content = code
});
cancellationToken.Cancel();
Program.locator.MainPage.ExtendInfoLoading = false;
if (result != null && result.record != null && result.record.Extends != null)
{
//healthcolor 健康码颜色
//nat 核酸结果
//nattime 核酸结果时间(暂无)
//inoculationtimes 疫苗接种剂次
var status = new HealthStatus() { success = true, message = "防疫信息核验通过" };
var healthcolor = result.record.Extends.FirstOrDefault(s => s.Key == "healthcolor");
if (healthcolor != null)
{
status.healthcolor = healthcolor.Content;
if (status.healthcolor != "绿色")
{
status.success = false;
status.message = "健康码状态异常";
}
}
var nat = result.record.Extends.FirstOrDefault(s => s.Key == "nat");
if (nat != null && int.TryParse(nat.Content, out int inat))
{
status.nat = inat;
if (inat > Program.config.LogicConfig.NATExpirationHours)
{
if (status.success)
{
status.success = false;
status.message = "核酸检测结果已过期";
}
}
else if (inat == -1)//未检测
{
if (status.success)
{
status.success = false;
status.message = "核酸未检测";
}
}
else if (inat == -99)//阳性
{
if (status.success)
{
status.success = false;
status.message = "核酸检测阳性";
}
}
}
var nattime = result.record.Extends.FirstOrDefault(s => s.Key == "nattime");
if (nattime != null && DateTime.TryParse(nattime.Content, out DateTime tnat))
{
status.nattime = tnat;
}
var inoculationtimes = result.record.Extends.FirstOrDefault(s => s.Key == "inoculationtimes");
if (inoculationtimes != null && int.TryParse(inoculationtimes.Content, out int itimes))
{
status.inoculationtimes = itimes;
}
return status;
}
return new HealthStatus { success = false, message = "服务异常" };
}
public static HealthStatus GetEmployeeStatus(string name, string idnum)
{
var code = $"SFZ{idnum}{name}";
CancellationTokenSource cancellationToken = new CancellationTokenSource();
Task.Delay(2000, cancellationToken.Token).ContinueWith(task =>
{
if (!task.IsCanceled)
{
Program.locator.MainPage.ExtendInfoLoading = true;
}
});
var result = Program.WebApiClient.Post<SuccessObject<QrCodeResult>>(Program.serviceListing.QrCodeParse, new
{
tcode = Program.config.GlobalConfig.tCode,
content = code
});
cancellationToken.Cancel();
Program.locator.MainPage.ExtendInfoLoading = false;
if (result != null && result.record != null && result.record.Extends != null)
{
//healthcolor 健康码颜色
//nat 核酸结果
//nattime 核酸结果时间(暂无)
//inoculationtimes 疫苗接种剂次
var status = new HealthStatus() { success = true, message = "防疫信息核验通过" };
var healthcolor = result.record.Extends.FirstOrDefault(s => s.Key == "healthcolor");
if (healthcolor != null)
{
status.healthcolor = healthcolor.Content;
if (status.healthcolor != "绿色")
{
status.success = false;
status.message = "健康码状态异常";
}
}
var nat = result.record.Extends.FirstOrDefault(s => s.Key == "nat");
if (nat != null && int.TryParse(nat.Content, out int inat))
{
status.nat = inat;
if (inat > Program.config.LogicConfig.NATExpirationHours)
{
if (status.success)
{
status.success = false;
status.message = "核酸检测结果已过期";
}
}
else if (inat == -1)//未检测
{
if (status.success)
{
status.success = false;
status.message = "核酸未检测";
}
}
else if (inat == -99)//阳性
{
if (status.success)
{
status.success = false;
status.message = "核酸检测阳性";
}
}
}
var inoculationtimes = result.record.Extends.FirstOrDefault(s => s.Key == "inoculationtimes");
if (inoculationtimes != null && int.TryParse(inoculationtimes.Content, out int itimes))
{
status.inoculationtimes = itimes;
}
return status;
}
return new HealthStatus { success = false, message = "服务异常" };
}
}
public class HealthStatus
{
public bool success { get; set; }
public string message { get; set; }
public string healthcolor { get; set; }
/// <summary>
/// -1:未检测 -99:阳性 >0:核酸检测距离现在的小时数
/// </summary>
public int nat { get; set; }
public DateTime nattime { get; set; }
public int inoculationtimes { get; set; }
}
public class QrCodeResult
{
public string CodeType { get; set; }
public string UserKey { get; set; }
public string Name { get; set; }
public string Phone { get; set; }
public string IdCard { get; set; }
public string IsSystemUser { get; set; }
public string IsVisitor { get; set; }
public List<QrCodeResult_ExtendInfo> Extends { get; set; }
}
public class QrCodeResult_ExtendInfo
{
public string Key { get; set; }
public string Name { get; set; }
public string Content { get; set; }
}
}
...@@ -67,6 +67,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -67,6 +67,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic
IdentifyMethod = ss.是否刷卡识别 ? 0 : 1, IdentifyMethod = ss.是否刷卡识别 ? 0 : 1,
FaceResult = ss.面部识别对比结果, FaceResult = ss.面部识别对比结果,
Tag = ss.进出标识, Tag = ss.进出标识,
HealthColor = ss.健康码颜色,
Nat = ss.核酸检测结果,
InoculationTimes = ss.疫苗接种剂次
}).ToList(); }).ToList();
if (visitData.Count > 0) if (visitData.Count > 0)
...@@ -107,7 +110,10 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -107,7 +110,10 @@ namespace GS.Terminal.Identification.Enterprise.Logic
SitePhoto = Tools.ReadFile(ss.现场照片), SitePhoto = Tools.ReadFile(ss.现场照片),
Tag = ss.进出标识, Tag = ss.进出标识,
IdentifyMethod = ss.是否刷卡识别 ? 0 : 1, IdentifyMethod = ss.是否刷卡识别 ? 0 : 1,
FaceResult = ss.面部识别对比结果 FaceResult = ss.面部识别对比结果,
HealthColor = ss.健康码颜色,
Nat = ss.核酸检测结果,
InoculationTimes = ss.疫苗接种剂次
}).ToList(); }).ToList();
if (emplyData.Count > 0) if (emplyData.Count > 0)
......
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
<Compile Include="Config\ServiceListing.cs" /> <Compile Include="Config\ServiceListing.cs" />
<Compile Include="Config\TerminalSetting.cs" /> <Compile Include="Config\TerminalSetting.cs" />
<Compile Include="Core\FaceFeatureLoader.cs" /> <Compile Include="Core\FaceFeatureLoader.cs" />
<Compile Include="Core\Heath.cs" />
<Compile Include="Core\LocalDataCenter.cs" /> <Compile Include="Core\LocalDataCenter.cs" />
<Compile Include="Core\Uploader.cs" /> <Compile Include="Core\Uploader.cs" />
<Compile Include="Face\FaceRecognizationService.cs" /> <Compile Include="Face\FaceRecognizationService.cs" />
......
...@@ -48,10 +48,11 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -48,10 +48,11 @@ namespace GS.Terminal.Identification.Enterprise.Logic
internal static Config.ServiceListing serviceListing; // 服务清单配置 internal static Config.ServiceListing serviceListing; // 服务清单配置
internal static Uploader uploader; // 数据上传 internal static Uploader uploader; // 数据上传
internal static IEasyTaskService syncService; // 数据同步插件服务 internal static IEasyTaskService syncService; // 数据同步插件服务
internal static string _logicVersion = "210928"; // 业务版本 internal static string _logicVersion = "220907"; // 业务版本
internal static WebApiClient WebApiClient; internal static WebApiClient WebApiClient;
internal static ILogWriter Logger; internal static ILogWriter Logger;
internal static FaceFeatureLoader FaceFeatureLoader; internal static FaceFeatureLoader FaceFeatureLoader;
internal static bool Loading = false;
public void Start(IAddonContext Context) public void Start(IAddonContext Context)
{ {
...@@ -162,6 +163,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -162,6 +163,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
private void Instance_onRuntimeCompleted(object sender) private void Instance_onRuntimeCompleted(object sender)
{ {
GetAndRegistServices(); GetAndRegistServices();
TerminalStatusCenter.Instance.SetStatus(TerminalStatusDefined.STANDBY, "system"); TerminalStatusCenter.Instance.SetStatus(TerminalStatusDefined.STANDBY, "system");
addonContext.CreateIntercativeData<string>("TERMINAL_STATUS"); addonContext.CreateIntercativeData<string>("TERMINAL_STATUS");
var terminal_status = $"{Frame.Utility.EnvironmentInfo.GetApplicationVersion()}({_logicVersion}) Standby {Frame.Network.HardwareInfo.GetMACAddress()}"; var terminal_status = $"{Frame.Utility.EnvironmentInfo.GetApplicationVersion()}({_logicVersion}) Standby {Frame.Network.HardwareInfo.GetMACAddress()}";
...@@ -175,6 +177,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic ...@@ -175,6 +177,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
RegistViewModel(); RegistViewModel();
MainHandler.ViewModel.tCode = config.GlobalConfig.tCode; MainHandler.ViewModel.tCode = config.GlobalConfig.tCode;
MainHandler.ViewModel.VersionString = new ApplicationBase().Info.Version.ToString(); MainHandler.ViewModel.VersionString = new ApplicationBase().Info.Version.ToString();
MainHandler.ViewModel.ViewMode = config.LogicConfig.HealthScope == Config.HealthScope.不核验 ? 视图模式.一般 : 视图模式.疫情核验;
logicShellService.ShowView(SimpleIoc.Default.GetInstance<Locator>().MainPage, args => logicShellService.ShowView(SimpleIoc.Default.GetInstance<Locator>().MainPage, args =>
{ {
//注册数据同步监听 //注册数据同步监听
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="MainShell_LogoText" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="60"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Margin" Value="20,0,0,0"/>
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="FontFamily" Value="/GS.Terminal.Theme;component/Fonts/#锐字云字库行草体1.0"/>
</Style>
<!-- 头部--> <!-- 头部-->
<Style x:Key="MainShell_HeaderBackground" TargetType="Grid"> <Style x:Key="MainShell_HeaderBackground" TargetType="Grid">
<Setter Property="Height" Value="120"></Setter> <Setter Property="Height" Value="120"></Setter>
...@@ -11,11 +19,7 @@ ...@@ -11,11 +19,7 @@
<Setter Property="Background" Value="#006766"></Setter> <Setter Property="Background" Value="#006766"></Setter>
</Style> </Style>
<Style x:Key="LogoTextBlockStyle" TargetType="TextBlock"> <Style x:Key="MainShell_HeadRight" TargetType="Grid">
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="Grid.Column" Value="1"/>
<Setter Property="FontSize" Value="60"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Margin" Value="20,0,0,0"/>
<Setter Property="FontFamily" Value="/GS.Terminal.Theme;component/Fonts/#锐字云字库行草体1.0"/>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Main_ADImage" TargetType="Image"> <Style x:Key="Main_ADImage" TargetType="Image">
<Setter Property="Source" Value="Images/ad.png"/> <Setter Property="Source" Value="Images/ad.png"/>
<Setter Property="Margin" Value="35,0,35,35"/>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
<clear /> <clear />
<add key="UpdateUrl" value="http://192.168.1.210/Soft/update" /> <add key="UpdateUrl" value="http://192.168.1.210/Soft/update" />
<add key="ServerIP" value="192.168.1.7" /> <add key="ServerIP" value="192.168.1.7" />
<add key="tCode" value="DN01" /> <add key="tCode" value="SNM1" />
<add key="WebPath" value="http://192.168.1.7:5888" /> <add key="WebPath" value="http://192.168.1.7:5084" />
<add key="ResourcePath" value="http://192.168.1.7:8888" /> <add key="ResourcePath" value="http://192.168.1.7:8084" />
<add key="ClientSettingsProvider.ServiceUri" value="" /> <add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings> </appSettings>
<system.web> <system.web>
......
...@@ -63,5 +63,9 @@ namespace GS.Terminal.Identification.LocalDbModel ...@@ -63,5 +63,9 @@ namespace GS.Terminal.Identification.LocalDbModel
/// 进 = 1,出 = 0,已识别 = 2, /// 进 = 1,出 = 0,已识别 = 2,
/// </summary> /// </summary>
public int 进出标识 { get; set; } public int 进出标识 { get; set; }
public string 健康码颜色 { get; set; }
public int 核酸检测结果 { get; set; }
public int 疫苗接种剂次 { get; set; }
} }
} }
...@@ -7,17 +7,24 @@ using System.ComponentModel.Composition; ...@@ -7,17 +7,24 @@ using System.ComponentModel.Composition;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media; using System.Windows.Media;
namespace IdentificationViewModels namespace IdentificationViewModels
{ {
public enum 视图模式
{
一般,
疫情核验
}
[Export(typeof(IViewModel))] [Export(typeof(IViewModel))]
public partial class MainPageViewModel : ViewModelBase, IViewModel public partial class MainPageViewModel : ViewModelBase, IViewModel
{ {
#region 方法 #region 方法
public void Reset() public void Reset()
{ {
ActiveHuman = new Human { IsCard = false, IsVisitor = false };
ActiveHuman = new Human { IsCard = false, IsVisitor = false, ShowHealthColor = Visibility.Collapsed, ShowInoculationt = Visibility.Collapsed, ShowNat = Visibility.Collapsed };
IsStandby = true; IsStandby = true;
ShowError = false; ShowError = false;
ErrorText = ""; ErrorText = "";
...@@ -35,6 +42,7 @@ namespace IdentificationViewModels ...@@ -35,6 +42,7 @@ namespace IdentificationViewModels
private string _VersionString = "-"; private string _VersionString = "-";
private bool _ShowError; private bool _ShowError;
private string _ErrorText; private string _ErrorText;
private bool _ExtendInfoLoading;
#endregion #endregion
#region 属性 #region 属性
...@@ -49,6 +57,15 @@ namespace IdentificationViewModels ...@@ -49,6 +57,15 @@ namespace IdentificationViewModels
set { _IsStandby = value; RaisePropertyChanged(nameof(IsStandby)); } set { _IsStandby = value; RaisePropertyChanged(nameof(IsStandby)); }
} }
private 视图模式 _ViewMode = 视图模式.一般;
public 视图模式 ViewMode
{
get { return _ViewMode; }
set { _ViewMode = value; RaisePropertyChanged("ViewMode"); }
}
/// <summary> /// <summary>
/// 无人操作界面重置倒计时(秒) /// 无人操作界面重置倒计时(秒)
/// </summary> /// </summary>
...@@ -126,6 +143,13 @@ namespace IdentificationViewModels ...@@ -126,6 +143,13 @@ namespace IdentificationViewModels
set { _ErrorText = value; RaisePropertyChanged("ErrorText"); } set { _ErrorText = value; RaisePropertyChanged("ErrorText"); }
} }
public bool ExtendInfoLoading
{
get { return _ExtendInfoLoading; }
set { _ExtendInfoLoading = value; RaisePropertyChanged("ExtendInfoLoading"); }
}
#endregion #endregion
} }
...@@ -194,6 +218,112 @@ namespace IdentificationViewModels ...@@ -194,6 +218,112 @@ namespace IdentificationViewModels
set { _IsCard = value; RaisePropertyChanged(nameof(IsCard)); } set { _IsCard = value; RaisePropertyChanged(nameof(IsCard)); }
} }
private Visibility _ShowHealthColor = Visibility.Collapsed;
public Visibility ShowHealthColor
{
get { return _ShowHealthColor; }
set { _ShowHealthColor = value; RaisePropertyChanged("ShowHealthColor"); }
}
private string _HealthColor;
/// <summary>
/// 健康码颜色 红色 黄色 绿色
/// </summary>
public string HealthColor
{
get
{
switch (_HealthColor)
{
case "红色": return "红码";
case "黄色": return "黄码";
case "绿色": return "绿码";
default:
break;
}
return _HealthColor;
}
set { _HealthColor = value; RaisePropertyChanged("HealthColor"); }
}
private Visibility _ShowNat = Visibility.Collapsed;
public Visibility ShowNat
{
get { return _ShowNat; }
set { _ShowNat = value; RaisePropertyChanged("ShowNat"); }
}
private string _Nat;
/// <summary>
/// 核酸状态 48h 4d 7d
/// </summary>
public string Nat
{
get { return _Nat; }
set { _Nat = value; RaisePropertyChanged("Nat"); }
}
private string _NatTime_Date;
public string NatTime_Date
{
get { return _NatTime_Date; }
set { _NatTime_Date = value; RaisePropertyChanged("NatTime_Date"); }
}
private string _NatTime_Time;
public string NatTime_Time
{
get { return _NatTime_Time; }
set { _NatTime_Time = value; RaisePropertyChanged("NatTime_Time"); }
}
private string _NatUnit;
public string NatUnit
{
get { return _NatUnit; }
set { _NatUnit = value; RaisePropertyChanged("NatUnit"); }
}
private string _NatColor;
public string NatColor
{
get { return _NatColor; }
set { _NatColor = value; RaisePropertyChanged("NatColor"); }
}
private Visibility _ShowInoculationt = Visibility.Collapsed;
public Visibility ShowInoculationt
{
get { return _ShowInoculationt; }
set { _ShowInoculationt = value; RaisePropertyChanged("ShowInoculationt"); }
}
private string _InoculationtText;
public string InoculationtText
{
get { return _InoculationtText; }
set { _InoculationtText = value; RaisePropertyChanged("InoculationtText"); }
}
public int Tag { get; set; } public int Tag { get; set; }
} }
#endregion #endregion
......
...@@ -120,6 +120,10 @@ ...@@ -120,6 +120,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Templates\Main.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Images\bg.png" /> <Resource Include="Images\bg.png" />
......
This diff is collapsed.
This diff is collapsed.
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