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; } = string.Empty;
///
/// 重量,单位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 string Measure_WasteSType { get; set; }
///
/// 价格
///
public decimal? Measure_Price { get; set; }
///
/// 金额
///
public decimal? Measure_Amount { get; set; }
///
/// 操作员
///
public string Measure_OpUser { get; set; }
///
/// 唯一消息ID
///
public string Measure_UUID { get; set; }
public string ID1 { get; set; }
public string ID2 { get; set; }
public string ID3 { get; set; }
public string ID4 { get; set; }
public string ID5 { get; set; }
public string ID6 { get; set; }
public string ID7 { get; set; }
public string ID8 { get; set; }
}
///
/// 上传的数据包体
///
public class MyPackage
{
///
/// 固定头
///
public string Key { get; set; } = string.Empty;
///
/// 数据体长度
///
public int Len { get; set; } = 0;
///
/// IMEI
///
public string IMEI { get; set; } = string.Empty;
///
/// ICCID
///
public string ICCID { get; set; } = string.Empty;
///
/// IMSI
///
public string IMSI { get; set; } = string.Empty;
///
/// 信号强度
///
public string GSLQ { get; set; } = string.Empty;
///
/// 时间
///
public string Time { get; set; }
///
/// 经度
///
public string Longitude { get; set; } = string.Empty;
///
/// 纬度
///
public string Latitude { get; set; } = string.Empty;
///
/// 设备地区
///
public string City { get; set; } = string.Empty;
///
/// 设备详细地点
///
public string Area { get; set; } = string.Empty;
///
/// 垃圾类别
///
public string WasteType { get; set; } = string.Empty;
///
/// 重量,KG
///
public string Weight { get; set; } = "0";
///
/// 内容
///
public string Body { get; set; } = string.Empty;
///
/// 字符串结果
///
public string Str { get; set; } = string.Empty;
///
/// 是否是否通过校检,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; } = string.Empty;
///
/// 消息ID
///
public string UUID { get; set; } = string.Empty;
///
/// 上报时间
///
public string UploadTime { get; set; } = string.Empty;
///
/// 价格
///
public string Price { get; set; } = string.Empty;
///
/// 金额
///
public string Amount { get; set; } = string.Empty;
///
/// 操作员
///
public string OpUser { get; set; } = string.Empty;
///
/// 设备出厂序列号/设备出厂编号
///
public string DeviceFacEcode { get; set; } = string.Empty;
///
/// 车牌号/物品编码/垃圾桶编号
///
public string Registration { get; set; } = string.Empty;
///
/// 毛重,KG
///
public string GrossWeight { get; set; } = string.Empty;
///
/// 皮重,KG
///
public string Tare { get; set; } = string.Empty;
///
/// 净重,KG
///
public string NetWeight { get; set; } = string.Empty;
public string ID1 { get; set; } = string.Empty;
public string ID2 { get; set; } = string.Empty;
public string ID3 { get; set; } = string.Empty;
public string ID4 { get; set; } = string.Empty;
public string ID5 { get; set; } = string.Empty;
public string ID6 { get; set; } = string.Empty;
public string ID7 { get; set; } = string.Empty;
public string ID8 { get; set; } = string.Empty;
}
///
/// A8协议模块上传的数据包体
///
public class A8MyPackage : A8Package
{
///
/// 固定头
///
public string Key { get; set; } = string.Empty;
///
/// 数据体长度
///
public int Len { get; set; } = 0;
///
/// IMEI
///
public string IMEI { get; set; } = string.Empty;
///
/// ICCID
///
public string ICCID { get; set; } = string.Empty;
///
/// IMSI
///
public string IMSI { get; set; } = string.Empty;
///
/// 信号强度
///
public string GSLQ { get; set; } = string.Empty;
///
/// 时间
///
public string Time { get; set; }
///
/// 经度
///
public string Longitude { get; set; } = string.Empty;
///
/// 纬度
///
public string Latitude { get; set; } = string.Empty;
///
/// 桶大小
///
public string size { get; set; } = string.Empty;
///
/// 垃圾桶编号
///
public string trashcode { get; set; } = string.Empty;
///
/// 垃圾类别
///
public string WasteType { get; set; } = string.Empty;
///
/// 重量,KG
///
public string Weight { get; set; } = "0";
///
/// 内容
///
public string Body { get; set; } = string.Empty;
///
/// 字符串结果
///
public string Str { get; set; } = string.Empty;
///
/// 是否是否通过校检,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; } = string.Empty;
///
/// 数据体长度
///
public int Len { get; set; } = 0;
///
/// IMEI
///
public string IMEI { get; set; } = string.Empty;
///
/// ICCID
///
public string ICCID { get; set; } = string.Empty;
///
/// IMSI
///
public string IMSI { get; set; } = string.Empty;
///
/// 信号强度
///
public string GSLQ { get; set; } = string.Empty;
///
/// 时间
///
public string Time { get; set; }
///
/// 经度
///
public string Longitude { get; set; } = string.Empty;
///
/// 纬度
///
public string Latitude { get; set; } = string.Empty;
///
/// 桶大小
///
public string size { get; set; } = string.Empty;
///
/// 垃圾桶编号
///
public string trashcode { get; set; } = string.Empty;
///
/// 垃圾类别
///
public string WasteType { get; set; } = string.Empty;
///
/// 重量,KG
///
public string Weight { get; set; } = "0";
///
/// 内容
///
public string Body { get; set; } = string.Empty;
///
/// 字符串结果
///
public string Str { get; set; } = string.Empty;
///
/// 是否是否通过校检,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; } = string.Empty;
///
/// 垃圾桶编号
///
public string trashcode { get; set; } = string.Empty;
///
/// 垃圾类别
///
public string WasteType { get; set; } = string.Empty;
///
/// 重量,KG
///
public string Weight { get; set; } = "0";
///
/// 是否为心跳包
///
public bool IsHeart { get; set; } = false;
}
}