DeviceManager/TsSFCDevice.Client.Biz/His/FieldOpsHistory.cs
2024-11-09 12:25:57 +08:00

104 lines
3.5 KiB
C#

using DeviceRepair.Models.Attr;
using DeviceRepair.Models.Enum;
using Newtonsoft.Json;
using System.Linq;
using TsSFCDevice.Client.Biz.Base.Utils;
namespace TsSFCDevice.Client.Biz.His
{
public class FieldOpsHistory
{
[JsonProperty("Operator", NullValueHandling = NullValueHandling.Ignore)]
public int Operator
{
get;
set;
}
[HistoryFilterField(Code = "FieldCode", CtlType = HistoryFilterCtlType.ComboBox, DefaultValue = "", Description = "主数据字段", ShowSequence = 0, QueryItems = "0:现象区分;1:维修方式;2:故障发生地;3:配件维护")]
[JsonProperty("FieldCode", NullValueHandling = NullValueHandling.Ignore)]
public string FieldCode { get; set; }
[JsonProperty("FieldType", NullValueHandling = NullValueHandling.Ignore)]
public string FieldType
{
get;
set;
}
/// <summary>
/// 名称
/// </summary>
[HistoryFilterField(Code = "FieldText", CtlType = HistoryFilterCtlType.TextBox, DefaultValue = "0", Description = "名称", ShowSequence = 1)]
[HistoryGridField(Description = "名称", ShowSequence = 1)]
[JsonProperty("FieldText", NullValueHandling = NullValueHandling.Ignore)]
public string FieldText { get; set; }
[HistoryGridField(Description = "值类型", ShowSequence = 2)]
[JsonProperty("FieldTypeDisplay", NullValueHandling = NullValueHandling.Ignore)]
public string oFieldTypeDisplay
{
get
{
string vtype = "";
switch ((FieldType?.ToUpper() ?? ""))
{
case "DECIMAL":
vtype = "货币";
break;
case "DOUBLE":
vtype = "数值";
break;
case "NVARCHAR":
vtype = "文本值";
break;
default:
vtype = "N/A";
break;
}
return vtype;
}
}
[HistoryGridField(Description = "字段值", ShowSequence = 3)]
[JsonProperty("FieldValue", NullValueHandling = NullValueHandling.Ignore)]
public string FieldValue { get; set; }
[HistoryGridField(Description = "操作类型", ShowSequence = 4)]
[JsonProperty("OperationType", NullValueHandling = NullValueHandling.Ignore)]
public string OperationType
{
get;
set;
}
[HistoryGridField(Description = "操作人", ShowSequence = 5)]
[JsonProperty("OperatorName", NullValueHandling = NullValueHandling.Ignore)]
public string OperatorName
{
get
{
var us = Utility.SystemRuntimeInfo.CurrentUsersCaches.FirstOrDefault(x => x.Id == Operator);
return (us?.UserCode) ?? "N/A";
}
}
[HistoryGridField(Description = "操作时间", ShowSequence = 6)]
[JsonProperty("OperationDate", NullValueHandling = NullValueHandling.Ignore)]
public string OperationDate
{
get;
set;
}
[HistoryGridField(Description = "操作客户端", ShowSequence = 7)]
[JsonProperty("OperationComputer", NullValueHandling = NullValueHandling.Ignore)]
public string OperationComputer
{
get;
set;
}
}
}