fix 离职人员餐补处理
This commit is contained in:
@@ -46,15 +46,45 @@ public class MealSupplementHandlerJob : BaseJob
|
|||||||
//档案不存在
|
//档案不存在
|
||||||
if (gainfo == null)
|
if (gainfo == null)
|
||||||
{
|
{
|
||||||
await DbContext.Updateable<MealSupplementRecordEntity>()
|
if (await DbContext.Queryable<GainfoEntity>().AS("GainfoLeave").Where(x => x.Code == item.Code).AnyAsync())
|
||||||
.SetColumns(x => x.Status == MealSupplementStatusEnumtype.Error)
|
{
|
||||||
.SetColumns(x => x.Result == "人员档案不存在")
|
try
|
||||||
|
{
|
||||||
|
var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>
|
||||||
|
{
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
UniqueId = item.UniqueId,
|
||||||
|
Status = "FAIL",
|
||||||
|
Msg = "人员离职"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await DbContext.Updateable<MealSupplementRecordEntity>()
|
||||||
|
.SetColumns(x => x.Result == r)
|
||||||
|
.SetColumns(x => x.Status == MealSupplementStatusEnumtype.Sucess)
|
||||||
|
.SetColumns(x => x.Sync == true)
|
||||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||||
.Where(x => x.UniqueId == item.UniqueId)
|
.Where(x => x.UniqueId == item.UniqueId)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
//后台任务获取人员
|
}
|
||||||
BackgroundJob.Enqueue<IGainfoUpdateService>(x => x.TodoByCodeAsync(item.Code));
|
}
|
||||||
|
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