|
@@ -25,6 +25,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
private DateTime _reportEndDate;
|
|
|
private string _fileNameText;
|
|
|
private string _excludeSelectText;
|
|
|
+ private string _terminalRecordCode;
|
|
|
private ObservableCollection<string> _excludeList = new();
|
|
|
private ObservableCollection<string> _searchedList = new();
|
|
|
private MigrateService _migrateService;
|
|
@@ -56,6 +57,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
private static bool _migrateReportResult = false;
|
|
|
private static bool _migrateUpgrade = false;
|
|
|
private static bool _migrateUserInfo = false;
|
|
|
+ private static bool _synchronizeTerminalRecord = false;
|
|
|
private COSClear _cosClear = new COSClear();
|
|
|
private readonly Action<Action> _runOnMainDispatcher;
|
|
|
|
|
@@ -231,6 +233,19 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public string TerminalRecordCode
|
|
|
+ {
|
|
|
+ get => _terminalRecordCode;
|
|
|
+ set
|
|
|
+ {
|
|
|
+ if (_terminalRecordCode != value)
|
|
|
+ {
|
|
|
+ _terminalRecordCode = value;
|
|
|
+ OnPropertyChanged(() => TerminalRecordCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public MigrateService MigrateService
|
|
|
{
|
|
|
get
|
|
@@ -260,6 +275,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
{
|
|
|
throw new Exception($"WingService Url Is Empty");
|
|
|
}
|
|
|
+ Logger.WriteLineInfo($"WingServiceUrl:{WingServiceUrl}");
|
|
|
_migrateServiceReal = new MigrateService(WingServiceUrl);
|
|
|
return _migrateServiceReal;
|
|
|
}
|
|
@@ -374,6 +390,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
public ButtonCommand SynUserDeviceOrgDataCommand { get; set; }
|
|
|
public ButtonCommand SynIsUserReportInfoAsyncCommand { get; set; }
|
|
|
public ButtonCommand ValidateOrganizationParentDataInfosCommand { get; set; }
|
|
|
+ public ButtonCommand SynchronizeTerminalRecordCommand { get; set; }
|
|
|
|
|
|
public MainWindowViewModel(Action<Action> runOnMainDispatcher)
|
|
|
{
|
|
@@ -417,9 +434,9 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
MigrateCustomLabelsCommand = new ButtonCommand(OnMigrateCustomLabelsCommand);
|
|
|
ClearColdDataCommand = new ButtonCommand(OnClearColdDataCommand);
|
|
|
MigrateVinnoOrgDataCommand = new ButtonCommand(OnMigrateVinnoOrgInfos);
|
|
|
- ValidateOrganizationParentDataInfosCommand = new ButtonCommand(OnValidateOrganizationParentDataInfos);
|
|
|
+ ValidateOrganizationParentDataInfosCommand = new ButtonCommand(OnValidateOrganizationParentDataInfos);
|
|
|
SynUserDeviceOrgDataCommand = new ButtonCommand(OnSynUserDeviceOrgDatas);
|
|
|
- SynIsUserReportInfoAsyncCommand = new ButtonCommand(OnSynIsUserReportInfoAsync);
|
|
|
+ SynIsUserReportInfoAsyncCommand = new ButtonCommand(OnSynIsUserReportInfoAsync);
|
|
|
WingServiceUrl = CommonConfigManager.DirectServer.Host;
|
|
|
ReportBeginDate = DateTime.Now.AddDays(-1);
|
|
|
ReportEndDate = DateTime.Now;
|
|
@@ -430,6 +447,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
WingMigrateCarotidCommand = new ButtonCommand(OnMigrateCarotidToWing);
|
|
|
WingMigrateConsultationCommand = new ButtonCommand(OnMigrateConsultationToWing);
|
|
|
WingMigrateReportCommand = new ButtonCommand(OnMigrateReportToWing);
|
|
|
+ SynchronizeTerminalRecordCommand = new ButtonCommand(OnSynchronizeTerminalRecord);
|
|
|
|
|
|
ExcludeList.Add("FlyinsonoDeploymentTool-en.zip");
|
|
|
ExcludeList.Add("FlyinsonoDeploymentTool-zh.zip");
|
|
@@ -978,7 +996,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
Logger.WriteLineWarn($"Syn SynIsUserReportInfoAsync err, ex:{ex}");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
private void OnSynUserDeviceOrgDatas(object obj)
|
|
|
{
|
|
@@ -1114,7 +1132,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
Logger.WriteLineWarn($"MigrateOnlinePrintDataAsync err, ex:{ex}");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void OnMigratePatchData(object obj)
|
|
|
{
|
|
|
if (_migratePatchData)
|
|
@@ -1179,7 +1197,7 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
Logger.WriteLineWarn($"BussinessData err, ex:{ex}");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
private void OnReadFeedBackExcelData(object obj)
|
|
|
{
|
|
@@ -1682,6 +1700,57 @@ namespace Flyinsono.DBCopy.Tool
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //报告
|
|
|
+ private void OnSynchronizeTerminalRecord(object obj)
|
|
|
+ {
|
|
|
+ if (_synchronizeTerminalRecord)
|
|
|
+ {
|
|
|
+ Logger.WriteLineWarn($"OnSynchronizeTerminalRecord Processing");
|
|
|
+ }
|
|
|
+ else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ _synchronizeTerminalRecord = true;
|
|
|
+ Task.Run(async () =>
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrWhiteSpace(TerminalRecordCode))
|
|
|
+ {
|
|
|
+ await MigrateServiceReal.SynchronizeByTerminalRecordCode(TerminalRecordCode);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var startTime = CommonConfigManager.TerminalRecordSync.StartTime;
|
|
|
+ var endTime = CommonConfigManager.TerminalRecordSync.EndTime;
|
|
|
+ Logger.WriteLineInfo($"OnSynchronizeTerminalRecord startTime:{startTime}");
|
|
|
+ Logger.WriteLineInfo($"OnSynchronizeTerminalRecord endTime:{endTime}");
|
|
|
+ await MigrateServiceReal.SynchronizeByTimeRange(startTime, endTime);
|
|
|
+ }
|
|
|
+ _synchronizeTerminalRecord = false;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.WriteLineWarn($"OnSynchronizeTerminalRecord err, ex:{ex}");
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ _synchronizeTerminalRecord = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.WriteLineWarn($"OnSynchronizeTerminalRecord err, ex:{ex}");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Logger.WriteLineWarn($"2.0Server Url Is Empty");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|