Exemple #1
0
        private void DataGridPatrolList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            patrols p = DataGridPatrolList.SelectedItem as patrols;

            if (p == null)
            {
                return;
            }
            pd = trackClient.GetPatrolDetail(p.id);
            PatrolDetail.SelectedObject = pd;

            foreach (var item in pd.route)
            {
                if (item.deviceName == "")
                {
                    var d1 = kksList.FindAll(i => i.Code.Contains(item.kksCode));
                    if (d1.Count > 0)
                    {
                        item.deviceName = d1[0].Name;
                    }
                }
            }

            DataGridRouteList.ItemsSource = pd.route;
        }
Exemple #2
0
 public static DbModel.Location.Work.InspectionTrack CreateInspectionTrack(patrols item)
 {
     DbModel.Location.Work.InspectionTrack now = new DbModel.Location.Work.InspectionTrack();
     now.Abutment_Id  = item.id;
     now.Code         = item.code;
     now.Name         = item.name;
     now.CreateTime   = (item.createTimes + nEightHourSecond) * 1000;
     now.dtCreateTime = Location.TModel.Tools.TimeConvert.ToDateTime(now.CreateTime);
     now.State        = item.state;
     now.StartTime    = (item.startTime + nEightHourSecond) * 1000;
     now.dtStartTime  = Location.TModel.Tools.TimeConvert.ToDateTime(now.StartTime);
     now.EndTime      = (item.endTime + nEightHourSecond) * 1000;
     now.dtEndTime    = Location.TModel.Tools.TimeConvert.ToDateTime(now.EndTime);
     return(now);
 }
        /// <summary>
        /// 获取巡检节点列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public patrols GetPatrolDetail(int patrolId)
        {
            /*
             * {"createTime":1568736088,"startTime":1568736000,"endTime":1568764200,"id":"2340","code":"巡检单-14270","name":"#1炉机务巡检路线(运行)","state":"执行中","route":[{"staffCode":"82000007","staffName":"","kksCode":"20190514RHUU","deviceCode":"#1炉辅机间0m区域","deviceName":"","deviceId":110864},{"staffCode":"82000007","staffName":"","kksCode":"201905142V55","deviceCode":"#1炉定排坑区域","deviceName":"","deviceId":110781},{"staffCode":"82000007","staffName":"","kksCode":"20190514WLUU","deviceCode":"#1炉辅机间2层平台","deviceName":"","deviceId":110888},{"staffCode":"82000007","staffName":"","kksCode":"20190514J4YJ","deviceCode":"#1炉辅机间3层平台","deviceName":"","deviceId":110887},{"staffCode":"82000007","staffName":"","kksCode":"20190514OVHO","deviceCode":"#1炉辅机间4层平台","deviceName":"","deviceId":110785},{"staffCode":"82000007","staffName":"","kksCode":"2019051447P1","deviceCode":"#1炉29.48m平台区域","deviceName":"","deviceId":110780},{"staffCode":"82000007","staffName":"","kksCode":"201905141961","deviceCode":"#1炉0m区域","deviceName":"","deviceId":110890}]}
             */
            patrols recv = new patrols();

            try
            {
                string path = "patrols/" + patrolId;
                string url  = BaseUri + path;

                recv = GetPatrols(url);
            }
            catch (Exception ex)
            {
                string messgae = ex.Message;
            }

            return(recv);
        }
        public patrols GetPatrols(string url)
        {
            patrols recv = new patrols();

            try
            {
                recv = WebApiHelper.GetEntity <patrols>(url);
                if (recv == null)
                {
                    return(null);
                }
                if (recv.route == null)
                {
                    recv.route = new List <checkpoints>();
                }
            }
            catch (Exception ex)
            {
                Message = ex.Message;
                return(null);
            }
            return(recv);
        }
Exemple #5
0
        public static DbModel.LocationHistory.Work.InspectionTrackHistory CreateInspectionTrackHistory(patrols item)
        {
            DbModel.LocationHistory.Work.InspectionTrackHistory history = new DbModel.LocationHistory.Work.InspectionTrackHistory();
            history.Abutment_Id  = item.id;
            history.Code         = item.code;
            history.Name         = item.name;
            history.CreateTime   = (item.createTimes + nEightHourSecond) * 1000;
            history.dtCreateTime = Location.TModel.Tools.TimeConvert.ToDateTime(history.CreateTime);
            history.State        = item.state;
            history.StartTime    = (item.startTime + nEightHourSecond) * 1000;
            history.dtStartTime  = Location.TModel.Tools.TimeConvert.ToDateTime(history.StartTime);
            history.EndTime      = (item.endTime + nEightHourSecond) * 1000;

            history.dtEndTime = Location.TModel.Tools.TimeConvert.ToDateTime(history.EndTime);
            return(history);
        }