Browse Source

同步卡

master
xxe 2 years ago
parent
commit
cdb2729767
4 changed files with 29 additions and 11 deletions
  1. +2
    -2
      HKCardManager/UserPages/PersonnelEntryPage.cs
  2. +9
    -0
      HKCardOUT/Bootstrapper.cs
  3. +18
    -0
      HKCardOUT/QuartzUtil/Job/CardJob.cs
  4. +0
    -9
      HKCardOUT/ViewModels/RootViewModel.cs

+ 2
- 2
HKCardManager/UserPages/PersonnelEntryPage.cs View File

@@ -644,8 +644,8 @@ namespace HKCardManager.UserPages
string cardNum = "";
if (item.Cards != null && item.Cards.Count > 0)
{
cardNum = item.Cards.ElementAt(0).CardNum;
status = ((CarStatus)item.Cards.ElementAt(0).State).ToString();
cardNum = item.Cards.FirstOrDefault(t=>t.State==1).CardNum;
status = ((CarStatus)item.Cards.FirstOrDefault(t => t.State == 1).State).ToString();
}
Global.UserListDtos.Add(new UserInfoModel()
{


+ 9
- 0
HKCardOUT/Bootstrapper.cs View File

@@ -18,6 +18,7 @@ using HKLib.RabbitMQ.Config;
using HKLib.RabbitMQ.Subscriber;
using System.Linq;
using BPA.Helper;
using QuartzUtil.Job;

namespace HKCardOUT
{
@@ -132,6 +133,14 @@ namespace HKCardOUT
/// </summary>
protected override void OnLaunch()
{
QuartzCoreFactory.QuartzCore().AddJob<CardJob>(new QuartzMap
{
JobDetail = "定时同步卡",
JobName = "同步卡",
JobGroup = "同步卡",
Cron= "0 25,55 11,17 * * ?"
});

QuartzCoreFactory.QuartzCore().AddJob<QuartzJob>(new QuartzMap
{
JobDetail = "定时推送订单",


+ 18
- 0
HKCardOUT/QuartzUtil/Job/CardJob.cs View File

@@ -0,0 +1,18 @@
using HKCardOUT.Logic;
using Quartz;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace QuartzUtil.Job
{
public class CardJob : IJob
{
public Task Execute(IJobExecutionContext context)
{
RemoteService.GetCardStuatas();
return Task.CompletedTask;
}
}
}

+ 0
- 9
HKCardOUT/ViewModels/RootViewModel.cs View File

@@ -43,7 +43,6 @@ namespace HKCardOUT.ViewModels
InsertData();
DataCenter.InitQueeue();
DataCenter.CreateData();
SyncCard();
}

/// <summary>
@@ -289,14 +288,6 @@ namespace HKCardOUT.ViewModels
Thread.Sleep(1000);
}, "写入数据", true);
}
private void SyncCard()
{
ThreadManage.GetInstance().StartLong(() =>
{
RemoteService.GetCardStuatas();
Thread.Sleep(1000 * 60 * 60);
}, "同步卡号", true);
}

private static ConcurrentQueue<SaleLogDto> Stacks = new ConcurrentQueue<SaleLogDto>();
#endregion


Loading…
Cancel
Save