fix model转换
This commit is contained in:
@@ -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