feat 获取设备上传的时间
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
||||
using Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
||||
using Dlhis.ScheduledTask.DeviceUploadLog.Services;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Org.BouncyCastle.Asn1.Crmf;
|
||||
|
||||
namespace Dlhis.ScheduledTask.DeviceUploadLog.Controllers;
|
||||
|
||||
@@ -67,4 +67,15 @@ public class DeviceUploadLogsController : ControllerBase
|
||||
{
|
||||
await _deviceUploadLogService.QiaoqiaoGaoshiqingAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备记录读取的配置
|
||||
/// </summary>
|
||||
/// <param name="deviceNo"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("setting")]
|
||||
public async Task<DateTimePeriod> GetDeviceUploadRecordSettingAsync(string deviceNo)
|
||||
{
|
||||
return await _deviceUploadLogService.GetDeviceUploadRecordSettingAsync(deviceNo);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
||||
using Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.ScheduledTask.DeviceUploadLog.Services;
|
||||
@@ -13,4 +14,12 @@ public interface IDeviceUploadLogService : IScopeDependency
|
||||
Task<List<DeviceUploadLogResponse>> GetMyRecordsAsync(DeviceUploadLogMyRecordRequest request);
|
||||
|
||||
Task QiaoqiaoGaoshiqingAsync(DeviceUploadLogSecretAddRequest request);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备记录获取的开始-结束时间
|
||||
/// </summary>
|
||||
/// <param name="deviceNo"></param>
|
||||
/// <returns></returns>
|
||||
Task<DateTimePeriod> GetDeviceUploadRecordSettingAsync(string deviceNo);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,20 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<DateTimePeriod> GetDeviceUploadRecordSettingAsync(string deviceNo)
|
||||
{
|
||||
var start = await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||
.Where(x => x.DeviceUniqueNo == deviceNo)
|
||||
.Select(x => SqlFunc.AggregateMax(x.RaiseDateTime))
|
||||
.SingleAsync();
|
||||
|
||||
return new DateTimePeriod
|
||||
{
|
||||
Start = start,
|
||||
End = DateTime.Now.AddDays(1)
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<Pagination<DeviceUploadLogResponse>> GetPageAsync(DeviceUploadLogPageRequest request)
|
||||
{
|
||||
DeviceUploadLogTypeEnumType? type = request.Type switch
|
||||
|
||||
@@ -12,11 +12,10 @@ public interface IAssignmentService : IScopeDependency
|
||||
/// <returns></returns>
|
||||
Task<List<DeviceTaskToDeviceByDeviceResponse>> DeviceGetTasksAsync(DeviceTaskGetRequest request);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新设备任务状态
|
||||
/// </summary>
|
||||
/// <param name="requests"></param>
|
||||
/// <returns></returns>
|
||||
Task UpdateDeviceTaskStatusAsync(List<UpdateDeviceTaskStatusRequest> requests);
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,6 @@ public class AssignmentService : IAssignmentService
|
||||
.Where((deviceTask, device, deviceTemplate, ga, gaLeave, department, deviceRegistry) =>
|
||||
device.HeartbeatInterval == 0 || SqlFunc.DateAdd(deviceRegistry.LastHeartbeatTime, device.HeartbeatInterval, DateType.Second) > DateTime.Now)
|
||||
#if !DEBUG
|
||||
|
||||
#endif
|
||||
.OrderBy(deviceTask => new { Priority = SqlFunc.Desc(deviceTask.Priority), deviceTask.CreateTime })
|
||||
.Select((deviceTask, device, deviceTemplate, ga, gaLeave, department) => new TaskDto
|
||||
@@ -353,6 +352,9 @@ public class AssignmentService : IAssignmentService
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 处理老档案数据
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user