fix 增加isError显示
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using Dlhis.ScheduledTask.DeviceUploadLog.Services.Implements;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
||||
|
||||
@@ -75,9 +77,33 @@ public class DeviceUploadLogResponse
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
public bool Status { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否是异常记录
|
||||
/// </summary>
|
||||
public bool IsError
|
||||
{
|
||||
get
|
||||
{
|
||||
if (WorkGridInfo.IsEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var obj = WorkGridInfo.ToObject<WorkGridInfo2>();
|
||||
return obj.IsError;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string WorkGridInfo { get; set; }
|
||||
}
|
||||
public class WorkGridInfo2
|
||||
{
|
||||
public bool IsError { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class DeviceUploadLogUserResponse
|
||||
{
|
||||
@@ -142,4 +168,24 @@ public class DeviceUploadLogUserResponse
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
public bool Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是异常记录
|
||||
/// </summary>
|
||||
public bool IsError
|
||||
{
|
||||
get
|
||||
{
|
||||
if (WorkGridInfo.IsEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var obj = WorkGridInfo.ToObject<WorkGridInfo2>();
|
||||
return obj.IsError;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string WorkGridInfo { get; set; }
|
||||
}
|
||||
@@ -194,8 +194,6 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
{
|
||||
workGridInfo.PeriodType = WorkGridTimePeriodEnumType.Night;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (currentNightWorkGridSchedules.Any(x => x.Date == currentDateOnly.AddDays(-1)))
|
||||
@@ -408,6 +406,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
NeedUpload = x.NeedUpload,
|
||||
Sync = x.Sync,
|
||||
Status = x.Status,
|
||||
WorkGridInfo = x.WorkGridInfo
|
||||
}).ToPageListAsync(request.PageIndex, request.PageSize);
|
||||
|
||||
return new Pagination<DeviceUploadLogUserResponse>
|
||||
@@ -473,6 +472,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
NeedUpload = x.NeedUpload,
|
||||
Sync = x.Sync,
|
||||
Status = x.Status,
|
||||
WorkGridInfo = x.WorkGridInfo
|
||||
}).ToPageListAsync(request.PageIndex, request.PageSize);
|
||||
|
||||
return new Pagination<DeviceUploadLogResponse>
|
||||
|
||||
Reference in New Issue
Block a user