fix .
This commit is contained in:
@@ -1,9 +1,18 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dlhis.ScheduledTask.Common.Request;
|
namespace Dlhis.ScheduledTask.Common.Request
|
||||||
|
|
||||||
public class UploadAttendanceRequest
|
|
||||||
{
|
{
|
||||||
|
public class UploadAttendanceRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 考勤数据包
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("T_DATA")]
|
||||||
|
public List<UploadAttendanceRequestItem> Data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UploadAttendanceRequestItem
|
||||||
|
{
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
@@ -29,4 +38,5 @@ public class UploadAttendanceRequest
|
|||||||
/// 设备位置
|
/// 设备位置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ZNOTE { get; set; }
|
public string ZNOTE { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -37,4 +37,7 @@ public interface IJinkoJipService : ISingletonDependency
|
|||||||
/// <param name="base64"></param>
|
/// <param name="base64"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<SapFaceSyncResponse> SyncFaceToSapAsync(string userCode, string base64);
|
Task<SapFaceSyncResponse> SyncFaceToSapAsync(string userCode, string base64);
|
||||||
|
|
||||||
|
|
||||||
|
Task<UploadAttendanceResponse> UploadAttendancesAsync(UploadAttendanceRequest request);
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Dlhis.Jip.Api.Requests;
|
|
||||||
using Dlhis.ScheduledTask.Common.Request;
|
using Dlhis.ScheduledTask.Common.Request;
|
||||||
using Dlhis.ScheduledTask.Common.Response;
|
using Dlhis.ScheduledTask.Common.Response;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
@@ -33,16 +32,11 @@ public class JinkoJipService : IJinkoJipService
|
|||||||
return httpClient;
|
return httpClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<UploadAttendanceResponse> UploadAttendancesAsync(List<UploadAttendanceRequest> requests)
|
public async Task<UploadAttendanceResponse> UploadAttendancesAsync(UploadAttendanceRequest request)
|
||||||
{
|
{
|
||||||
var requestUrl = "/JIP/HCM/HCM_SWIPE_DATA_SAVE";
|
var requestUrl = "/JIP/HCM/HCM_SWIPE_DATA_SAVE";
|
||||||
|
|
||||||
var body = new
|
var json = request.ToJson();
|
||||||
{
|
|
||||||
T_DATA = requests,
|
|
||||||
};
|
|
||||||
|
|
||||||
var json = body.ToJson();
|
|
||||||
|
|
||||||
//_logger.LogInformation("上传考勤记录请求:{json}", json);
|
//_logger.LogInformation("上传考勤记录请求:{json}", json);
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Dlhis.Basic.Api\Dlhis.Basic.Api.csproj" />
|
<ProjectReference Include="..\Dlhis.Basic.Api\Dlhis.Basic.Api.csproj" />
|
||||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||||
<ProjectReference Include="..\Dlhis.Jip.Api\Dlhis.Jip.Api.csproj" />
|
|
||||||
<ProjectReference Include="..\Dlhis.Sys.Api\Dlhis.Sys.Api.csproj" />
|
<ProjectReference Include="..\Dlhis.Sys.Api\Dlhis.Sys.Api.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Device.Entities;
|
using Dlhis.Entity.Device.Entities;
|
||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Dlhis.Jip.Api;
|
|
||||||
using Dlhis.Jip.Api.Requests;
|
|
||||||
using Dlhis.ScheduledTask.Attributes;
|
using Dlhis.ScheduledTask.Attributes;
|
||||||
|
using Dlhis.ScheduledTask.Common.Request;
|
||||||
|
using Dlhis.ScheduledTask.Common.Services;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.ScheduledTask.Jobs;
|
namespace Dlhis.ScheduledTask.Jobs;
|
||||||
@@ -14,11 +14,11 @@ namespace Dlhis.ScheduledTask.Jobs;
|
|||||||
[RecurringJob(nameof(SyncOriginCardInfoJob), "0 0/1 * * * ?", Name = "上传考勤记录")]
|
[RecurringJob(nameof(SyncOriginCardInfoJob), "0 0/1 * * * ?", Name = "上传考勤记录")]
|
||||||
public class SyncOriginCardInfoJob : BaseJob
|
public class SyncOriginCardInfoJob : BaseJob
|
||||||
{
|
{
|
||||||
private readonly IJinkoJipApi _jinkoJipApi;
|
private readonly IJinkoJipService _jinkoJipService;
|
||||||
|
|
||||||
public SyncOriginCardInfoJob(IJinkoJipApi jinkoJipApi, IServiceProvider serviceProvider) : base(serviceProvider)
|
public SyncOriginCardInfoJob(IJinkoJipService jinkoJipService, IServiceProvider serviceProvider) : base(serviceProvider)
|
||||||
{
|
{
|
||||||
_jinkoJipApi = jinkoJipApi;
|
_jinkoJipService = jinkoJipService;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task RunAsync(IServiceProvider serviceProvider)
|
protected override async Task RunAsync(IServiceProvider serviceProvider)
|
||||||
@@ -52,7 +52,7 @@ public class SyncOriginCardInfoJob : BaseJob
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var ids = items.Select(x => x.Id).ToList();
|
var ids = items.Select(x => x.Id).ToList();
|
||||||
var r = await _jinkoJipApi.UploadAttendancesAsync(new UploadAttendanceRequest { Data = items.ToList() });
|
var r = await _jinkoJipService.UploadAttendancesAsync(new UploadAttendanceRequest { Data = items.ToList() });
|
||||||
if (r.OLX == "0")
|
if (r.OLX == "0")
|
||||||
{
|
{
|
||||||
await DbContext.Updateable<DeviceUploadLogEntity>()
|
await DbContext.Updateable<DeviceUploadLogEntity>()
|
||||||
|
|||||||
Reference in New Issue
Block a user