refactor 优化代码

This commit is contained in:
2024-11-26 15:26:12 +08:00
parent a32910f0d9
commit 623a5c4e49
88 changed files with 1820 additions and 941 deletions

View File

@@ -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)
{