定时任务调整

dev
douhandong 3 weeks ago
parent a1fb034070
commit dbe5771c1a

@ -11,22 +11,22 @@ namespace DS.Module.QuartzModuleInstall
{
public static void AddFeeQuartzModuleInstall(this IServiceCollection services, IConfiguration configuration)
{
//获取进项发票
var jobKey = new JobKey("InInvoice");
////获取进项发票
//var jobKey = new JobKey("InInvoice");
services.AddQuartz(q =>
{
// 配置 Quartz
q.UseMicrosoftDependencyInjectionJobFactory();
//services.AddQuartz(q =>
//{
// // 配置 Quartz
// q.UseMicrosoftDependencyInjectionJobFactory();
q.AddJob<InInvoiceJob>(opts => opts.WithIdentity(jobKey));
q.AddTrigger(opts => opts
.ForJob(jobKey)
.WithIdentity("InInvoice-trigger")
.WithSimpleSchedule(x => x
.WithIntervalInSeconds(60)
.RepeatForever()));
});
// q.AddJob<InInvoiceJob>(opts => opts.WithIdentity(jobKey));
// q.AddTrigger(opts => opts
// .ForJob(jobKey)
// .WithIdentity("InInvoice-trigger")
// .WithSimpleSchedule(x => x
// .WithIntervalInSeconds(60)
// .RepeatForever()));
//});
//获取银行流水

@ -72,17 +72,18 @@ namespace DS.WMS.Core.QuarztJobs.Method
});
var listdt = info.result.Select(t => t.TransactionReferenceNumber).ToList();
var ininviceinfo = tenantDb.Queryable<BankStatement>().Where(x =>listdt .Contains(x.TransactionReferenceNumber)).ToList();
var listdt = info.result.Select(t => t.RecordID).ToList();
var ininviceinfo = tenantDb.Queryable<BankStatement>().Where(x =>listdt .Contains(x.RecordID)).ToList();
foreach (var itemdata in info.result)
{
//数据库中银行流水为空,则添加银行流水数据数据
if (ininviceinfo.Where(t => t.TransactionReferenceNumber == itemdata.TransactionReferenceNumber).Count() == 0)
if (ininviceinfo.Where(t => t.RecordID == itemdata.RecordID).Count() == 0)
{
BankStatement bs = new BankStatement();
bs.Id = SnowFlakeSingle.Instance.NextId();
bs.OrgId = item.OrgId;
bs.Custom = itemdata.Custom;
bs.BankName = itemdata.BankName;

Loading…
Cancel
Save