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(SyncPositionJob), "0 0 0 * * ?", Name = "SAP岗位信息同步")]
|
||||
public class SyncPositionJob : BaseJob
|
||||
{
|
||||
private readonly IJinkoSapService _jinkoSapService;
|
||||
private readonly ISyncApi _syncApi;
|
||||
|
||||
public SyncPositionJob(IServiceProvider serviceProvider, IJinkoSapService jinkoSapService) : base(serviceProvider)
|
||||
public SyncPositionJob(IServiceProvider serviceProvider, ISyncApi syncApi) : base(serviceProvider)
|
||||
{
|
||||
_jinkoSapService = jinkoSapService;
|
||||
_syncApi = syncApi;
|
||||
}
|
||||
|
||||
protected override async Task RunAsync(IServiceProvider serviceProvider)
|
||||
{
|
||||
var positionResult = await _jinkoSapService.GetPositionsAsync();
|
||||
var positionResult = await _syncApi.GetPositionsAsync();
|
||||
|
||||
if (positionResult.Position != null && positionResult.Position.Items.Count > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user