diff --git a/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs b/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs index cc462666..6d8890bb 100644 --- a/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/WerkEntity.cs @@ -38,12 +38,6 @@ public class WerkEntity : SugarBaseEntity [SugarColumn(IsNullable = false, ColumnDescription = "差异数")] public int DiffNumber { get; set; } - /// - /// 权限变更数 - /// - [SugarColumn(IsNullable = false, ColumnDescription = "权限变更数")] - public int PermissionChangeNumber { get; set; } - /// /// 最近同步时间 /// diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs index 99be42ef..3dfd86b9 100644 --- a/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs @@ -90,13 +90,8 @@ public class GainfoUpdateService : IGainfoUpdateService var d = modifiedPersons.First(); _logger.LogInformation("差异信息:{json}", d.ToJson()); _logger.LogInformation("差异信息:{json}", (await _dbContext.Queryable().Where(x => x.ename == d.ZWORKCODE).FirstAsync())?.ToJson()); - var tenantResult = await _tenantApi.GetTenantsInternalAsync(); - _tenants = tenantResult.Data; await SavePersonAsync(modifiedPersons); - - werkInfo.PermissionChangeNumber = 0; - await _dbContext.UpdateAsync(werkInfo); } } @@ -131,18 +126,7 @@ public class GainfoUpdateService : IGainfoUpdateService _logger.LogInformation("SAP人员差异数量为:{count}", modifiedPersons.Count); if (modifiedPersons.Count > 0) { - //var tenantResult = await _tenantApi.GetTenantsInternalAsync(); - //_tenants = tenantResult.Data; - - //var codes = modifiedPersons.Select(x => x.ZWORKCODE).ToList(); - //var userNos = await _dbContext.Queryable().Where(x => codes.Contains(x.Code)).Select(x => x.No).ToListAsync(); - //var dtoResult = await _devicePermissionApi.GetPermissionUsersInfoAsync(userNos); - //var dto = dtoResult.Data; - await SavePersonAsync(modifiedPersons); - - //var rResult = await _devicePermissionApi.RePermissionUsersInfoAsync(dto); - //var r = rResult.Data; } } @@ -152,6 +136,9 @@ public class GainfoUpdateService : IGainfoUpdateService private async Task SavePersonAsync(List persons) { + var tenantResult = await _tenantApi.GetTenantsInternalAsync(); + _tenants = tenantResult.Data; + var workCodes = persons.Select(x => x.ZWORKCODE).ToList(); var chunks = workCodes.Chunk(4000).ToList(); diff --git a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs index b65187fa..01d942c3 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs @@ -6,6 +6,7 @@ using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; using Dlhis.ScheduledTask.Common.Request; using Dlhis.ScheduledTask.Common.Services; +using Hangfire; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.Scheduled; @@ -51,6 +52,10 @@ public class MealSupplementHandlerJob : BaseJob .SetColumns(x => x.ModifiedTime == DateTime.Now) .Where(x => x.UniqueId == item.UniqueId) .ExecuteCommandAsync(); + + //后台任务获取人员 + BackgroundJob.Enqueue(x => x.TodoByCodeAsync(item.Code)); + continue; } else