MainWindowViewModel.cs 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Net.Http;
  6. using System.Net;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Threading;
  10. using Flyinsono.DBCopy.Tool.Log;
  11. using Flyinsono.DBCopy.Tool.Service;
  12. using Flyinsono.DBCopy.Tool.Utilities;
  13. using WingInterfaceLibrary.Enum;
  14. using Flyinsono.DBCopy.Tool.RpcService;
  15. using MongoDB.Bson.IO;
  16. using Newtonsoft.Json.Linq;
  17. namespace Flyinsono.DBCopy.Tool
  18. {
  19. class MainWindowViewModel : ViewModel
  20. {
  21. private string _hostUrl;
  22. private uint _userCount;
  23. private string _message;
  24. private string _dbPath;
  25. private string _databaseUrl;
  26. private string _dcServiceUrl;
  27. private string _wingServiceUrl;
  28. private DateTime _reportBeginDate;
  29. private DateTime _reportEndDate;
  30. private string _fileNameText;
  31. private string _excludeSelectText;
  32. private string _terminalRecordCode;
  33. private ObservableCollection<string> _excludeList = new();
  34. private ObservableCollection<string> _searchedList = new();
  35. private MigrateService _migrateService;
  36. private MigrateService _migrateServiceReal;
  37. private FilterTestService _filterTestService;
  38. private static bool _migrateRemoteDisgnosis = false;
  39. private static bool _migrateLiveConsultation = false;
  40. private static bool _migrateVideo = false;
  41. private static bool _migrateCourse = false;
  42. private static bool _migrateExamPaper = false;
  43. private static bool _migrateReport = false;
  44. private static bool _migrateAIData = false;
  45. private static bool _migrateBasicData = false;
  46. private static bool _readFeedBackData = false;
  47. private static bool _bussinessData = false;
  48. private static bool _migratePrintData = false;
  49. private static bool _migratePatchData = false;
  50. private static bool _migratePackageData = false;
  51. private static bool _migrateVinnoOrgData = false;
  52. private static bool _validateOrganizationParentData = false;
  53. private static bool _synUserDeviceOrgData = false;
  54. private static bool _synIsUserReportInfoData = false;
  55. private static bool _migrateCourseData = false;
  56. private static bool _migrateCertifiedInstructorUser = false;
  57. private static bool _migrateRemedicalRecord = false;
  58. private static bool _migrateSpecialReport = false;
  59. private static bool _visitWeb = false;
  60. private static bool _migrateRemedicalData = false;
  61. private static bool _migrateAI = false;
  62. private static bool _migrateCarotid = false;
  63. private static bool _migrateConsultation = false;
  64. private static bool _migrateReportResult = false;
  65. private static bool _migrateUpgrade = false;
  66. private static bool _migrateUserInfo = false;
  67. private static bool _migrateDicInfo = false;
  68. private static bool _synchronizeTerminalRecord = false;
  69. private static long _visitWebErrorNum = 0;
  70. private COSClear _cosClear = new COSClear();
  71. private readonly Action<Action> _runOnMainDispatcher;
  72. public ButtonCommand ClearRemoteDataCommand { get; set; }
  73. public ButtonCommand ExitCommand { get; set; }
  74. public string HostUrl
  75. {
  76. get => _hostUrl;
  77. set
  78. {
  79. if (_hostUrl != value)
  80. {
  81. _hostUrl = value;
  82. OnPropertyChanged(() => HostUrl);
  83. }
  84. }
  85. }
  86. public string DatabaseUrl
  87. {
  88. get => _databaseUrl;
  89. set
  90. {
  91. if (_databaseUrl != value)
  92. {
  93. _databaseUrl = value;
  94. OnPropertyChanged(() => DatabaseUrl);
  95. }
  96. }
  97. }
  98. public uint UserCount
  99. {
  100. get => _userCount;
  101. set
  102. {
  103. if (_userCount != value)
  104. {
  105. _userCount = value;
  106. OnPropertyChanged(() => UserCount);
  107. }
  108. }
  109. }
  110. public string Message
  111. {
  112. get => _message;
  113. set
  114. {
  115. if (_message != value)
  116. {
  117. _message = value;
  118. OnPropertyChanged(() => Message);
  119. }
  120. }
  121. }
  122. public string DbPath
  123. {
  124. get => _dbPath;
  125. set
  126. {
  127. if (_dbPath != value)
  128. {
  129. _dbPath = value;
  130. OnPropertyChanged(() => DbPath);
  131. }
  132. }
  133. }
  134. public string DCServiceUrl
  135. {
  136. get => _dcServiceUrl;
  137. set
  138. {
  139. if (_dcServiceUrl != value)
  140. {
  141. _dcServiceUrl = value;
  142. OnPropertyChanged(() => DCServiceUrl);
  143. }
  144. }
  145. }
  146. public string WingServiceUrl
  147. {
  148. get => _wingServiceUrl;
  149. set
  150. {
  151. if (_wingServiceUrl != value)
  152. {
  153. _wingServiceUrl = value;
  154. OnPropertyChanged(() => WingServiceUrl);
  155. }
  156. }
  157. }
  158. public DateTime ReportBeginDate
  159. {
  160. get => _reportBeginDate;
  161. set
  162. {
  163. if (_reportBeginDate != value)
  164. {
  165. _reportBeginDate = value;
  166. OnPropertyChanged(() => _reportBeginDate);
  167. }
  168. }
  169. }
  170. public DateTime ReportEndDate
  171. {
  172. get => _reportEndDate;
  173. set
  174. {
  175. if (_reportEndDate != value)
  176. {
  177. _reportEndDate = value;
  178. OnPropertyChanged(() => _reportEndDate);
  179. }
  180. }
  181. }
  182. public string FileNameText
  183. {
  184. get => _fileNameText;
  185. set
  186. {
  187. if (_fileNameText != value)
  188. {
  189. _fileNameText = value;
  190. OnPropertyChanged(() => _fileNameText);
  191. }
  192. }
  193. }
  194. public string ExcludeSelectText
  195. {
  196. get => _excludeSelectText;
  197. set
  198. {
  199. if (_excludeSelectText != value)
  200. {
  201. _excludeSelectText = value;
  202. OnPropertyChanged(() => _excludeSelectText);
  203. }
  204. }
  205. }
  206. public ObservableCollection<string> SearchedFiles
  207. {
  208. get => _searchedList;
  209. set
  210. {
  211. if (_searchedList != value)
  212. {
  213. _searchedList = value;
  214. OnPropertyChanged(() => _searchedList);
  215. }
  216. }
  217. }
  218. public ObservableCollection<string> ExcludeList
  219. {
  220. get => _excludeList;
  221. set
  222. {
  223. if (_excludeList != value)
  224. {
  225. _excludeList = value;
  226. OnPropertyChanged(() => _excludeList);
  227. }
  228. }
  229. }
  230. public string TerminalRecordCode
  231. {
  232. get => _terminalRecordCode;
  233. set
  234. {
  235. if (_terminalRecordCode != value)
  236. {
  237. _terminalRecordCode = value;
  238. OnPropertyChanged(() => TerminalRecordCode);
  239. }
  240. }
  241. }
  242. public MigrateService MigrateService
  243. {
  244. get
  245. {
  246. if (_migrateService != null)
  247. {
  248. return _migrateService;
  249. }
  250. if (string.IsNullOrWhiteSpace(DCServiceUrl))
  251. {
  252. throw new Exception($"DCService Url Is Empty");
  253. }
  254. _migrateService = new MigrateService(DCServiceUrl);
  255. return _migrateService;
  256. }
  257. }
  258. public MigrateService MigrateServiceReal
  259. {
  260. get
  261. {
  262. if (_migrateServiceReal != null)
  263. {
  264. return _migrateServiceReal;
  265. }
  266. if (string.IsNullOrWhiteSpace(WingServiceUrl))
  267. {
  268. throw new Exception($"WingService Url Is Empty");
  269. }
  270. Logger.WriteLineInfo($"WingServiceUrl:{WingServiceUrl}");
  271. _migrateServiceReal = new MigrateService(WingServiceUrl);
  272. return _migrateServiceReal;
  273. }
  274. }
  275. public FilterTestService FilterTestService
  276. {
  277. get
  278. {
  279. if (_filterTestService != null)
  280. {
  281. return _filterTestService;
  282. }
  283. _filterTestService = new FilterTestService();
  284. return _filterTestService;
  285. }
  286. }
  287. //private List<SequenceExecutor<int>> _sequenceExecutors = new List<SequenceExecutor<int>>();
  288. /// <summary>
  289. /// Request window close
  290. /// </summary>
  291. public event EventHandler RequestClosed;
  292. /// <summary>
  293. /// Cancel Command
  294. /// </summary>
  295. public Command CancelCommand { get; }
  296. /// <summary>
  297. /// Finish command
  298. /// </summary>
  299. public Command CloseCommand { get; }
  300. /// <summary>
  301. /// Open Output Dir Command
  302. /// </summary>
  303. public Command OpenOutputDirCommand { get; }
  304. /// <summary>
  305. /// Log infoes
  306. /// </summary>
  307. public ObservableCollection<LogItem> LogItems { get; }
  308. public Command ClearLogCommand { get; }
  309. public ButtonCommand ConnectDbCommand { get; set; }
  310. public ButtonCommand ConnectDbServerCommand { get; set; }
  311. public ButtonCommand MigrateRemoteDiagnosisCommand { get; set; }
  312. public ButtonCommand MigrateLiveConsultationCommand { get; set; }
  313. public ButtonCommand MigrateVideoCommand { get; set; }
  314. public ButtonCommand MigrateBasicDataCommand { get; set; }
  315. public ButtonCommand MigrateIsOldAgentUserDataCommand { get; set; }
  316. public ButtonCommand DeleteDictionDataCommand { get; set; }
  317. public ButtonCommand ReadFeedBackExcelDataCommand { get; set; }
  318. public ButtonCommand UpgradeBussinessDataCommand { get; set; }
  319. public ButtonCommand MigratePrintDataCommand { get; set; }
  320. public ButtonCommand MigratePatchDataCommand { get; set; }
  321. public ButtonCommand MigratePackageDataCommand { get; set; }
  322. public ButtonCommand MigrateBasicUserDataCommand { get; set; }
  323. public ButtonCommand DiffOrganizationDataCommand { get; set; }
  324. public ButtonCommand ClearColdDataCommand { get; set; }
  325. public ButtonCommand MigrateCourseCommand { get; set; }
  326. public ButtonCommand MigrateExamPaperCommand { get; set; }
  327. public ButtonCommand MigrateReportCommand { get; set; }
  328. public ButtonCommand MigrateAIDataCommand { get; set; }
  329. public ButtonCommand MigrateStaticCommand { get; set; }
  330. public ButtonCommand WingMigrateRemoteRecordCommand { get; set; }
  331. public ButtonCommand MigrateSpecialReportCommand { get; set; }
  332. public ButtonCommand TryVisitWebCommand{get;set;}
  333. public ButtonCommand WingMigrateRemoteDataCommand { get; set; }
  334. public ButtonCommand WingMigrateAICommand { get; set; }
  335. public ButtonCommand WingMigrateCarotidCommand { get; set; }
  336. public ButtonCommand WingMigrateConsultationCommand { get; set; }
  337. public ButtonCommand WingMigrateReportCommand { get; set; }
  338. public ButtonCommand MigrateCourseVideoCommand { get; set; }
  339. public ButtonCommand MigrateCertifiedInstructorUserCommand { get; set; }
  340. public ButtonCommand WingUpgradeMigrateCommand { get; set; }
  341. public ButtonCommand TransferDiagnosisResultCommand { get; set; }
  342. public ButtonCommand MigrateCustomLabelsCommand { get; set; }
  343. public ButtonCommand NewDeployFileClearCommand { get; set; }
  344. public ButtonCommand OldDeployFileClearCommand { get; set; }
  345. public ButtonCommand OldClientFileClearCommand { get; set; }
  346. public ButtonCommand NewClientFileClearCommand { get; set; }
  347. public ButtonCommand AddExcludeCommand { get; set; }
  348. public ButtonCommand RemoveExcludeCommand { get; set; }
  349. public ButtonCommand MigrateVinnoOrgDataCommand { get; set; }
  350. public ButtonCommand MigrateVinnoDeviceDataCommand { get; set; }
  351. public ButtonCommand SynUserDeviceOrgDataCommand { get; set; }
  352. public ButtonCommand SynIsUserReportInfoAsyncCommand { get; set; }
  353. public ButtonCommand ValidateOrganizationParentDataInfosCommand { get; set; }
  354. public ButtonCommand SynchronizeTerminalRecordCommand { get; set; }
  355. public ButtonCommand MigrateAgentCommand { get; set; }
  356. public ButtonCommand DataDiffCommand { get; set; }
  357. public MainWindowViewModel(Action<Action> runOnMainDispatcher)
  358. {
  359. LogItems = new ObservableCollection<LogItem>();
  360. Description = "AppName";
  361. CancelCommand = new ButtonCommand(OnCancelCommand, "Cancel");
  362. CloseCommand = new ButtonCommand(OnCloseCommand, "Finish");
  363. ClearLogCommand = new ButtonCommand(OnClearLogCommand, "ClearLog");
  364. HostUrl = "http://192.168.6.80:8303/";
  365. //HostUrl = "wss://192.168.6.175:8443/wss/";
  366. UserCount = 100;
  367. Message = "PC-1";
  368. ClearRemoteDataCommand = new ButtonCommand(OnClearRemoteData, "Run");
  369. ExitCommand = new ButtonCommand(OnExit, "Exit");
  370. ConnectDbCommand = new ButtonCommand(OnConnectDb, "Connect DB");
  371. ConnectDbServerCommand = new ButtonCommand(OnConnectDbServer);
  372. DCServiceUrl = "http://192.168.6.128:8303/";
  373. MigrateRemoteDiagnosisCommand = new ButtonCommand(OnMigrateRemoteDiagnosis);
  374. MigrateLiveConsultationCommand = new ButtonCommand(OnMigrateLiveConsultation);
  375. MigrateVideoCommand = new ButtonCommand(OnMigrateVideo);
  376. MigrateCourseCommand = new ButtonCommand(OnMigrateCourse);
  377. MigrateExamPaperCommand = new ButtonCommand(OnMigrateExamPaper);
  378. MigrateReportCommand = new ButtonCommand(OnMigrateReport);
  379. MigrateAIDataCommand = new ButtonCommand(OnMigrateTerminalAIData);
  380. MigrateStaticCommand = new ButtonCommand(OnMigrateStatic);
  381. MigrateBasicDataCommand = new ButtonCommand(OnMigrateBasicData);
  382. MigrateIsOldAgentUserDataCommand = new ButtonCommand(OnMigrateIsOldAgentUserInfosData);
  383. DeleteDictionDataCommand = new ButtonCommand(OnDeleteDictionData);
  384. ReadFeedBackExcelDataCommand = new ButtonCommand(OnReadFeedBackExcelData);
  385. UpgradeBussinessDataCommand = new ButtonCommand(OnUpgradeBussinessDataCommand);
  386. MigratePrintDataCommand = new ButtonCommand(OnMigratePrintData);
  387. MigratePatchDataCommand = new ButtonCommand(OnMigratePatchData);
  388. MigratePackageDataCommand = new ButtonCommand(OnMigratePackageData);
  389. MigrateBasicUserDataCommand = new ButtonCommand(OnMigrateBasicUserData);
  390. DiffOrganizationDataCommand = new ButtonCommand(OnDiffOrganizationData);
  391. MigrateCourseVideoCommand = new ButtonCommand(OnMigrateCourseVideo);
  392. MigrateCertifiedInstructorUserCommand = new ButtonCommand(OnWingCertifiedInstructorUserMigrate);
  393. WingUpgradeMigrateCommand = new ButtonCommand(OnWingUpgradeMigrate);
  394. TransferDiagnosisResultCommand = new ButtonCommand(OnTransferDiagnosisResultCommand);
  395. MigrateAgentCommand = new ButtonCommand(OnMigrateAgentCommand);
  396. DataDiffCommand = new ButtonCommand(OnDataDiffCommand);
  397. MigrateCustomLabelsCommand = new ButtonCommand(OnMigrateCustomLabelsCommand);
  398. ClearColdDataCommand = new ButtonCommand(OnClearColdDataCommand);
  399. MigrateVinnoOrgDataCommand = new ButtonCommand(OnMigrateVinnoOrgInfos);
  400. MigrateVinnoDeviceDataCommand = new ButtonCommand(OnMigrateVinnoDeviceInfos);
  401. ValidateOrganizationParentDataInfosCommand = new ButtonCommand(OnValidateOrganizationParentDataInfos);
  402. SynUserDeviceOrgDataCommand = new ButtonCommand(OnSynUserDeviceOrgDatas);
  403. SynIsUserReportInfoAsyncCommand = new ButtonCommand(OnSynIsUserReportInfoAsync);
  404. WingServiceUrl = CommonConfigManager.DirectServer.Host;
  405. ReportBeginDate = DateTime.Now.AddDays(-1);
  406. ReportEndDate = DateTime.Now;
  407. WingMigrateRemoteRecordCommand = new ButtonCommand(OnMigrateRemoteRecordToWing);
  408. MigrateSpecialReportCommand = new ButtonCommand(OnMigrateSpecialReport);
  409. TryVisitWebCommand = new ButtonCommand(OnMTryVisitWeb);
  410. WingMigrateRemoteDataCommand = new ButtonCommand(OnMigrateRemeteDataToWing);
  411. WingMigrateAICommand = new ButtonCommand(OnMigrateAIDataToWing);
  412. WingMigrateCarotidCommand = new ButtonCommand(OnMigrateCarotidToWing);
  413. WingMigrateConsultationCommand = new ButtonCommand(OnMigrateConsultationToWing);
  414. WingMigrateReportCommand = new ButtonCommand(OnMigrateReportToWing);
  415. SynchronizeTerminalRecordCommand = new ButtonCommand(OnSynchronizeTerminalRecord);
  416. ExcludeList.Add("FlyinsonoDeploymentTool-en.zip");
  417. ExcludeList.Add("FlyinsonoDeploymentTool-zh.zip");
  418. ExcludeList.Add("DeployServer.zip");
  419. ExcludeList.Add("42E4E397C0954D61B216FBE480FB1012.zip");
  420. ExcludeList.Add("Flyinsono_SonoPost_1.2.0.0.exe");
  421. ExcludeList.Add("1.7.63.27096");
  422. ExcludeList.Add("1.7.62.27018");
  423. ExcludeList.Add("2.0.1.1471");
  424. ExcludeList.Add("_Public.zip");
  425. ExcludeList.Add("_LoalNetwork.zip");
  426. ExcludeList.Add("_local.zip");
  427. ExcludeList.Add("_Local_");
  428. ExcludeList.Add("_last_");
  429. ExcludeList.Add("FISSDK_2.0.0.293.zip.part1");
  430. ExcludeList.Add("Flyinsono_SonoPost_1.7.64.27262.apk.part1");
  431. ExcludeList.Add("Flyinsono_SonoPost_1.7.64.27262.zip");
  432. ExcludeList.Add("Flyinsono_SonoPost_1.7.64.27262.apk");
  433. NewDeployFileClearCommand = new ButtonCommand(OnNewDeployFileClearCommand);
  434. OldDeployFileClearCommand = new ButtonCommand(OnOldDeployFileClearCommand);
  435. NewClientFileClearCommand = new ButtonCommand(OnNewClientFileClearCommand);
  436. OldClientFileClearCommand = new ButtonCommand(OnOldClientFileClearCommand);
  437. AddExcludeCommand = new ButtonCommand(OnAddExcludeCommand);
  438. RemoveExcludeCommand = new ButtonCommand(OnRemoveExcludeCommand);
  439. this._runOnMainDispatcher = runOnMainDispatcher;
  440. }
  441. private void OnRemoveExcludeCommand(object obj)
  442. {
  443. if (!string.IsNullOrWhiteSpace(ExcludeSelectText))
  444. {
  445. ExcludeList.Remove(ExcludeSelectText);
  446. }
  447. }
  448. private void OnAddExcludeCommand(object obj)
  449. {
  450. string fileName = FileNameText;
  451. if (!string.IsNullOrWhiteSpace(fileName))
  452. {
  453. ExcludeList.Add(fileName);
  454. }
  455. FileNameText = string.Empty;
  456. }
  457. private void OnOldClientFileClearCommand(object obj)
  458. {
  459. try
  460. {
  461. Dispatcher.CurrentDispatcher.Invoke(() =>
  462. {
  463. //查询前缀
  464. var searchPrefixList = new List<string>{
  465. "Flyinsono_Server_1",
  466. "Flyinsono_Android_1",
  467. "Flyinsono_Windows_1",
  468. "Flyinsono_SonoPost_1"
  469. };
  470. _cosClear.SearchFiles(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  471. var confirmDialog = new ConfirmDialog("The operation cannot be rolled back. Are you sure you want to delete it?");
  472. if (confirmDialog.ShowDialog() == true)
  473. {
  474. _cosClear.RunClear(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  475. }
  476. });
  477. }
  478. catch (Exception ex)
  479. {
  480. Logger.WriteLineWarn($"OnDBBakFileClearCommand err, ex:{ex}");
  481. }
  482. }
  483. private void OnNewClientFileClearCommand(object obj)
  484. {
  485. try
  486. {
  487. Dispatcher.CurrentDispatcher.Invoke(() =>
  488. {
  489. //查询前缀
  490. var searchPrefixList = new List<string>{
  491. "Flyinsono_Server_2",
  492. "Flyinsono_Android_2",
  493. "Flyinsono_Windows_2",
  494. "FISSDK_2",
  495. "Flyinsono_SonoPost_2"
  496. };
  497. _cosClear.SearchFiles(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  498. var confirmDialog = new ConfirmDialog("The operation cannot be rolled back. Are you sure you want to delete it?");
  499. if (confirmDialog.ShowDialog() == true)
  500. {
  501. _cosClear.RunClear(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  502. }
  503. });
  504. }
  505. catch (Exception ex)
  506. {
  507. Logger.WriteLineWarn($"OnDBBakFileClearCommand err, ex:{ex}");
  508. }
  509. }
  510. private void OnOldDeployFileClearCommand(object obj)
  511. {
  512. try
  513. {
  514. Dispatcher.CurrentDispatcher.Invoke(() =>
  515. {
  516. //查询前缀
  517. var searchPrefixList = new List<string>{
  518. "DeploymentTool",
  519. "Server"
  520. };
  521. _cosClear.SearchFiles(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  522. var confirmDialog = new ConfirmDialog("The operation cannot be rolled back. Are you sure you want to delete it?");
  523. if (confirmDialog.ShowDialog() == true)
  524. {
  525. _cosClear.RunClear(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  526. }
  527. });
  528. }
  529. catch (Exception ex)
  530. {
  531. Logger.WriteLineWarn($"OnTestFileClearCommand err, ex:{ex}");
  532. }
  533. }
  534. /// <summary>
  535. /// 清理部署包文件
  536. /// </summary>
  537. /// <param name="obj"></param>
  538. private void OnNewDeployFileClearCommand(object obj)
  539. {
  540. try
  541. {
  542. Dispatcher.CurrentDispatcher.Invoke(() =>
  543. {
  544. //查询前缀
  545. var searchPrefixList = new List<string>{
  546. "FlyinsonoDeploymentTool"
  547. };
  548. _cosClear.SearchFiles(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  549. var confirmDialog = new ConfirmDialog("The operation cannot be rolled back. Are you sure you want to delete it?");
  550. if (confirmDialog.ShowDialog() == true)
  551. {
  552. _cosClear.RunClear(searchPrefixList, _excludeList.ToList()).ConfigureAwait(false);
  553. }
  554. });
  555. }
  556. catch (Exception ex)
  557. {
  558. Logger.WriteLineWarn($"OnDeployFileClearCommand err, ex:{ex}");
  559. }
  560. }
  561. private void OnExit(object obj)
  562. {
  563. }
  564. private async void OnClearRemoteData(object obj)
  565. {
  566. //var service = AppManager.Instance.GetManager<IClientTestManager>();
  567. //service.Run();
  568. try
  569. {
  570. Task.Run(async () =>
  571. {
  572. try
  573. {
  574. await FilterTestService.BeginClearTestData();
  575. }
  576. catch (Exception ex)
  577. {
  578. Logger.WriteLineWarn($"BeginClearTestData err, ex:{ex}");
  579. }
  580. });
  581. }
  582. catch (Exception ex)
  583. {
  584. Logger.WriteLineWarn($"BeginClearTestData err, ex:{ex}");
  585. }
  586. }
  587. private async void OnDataDiffCommand(object obj)
  588. {
  589. try
  590. {
  591. Task.Run(async () =>
  592. {
  593. try
  594. {
  595. //await MigrateServiceReal.DataDiffCommand();
  596. await MigrateServiceReal.InitDeviceModelAsync();
  597. }
  598. catch (Exception ex)
  599. {
  600. Logger.WriteLineWarn($"DataDiffCommand err, ex:{ex}");
  601. }
  602. });
  603. }
  604. catch (Exception ex)
  605. {
  606. Logger.WriteLineWarn($"DataDiffCommand err, ex:{ex}");
  607. }
  608. }
  609. private async void OnMigrateAgentCommand(object obj)
  610. {
  611. try
  612. {
  613. Task.Run(async () =>
  614. {
  615. try
  616. {
  617. await MigrateServiceReal.MigrateAgentInfos();
  618. }
  619. catch (Exception ex)
  620. {
  621. Logger.WriteLineWarn($"MigrateAgentCommand err, ex:{ex}");
  622. }
  623. });
  624. }
  625. catch (Exception ex)
  626. {
  627. Logger.WriteLineWarn($"MigrateAgentCommand err, ex:{ex}");
  628. }
  629. }
  630. private async void OnMigrateCustomLabelsCommand(object obj)
  631. {
  632. try
  633. {
  634. Task.Run(async () =>
  635. {
  636. try
  637. {
  638. await MigrateServiceReal.MigrateCustomLabels();
  639. }
  640. catch (Exception ex)
  641. {
  642. Logger.WriteLineWarn($"BeginMigrateCustomLabels err, ex:{ex}");
  643. }
  644. });
  645. }
  646. catch (Exception ex)
  647. {
  648. Logger.WriteLineWarn($"BeginMigrateCustomLabels err, ex:{ex}");
  649. }
  650. }
  651. private async void OnTransferDiagnosisResultCommand(object obj)
  652. {
  653. try
  654. {
  655. Task.Run(async () =>
  656. {
  657. try
  658. {
  659. await FilterTestService.TransferDiagnosisResults();
  660. }
  661. catch (Exception ex)
  662. {
  663. Logger.WriteLineWarn($"BeginTransferDiagnosisResultData err, ex:{ex}");
  664. }
  665. });
  666. }
  667. catch (Exception ex)
  668. {
  669. Logger.WriteLineWarn($"BeginTransferDiagnosisResultData err, ex:{ex}");
  670. }
  671. }
  672. private void OnClearLogCommand(object obj)
  673. {
  674. LogItems.Clear();
  675. }
  676. private void OnCancelCommand(object obj)
  677. {
  678. OnRequestClosed();
  679. }
  680. private void OnCloseCommand(object obj)
  681. {
  682. OnRequestClosed();
  683. }
  684. void OnRequestClosed()
  685. {
  686. RequestClosed?.Invoke(this, EventArgs.Empty);
  687. }
  688. private void OnConnectDb(object obj) // 新增OnConnectDb方法
  689. {
  690. var service = AppManager.Instance.GetManager<IClientTestManager>();
  691. if (string.IsNullOrEmpty(DbPath))
  692. {
  693. DbPath = "F:\\BaiduNetdiskDownload\\Database0708Resume\\Database";
  694. }
  695. service.ConnectDb(DbPath);
  696. }
  697. private void OnConnectDbServer(object obj)
  698. {
  699. CommonConfigManager.IsLocalHost = false;
  700. MongoDbClientSingle.Instance = new MongoDbClient();
  701. }
  702. private void OnMigrateStatic(object obj)
  703. {
  704. try
  705. {
  706. Task.Run(async () =>
  707. {
  708. try
  709. {
  710. await MigrateService.WriteMigrateStaticAsync();
  711. }
  712. catch (Exception ex)
  713. {
  714. Logger.WriteLineWarn($"WriteMigrateStaticAsync err, ex:{ex}");
  715. }
  716. });
  717. }
  718. catch (Exception ex)
  719. {
  720. Logger.WriteLineWarn($"WriteMigrateStaticAsync err, ex:{ex}");
  721. }
  722. }
  723. private void OnMigrateRemoteDiagnosis(object obj)
  724. {
  725. if (_migrateRemoteDisgnosis)
  726. {
  727. Logger.WriteLineWarn($"Migrate Remote Diagnosis Processing");
  728. return;
  729. }
  730. try
  731. {
  732. _migrateRemoteDisgnosis = true;
  733. Task.Run(async () =>
  734. {
  735. try
  736. {
  737. await MigrateService.MigrateRemoteDiagnosisInfosAsync();
  738. }
  739. catch (Exception ex)
  740. {
  741. Logger.WriteLineWarn($"MigrateRemoteDiagnisisInfos err, ex:{ex}");
  742. }
  743. finally
  744. {
  745. _migrateRemoteDisgnosis = false;
  746. }
  747. });
  748. }
  749. catch (Exception ex)
  750. {
  751. Logger.WriteLineWarn($"MigrateRemoteDiagnisisInfos err, ex:{ex}");
  752. }
  753. }
  754. private void OnMigrateLiveConsultation(object obj)
  755. {
  756. if (_migrateLiveConsultation)
  757. {
  758. Logger.WriteLineWarn($"Migrate Live Consultation Processing");
  759. return;
  760. }
  761. try
  762. {
  763. _migrateLiveConsultation = true;
  764. Task.Run(async () =>
  765. {
  766. try
  767. {
  768. await MigrateService.MigrateLiveConsultationInfosAsync();
  769. }
  770. catch (Exception ex)
  771. {
  772. Logger.WriteLineWarn($"MigrateLiveConsultationInfosAsync err, ex:{ex}");
  773. }
  774. finally
  775. {
  776. _migrateLiveConsultation = false;
  777. }
  778. });
  779. }
  780. catch (Exception ex)
  781. {
  782. Logger.WriteLineWarn($"MigrateLiveConsultationInfosAsync err, ex:{ex}");
  783. }
  784. }
  785. private void OnMigrateVideo(object obj)
  786. {
  787. if (_migrateVideo)
  788. {
  789. Logger.WriteLineWarn($"Migrate Video Processing");
  790. return;
  791. }
  792. try
  793. {
  794. _migrateVideo = true;
  795. Task.Run(async () =>
  796. {
  797. try
  798. {
  799. await MigrateService.MigrateOnlineVideoInfosAsync();
  800. }
  801. catch (Exception ex)
  802. {
  803. Logger.WriteLineWarn($"MigrateOnlineVideoInfosAsync err, ex:{ex}");
  804. }
  805. finally
  806. {
  807. _migrateVideo = false;
  808. }
  809. });
  810. }
  811. catch (Exception ex)
  812. {
  813. Logger.WriteLineWarn($"MigrateOnlineVideoInfosAsync err, ex:{ex}");
  814. }
  815. }
  816. private void OnMigrateCourse(object obj)
  817. {
  818. if (_migrateCourse)
  819. {
  820. Logger.WriteLineWarn($"Migrate Course Processing");
  821. return;
  822. }
  823. try
  824. {
  825. _migrateCourse = true;
  826. Task.Run(async () =>
  827. {
  828. try
  829. {
  830. await MigrateService.MigrateOnlineTrainingInfosAsync();
  831. }
  832. catch (Exception ex)
  833. {
  834. Logger.WriteLineWarn($"MigrateOnlineTrainingInfosAsync err, ex:{ex}");
  835. }
  836. finally
  837. {
  838. _migrateCourse = false;
  839. }
  840. });
  841. }
  842. catch (Exception ex)
  843. {
  844. Logger.WriteLineWarn($"MigrateOnlineTrainingInfosAsync err, ex:{ex}");
  845. }
  846. }
  847. private void OnMigrateExamPaper(object obj)
  848. {
  849. if (_migrateExamPaper)
  850. {
  851. Logger.WriteLineWarn($"Migrate Exam Paper Processing");
  852. return;
  853. }
  854. try
  855. {
  856. _migrateExamPaper = true;
  857. Task.Run(async () =>
  858. {
  859. try
  860. {
  861. await MigrateService.MigrateExamPaperInfosAsync();
  862. }
  863. catch (Exception ex)
  864. {
  865. Logger.WriteLineWarn($"MigrateExamPaperInfosAsync err, ex:{ex}");
  866. }
  867. finally
  868. {
  869. _migrateExamPaper = false;
  870. }
  871. });
  872. }
  873. catch (Exception ex)
  874. {
  875. Logger.WriteLineWarn($"MigrateExamPaperInfosAsync err, ex:{ex}");
  876. }
  877. }
  878. private void OnMigrateReport(object obj)
  879. {
  880. if (_migrateReport)
  881. {
  882. Logger.WriteLineWarn($"Migrate Report Processing");
  883. return;
  884. }
  885. try
  886. {
  887. _migrateReport = true;
  888. Task.Run(async () =>
  889. {
  890. try
  891. {
  892. await MigrateService.MigrateReportInfosAsync();
  893. }
  894. catch (Exception ex)
  895. {
  896. Logger.WriteLineWarn($"MigrateReportInfosAsync err, ex:{ex}");
  897. }
  898. finally
  899. {
  900. _migrateReport = false;
  901. }
  902. });
  903. }
  904. catch (Exception ex)
  905. {
  906. Logger.WriteLineWarn($"MigrateReportInfosAsync err, ex:{ex}");
  907. }
  908. }
  909. private void OnMigrateTerminalAIData(object obj)
  910. {
  911. if (_migrateAIData)
  912. {
  913. Logger.WriteLineWarn($"Migrate TerminalAIData Processing");
  914. return;
  915. }
  916. try
  917. {
  918. _migrateAIData = true;
  919. Task.Run(async () =>
  920. {
  921. try
  922. {
  923. await MigrateService.MigrateTerminalAIDataInfosAsync();
  924. }
  925. catch (Exception ex)
  926. {
  927. Logger.WriteLineWarn($"MigrateTerminalAIDataInfosAsync err, ex:{ex}");
  928. }
  929. finally
  930. {
  931. _migrateAIData = false;
  932. }
  933. });
  934. }
  935. catch (Exception ex)
  936. {
  937. Logger.WriteLineWarn($"MigrateTerminalAIDataInfosAsync err, ex:{ex}");
  938. }
  939. }
  940. private void OnSynIsUserReportInfoAsync(object obj)
  941. {
  942. if (_synIsUserReportInfoData)
  943. {
  944. Logger.WriteLineWarn($"Syn SynIsUserReportInfoAsync Processing");
  945. return;
  946. }
  947. try
  948. {
  949. _synIsUserReportInfoData = true;
  950. Task.Run(async () =>
  951. {
  952. try
  953. {
  954. await MigrateServiceReal.SynIsUserReportInfoAsync();
  955. }
  956. catch (Exception ex)
  957. {
  958. Logger.WriteLineWarn($"Syn SynIsUserReportInfoAsync err, ex:{ex}");
  959. }
  960. finally
  961. {
  962. _synIsUserReportInfoData = false;
  963. }
  964. });
  965. }
  966. catch (Exception ex)
  967. {
  968. _synIsUserReportInfoData = false;
  969. Logger.WriteLineWarn($"Syn SynIsUserReportInfoAsync err, ex:{ex}");
  970. }
  971. }
  972. private void OnSynUserDeviceOrgDatas(object obj)
  973. {
  974. if (_synUserDeviceOrgData)
  975. {
  976. Logger.WriteLineWarn($"Syn UserDeviceOrgData Processing");
  977. return;
  978. }
  979. try
  980. {
  981. _synUserDeviceOrgData = true;
  982. Task.Run(async () =>
  983. {
  984. try
  985. {
  986. //await MigrateServiceReal.SynUserDeviceOrganizationData();
  987. await MigrateServiceReal.ClearReportTemplateData();
  988. //await MigrateServiceReal.ClearReportTemplateDataJson();
  989. }
  990. catch (Exception ex)
  991. {
  992. Logger.WriteLineWarn($"Syn UserDeviceOrgData err, ex:{ex}");
  993. }
  994. finally
  995. {
  996. _synUserDeviceOrgData = false;
  997. }
  998. });
  999. }
  1000. catch (Exception ex)
  1001. {
  1002. _synUserDeviceOrgData = false;
  1003. Logger.WriteLineWarn($"Syn UserDeviceOrgData err, ex:{ex}");
  1004. }
  1005. }
  1006. private void OnValidateOrganizationParentDataInfos(object obj)
  1007. {
  1008. if (_validateOrganizationParentData)
  1009. {
  1010. Logger.WriteLineWarn($"ValidateOrganizationParentDataInfos Processing");
  1011. return;
  1012. }
  1013. try
  1014. {
  1015. _validateOrganizationParentData = true;
  1016. Task.Run(async () =>
  1017. {
  1018. try
  1019. {
  1020. await MigrateServiceReal.ValidateOrganizationParentDataInfos();
  1021. }
  1022. catch (Exception ex)
  1023. {
  1024. Logger.WriteLineWarn($"ValidateOrganizationParentDataInfos err, ex:{ex}");
  1025. }
  1026. finally
  1027. {
  1028. _validateOrganizationParentData = false;
  1029. }
  1030. });
  1031. }
  1032. catch (Exception ex)
  1033. {
  1034. _validateOrganizationParentData = false;
  1035. Logger.WriteLineWarn($"ValidateOrganizationParentDataInfos err, ex:{ex}");
  1036. }
  1037. }
  1038. private void OnMigrateVinnoOrgInfos(object obj)
  1039. {
  1040. if (_migrateVinnoOrgData)
  1041. {
  1042. Logger.WriteLineWarn($"Migrate VinnoOrgData Processing");
  1043. return;
  1044. }
  1045. try
  1046. {
  1047. _migrateVinnoOrgData = true;
  1048. Task.Run(async () =>
  1049. {
  1050. try
  1051. {
  1052. await MigrateServiceReal.MigrateVinnoOrgInfos();
  1053. }
  1054. catch (Exception ex)
  1055. {
  1056. Logger.WriteLineWarn($"MigrateOnlineVinnoOrgDataDataAsync err, ex:{ex}");
  1057. }
  1058. finally
  1059. {
  1060. _migrateVinnoOrgData = false;
  1061. }
  1062. });
  1063. }
  1064. catch (Exception ex)
  1065. {
  1066. _migrateVinnoOrgData = false;
  1067. Logger.WriteLineWarn($"MigrateOnlineVinnoOrgDataAsync err, ex:{ex}");
  1068. }
  1069. }
  1070. private void OnMigrateVinnoDeviceInfos(object obj)
  1071. {
  1072. if (_migrateVinnoOrgData)
  1073. {
  1074. Logger.WriteLineWarn($"MigrateVinnoOrDataInfosByConfig Processing");
  1075. return;
  1076. }
  1077. try
  1078. {
  1079. _migrateVinnoOrgData = true;
  1080. Task.Run(async () =>
  1081. {
  1082. try
  1083. {
  1084. await MigrateServiceReal.MigrateVinnoOrDataInfosByConfig();
  1085. }
  1086. catch (Exception ex)
  1087. {
  1088. Logger.WriteLineWarn($"MigrateVinnoOrDataInfosByConfig err, ex:{ex}");
  1089. }
  1090. finally
  1091. {
  1092. _migrateVinnoOrgData = false;
  1093. }
  1094. });
  1095. }
  1096. catch (Exception ex)
  1097. {
  1098. _migrateVinnoOrgData = false;
  1099. Logger.WriteLineWarn($"MigrateVinnoOrDataInfosByConfig err, ex:{ex}");
  1100. }
  1101. }
  1102. private void OnMigratePrintData(object obj)
  1103. {
  1104. if (_migratePrintData)
  1105. {
  1106. Logger.WriteLineWarn($"Migrate PrintData Processing");
  1107. return;
  1108. }
  1109. try
  1110. {
  1111. _migratePrintData = true;
  1112. Task.Run(async () =>
  1113. {
  1114. try
  1115. {
  1116. await MigrateServiceReal.MigratePrintInfos();
  1117. }
  1118. catch (Exception ex)
  1119. {
  1120. Logger.WriteLineWarn($"MigrateOnlinePrintDataAsync err, ex:{ex}");
  1121. }
  1122. finally
  1123. {
  1124. _migratePrintData = false;
  1125. }
  1126. });
  1127. }
  1128. catch (Exception ex)
  1129. {
  1130. _migratePrintData = false;
  1131. Logger.WriteLineWarn($"MigrateOnlinePrintDataAsync err, ex:{ex}");
  1132. }
  1133. }
  1134. private void OnMigratePatchData(object obj)
  1135. {
  1136. if (_migratePatchData)
  1137. {
  1138. Logger.WriteLineWarn($"Migrate PatchData Processing");
  1139. return;
  1140. }
  1141. try
  1142. {
  1143. _migratePatchData = true;
  1144. Task.Run(async () =>
  1145. {
  1146. try
  1147. {
  1148. await MigrateServiceReal.MigratePatchDataInfos(SyncDBEnum.Migrate);
  1149. }
  1150. catch (Exception ex)
  1151. {
  1152. Logger.WriteLineWarn($"MigrateOnlinePatchDataAsync err, ex:{ex}");
  1153. }
  1154. finally
  1155. {
  1156. _migratePatchData = false;
  1157. }
  1158. });
  1159. }
  1160. catch (Exception ex)
  1161. {
  1162. _migratePatchData = false;
  1163. Logger.WriteLineWarn($"MigrateOnlinePatchDataAsync err, ex:{ex}");
  1164. }
  1165. }
  1166. private void OnMigratePackageData(object obj)
  1167. {
  1168. if (_migratePackageData)
  1169. {
  1170. Logger.WriteLineWarn($"Migrate PackageData Processing");
  1171. return;
  1172. }
  1173. try
  1174. {
  1175. _migratePackageData = true;
  1176. Task.Run(async () =>
  1177. {
  1178. try
  1179. {
  1180. await MigrateServiceReal.MigratePackageInfos(SyncDBEnum.Migrate);
  1181. }
  1182. catch (Exception ex)
  1183. {
  1184. Logger.WriteLineWarn($"MigratePackageInfos err, ex:{ex}");
  1185. }
  1186. finally
  1187. {
  1188. _migratePackageData = false;
  1189. }
  1190. });
  1191. }
  1192. catch (Exception ex)
  1193. {
  1194. _migratePackageData = false;
  1195. Logger.WriteLineWarn($"MigratePackageInfos err, ex:{ex}");
  1196. }
  1197. }
  1198. private void OnUpgradeBussinessDataCommand(object obj)
  1199. {
  1200. if (_bussinessData)
  1201. {
  1202. Logger.WriteLineWarn($"Migrate BussinessData Processing");
  1203. return;
  1204. }
  1205. try
  1206. {
  1207. _bussinessData = true;
  1208. Task.Run(async () =>
  1209. {
  1210. try
  1211. {
  1212. await MigrateServiceReal.ClearBussinessDatas();
  1213. }
  1214. catch (Exception ex)
  1215. {
  1216. Logger.WriteLineWarn($"BussinessData err, ex:{ex}");
  1217. }
  1218. finally
  1219. {
  1220. _bussinessData = false;
  1221. }
  1222. });
  1223. }
  1224. catch (Exception ex)
  1225. {
  1226. Logger.WriteLineWarn($"BussinessData err, ex:{ex}");
  1227. }
  1228. }
  1229. private void OnReadFeedBackExcelData(object obj)
  1230. {
  1231. if (_readFeedBackData)
  1232. {
  1233. Logger.WriteLineWarn($"Migrate ReadFeedBackExcelData Processing");
  1234. return;
  1235. }
  1236. try
  1237. {
  1238. _readFeedBackData = true;
  1239. Task.Run(async () =>
  1240. {
  1241. try
  1242. {
  1243. await MigrateServiceReal.ReadFeedBackExcelDataAsync();
  1244. }
  1245. catch (Exception ex)
  1246. {
  1247. Logger.WriteLineWarn($"ReadFeedBackExcelData err, ex:{ex}");
  1248. }
  1249. finally
  1250. {
  1251. _readFeedBackData = false;
  1252. }
  1253. });
  1254. }
  1255. catch (Exception ex)
  1256. {
  1257. Logger.WriteLineWarn($"ReadFeedBackExcelData err, ex:{ex}");
  1258. }
  1259. }
  1260. private void OnMigrateBasicData(object obj)
  1261. {
  1262. if (_migrateBasicData)
  1263. {
  1264. Logger.WriteLineWarn($"Migrate BasicData Processing");
  1265. return;
  1266. }
  1267. try
  1268. {
  1269. _migrateBasicData = true;
  1270. Task.Run(async () =>
  1271. {
  1272. try
  1273. {
  1274. await MigrateServiceReal.MigrateBasicInfos(SyncDBEnum.Migrate);
  1275. //await MigrateServiceReal.AddOrg();
  1276. }
  1277. catch (Exception ex)
  1278. {
  1279. Logger.WriteLineWarn($"MigrateOnlineBasicDataAsync err, ex:{ex}");
  1280. }
  1281. finally
  1282. {
  1283. _migrateBasicData = false;
  1284. }
  1285. });
  1286. }
  1287. catch (Exception ex)
  1288. {
  1289. Logger.WriteLineWarn($"MigrateOnlineBasicDataAsync err, ex:{ex}");
  1290. }
  1291. }
  1292. private void OnDeleteDictionData(object obj)
  1293. {
  1294. if (_migrateDicInfo)
  1295. {
  1296. Logger.WriteLineWarn($"Migrate DeleteDictionData Processing");
  1297. return;
  1298. }
  1299. try
  1300. {
  1301. _migrateDicInfo = true;
  1302. Task.Run(async () =>
  1303. {
  1304. try
  1305. {
  1306. await MigrateServiceReal.DeleteRepeatDicData();
  1307. }
  1308. catch (Exception ex)
  1309. {
  1310. Logger.WriteLineWarn($"Migrate DeleteDictionData err, ex:{ex}");
  1311. }
  1312. finally
  1313. {
  1314. _migrateDicInfo = false;
  1315. }
  1316. });
  1317. }
  1318. catch (Exception ex)
  1319. {
  1320. Logger.WriteLineWarn($"Migrate DeleteDictionData err, ex:{ex}");
  1321. }
  1322. }
  1323. /// <summary>
  1324. /// 同步老的代理商用户数据
  1325. /// </summary>
  1326. /// <param name="obj"></param>
  1327. private void OnMigrateIsOldAgentUserInfosData(object obj)
  1328. {
  1329. if (_migrateUserInfo)
  1330. {
  1331. Logger.WriteLineWarn($"Migrate IsOldAgent User Infos Processing");
  1332. return;
  1333. }
  1334. try
  1335. {
  1336. _migrateUserInfo = true;
  1337. Task.Run(async () =>
  1338. {
  1339. try
  1340. {
  1341. await MigrateServiceReal.MigrateIsOldAgentUserInfos(SyncDBEnum.Synchronize);
  1342. }
  1343. catch (Exception ex)
  1344. {
  1345. Logger.WriteLineWarn($"Migrate IsOldAgent User Infos err, ex:{ex}");
  1346. }
  1347. finally
  1348. {
  1349. _migrateUserInfo = false;
  1350. }
  1351. });
  1352. }
  1353. catch (Exception ex)
  1354. {
  1355. Logger.WriteLineWarn($"Migrate IsOldAgent User Infos err, ex:{ex}");
  1356. }
  1357. }
  1358. private void OnMigrateBasicUserData(object obj)
  1359. {
  1360. if (_migrateUserInfo)
  1361. {
  1362. Logger.WriteLineWarn($"Migrate User Infos Processing");
  1363. return;
  1364. }
  1365. try
  1366. {
  1367. _migrateUserInfo = true;
  1368. Task.Run(async () =>
  1369. {
  1370. try
  1371. {
  1372. await MigrateServiceReal.MigrateBasicUserInfos(SyncDBEnum.Migrate);
  1373. }
  1374. catch (Exception ex)
  1375. {
  1376. Logger.WriteLineWarn($"MigrateBasicUserInfos err, ex:{ex}");
  1377. }
  1378. finally
  1379. {
  1380. _migrateUserInfo = false;
  1381. }
  1382. });
  1383. }
  1384. catch (Exception ex)
  1385. {
  1386. Logger.WriteLineWarn($"MigrateBasicUserInfos err, ex:{ex}");
  1387. }
  1388. }
  1389. private void OnDiffOrganizationData(object obj)
  1390. {
  1391. if (_migrateUserInfo)
  1392. {
  1393. Logger.WriteLineWarn($"Migrate User Infos Processing");
  1394. return;
  1395. }
  1396. try
  1397. {
  1398. _migrateUserInfo = true;
  1399. Task.Run(async () =>
  1400. {
  1401. try
  1402. {
  1403. await MigrateServiceReal.DiffOrg();
  1404. }
  1405. catch (Exception ex)
  1406. {
  1407. Logger.WriteLineWarn($"MigrateBasicUserInfos err, ex:{ex}");
  1408. }
  1409. finally
  1410. {
  1411. _migrateUserInfo = false;
  1412. }
  1413. });
  1414. }
  1415. catch (Exception ex)
  1416. {
  1417. Logger.WriteLineWarn($"MigrateBasicUserInfos err, ex:{ex}");
  1418. }
  1419. }
  1420. private void OnMigrateCourseVideo(object obj)
  1421. {
  1422. if (_migrateCourseData)
  1423. {
  1424. Logger.WriteLineWarn($"Migrate CourseVideo Processing");
  1425. return;
  1426. }
  1427. try
  1428. {
  1429. _migrateCourseData = true;
  1430. Task.Run(async () =>
  1431. {
  1432. try
  1433. {
  1434. await MigrateServiceReal.MigrateCourseInfos(SyncDBEnum.Migrate);
  1435. }
  1436. catch (Exception ex)
  1437. {
  1438. Logger.WriteLineWarn($"MigrateOnlineCourseVideoAsync err, ex:{ex}");
  1439. }
  1440. finally
  1441. {
  1442. _migrateCourseData = false;
  1443. }
  1444. });
  1445. }
  1446. catch (Exception ex)
  1447. {
  1448. Logger.WriteLineWarn($"MigrateOnlineCourseVideoAsync err, ex:{ex}");
  1449. }
  1450. }
  1451. private void OnWingCertifiedInstructorUserMigrate(object obj)
  1452. {
  1453. if (_migrateCertifiedInstructorUser)
  1454. {
  1455. Logger.WriteLineWarn($"Migrate CertifiedInstructorUser Processing");
  1456. return;
  1457. }
  1458. try
  1459. {
  1460. _migrateCertifiedInstructorUser = true;
  1461. Task.Run(async () =>
  1462. {
  1463. try
  1464. {
  1465. //List<Dictionary<string, object>> keyValuePairs = new List<Dictionary<string, object>>();
  1466. //Dictionary<string, object> temp = new Dictionary<string, object>();
  1467. //temp.Add("Name", "武松");
  1468. //temp["Age"] = 28;
  1469. //temp["Birthday"] = DateTime.Now;
  1470. //keyValuePairs.Add(temp);
  1471. //Dictionary<string, object> temp1 = new Dictionary<string, object>();
  1472. //temp1.Add("Name", "睿智深");
  1473. //temp1["Age"] = 31;
  1474. //temp1["Birthday"] = DateTime.Now;
  1475. //keyValuePairs.Add(temp1);
  1476. //List<dynamic> dynamicsList = new List<dynamic>();
  1477. //foreach (Dictionary<string, object> keyValues in keyValuePairs)
  1478. //{
  1479. // dynamic obj = new System.Dynamic.ExpandoObject();
  1480. // foreach (KeyValuePair<string, object> keyValuePair in keyValues)
  1481. // {
  1482. // ((IDictionary<string, object>)obj).Add(keyValuePair.Key, keyValuePair.Value);
  1483. // }
  1484. // dynamicsList.Add(obj);
  1485. //}
  1486. //string paramsText = Newtonsoft.Json.JsonConvert.SerializeObject(dynamicsList);
  1487. //await MigrateServiceReal.MigrateCertifiedInstructorUserInfos(SyncDBEnum.Synchronize);
  1488. //await MigrateServiceReal.GetTrainingBrowsedRecordsDatas(SyncDBEnum.Synchronize);
  1489. await MigrateServiceReal.FindUserAccountInfo();
  1490. //await MigrateServiceReal.SignStudentCourse();
  1491. }
  1492. catch (Exception ex)
  1493. {
  1494. Logger.WriteLineWarn($"Migrate CertifiedInstructorUser Async err, ex:{ex}");
  1495. }
  1496. finally
  1497. {
  1498. _migrateCertifiedInstructorUser = false;
  1499. }
  1500. });
  1501. }
  1502. catch (Exception ex)
  1503. {
  1504. Logger.WriteLineWarn($"Migrate CertifiedInstructorUser Async err, ex:{ex}");
  1505. }
  1506. }
  1507. private void OnWingUpgradeMigrate(object obj)
  1508. {
  1509. if (_migrateUpgrade)
  1510. {
  1511. Logger.WriteLineWarn($"Migrate Upgrade Processing");
  1512. return;
  1513. }
  1514. try
  1515. {
  1516. _migrateUpgrade = true;
  1517. Task.Run(async () =>
  1518. {
  1519. try
  1520. {
  1521. await MigrateServiceReal.MigrateUpgradeInfos();
  1522. }
  1523. catch (Exception ex)
  1524. {
  1525. Logger.WriteLineWarn($"Migrate Upgrade Async err, ex:{ex}");
  1526. }
  1527. finally
  1528. {
  1529. _migrateUpgrade = false;
  1530. }
  1531. });
  1532. }
  1533. catch (Exception ex)
  1534. {
  1535. Logger.WriteLineWarn($"Migrate Upgrade Async err, ex:{ex}");
  1536. }
  1537. }
  1538. //远程
  1539. private void OnMigrateSpecialReport(object obj)
  1540. {
  1541. if (_migrateSpecialReport)
  1542. {
  1543. Logger.WriteLineWarn($"OnMigrateSpecialReport Processing");
  1544. }
  1545. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1546. {
  1547. try
  1548. {
  1549. if (ReportEndDate < ReportBeginDate)
  1550. {
  1551. Logger.WriteLineError($"BeginDate Not Greater EndDate");
  1552. }
  1553. else
  1554. {
  1555. _migrateSpecialReport = true;
  1556. Task.Run(async () =>
  1557. {
  1558. try
  1559. {
  1560. await MigrateServiceReal.MigrateSpeicalReportInfoResults(ReportBeginDate, ReportEndDate);
  1561. _migrateSpecialReport = false;
  1562. }
  1563. catch (Exception ex)
  1564. {
  1565. Logger.WriteLineWarn($"OnMigrateSpecialReport err, ex:{ex}");
  1566. }
  1567. finally
  1568. {
  1569. _migrateSpecialReport = false;
  1570. }
  1571. });
  1572. }
  1573. }
  1574. catch (Exception ex)
  1575. {
  1576. Logger.WriteLineWarn($"OnMigrateSpecialReport err, ex:{ex}");
  1577. }
  1578. }
  1579. else
  1580. {
  1581. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1582. }
  1583. }
  1584. //访问网站获取响应
  1585. private void OnMTryVisitWeb(object obj)
  1586. {
  1587. if (_visitWeb)
  1588. {
  1589. Logger.WriteLineWarn($"OnMTryVisitWeb Processing");
  1590. }
  1591. Task.Run(async () =>
  1592. {
  1593. while (true)
  1594. {
  1595. try
  1596. {
  1597. await TryVisitWeb();
  1598. _visitWebErrorNum = 0;
  1599. }
  1600. catch (Exception ex)
  1601. {
  1602. _visitWebErrorNum++;
  1603. if (_visitWebErrorNum == 2)
  1604. {
  1605. Logger.WriteLineError("TryVisitWeb error");
  1606. await SendNoticeSmail("303579937@qq.com");
  1607. await SendNoticeSmail("15506154416@163.com");
  1608. await SendNoticeSmail("4087016@qq.com");
  1609. }
  1610. }
  1611. finally
  1612. {
  1613. }
  1614. await Task.Delay(1000 * 60);
  1615. }
  1616. });
  1617. }
  1618. public async Task<bool> TryVisitWeb()
  1619. {
  1620. try
  1621. {
  1622. string url = "http://s01.flyinsono.com:9090/";
  1623. HttpClient client = new HttpClient();
  1624. client.Timeout = TimeSpan.FromSeconds(30);
  1625. var response = client.GetAsync(url).Result;
  1626. Console.WriteLine("Response obtained successfully!");
  1627. }
  1628. catch (WebException ex)
  1629. {
  1630. // If there is no response or an error occurs, perform other actions here
  1631. Console.WriteLine("No response obtained. Performing additional tasks...");
  1632. // TODO: Add your custom code here to handle the situation when there is no response
  1633. }
  1634. return true;
  1635. }
  1636. public async Task<bool> SendNoticeSmail(string email)
  1637. {
  1638. try
  1639. {
  1640. var url = "https://bj.flyinsono.com/ILoginService";
  1641. var payload = new
  1642. {
  1643. jsonrpc = "2.0",
  1644. method = "SendEmailVerificationCodeAsync",
  1645. @params = new[]
  1646. {
  1647. new
  1648. {
  1649. LanguageCode = "zh-CN",
  1650. EmailAddress = email
  1651. }
  1652. },
  1653. id = 531560752
  1654. };
  1655. using (var httpClient = new HttpClient())
  1656. {
  1657. var jsonPayload = Newtonsoft.Json.JsonConvert.SerializeObject(payload);
  1658. var content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
  1659. var response = await httpClient.PostAsync(url, content);
  1660. if (response.IsSuccessStatusCode)
  1661. {
  1662. var responseContent = await response.Content.ReadAsStringAsync();
  1663. Console.WriteLine(responseContent);
  1664. }
  1665. else
  1666. {
  1667. Console.WriteLine("An error occurred: " + response.StatusCode);
  1668. }
  1669. }
  1670. }
  1671. catch (Exception ex)
  1672. {
  1673. }
  1674. return true;
  1675. }
  1676. //远程
  1677. private void OnMigrateRemoteRecordToWing(object obj)
  1678. {
  1679. if (_migrateRemedicalRecord)
  1680. {
  1681. Logger.WriteLineWarn($"OnMigrateRemoteRecordToWing Processing");
  1682. }
  1683. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1684. {
  1685. try
  1686. {
  1687. _migrateRemedicalRecord = true;
  1688. Task.Run(async () =>
  1689. {
  1690. try
  1691. {
  1692. await MigrateServiceReal.MigrateRemedicalRecords(SyncDBEnum.Migrate);
  1693. _migrateRemedicalRecord = false;
  1694. }
  1695. catch (Exception ex)
  1696. {
  1697. Logger.WriteLineWarn($"OnMigrateRemoteRecordToWing err, ex:{ex}");
  1698. }
  1699. finally
  1700. {
  1701. _migrateRemedicalRecord = false;
  1702. }
  1703. });
  1704. }
  1705. catch (Exception ex)
  1706. {
  1707. Logger.WriteLineWarn($"OnMigrateRemoteRecordToWing err, ex:{ex}");
  1708. }
  1709. }
  1710. else
  1711. {
  1712. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1713. }
  1714. }
  1715. //图像
  1716. private void OnMigrateRemeteDataToWing(object obj)
  1717. {
  1718. if (_migrateRemedicalData)
  1719. {
  1720. Logger.WriteLineWarn($"OnMigrateRemeteDataToWing Processing");
  1721. }
  1722. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1723. {
  1724. try
  1725. {
  1726. _migrateRemedicalData = true;
  1727. Task.Run(async () =>
  1728. {
  1729. try
  1730. {
  1731. await MigrateServiceReal.MigrateRemedicalDatas(SyncDBEnum.Migrate, 1);
  1732. _migrateRemedicalData = false;
  1733. }
  1734. catch (Exception ex)
  1735. {
  1736. Logger.WriteLineWarn($"OnMigrateRemeteDataToWing err, ex:{ex}");
  1737. }
  1738. finally
  1739. {
  1740. _migrateRemedicalData = false;
  1741. }
  1742. });
  1743. }
  1744. catch (Exception ex)
  1745. {
  1746. Logger.WriteLineWarn($"OnMigrateRemeteDataToWing err, ex:{ex}");
  1747. }
  1748. }
  1749. else
  1750. {
  1751. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1752. }
  1753. }
  1754. //AI
  1755. private void OnMigrateAIDataToWing(object obj)
  1756. {
  1757. if (_migrateAI)
  1758. {
  1759. Logger.WriteLineWarn($"OnMigrateAIDataToWing Processing");
  1760. }
  1761. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1762. {
  1763. try
  1764. {
  1765. _migrateAI = true;
  1766. Task.Run(async () =>
  1767. {
  1768. try
  1769. {
  1770. await MigrateServiceReal.MigrateRemedicalAIDatas(SyncDBEnum.Migrate);
  1771. _migrateAI = false;
  1772. }
  1773. catch (Exception ex)
  1774. {
  1775. Logger.WriteLineWarn($"OnMigrateAIDataToWing err, ex:{ex}");
  1776. }
  1777. finally
  1778. {
  1779. _migrateAI = false;
  1780. }
  1781. });
  1782. }
  1783. catch (Exception ex)
  1784. {
  1785. Logger.WriteLineWarn($"OnMigrateAIDataToWing err, ex:{ex}");
  1786. }
  1787. }
  1788. else
  1789. {
  1790. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1791. }
  1792. }
  1793. //颈动脉AI
  1794. private void OnMigrateCarotidToWing(object obj)
  1795. {
  1796. if (_migrateCarotid)
  1797. {
  1798. Logger.WriteLineWarn($"OnMigrateCarotidToWing Processing");
  1799. }
  1800. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1801. {
  1802. try
  1803. {
  1804. _migrateCarotid = true;
  1805. Task.Run(async () =>
  1806. {
  1807. try
  1808. {
  1809. await MigrateServiceReal.MigrateRemedicalCarotidDatas(SyncDBEnum.Migrate);
  1810. _migrateCarotid = false;
  1811. }
  1812. catch (Exception ex)
  1813. {
  1814. Logger.WriteLineWarn($"OnMigrateCarotidToWing err, ex:{ex}");
  1815. }
  1816. finally
  1817. {
  1818. _migrateCarotid = false;
  1819. }
  1820. });
  1821. }
  1822. catch (Exception ex)
  1823. {
  1824. Logger.WriteLineWarn($"OnMigrateCarotidToWing err, ex:{ex}");
  1825. }
  1826. }
  1827. else
  1828. {
  1829. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1830. }
  1831. }
  1832. //会诊
  1833. private void OnMigrateConsultationToWing(object obj)
  1834. {
  1835. if (_migrateConsultation)
  1836. {
  1837. Logger.WriteLineWarn($"OnMigrateConsultationToWing Processing");
  1838. }
  1839. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1840. {
  1841. try
  1842. {
  1843. _migrateConsultation = true;
  1844. Task.Run(async () =>
  1845. {
  1846. try
  1847. {
  1848. await MigrateServiceReal.MigrateConsultationResults(SyncDBEnum.Migrate);
  1849. _migrateConsultation = false;
  1850. }
  1851. catch (Exception ex)
  1852. {
  1853. Logger.WriteLineWarn($"OnMigrateConsultationToWing err, ex:{ex}");
  1854. }
  1855. finally
  1856. {
  1857. _migrateConsultation = false;
  1858. }
  1859. });
  1860. }
  1861. catch (Exception ex)
  1862. {
  1863. Logger.WriteLineWarn($"OnMigrateConsultationToWing err, ex:{ex}");
  1864. }
  1865. }
  1866. else
  1867. {
  1868. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1869. }
  1870. }
  1871. private async void OnClearColdDataCommand(object obj)
  1872. {
  1873. try
  1874. {
  1875. Task.Run(async () =>
  1876. {
  1877. try
  1878. {
  1879. await FilterTestService.DeleteColdData();
  1880. }
  1881. catch (Exception ex)
  1882. {
  1883. Logger.WriteLineWarn($"BeginClearColdData err, ex:{ex}");
  1884. }
  1885. });
  1886. }
  1887. catch (Exception ex)
  1888. {
  1889. Logger.WriteLineWarn($"BeginClearColdData err, ex:{ex}");
  1890. }
  1891. }
  1892. //报告
  1893. private void OnMigrateReportToWing(object obj)
  1894. {
  1895. if (_migrateReportResult)
  1896. {
  1897. Logger.WriteLineWarn($"OnMigrateReportToWing Processing");
  1898. }
  1899. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1900. {
  1901. try
  1902. {
  1903. _migrateReportResult = true;
  1904. Task.Run(async () =>
  1905. {
  1906. try
  1907. {
  1908. await MigrateServiceReal.MigrateReportInfoResults(SyncDBEnum.Migrate);
  1909. _migrateReportResult = false;
  1910. }
  1911. catch (Exception ex)
  1912. {
  1913. Logger.WriteLineWarn($"OnMigrateReportToWing err, ex:{ex}");
  1914. }
  1915. finally
  1916. {
  1917. _migrateReportResult = false;
  1918. }
  1919. });
  1920. }
  1921. catch (Exception ex)
  1922. {
  1923. Logger.WriteLineWarn($"OnMigrateReportToWing err, ex:{ex}");
  1924. }
  1925. }
  1926. else
  1927. {
  1928. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1929. }
  1930. }
  1931. //报告
  1932. private void OnSynchronizeTerminalRecord(object obj)
  1933. {
  1934. if (_synchronizeTerminalRecord)
  1935. {
  1936. Logger.WriteLineWarn($"OnSynchronizeTerminalRecord Processing");
  1937. }
  1938. else if (!string.IsNullOrWhiteSpace(WingServiceUrl))
  1939. {
  1940. try
  1941. {
  1942. _synchronizeTerminalRecord = true;
  1943. Task.Run(async () =>
  1944. {
  1945. try
  1946. {
  1947. if (!string.IsNullOrWhiteSpace(TerminalRecordCode))
  1948. {
  1949. await MigrateServiceReal.SynchronizeByTerminalRecordCode(TerminalRecordCode);
  1950. }
  1951. else
  1952. {
  1953. var startTime = CommonConfigManager.TerminalRecordSync.StartTime;
  1954. var endTime = CommonConfigManager.TerminalRecordSync.EndTime;
  1955. Logger.WriteLineInfo($"OnSynchronizeTerminalRecord startTime:{startTime}");
  1956. Logger.WriteLineInfo($"OnSynchronizeTerminalRecord endTime:{endTime}");
  1957. await MigrateServiceReal.SynchronizeByTimeRange(startTime, endTime);
  1958. }
  1959. _synchronizeTerminalRecord = false;
  1960. }
  1961. catch (Exception ex)
  1962. {
  1963. Logger.WriteLineWarn($"OnSynchronizeTerminalRecord err, ex:{ex}");
  1964. }
  1965. finally
  1966. {
  1967. _synchronizeTerminalRecord = false;
  1968. }
  1969. });
  1970. }
  1971. catch (Exception ex)
  1972. {
  1973. Logger.WriteLineWarn($"OnSynchronizeTerminalRecord err, ex:{ex}");
  1974. }
  1975. }
  1976. else
  1977. {
  1978. Logger.WriteLineWarn($"2.0Server Url Is Empty");
  1979. }
  1980. }
  1981. }
  1982. }