using MongoDB.Bson.Serialization.Attributes; using Pursue.Extension.MongoDB; using System; namespace Znyc.Cloudcar.Admin.MongoDb.Core.Collection { public class GpsRealTime : MongoEntityPrimaryKey { private int _acc; private string _accDurationTime; public long VehicleId { get; set; } public string VehicleCode { get; set; } public string VehiclePlate { get; set; } public long VehicleDriver { get; set; } public string DriverPhone { get; set; } public int State { get; set; } public int GpsState { get; set; } /// /// Gps数据产生时间 /// [BsonDateTimeOptions(Kind = DateTimeKind.Unspecified)] public DateTime GpsTime { get; set; } /// /// Gps服务器接收时间 /// [BsonDateTimeOptions(Kind = DateTimeKind.Unspecified)] public DateTime RecTime { get; set; } public decimal Longitude { get; set; } public decimal Latitude { get; set; } public int Direct { get; set; } public int Speed { get; set; } public string DurationTime { get; set; } public int Acc { get => GpsState == 0 ? 0 : _acc; set => _acc = value; } public string AccDurationTime { get => GpsState == 0 ? DurationTime : _accDurationTime; set => _accDurationTime = value; } public string Address { get; set; } public string SimNo { get; set; } public long CompanyId { get; set; } [BsonDateTimeOptions(Kind = DateTimeKind.Unspecified)] public DateTime ModifiedTime { get; set; } [BsonDateTimeOptions(Kind = DateTimeKind.Unspecified)] public DateTime CreatedTime { get; set; } /// /// 设备号 /// public string TerminalNo { get; set; } } }