fix 日期范围
This commit is contained in:
@@ -40,7 +40,7 @@ public class SapBusinessTripService : ISapBusinessTripService
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var tripResponse = await _jinkoJipApi.GetBusinessTripInfosByFactoryAsync(factory, today, today);
|
var tripResponse = await _jinkoJipApi.GetBusinessTripInfosByFactoryAsync(factory, yesterday, today);
|
||||||
if (!tripResponse.Items.Any())
|
if (!tripResponse.Items.Any())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -24,7 +24,14 @@ public class SyncBusinessTripJob : BaseJob
|
|||||||
|
|
||||||
foreach (var factory in factories)
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,4 +22,20 @@ public class Startup : DefaultStartup
|
|||||||
base.ConfigureServices(services);
|
base.ConfigureServices(services);
|
||||||
services.AddRedis();
|
services.AddRedis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
base.Configure(app, env);
|
||||||
|
|
||||||
|
var a = app.ApplicationServices.GetService<IJinkoJipApi>().SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>()
|
||||||
|
{
|
||||||
|
new SyncMealSupplementRecordRequest
|
||||||
|
{
|
||||||
|
UniqueId = null,
|
||||||
|
Status = null,
|
||||||
|
Msg = null
|
||||||
|
}
|
||||||
|
}).GetAwaiter().GetResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Basic.Api;
|
using Dlhis.Basic.Api;
|
||||||
|
using Dlhis.Jip.Api;
|
||||||
using Dlhis.Jip.Api.Request;
|
using Dlhis.Jip.Api.Request;
|
||||||
using Hangfire;
|
using Hangfire;
|
||||||
using Kurisu.AspNetCore.Utils;
|
using Kurisu.AspNetCore.Utils;
|
||||||
@@ -16,10 +17,12 @@ namespace Dlhis.ScheduledTask.TaskAssignment.Controllers;
|
|||||||
public class HangfireController : ControllerBase
|
public class HangfireController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RedisCache _redisCache;
|
private readonly RedisCache _redisCache;
|
||||||
|
private readonly IJinkoJipApi _jinkoJipApi;
|
||||||
|
|
||||||
public HangfireController( RedisCache redisCache)
|
public HangfireController(RedisCache redisCache, IJinkoJipApi jinkoJipApi)
|
||||||
{
|
{
|
||||||
_redisCache = redisCache;
|
_redisCache = redisCache;
|
||||||
|
_jinkoJipApi = jinkoJipApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -53,4 +56,16 @@ public class HangfireController : ControllerBase
|
|||||||
BackgroundJob.Enqueue<ISyncApi>(x => x.SyncGainfoByWerkAsync(request.Code));
|
BackgroundJob.Enqueue<ISyncApi>(x => x.SyncGainfoByWerkAsync(request.Code));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost("test")]
|
||||||
|
public async Task<object> TestAsync()
|
||||||
|
{
|
||||||
|
return await _jinkoJipApi.SyncMealSupplementRecordsAsync(new List<SyncMealSupplementRecordRequest>()
|
||||||
|
{
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
UniqueId = "Dl-Test01", Msg = "成功", Status = "SUCCESS"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -36,11 +36,18 @@
|
|||||||
"ClientSecret": "123456"
|
"ClientSecret": "123456"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// "JinkoOptions": {
|
||||||
|
// "Jip": {
|
||||||
|
// "BaseUrl": "http://172.16.202.34:8000",
|
||||||
|
// "Key": "FACE-7409WIBX",
|
||||||
|
// "Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
|
||||||
|
// }
|
||||||
|
// },
|
||||||
"JinkoOptions": {
|
"JinkoOptions": {
|
||||||
"Jip": {
|
"Jip": {
|
||||||
"BaseUrl": "http://172.16.202.34:8000",
|
"BaseUrl": "http://jip.jinkosolar.com",
|
||||||
"Key": "FACE-7409WIBX",
|
"Key": "FACE-CUOJG9N7",
|
||||||
"Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
|
"Secret": "130c2f2d-03a0-4720-8e25-538ffac7a7cb"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user