fix 临时调整代码

This commit is contained in:
2024-11-25 11:58:03 +08:00
parent bbaf7aa3be
commit f49404f938
13 changed files with 81 additions and 102 deletions

View File

@@ -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 IJinkoJipService _jinkoJIPService;
private readonly IJinkoJipApi _jinkoJipApi;
public SyncOriginCardInfoJob(IJinkoJipService jinkoJIPService, IServiceProvider serviceProvider) : base(serviceProvider)
public SyncOriginCardInfoJob(IJinkoJipApi jinkoJipApi, IServiceProvider serviceProvider) : base(serviceProvider)
{
_jinkoJIPService = jinkoJIPService;
_jinkoJipApi = jinkoJipApi;
}
protected override async Task RunAsync(IServiceProvider serviceProvider)
@@ -34,7 +34,7 @@ public class SyncOriginCardInfoJob : BaseJob
.Where(x => SqlFunc.Subqueryable<DeviceEntity>()
.Where(p => p.UniqueNo == x.DeviceUniqueNo)
.Where(p => p.Type == DeviceTypeEnumType.Attendance || (p.Type == DeviceTypeEnumType.Door && p.AsAttendance)).Any())
.Select((x, device) => new UploadAttendanceRequest
.Select((x, device) => new UploadAttendanceRequestItem
{
Id = x.Id,
RaiseDateTime = x.RaiseDateTime,
@@ -52,7 +52,7 @@ public class SyncOriginCardInfoJob : BaseJob
try
{
var ids = items.Select(x => x.Id).ToList();
var r = await _jinkoJIPService.UploadAttendancesAsync(items.ToList());
var r = await _jinkoJipApi.UploadAttendancesAsync(new UploadAttendanceRequest { Data = items.ToList() });
if (r.OLX == "0")
{
await DbContext.Updateable<DeviceUploadLogEntity>()