fix .
This commit is contained in:
@@ -1,32 +1,42 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dlhis.ScheduledTask.Common.Request;
|
||||
|
||||
public class UploadAttendanceRequest
|
||||
namespace Dlhis.ScheduledTask.Common.Request
|
||||
{
|
||||
[JsonIgnore]
|
||||
public long Id { get; set; }
|
||||
public class UploadAttendanceRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 考勤数据包
|
||||
/// </summary>
|
||||
[JsonProperty("T_DATA")]
|
||||
public List<UploadAttendanceRequestItem> Data { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// item.CardNo.TrimEnd('\0')
|
||||
/// </summary>
|
||||
public string ZWORKCODE { get; set; }
|
||||
public class UploadAttendanceRequestItem
|
||||
{
|
||||
[JsonIgnore]
|
||||
public long Id { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public DateTime RaiseDateTime { get; set; }
|
||||
/// <summary>
|
||||
/// item.CardNo.TrimEnd('\0')
|
||||
/// </summary>
|
||||
public string ZWORKCODE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// yyyy-MM-dd
|
||||
/// </summary>
|
||||
public string ZDATE => RaiseDateTime.ToString("yyyy-MM-dd");
|
||||
[JsonIgnore]
|
||||
public DateTime RaiseDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// HH:mm:ss
|
||||
/// </summary>
|
||||
public string ZTIME => RaiseDateTime.ToString("HH:mm:ss");
|
||||
/// <summary>
|
||||
/// yyyy-MM-dd
|
||||
/// </summary>
|
||||
public string ZDATE => RaiseDateTime.ToString("yyyy-MM-dd");
|
||||
|
||||
/// <summary>
|
||||
/// 设备位置
|
||||
/// </summary>
|
||||
public string ZNOTE { get; set; }
|
||||
/// <summary>
|
||||
/// HH:mm:ss
|
||||
/// </summary>
|
||||
public string ZTIME => RaiseDateTime.ToString("HH:mm:ss");
|
||||
|
||||
/// <summary>
|
||||
/// 设备位置
|
||||
/// </summary>
|
||||
public string ZNOTE { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -37,4 +37,7 @@ public interface IJinkoJipService : ISingletonDependency
|
||||
/// <param name="base64"></param>
|
||||
/// <returns></returns>
|
||||
Task<SapFaceSyncResponse> SyncFaceToSapAsync(string userCode, string base64);
|
||||
|
||||
|
||||
Task<UploadAttendanceResponse> UploadAttendancesAsync(UploadAttendanceRequest request);
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Net.Http.Headers;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using Dlhis.Jip.Api.Requests;
|
||||
using Dlhis.ScheduledTask.Common.Request;
|
||||
using Dlhis.ScheduledTask.Common.Response;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
@@ -33,16 +32,11 @@ public class JinkoJipService : IJinkoJipService
|
||||
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 body = new
|
||||
{
|
||||
T_DATA = requests,
|
||||
};
|
||||
|
||||
var json = body.ToJson();
|
||||
var json = request.ToJson();
|
||||
|
||||
//_logger.LogInformation("上传考勤记录请求:{json}", json);
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dlhis.Basic.Api\Dlhis.Basic.Api.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" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.Jip.Api;
|
||||
using Dlhis.Jip.Api.Requests;
|
||||
using Dlhis.ScheduledTask.Attributes;
|
||||
using Dlhis.ScheduledTask.Common.Request;
|
||||
using Dlhis.ScheduledTask.Common.Services;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.ScheduledTask.Jobs;
|
||||
@@ -14,11 +14,11 @@ namespace Dlhis.ScheduledTask.Jobs;
|
||||
[RecurringJob(nameof(SyncOriginCardInfoJob), "0 0/1 * * * ?", Name = "上传考勤记录")]
|
||||
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)
|
||||
@@ -52,7 +52,7 @@ public class SyncOriginCardInfoJob : BaseJob
|
||||
try
|
||||
{
|
||||
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")
|
||||
{
|
||||
await DbContext.Updateable<DeviceUploadLogEntity>()
|
||||
|
||||
Reference in New Issue
Block a user