diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Comparers/SapPersonComparer.cs b/Src/Dlhis.ScheduledTask/Common/Comparers/SapPersonComparer.cs similarity index 96% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Comparers/SapPersonComparer.cs rename to Src/Dlhis.ScheduledTask/Common/Comparers/SapPersonComparer.cs index 65bdb11b..4e7ef728 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Comparers/SapPersonComparer.cs +++ b/Src/Dlhis.ScheduledTask/Common/Comparers/SapPersonComparer.cs @@ -1,7 +1,8 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Dto; +using Dlhis.ScheduledTask.Common; +using Dlhis.ScheduledTask.Common.Dto; using System.Text; -namespace Dlhis.ScheduledTask.SyncSapInfo.Comparers; +namespace Dlhis.ScheduledTask.Common.Comparers; /// /// 人员信息比较器 diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapOrganization.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapOrganization.cs similarity index 84% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapOrganization.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapOrganization.cs index 2d10427b..53d91790 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapOrganization.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapOrganization.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto; +namespace Dlhis.ScheduledTask.Common.Dto; /// /// sap机构信息 diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapOrganizationItem.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapOrganizationItem.cs similarity index 96% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapOrganizationItem.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapOrganizationItem.cs index f1b239c5..531504c2 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapOrganizationItem.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapOrganizationItem.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto; +namespace Dlhis.ScheduledTask.Common.Dto; public class SapOrganizationItem { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPerson.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapPerson.cs similarity index 72% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPerson.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapPerson.cs index a018be58..90949296 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPerson.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapPerson.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto; +namespace Dlhis.ScheduledTask.Common.Dto; public class SapPerson { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonDepartmentStatus.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonDepartmentStatus.cs similarity index 87% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonDepartmentStatus.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapPersonDepartmentStatus.cs index 7711c882..a4623016 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonDepartmentStatus.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonDepartmentStatus.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto +namespace Dlhis.ScheduledTask.Common.Dto { public class SapPersonDepartmentStatus { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonItem.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonItem.cs similarity index 98% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonItem.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapPersonItem.cs index 998370f8..075b32df 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonItem.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonItem.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto; +namespace Dlhis.ScheduledTask.Common.Dto; public class SapPersonItem { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonJobStatus.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonJobStatus.cs similarity index 85% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonJobStatus.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapPersonJobStatus.cs index 13e14f6c..8f124a22 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPersonJobStatus.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonJobStatus.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto +namespace Dlhis.ScheduledTask.Common.Dto { public class SapPersonJobStatus { diff --git a/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonNoRequest.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonNoRequest.cs new file mode 100644 index 00000000..1628cac6 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapPersonNoRequest.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; + +namespace Dlhis.ScheduledTask.Common.Dto; + +public class SapPersonNoRequest +{ + + [Required] + public string Code { get; set; } +} diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPosition.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapPosition.cs similarity index 74% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPosition.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapPosition.cs index d8dbc0fe..25b47e00 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPosition.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapPosition.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto; +namespace Dlhis.ScheduledTask.Common.Dto; public class SapPosition { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPositionItem.cs b/Src/Dlhis.ScheduledTask/Common/Dto/SapPositionItem.cs similarity index 94% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPositionItem.cs rename to Src/Dlhis.ScheduledTask/Common/Dto/SapPositionItem.cs index 7cb0d9ef..3feaa89e 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Dto/SapPositionItem.cs +++ b/Src/Dlhis.ScheduledTask/Common/Dto/SapPositionItem.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo.Dto +namespace Dlhis.ScheduledTask.Common.Dto { public class SapPositionItem { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/GetHashCodeExtensions.cs b/Src/Dlhis.ScheduledTask/Common/GetHashCodeExtensions.cs similarity index 85% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/GetHashCodeExtensions.cs rename to Src/Dlhis.ScheduledTask/Common/GetHashCodeExtensions.cs index c0ffb779..61f0bd7f 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/GetHashCodeExtensions.cs +++ b/Src/Dlhis.ScheduledTask/Common/GetHashCodeExtensions.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo; +namespace Dlhis.ScheduledTask.Common; internal static class GetHashCodeExtensions { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/SyncMealSupplementRecordRequest.cs b/Src/Dlhis.ScheduledTask/Common/Request/SyncMealSupplementRecordRequest.cs similarity index 85% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/SyncMealSupplementRecordRequest.cs rename to Src/Dlhis.ScheduledTask/Common/Request/SyncMealSupplementRecordRequest.cs index 68fa53df..ea343082 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/SyncMealSupplementRecordRequest.cs +++ b/Src/Dlhis.ScheduledTask/Common/Request/SyncMealSupplementRecordRequest.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo; +namespace Dlhis.ScheduledTask.Common.Request; public class SyncMealSupplementRecordRequest { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/UploadAttendanceRequest.cs b/Src/Dlhis.ScheduledTask/Common/Request/UploadAttendanceRequest.cs similarity index 94% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/UploadAttendanceRequest.cs rename to Src/Dlhis.ScheduledTask/Common/Request/UploadAttendanceRequest.cs index 05f9833c..3ec862f6 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/UploadAttendanceRequest.cs +++ b/Src/Dlhis.ScheduledTask/Common/Request/UploadAttendanceRequest.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo +namespace Dlhis.ScheduledTask.Common.Request { public class UploadAttendanceRequest { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapOrganizationResponse.cs b/Src/Dlhis.ScheduledTask/Common/Response/SapOrganizationResponse.cs similarity index 58% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapOrganizationResponse.cs rename to Src/Dlhis.ScheduledTask/Common/Response/SapOrganizationResponse.cs index 9e52dd08..03fd9abb 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapOrganizationResponse.cs +++ b/Src/Dlhis.ScheduledTask/Common/Response/SapOrganizationResponse.cs @@ -1,7 +1,7 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Dto; +using Dlhis.ScheduledTask.Common.Dto; using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo.Response; +namespace Dlhis.ScheduledTask.Common.Response; public class SapOrganizationResponse { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapPersonResponse.cs b/Src/Dlhis.ScheduledTask/Common/Response/SapPersonResponse.cs similarity index 84% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapPersonResponse.cs rename to Src/Dlhis.ScheduledTask/Common/Response/SapPersonResponse.cs index 956edf4e..3d9b14c8 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapPersonResponse.cs +++ b/Src/Dlhis.ScheduledTask/Common/Response/SapPersonResponse.cs @@ -1,7 +1,7 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Dto; +using Dlhis.ScheduledTask.Common.Dto; using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo.Response; +namespace Dlhis.ScheduledTask.Common.Response; public class SapPersonResponse { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapPositionResponse.cs b/Src/Dlhis.ScheduledTask/Common/Response/SapPositionResponse.cs similarity index 58% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapPositionResponse.cs rename to Src/Dlhis.ScheduledTask/Common/Response/SapPositionResponse.cs index ed7be3a7..76eb0892 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/SapPositionResponse.cs +++ b/Src/Dlhis.ScheduledTask/Common/Response/SapPositionResponse.cs @@ -1,7 +1,7 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Dto; +using Dlhis.ScheduledTask.Common.Dto; using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo.Response; +namespace Dlhis.ScheduledTask.Common.Response; public class SapPositionResponse { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/UploadAttendanceResponse.cs b/Src/Dlhis.ScheduledTask/Common/Response/UploadAttendanceResponse.cs similarity index 79% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Response/UploadAttendanceResponse.cs rename to Src/Dlhis.ScheduledTask/Common/Response/UploadAttendanceResponse.cs index 4115ca77..1236693a 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Response/UploadAttendanceResponse.cs +++ b/Src/Dlhis.ScheduledTask/Common/Response/UploadAttendanceResponse.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo.Response +namespace Dlhis.ScheduledTask.Common.Response { public class UploadAttendanceResponse { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IGainfoUpdateService.cs b/Src/Dlhis.ScheduledTask/Common/Services/IGainfoUpdateService.cs similarity index 63% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IGainfoUpdateService.cs rename to Src/Dlhis.ScheduledTask/Common/Services/IGainfoUpdateService.cs index 68979970..07b38d92 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IGainfoUpdateService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/IGainfoUpdateService.cs @@ -1,4 +1,4 @@ -namespace Dlhis.ScheduledTask.SyncSapInfo.Services; +namespace Dlhis.ScheduledTask.Common.Services; public interface IGainfoUpdateService : IScopeDependency { diff --git a/Src/Dlhis.ScheduledTask/Common/Services/IHangfireService.cs b/Src/Dlhis.ScheduledTask/Common/Services/IHangfireService.cs new file mode 100644 index 00000000..f2b92964 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Common/Services/IHangfireService.cs @@ -0,0 +1,16 @@ +using Dlhis.ScheduledTask.Common.Dto; + +namespace Dlhis.ScheduledTask.Common.Services; + +/// +/// hangfire调度服务 +/// +public interface IHangfireService : ISingletonDependency +{ + /// + /// 创建sap人员同步后台任务 + /// + /// + /// + Task CreateSapPersonSyncBackgroundJobAsync(SapPersonNoRequest request); +} diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IJinkoJIPService.cs b/Src/Dlhis.ScheduledTask/Common/Services/IJinkoJIPService.cs similarity index 68% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IJinkoJIPService.cs rename to Src/Dlhis.ScheduledTask/Common/Services/IJinkoJIPService.cs index fad41965..b80442e0 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IJinkoJIPService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/IJinkoJIPService.cs @@ -1,6 +1,7 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Response; +using Dlhis.ScheduledTask.Common.Request; +using Dlhis.ScheduledTask.Common.Response; -namespace Dlhis.ScheduledTask.SyncSapInfo.Services; +namespace Dlhis.ScheduledTask.Common.Services; public interface IJinkoJIPService : ISingletonDependency { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IJinkoSapService.cs b/Src/Dlhis.ScheduledTask/Common/Services/IJinkoSapService.cs similarity index 73% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IJinkoSapService.cs rename to Src/Dlhis.ScheduledTask/Common/Services/IJinkoSapService.cs index d706df18..736def0e 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/IJinkoSapService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/IJinkoSapService.cs @@ -1,6 +1,6 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Response; +using Dlhis.ScheduledTask.Common.Response; -namespace Dlhis.ScheduledTask.SyncSapInfo.Services; +namespace Dlhis.ScheduledTask.Common.Services; public interface IJinkoSapService : IScopeDependency { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/GainfoUpdateService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs similarity index 98% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/GainfoUpdateService.cs rename to Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs index 0f445c2a..83fa60a5 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/GainfoUpdateService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/GainfoUpdateService.cs @@ -2,15 +2,15 @@ using Dlhis.Basic.Api; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Basic.Enums; -using Dlhis.ScheduledTask.SyncSapInfo.Comparers; -using Dlhis.ScheduledTask.SyncSapInfo.Dto; using System.Text; using Dlhis.Sys.Api; using Kurisu.SqlSugar.Services; using SqlSugar; using Dlhis.Sys.Api.Response; +using Dlhis.ScheduledTask.Common.Dto; +using Dlhis.ScheduledTask.Common.Comparers; -namespace Dlhis.ScheduledTask.SyncSapInfo.Services.Implements; +namespace Dlhis.ScheduledTask.Common.Services.Implements; public class GainfoUpdateService : IGainfoUpdateService { @@ -368,7 +368,7 @@ public class GainfoUpdateService : IGainfoUpdateService remark = rmk, native = native, sex = sex, - //web = SubString(position?.Name ?? "", 30), + web = person.PLANS, logdate = DateTime.Now, isowner = int.Parse(person.ZSTATUS) < 5 ? "T" : "F", @class = "C", diff --git a/Src/Dlhis.ScheduledTask/Common/Services/Implements/HangfireService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/HangfireService.cs new file mode 100644 index 00000000..7664a55b --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/HangfireService.cs @@ -0,0 +1,26 @@ +using Dlhis.ScheduledTask.Common.Dto; +using Hangfire; +using Kurisu.AspNetCore.Utils; + +namespace Dlhis.ScheduledTask.Common.Services.Implements; + +public class HangfireService : IHangfireService +{ + private readonly RedisCache _redisCache; + + public HangfireService(RedisCache redisCache) + { + _redisCache = redisCache; + } + + public async Task CreateSapPersonSyncBackgroundJobAsync(SapPersonNoRequest request) + { + var jobKey = $"hangfire:background:{request.Code}"; + + using var handler = await _redisCache.LockAsync(jobKey); + if (handler.Acquired) + { + BackgroundJob.Enqueue(x => x.TodoAsync(request.Code)); + } + } +} diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoJIPService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoJIPService.cs similarity index 95% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoJIPService.cs rename to Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoJIPService.cs index 11c529fb..96beb9d4 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoJIPService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoJIPService.cs @@ -2,12 +2,14 @@ using System.Net.Http.Headers; using System.Security.Claims; using System.Text; -using Dlhis.ScheduledTask.SyncSapInfo.Response; +using Dlhis.ScheduledTask.Common.Request; +using Dlhis.ScheduledTask.Common.Response; +using Dlhis.ScheduledTask.Common.Services; using Kurisu.AspNetCore.Utils.Extensions; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json.Linq; -namespace Dlhis.ScheduledTask.SyncSapInfo.Services.Implements; +namespace Dlhis.ScheduledTask.Common.Services.Implements; public class JinkoJIPService : IJinkoJIPService { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoSapService.cs b/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoSapService.cs similarity index 97% rename from Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoSapService.cs rename to Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoSapService.cs index 2dc4dd01..512bee47 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Services/Implements/JinkoSapService.cs +++ b/Src/Dlhis.ScheduledTask/Common/Services/Implements/JinkoSapService.cs @@ -1,13 +1,13 @@ using System.Net.Http.Headers; using System.Text; using Dlhis.Entity.Basic.Entity; -using Dlhis.ScheduledTask.SyncSapInfo.Dto; -using Dlhis.ScheduledTask.SyncSapInfo.Response; +using Dlhis.ScheduledTask.Common.Dto; +using Dlhis.ScheduledTask.Common.Response; using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.SqlSugar.Services; using Newtonsoft.Json; -namespace Dlhis.ScheduledTask.SyncSapInfo.Services.Implements; +namespace Dlhis.ScheduledTask.Common.Services.Implements; public class JinkoSapService : IJinkoSapService { diff --git a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs index 18228d1e..b65187fa 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs @@ -4,8 +4,8 @@ using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Basic.Enums; using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; -using Dlhis.ScheduledTask.SyncSapInfo; -using Dlhis.ScheduledTask.SyncSapInfo.Services; +using Dlhis.ScheduledTask.Common.Request; +using Dlhis.ScheduledTask.Common.Services; using Kurisu.AspNetCore.Utils; using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.Scheduled; diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncOrganizationJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncOrganizationJob.cs index ab0ce62f..264a904d 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncOrganizationJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncOrganizationJob.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Basic.Entity; -using Dlhis.ScheduledTask.SyncSapInfo.Dto; -using Dlhis.ScheduledTask.SyncSapInfo.Services; +using Dlhis.ScheduledTask.Common.Dto; +using Dlhis.ScheduledTask.Common.Services; using Hangfire; using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs index 13328159..ff41e7cb 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncOriginCardInfoJob.cs @@ -1,8 +1,8 @@ using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; -using Dlhis.ScheduledTask.SyncSapInfo; -using Dlhis.ScheduledTask.SyncSapInfo.Services; +using Dlhis.ScheduledTask.Common.Request; +using Dlhis.ScheduledTask.Common.Services; using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs index 1ebd56e3..5d050e21 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncPersonJob.cs @@ -1,4 +1,4 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Services; +using Dlhis.ScheduledTask.Common.Services; using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncPositionJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncPositionJob.cs index 7a8b61c4..5b40e46f 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/SyncPositionJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/SyncPositionJob.cs @@ -1,6 +1,6 @@ using Dlhis.Entity.Basic.Entity; -using Dlhis.ScheduledTask.SyncSapInfo.Dto; -using Dlhis.ScheduledTask.SyncSapInfo.Services; +using Dlhis.ScheduledTask.Common.Dto; +using Dlhis.ScheduledTask.Common.Services; using Kurisu.Scheduled; using Kurisu.Scheduled.Attributes; diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/GainfoTasksController.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/GainfoTasksController.cs deleted file mode 100644 index 5adfd3d6..00000000 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/GainfoTasksController.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Dlhis.ScheduledTask.SyncSapInfo.Services; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace Dlhis.ScheduledTask.TaskAssignment.Controllers; - -[Authorize(Roles = "admin")] -[Route("api/[controller]")] -[ApiController] -public class GainfoTasksController : ControllerBase -{ - private readonly IGainfoUpdateService _gainfoUpdateService; - - public GainfoTasksController(IGainfoUpdateService gainfoUpdateService) - { - _gainfoUpdateService = gainfoUpdateService; - } - - /// - /// 手动获取人员 - /// - /// - /// - [HttpGet("ManuallySync")] - public async Task ManuallySync(string code) - { - await _gainfoUpdateService.TodoAsync(code); - } -} diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/HangfireController.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/HangfireController.cs new file mode 100644 index 00000000..210d9613 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/HangfireController.cs @@ -0,0 +1,30 @@ +using Dlhis.ScheduledTask.Common.Dto; +using Dlhis.ScheduledTask.Common.Services; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.ScheduledTask.TaskAssignment.Controllers; + +[Authorize(Roles = "admin")] +[Route("api/[controller]")] +[ApiController] +public class HangfireController : ControllerBase +{ + private readonly IHangfireService _hangfireService; + + public HangfireController(IHangfireService hangfireService) + { + _hangfireService = hangfireService; + } + + /// + /// 手动获取人员 + /// + /// + /// + [HttpPost("sap/person/no")] + public async Task ManuallySync(SapPersonNoRequest request) + { + await _hangfireService.CreateSapPersonSyncBackgroundJobAsync(request); + } +}