Ejemplo n.º 1
0
        /// <summary>
        /// 查询车辆历史数据(分页)
        /// </summary>
        /// <param name="vehicleCode"></param>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="isRevise"></param>
        /// <returns></returns>
        public GPSHistorySectionViewModel GetSectionHistoryLocus(Guid vehicleCode, DateTime beginTime, DateTime endTime, TimeSpan overTime, TimeSpan? lastStopTime, int RecordNum, EnumMapType mapType)
        {
            HistoryLocusService service = new HistoryLocusService();

            if (RecordNum < 1)
                RecordNum = _VehicleLocusSize;

            VGPSHistorySection section = service.GetHistoryLocus(vehicleCode, beginTime, endTime, mapType, RecordNum, overTime, lastStopTime);

            GPSHistorySectionViewModel res = new GPSHistorySectionViewModel();
            res.IsNext = section.IsNext;
            res.NextBegin = section.NextBegin;
            res.NextEnd = section.NextEnd;
            res.PlayKey = Guid.Empty;
            res.LastPointIsStop = section.LastPointIsStop;
            res.LastStopTime = section.LastStopTime;

            if (!section.CurrentHistoryInfos.IsNullOrEmpty())
            {
                res.CurrentHistoryInfos = new List<HistoryLocusViewModel>();
                foreach (var item in section.CurrentHistoryInfos)
                {
                    res.CurrentHistoryInfos.Add(new HistoryLocusViewModel
                    {
                        Latitude = item.Latitude,
                        Longitude = item.Longitude,
                        EncodeLatLon = item.EncodeLatLon,
                        ReportTime = item.ReportTime,
                        Speed = item.Speed,
                        Direction = item.Direction,
                        Mileage = item.Mileage,
                        StarkMileage = item.StarkMileage,
                        StopTime = item.StopTime,
                        StopTimeBegin = item.StopTimeBegin,
                        StopTimeEnd = item.StopTimeEnd,
                        Description = item.Description,
                        IsNotSureStop = item.IsNotSureStop,
                        IsStop = item.IsStop,
                        IsPoweOff = item.IsPoweOff,
                        IsRob = item.IsRob
                    });
                }
            }

            return res;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 查询车辆历史数据(全部轨迹,分页)
        /// </summary>
        /// <param name="vehicleCode"></param>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="isRevise"></param>
        /// <returns></returns>
        public GPSHistorySectionViewModel GetAllHistoryLocus(Guid vehicleCode, DateTime beginTime, DateTime endTime, EnumMapType mapType)
        {
            HistoryLocusService service = new HistoryLocusService();

            VGPSHistorySection section = service.GetHistoryLocus(vehicleCode, beginTime, endTime, mapType, int.MaxValue);

            List<HistoryLocusViewModel> listViewModel = section.CurrentHistoryInfos.Select(o => new HistoryLocusViewModel()
            {
                Latitude = o.Latitude,
                Longitude = o.Longitude,
                ReportTime = o.ReportTime,
                Speed = o.Speed,
                Direction = o.Direction,
                Mileage = o.Mileage,
                StopTime = o.StopTime
            }).ToList<HistoryLocusViewModel>();

            GPSHistorySectionViewModel viewModel = new GPSHistorySectionViewModel()
            {
                IsNext = section.IsNext,
                NextBegin = section.NextBegin,
                NextEnd = section.NextEnd,
                CurrentHistoryInfos = listViewModel,
                LastPointIsStop = section.LastPointIsStop,
                LastStopTime = section.LastStopTime
            };

            return viewModel;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询车辆历史数据(无分页)
        /// </summary>
        /// <param name="vehicleCode"></param>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="isRevise"></param>
        /// <returns></returns>
        public List<HistoryLocusViewModel> GetHistoryLocus(Guid vehicleCode, DateTime beginTime, DateTime endTime, EnumMapType mapType)
        {
            HistoryLocusService service = new HistoryLocusService();

            IList<VGPSHistoryRunInfo> list = service.GetHistoryLocus(vehicleCode, beginTime, endTime, mapType);
            if (list == null)
            {
                list = new List<VGPSHistoryRunInfo>();
            }
            List<HistoryLocusViewModel> listViewModel = list.Select(o => new HistoryLocusViewModel()
            {
                Latitude = o.Latitude,
                Longitude = o.Longitude,
                ReportTime = o.ReportTime,
                Speed = o.Speed,
                Direction = o.Direction,
                Mileage = o.Mileage,
                StopTime = o.StopTime
            }).ToList<HistoryLocusViewModel>();

            return listViewModel;
        }