Commit 820754f9 authored by 姜春辉's avatar 姜春辉

修正有些情况下token无法设置到同步器的bug;待机时清空历史列表;

parent c1d9e687
......@@ -15,6 +15,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Core
private static List<VisitInfo> VisitInfo = new List<VisitInfo>();
private static List<FaceEntity> AllFace = new List<FaceEntity>();
private static List<EmployeeCard> AllCards = new List<EmployeeCard>();
private static Remote.Synchronize.EasyTask.TaskBaseEvent<Employee> employeeSync;
private static Remote.Synchronize.EasyTask.TaskBaseEvent<VisitInfo> visitInfoSync;
private static Remote.Synchronize.EasyTask.TaskBaseEvent<EmployeeCard> employeeCardSync;
internal static void InitDataSync()
{
......@@ -24,7 +27,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Core
var config = Program.config.DataSyncConfig.Datas.FirstOrDefault(ss => ss.Key.Equals(Key, StringComparison.CurrentCultureIgnoreCase));
if (config != null && config.Enable)
{
var employeeSync =
employeeSync =
Program.syncService.Regist<Employee>(Key,
$"{Program.config.GlobalConfig.WebPath}{config.ServiceUrl}",
config.IntervalSec, Program.WebApiClient.Token);
......@@ -49,7 +52,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Core
var config = Program.config.DataSyncConfig.Datas.FirstOrDefault(ss => ss.Key.Equals(Key, StringComparison.CurrentCultureIgnoreCase));
if (config != null && config.Enable)
{
var visitInfoSync =
visitInfoSync =
Program.syncService.Regist<VisitInfo>(Key,
$"{Program.config.GlobalConfig.WebPath}{config.ServiceUrl}",
config.IntervalSec, Program.WebApiClient.Token);
......@@ -65,7 +68,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Core
var config = Program.config.DataSyncConfig.Datas.FirstOrDefault(ss => ss.Key.Equals(Key, StringComparison.CurrentCultureIgnoreCase));
if (config != null && config.Enable)
{
var employeeCardSync =
employeeCardSync =
Program.syncService.Regist<EmployeeCard>(Key,
$"{Program.config.GlobalConfig.WebPath}{config.ServiceUrl}",
config.IntervalSec, Program.WebApiClient.Token);
......@@ -76,6 +79,13 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Core
#endregion
}
public static void SetToken()
{
employeeSync.SetToken(Program.WebApiClient.Token);
visitInfoSync.SetToken(Program.WebApiClient.Token);
employeeCardSync.SetToken(Program.WebApiClient.Token);
}
private static void EmployeeCardSync_OnDataChanged(object sender, List<EmployeeCard> newData)
{
AllCards = newData ?? new List<EmployeeCard>();
......
......@@ -48,7 +48,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
internal static Config.ServiceListing serviceListing; // 服务清单配置
internal static Uploader uploader; // 数据上传
internal static IEasyTaskService syncService; // 数据同步插件服务
internal static string _logicVersion = "210904"; // 业务版本
internal static string _logicVersion = "210928"; // 业务版本
internal static WebApiClient WebApiClient;
internal static ILogWriter Logger;
internal static FaceFeatureLoader FaceFeatureLoader;
......@@ -187,6 +187,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
private void WebApiClient_OnSignatured()
{
uploader = new Uploader(config.GlobalConfig.tCode);
LocalDataCenter.SetToken();
}
/// <summary>
......
......@@ -21,6 +21,7 @@ namespace IdentificationViewModels
IsStandby = true;
ShowError = false;
ErrorText = "";
VisitHistory = new ObservableCollection<Human>();
}
#endregion
......
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