using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using Waste.Domain; namespace Waste.Application { /// /// 投放记录列表 /// public class ResultListByEquS2CDto { /// /// 垃圾类别 /// public string WasteType { get; set; } /// /// 物品小类别 /// public string WasteSType { get; set; } = ""; /// /// 重量,单位KG /// public string Weight { get; set; } /// /// 垃圾桶编号 /// public string TrashCode { get; set; } /// /// 上报时间 /// public long Time { get; set; } } /// /// 投放记录列表 /// public class ResultListByEquS2SDto : ResultListByEquS2CDto { /// /// 上报时间 /// public DateTime CreateTime { get; set; } /// /// 测量记录ID /// public Guid Id { get; set; } /// /// 毛重 /// public decimal GrossWeight { get; set; } } /// /// 查询投放记录 /// public class ResultListByEquC2SDto : IValidatableObject { /// /// 当前页 /// public int offset { get; set; } = 1; /// /// 每页显示的数量 /// public int limit { get; set; } = 10; /// /// 开始时间 /// public DateTime? StartTime { get; set; } /// /// 结束时间 /// public DateTime? EndTime { get; set; } /// /// 设备ID /// public Guid DeviceId { get; set; } public IEnumerable Validate(ValidationContext validationContext) { if (DeviceId == Guid.Empty) { yield return new ValidationResult("设备ID不可为空", new[] { nameof(DeviceId) }); } if (limit > 100) { yield return new ValidationResult("一次最多100条记录", new[] { nameof(limit) }); } if (offset <= 0) { yield return new ValidationResult("页码需从1开始", new[] { nameof(offset) }); } if (StartTime.HasValue && StartTime.Value.Date > DateTime.Now.Date) { yield return new ValidationResult("开始时间不可超过当天", new[] { nameof(StartTime) }); } if (EndTime.HasValue && EndTime.Value.Date > DateTime.Now.Date) { yield return new ValidationResult("结束时间不可超过当天", new[] { nameof(StartTime) }); } } } public class ResultList : W_Result { /// /// 商户名称 /// public string BusinessName { get; set; } /// /// 设备名称 /// public string DeviceName { get; set; } /// /// 设备地址 /// public string DeviceAddress { get; set; } /// /// 设备出厂序列号 /// public string DeviceFacEcode { get; set; } /// /// 设备编号 /// public string DeviceEcode { get; set; } /// /// 上报是否成功,1-成功,0-失败 /// public int PostStatus { get; set; } } /// /// 上传的数据包体 /// public class MyPackage { /// /// 固定头 /// public string Key { get; set; } = ""; /// /// 数据体长度 /// public int Len { get; set; } = 0; /// /// IMEI /// public string IMEI { get; set; } = ""; /// /// ICCID /// public string ICCID { get; set; } = ""; /// /// IMSI /// public string IMSI { get; set; } = ""; /// /// 信号强度 /// public string GSLQ { get; set; } = ""; /// /// 时间 /// public string Time { get; set; } /// /// 经度 /// public string Longitude { get; set; } = ""; /// /// 纬度 /// public string Latitude { get; set; } = ""; /// /// 设备地区 /// public string City { get; set; } = ""; /// /// 设备详细地点 /// public string Area { get; set; } = ""; /// /// 垃圾类别 /// public string WasteType { get; set; } = ""; /// /// 重量,KG /// public string Weight { get; set; } = "0"; /// /// 内容 /// public string Body { get; set; } = ""; /// /// 字符串结果 /// public string Str { get; set; } = ""; /// /// 是否是否通过校检,true-是,false-否 /// public bool IsChecked { get; set; } = true; /// /// 是否为心跳包数据 /// public bool IsHeart { get; set; } = false; /// /// 是否为有效测量 /// public bool IsWeight { get; set; } = false; } /// /// A8协议包内容 /// public class A8Package { /// /// 垃圾类别小类 /// public string WasteSType { get; set; } = ""; /// /// 消息ID /// public string UUID { get; set; } = ""; /// /// 上报时间 /// public string UploadTime { get; set; } = ""; /// /// 价格 /// public string Price { get; set; } = ""; /// /// 金额 /// public string Amount { get; set; } = ""; /// /// 操作员 /// public string OpUser { get; set; } = ""; } /// /// A8协议模块上传的数据包体 /// public class A8MyPackage : A8Package { /// /// 固定头 /// public string Key { get; set; } = ""; /// /// 数据体长度 /// public int Len { get; set; } = 0; /// /// IMEI /// public string IMEI { get; set; } = ""; /// /// ICCID /// public string ICCID { get; set; } = ""; /// /// IMSI /// public string IMSI { get; set; } = ""; /// /// 信号强度 /// public string GSLQ { get; set; } = ""; /// /// 时间 /// public string Time { get; set; } /// /// 经度 /// public string Longitude { get; set; } = ""; /// /// 纬度 /// public string Latitude { get; set; } = ""; /// /// 桶大小 /// public string size { get; set; } = ""; /// /// 垃圾桶编号 /// public string trashcode { get; set; } = ""; /// /// 垃圾类别 /// public string WasteType { get; set; } = ""; /// /// 重量,KG /// public string Weight { get; set; } = "0"; /// /// 内容 /// public string Body { get; set; } = ""; /// /// 字符串结果 /// public string Str { get; set; } = ""; /// /// 是否是否通过校检,true-是,false-否 /// public bool IsChecked { get; set; } = true; /// /// 是否为心跳包数据 /// public bool IsHeart { get; set; } = false; /// /// 是否为有效测量 /// public bool IsWeight { get; set; } = false; } /// /// 新的4G模块上传的数据包体 /// public class nMyPackage { /// /// 固定头 /// public string Key { get; set; } = ""; /// /// 数据体长度 /// public int Len { get; set; } = 0; /// /// IMEI /// public string IMEI { get; set; } = ""; /// /// ICCID /// public string ICCID { get; set; } = ""; /// /// IMSI /// public string IMSI { get; set; } = ""; /// /// 信号强度 /// public string GSLQ { get; set; } = ""; /// /// 时间 /// public string Time { get; set; } /// /// 经度 /// public string Longitude { get; set; } = ""; /// /// 纬度 /// public string Latitude { get; set; } = ""; /// /// 桶大小 /// public string size { get; set; } = ""; /// /// 垃圾桶编号 /// public string trashcode { get; set; } = ""; /// /// 垃圾类别 /// public string WasteType { get; set; } = ""; /// /// 重量,KG /// public string Weight { get; set; } = "0"; /// /// 内容 /// public string Body { get; set; } = ""; /// /// 字符串结果 /// public string Str { get; set; } = ""; /// /// 是否是否通过校检,true-是,false-否 /// public bool IsChecked { get; set; } = true; /// /// 是否为心跳包数据 /// public bool IsHeart { get; set; } = false; /// /// 是否为有效测量 /// public bool IsWeight { get; set; } = false; } /// /// wifi模块上传的数据包体 /// public class WifiPackage { /// /// 设备机器码 /// public string sn { get; set; } /// /// 桶大小 /// public string size { get; set; } = ""; /// /// 垃圾桶编号 /// public string trashcode { get; set; } = ""; /// /// 垃圾类别 /// public string WasteType { get; set; } = ""; /// /// 重量,KG /// public string Weight { get; set; } = "0"; /// /// 是否为心跳包 /// public bool IsHeart { get; set; } = false; } }