fix 周期任务时间修正

This commit is contained in:
cheche
2024-01-09 09:07:47 +08:00
parent 598444fb96
commit 4bc02bd170
4 changed files with 43 additions and 33 deletions

View File

@@ -32,7 +32,7 @@ public class MealUserService : IMealUserService
public async Task AddAsync(MealUserAddRequest request)
{
//todo 获取档案信息
// 获取档案信息
var gainfoEntity = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
.Where(x => x.No.ToString() == request.UserId)

View File

@@ -11,6 +11,9 @@ using Dlhis.ScheduledTask.Configurations;
using Kurisu.SqlSugar.Services;
using Dlhis.Entity.Basic.Entity;
using Dlhis.ScheduledTask.Wsproxy.Dlhis.JinkoHr.WsProxy;
using System.Net;
using System;
using Dlhis.Entity.Basic.Enums;
namespace Dlhis.ScheduledTask.Job
{
@@ -159,32 +162,32 @@ namespace Dlhis.ScheduledTask.Job
}
else
{
var info = new GainfoEntity()
var info = new GainfoEntity
{
SapNo = item.ano,
No = item.guestno,
GType = item.@class,
Name = item.gname,
Code = item.ename,
CountryNo = item.country,
IdClass = item.idcls,
Native = item.native,
Gender = item.sex,
Birthday = (DateTime)item.birthday,
Address = item.address,
//Occupation = item.occupation,
DepartmentNo = item.appellation,
Nation = item.nation,
Phone = item.phone,
Position = item.web,
//Log_id = item.log_id,
//Log_shift = item.log_shift,
//Log_date = (DateTime)item.log_date,
//Log_ip = item.log_ip,
Employed = item.isowner,
Remark = item.remark,
Degree = item.email,
Werks = item.WERKS,
SapNo = item.ano,
No = item.guestno,
GType = item.@class,
Name = item.gname,
Code = item.ename,
CountryNo = item.country,
IdClass = item.idcls,
Native = item.native,
Gender = item.sex =="女性"? GenderEnumType.Female: GenderEnumType.Male,
Birthday = (DateTime)item.birthday,
Address = item.address,
//Occuption = item.occuption,
DepartmentNo = item.appellation,
Nation =item.nation,
Phone = item.phone,
Position = item.web,
//Log_id = item.log_id,
//Log_shift = item.log_shift,
//tLog_date = item.log_date,
//Log_ip = item.log_ip,
Employed = item.isowner,
Remark = item.remark,
Degree = item.email,
Werks = item.WERKS
};
await _dbContext.InsertAsync(info);
}
@@ -440,4 +443,5 @@ namespace Dlhis.ScheduledTask.Job
}
}
}
}

View File

@@ -59,9 +59,15 @@ public class HangfirePack : BaseAppPack
app.UseHangfireDashboard();
BackgroundJob.Enqueue(() => Console.WriteLine("This is a background job."));
RecurringJob.AddOrUpdate<SyncOrgInfoJob>("SyncOrgInfoJob_id", s => s.SyncOrgInfo(), "0 0 0 * * ?");
RecurringJob.AddOrUpdate<SyncPositionJob>("SyncPositionJob_id", s => s.SyncPositionInfo(), "0 0 1 * * ?");
RecurringJob.AddOrUpdate<SyncPersonJob>("SyncPersonJob_id", s => s.SyncPersonInfo(), "0 0 2 * * ?");
#region 周期任务
//0:00
RecurringJob.AddOrUpdate<SyncOrgInfoJob>("SyncOrgInfoJob_id", s => s.SyncOrgInfo(), "0 0 16 * * ?");
//1:00
RecurringJob.AddOrUpdate<SyncPositionJob>("SyncPositionJob_id", s => s.SyncPositionInfo(), "0 0 17 * * ?");
//2:00
RecurringJob.AddOrUpdate<SyncPersonJob>("SyncPersonJob_id", s => s.SyncPersonInfo(), "0 0 18 * * ?");
#endregion
}
}

View File

@@ -13,7 +13,7 @@
"EnableSqlLog": true
},
"ConnectionStrings": {
"HangfireConnection": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=Hangfire;charset=utf8mb4;Allow User Variables=true;"
"HangfireConnection": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=HangFire;charset=utf8mb4;Allow User Variables=true;"
},
"ServiceSettings": {
"ServerUrl": "http://172.16.7.58:8125",