fix model转换
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Device.Models;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -103,12 +103,4 @@ public class WorkGridScheduleAttendancePageResponse
|
||||
return "/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class WorkGridInfo
|
||||
{
|
||||
public bool IsError { get; set; }
|
||||
public object WorkGrid { get; set; }
|
||||
public WorkGridTimePeriodEnumType? PeriodType { get; set; }
|
||||
public object TimeSetting { get; set; }
|
||||
}
|
||||
@@ -313,7 +313,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
)
|
||||
.Where(log => log.WorkGridInfo.StartsWith(filterString))
|
||||
.Where((log, d) => d.Type == DeviceTypeEnumType.Attendance || (d.Type == DeviceTypeEnumType.Door && d.AsAttendance))
|
||||
.OrderBy(log => log.RaiseDateTime)
|
||||
.OrderBy(log => log.RaiseDateTime, OrderByType.Desc)
|
||||
.Select((log, d, ga) => new WorkGridScheduleAttendancePageResponse
|
||||
{
|
||||
Id = log.Id,
|
||||
|
||||
18
Src/Dlhis.Entity/Device/Models/WorkGridInfo.cs
Normal file
18
Src/Dlhis.Entity/Device/Models/WorkGridInfo.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
|
||||
namespace Dlhis.Entity.Device.Models;
|
||||
|
||||
public class WorkGridInfo
|
||||
{
|
||||
public bool IsError { get; set; }
|
||||
public WorkGridInfoDetail WorkGrid { get; set; }
|
||||
public WorkGridTimePeriodEnumType? PeriodType { get; set; }
|
||||
public object TimeSetting { get; set; }
|
||||
}
|
||||
|
||||
public class WorkGridInfoDetail
|
||||
{
|
||||
public Guid WorkGridCode { get; set; }
|
||||
public string WorkGridName { get; set; }
|
||||
public string LeaderUserCode { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Dlhis.Entity.Device.Models;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
||||
@@ -90,7 +91,7 @@ public class DeviceUploadLogResponse
|
||||
return false;
|
||||
}
|
||||
|
||||
var obj = WorkGridInfo.ToObject<WorkGridInfo2>();
|
||||
var obj = WorkGridInfo.ToObject<WorkGridInfo>();
|
||||
return obj.IsError;
|
||||
}
|
||||
}
|
||||
@@ -120,11 +121,6 @@ public class DeviceUploadLogResponse
|
||||
}
|
||||
}
|
||||
|
||||
public class WorkGridInfo2
|
||||
{
|
||||
public bool IsError { get; set; }
|
||||
}
|
||||
|
||||
public class DeviceUploadLogUserResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
@@ -201,14 +197,40 @@ public class DeviceUploadLogUserResponse
|
||||
return false;
|
||||
}
|
||||
|
||||
var obj = WorkGridInfo.ToObject<WorkGridInfo2>();
|
||||
return obj.IsError;
|
||||
return WorkGridInfoObj.IsError;
|
||||
}
|
||||
}
|
||||
|
||||
public string WorkGridName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (WorkGridInfoObj != null)
|
||||
{
|
||||
return WorkGridInfoObj?.WorkGrid?.WorkGridName;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string WorkGridInfo { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public WorkGridInfo WorkGridInfoObj
|
||||
{
|
||||
get
|
||||
{
|
||||
if (WorkGridInfo.IsPresent())
|
||||
{
|
||||
return WorkGridInfo.ToObject<WorkGridInfo>();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 状态描述
|
||||
/// </summary>
|
||||
|
||||
@@ -5,6 +5,7 @@ using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.Entity.Device.Models;
|
||||
using Dlhis.Jip.Api;
|
||||
using Dlhis.Jip.Api.Requests;
|
||||
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
||||
@@ -219,7 +220,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
|
||||
|
||||
needUpload = workGridInfo.PeriodType.HasValue;
|
||||
|
||||
workGridInfo.IsError = workGridInfo.TimeSetting != null && workGridInfo.PeriodType.HasValue == false;
|
||||
if (!needUpload)
|
||||
{
|
||||
try
|
||||
@@ -489,19 +490,4 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
Data = r
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class WorkGridInfo
|
||||
{
|
||||
public bool IsError => TimeSetting != null && PeriodType.HasValue == false;
|
||||
public WorkGridInfoDetail WorkGrid { get; set; }
|
||||
public WorkGridTimePeriodEnumType? PeriodType { get; set; }
|
||||
public object TimeSetting { get; set; }
|
||||
}
|
||||
|
||||
public class WorkGridInfoDetail
|
||||
{
|
||||
public Guid WorkGridCode { get; set; }
|
||||
public string WorkGridName { get; set; }
|
||||
public string LeaderUserCode { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user