245 lines
4.6 KiB
C#
245 lines
4.6 KiB
C#
using Dlhis.Entity.Device.Models;
|
|
using Kurisu.AspNetCore.Utils.Extensions;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
|
|
|
public class DeviceUploadLogResponse
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 设备号
|
|
/// </summary>
|
|
public string DeviceUniqueNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 外包供应商
|
|
/// </summary>
|
|
public string OutsourceSupplier { get; set; }
|
|
|
|
public string SapUserCode { get; set; }
|
|
|
|
public string SapUserName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 设备部署点
|
|
/// </summary>
|
|
public string DeployPlace { get; set; }
|
|
|
|
/// <summary>
|
|
/// 用户档案号
|
|
/// </summary>
|
|
public string UserNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 用户学工号
|
|
/// </summary>
|
|
public string UserCode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 用户名称
|
|
/// </summary>
|
|
public string UserName { get; set; }
|
|
|
|
|
|
[JsonIgnore]
|
|
public string UserNameEn { get; set; }
|
|
|
|
/// <summary>
|
|
/// 上传时间
|
|
/// </summary>
|
|
public DateTime RaiseDateTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 记录创建时间
|
|
/// </summary>
|
|
public DateTime CreateTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 序列号
|
|
/// </summary>
|
|
public string SerialNo { get; set; }
|
|
|
|
|
|
[JsonIgnore]
|
|
public string OriginUserUniqueNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否同步sap
|
|
/// </summary>
|
|
public bool Sync { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否需要上传
|
|
/// </summary>
|
|
public bool NeedUpload { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否有效
|
|
/// </summary>
|
|
public bool Status { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 是否是异常记录
|
|
/// </summary>
|
|
public bool IsError
|
|
{
|
|
get
|
|
{
|
|
if (NeedUpload || WorkGridInfo.IsEmpty())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
var obj = WorkGridInfo.ToObject<WorkGridInfo>();
|
|
return obj.IsError;
|
|
}
|
|
}
|
|
|
|
[JsonIgnore]
|
|
public string WorkGridInfo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 状态描述
|
|
/// </summary>
|
|
public string ResultDescription
|
|
{
|
|
get
|
|
{
|
|
if (IsError)
|
|
{
|
|
return Sync ? "已上传" : "/";
|
|
}
|
|
|
|
if (NeedUpload)
|
|
{
|
|
return Sync ? "已上传" : "待上传";
|
|
}
|
|
|
|
return "/";
|
|
}
|
|
}
|
|
}
|
|
|
|
public class DeviceUploadLogUserResponse
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 设备号
|
|
/// </summary>
|
|
public string DeviceUniqueNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 设备部署点
|
|
/// </summary>
|
|
public string DeployPlace { get; set; }
|
|
|
|
/// <summary>
|
|
/// 用户档案号
|
|
/// </summary>
|
|
public string UserNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 用户学工号
|
|
/// </summary>
|
|
public string UserCode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 用户名称
|
|
/// </summary>
|
|
public string UserName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 上传时间
|
|
/// </summary>
|
|
public DateTime RaiseDateTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 记录创建时间
|
|
/// </summary>
|
|
public DateTime CreateTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 序列号
|
|
/// </summary>
|
|
public string SerialNo { get; set; }
|
|
|
|
|
|
[JsonIgnore]
|
|
public string OriginUserUniqueNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否同步sap
|
|
/// </summary>
|
|
public bool Sync { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否需要上传
|
|
/// </summary>
|
|
public bool NeedUpload { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否有效
|
|
/// </summary>
|
|
public bool Status { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否是异常记录
|
|
/// </summary>
|
|
public bool IsError
|
|
{
|
|
get
|
|
{
|
|
if (NeedUpload || WorkGridInfo.IsEmpty())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return WorkGridInfoObj.IsError;
|
|
}
|
|
}
|
|
|
|
[JsonIgnore]
|
|
public string WorkGridInfo { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public WorkGridInfo WorkGridInfoObj
|
|
{
|
|
get
|
|
{
|
|
if (WorkGridInfo.IsPresent())
|
|
{
|
|
return WorkGridInfo.ToObject<WorkGridInfo>();
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 状态描述
|
|
/// </summary>
|
|
public string ResultDescription
|
|
{
|
|
get
|
|
{
|
|
if (IsError)
|
|
{
|
|
return Sync ? "已上传" : "/";
|
|
}
|
|
|
|
if (NeedUpload)
|
|
{
|
|
return Sync ? "已上传" : "待上传";
|
|
}
|
|
|
|
return "/";
|
|
}
|
|
}
|
|
} |