using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataVAPI.Tool.IOT { /// /// 大屏监视Model /// public class ScreenMonitorModel { /// /// 服务商家数 /// public string TotalSales { get; set; } /// /// 现场运营设备状态 /// public OperatingDeviceStatus operatingDeviceStatus { get; set; } /// /// 通知消息 /// public InfoMessage infoMessage { get; set; } /// /// 返回JSON /// /// public string ToJSON() { try { return Tools.JsonConvertTools(this); } catch (Exception ex) { return string.Empty; } } /// /// 序列化为对象 /// /// /// public ScreenMonitorModel JSONtoDX(string JSON) { try { return Tools.JsonToObjectTools(JSON); } catch (Exception ex) { return new ScreenMonitorModel(); } } } /// /// 下订单统计 /// public class PlaceOrderCount { /// /// 今日下单量统计 /// public string ToDayPlaceCount { get; set; } /// /// 本月下单量统计 /// public string MonthPlaceCount { get; set; } /// /// 本年下单量统计 /// public string YearPlaceCount { get; set; } } /// /// 制作流程 /// public class ProcessMessage { public List data { get; set; } } /// /// 制作流程Model /// public class ProcessModel { /// /// 告警程度:提示 一般 严重 /// private bool _IsMark { get; set; } public bool IsMark { get { return _IsMark; } set { _IsMark = value; if (_IsMark) ProcessColor = new ALYColor { r = 253, g = 234, b = 1, a = 1 }; else ProcessColor = new ALYColor { r = 151, g = 150, b = 140, a = 1 }; } } /// /// 流程名称 /// public string ProcessName { get; set; } /// /// 流程描述 /// public string ProcessMS { get; set; } /// /// 颜色 /// public ALYColor ProcessColor { get; set; } public ProcessModel() { IsMark = false; ProcessMS = string.Empty; ProcessName = string.Empty; } } /// /// 通知消息 /// public class InfoMessage { public List data { get; set; } } /// /// 运营设备及状态 /// public class OperatingDeviceStatus { public List data { get; set; } } /// /// 设备状态 /// public class DevStatus : DeviceBase { /// /// 设备状态 /// public string DeviceZT { get { return _DeviceZT; } set { _DeviceZT = value; if (_DeviceZT == "在线") DeviceColor = new ALYColor { r = 13, g = 254, b = 73, a = 1 }; else DeviceColor = new ALYColor { r = 249, g = 191, b = 0, a = 1 }; } } private string _DeviceZT { get; set; } /// /// 是否有告警 /// public bool IsAlarm { get { return _IsAlarm; } set { _IsAlarm = value; if (_IsAlarm) AlarmColor = new ALYColor { r = 245, g = 13, b = 13, a = 1 }; else AlarmColor = new ALYColor { r = 245, g = 13, b = 13, a = 0 }; } } private bool _IsAlarm { get; set; } /// /// 颜色 /// public ALYColor DeviceColor { get; set; } /// /// 告警颜色 /// public ALYColor AlarmColor { get; set; } /// /// 初始化 /// public DevStatus() { IsAlarm = false; AlarmColor = new ALYColor { r = 245, g = 13, b = 13, a = 0 }; DeviceColor = new ALYColor { r = 249, g = 191, b = 0, a = 1 }; } /// /// 设置属性 /// /// /// /// /// /// /// public void SetTarget(string _deviceName, string _gmtCreate, string _DeviceMC, string _DeviceMS, string _DeviceSJ, string _DeviceZT) { deviceName = _deviceName; gmtCreate = _gmtCreate; DeviceMC = _DeviceMC; DeviceMS = _DeviceMS; DeviceSJ = _DeviceSJ; DeviceZT = _DeviceZT; } /// /// 状态 /// /// public void SetStatus(string _DeviceZT) { DeviceSJ = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); DeviceZT = _DeviceZT; } } /// /// 设备基本属性 /// public class DeviceBase : DevBase { /// /// 设备名称 /// public string DeviceMC { get; set; } /// /// 设备描述 /// public string DeviceMS { get; set; } /// /// 设备时间 /// public string DeviceSJ { get; set; } /// /// 设备状态:已处理 未处理 /// public string DeviceZT { get; set; } } /// /// 设备基本信息 /// public class DevBase { /// /// 唯一id /// public string id { get; set; } /// /// 设备key /// public string productKey { get; set; } /// /// 设备名称 /// public string deviceName { get; set; } /// /// gmtCreate /// public string gmtCreate { get; set; } /// /// 客户端ID /// public string clientId { get; set; } public DevBase() { id = Guid.NewGuid().ToString(); } } }