refactor 优化代码
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Basic.Api;
|
||||
using Dlhis.Basic.Api.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.ScheduledTask.Attributes;
|
||||
using Dlhis.ScheduledTask.Common.Dto;
|
||||
using Dlhis.ScheduledTask.Common.Services;
|
||||
|
||||
namespace Dlhis.ScheduledTask.Jobs;
|
||||
|
||||
@@ -11,16 +11,16 @@ namespace Dlhis.ScheduledTask.Jobs;
|
||||
[RecurringJob(nameof(SyncOrganizationJob), "0 0 0 * * ?", Name = "SAP组织架构数据同步")]
|
||||
public class SyncOrganizationJob : BaseJob
|
||||
{
|
||||
private readonly IJinkoSapService _jinkoSapService;
|
||||
private readonly ISyncApi _syncApi;
|
||||
|
||||
public SyncOrganizationJob(IServiceProvider serviceProvider, IJinkoSapService jinkoSapService) : base(serviceProvider)
|
||||
public SyncOrganizationJob(IServiceProvider serviceProvider, ISyncApi syncApi) : base(serviceProvider)
|
||||
{
|
||||
_jinkoSapService = jinkoSapService;
|
||||
_syncApi = syncApi;
|
||||
}
|
||||
|
||||
protected override async Task RunAsync(IServiceProvider serviceProvider)
|
||||
{
|
||||
var orgResult = await _jinkoSapService.GetSapOrganizationsAsync();
|
||||
var orgResult = await _syncApi.SyncOrganizationsAsync();
|
||||
|
||||
if (orgResult.Org != null && orgResult.Org.Items.Count > 0)
|
||||
{
|
||||
@@ -53,4 +53,4 @@ public class SyncOrganizationJob : BaseJob
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user