fix job
This commit is contained in:
@@ -48,7 +48,20 @@ public class MealSupplementHandlerJob : BaseJob
|
|||||||
if (gainfo == null)
|
if (gainfo == null)
|
||||||
{
|
{
|
||||||
gainfo = await DbContext.Queryable<GainfoEntity>().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync();
|
gainfo = await DbContext.Queryable<GainfoEntity>().AS("GainfoLeave").Where(x => x.Code == item.Code).SingleAsync();
|
||||||
if (gainfo != null && gainfo.ResignationDate < item.Date)
|
|
||||||
|
if (gainfo == null)
|
||||||
|
{
|
||||||
|
await DbContext.Updateable<MealSupplementRecordEntity>()
|
||||||
|
.SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error)
|
||||||
|
.SetColumns(x => x.Result == "人员档案不存在")
|
||||||
|
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||||
|
.Where(x => x.UniqueId == item.UniqueId)
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
|
||||||
|
//后台任务获取人员
|
||||||
|
BackgroundJob.Enqueue<IGainfoUpdateService>(x => x.TodoByCodeAsync(item.Code));
|
||||||
|
}
|
||||||
|
else if (gainfo.ResignationDate < item.Date)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -76,18 +89,6 @@ public class MealSupplementHandlerJob : BaseJob
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
await DbContext.Updateable<MealSupplementRecordEntity>()
|
|
||||||
.SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error)
|
|
||||||
.SetColumns(x => x.Result == "人员档案不存在")
|
|
||||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
|
||||||
.Where(x => x.UniqueId == item.UniqueId)
|
|
||||||
.ExecuteCommandAsync();
|
|
||||||
|
|
||||||
//后台任务获取人员
|
|
||||||
BackgroundJob.Enqueue<IGainfoUpdateService>(x => x.TodoByCodeAsync(item.Code));
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user