diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs
index 79381e05..77e259c4 100644
--- a/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs
+++ b/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs
@@ -40,7 +40,7 @@ public class SapBusinessTripService : ISapBusinessTripService
try
{
- var tripResponse = await _jinkoJipApi.GetBusinessTripInfosByFactoryAsync(factory, today, today);
+ var tripResponse = await _jinkoJipApi.GetBusinessTripInfosByFactoryAsync(factory, yesterday, today);
if (!tripResponse.Items.Any())
{
return;
diff --git a/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs b/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs
index 5f0d179e..e8fbad0f 100644
--- a/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs
+++ b/Src/Dlhis.ScheduledTask/Jobs/SyncBusinessTripJob.cs
@@ -24,7 +24,14 @@ public class SyncBusinessTripJob : BaseJob
foreach (var factory in factories)
{
- await _syncApi.HandlerBusinessTripsAsync(factory.Code);
+ try
+ {
+ await _syncApi.HandlerBusinessTripsAsync(factory.Code);
+ }
+ catch (Exception e)
+ {
+ Logger.LogError(e, "同步出差人员异常:{msg}", e.Message);
+ }
}
}
}
\ No newline at end of file
diff --git a/Src/Dlhis.ScheduledTask/Program.cs b/Src/Dlhis.ScheduledTask/Program.cs
index 7c759046..7f86717a 100644
--- a/Src/Dlhis.ScheduledTask/Program.cs
+++ b/Src/Dlhis.ScheduledTask/Program.cs
@@ -22,4 +22,20 @@ public class Startup : DefaultStartup
base.ConfigureServices(services);
services.AddRedis();
}
+
+ ///
+ public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+ {
+ base.Configure(app, env);
+
+ var a = app.ApplicationServices.GetService().SyncMealSupplementRecordsAsync(new List()
+ {
+ new SyncMealSupplementRecordRequest
+ {
+ UniqueId = null,
+ Status = null,
+ Msg = null
+ }
+ }).GetAwaiter().GetResult();
+ }
}
\ No newline at end of file
diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/HangfireController.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/HangfireController.cs
index f92169c4..b9b03f45 100644
--- a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/HangfireController.cs
+++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/HangfireController.cs
@@ -1,4 +1,5 @@
using Dlhis.Basic.Api;
+using Dlhis.Jip.Api;
using Dlhis.Jip.Api.Request;
using Hangfire;
using Kurisu.AspNetCore.Utils;
@@ -16,10 +17,12 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Controllers;
public class HangfireController : ControllerBase
{
private readonly RedisCache _redisCache;
+ private readonly IJinkoJipApi _jinkoJipApi;
- public HangfireController( RedisCache redisCache)
+ public HangfireController(RedisCache redisCache, IJinkoJipApi jinkoJipApi)
{
_redisCache = redisCache;
+ _jinkoJipApi = jinkoJipApi;
}
///
@@ -53,4 +56,16 @@ public class HangfireController : ControllerBase
BackgroundJob.Enqueue(x => x.SyncGainfoByWerkAsync(request.Code));
}
}
+
+ [HttpPost("test")]
+ public async Task