Пример #1
0
        /// <summary>
        /// 获取车牌列表
        /// </summary>
        public void getLicensePlateControlList(HttpContext context)
        {
            int    page     = int.Parse(request.Params["page"]);
            int    pageSize = int.Parse(request.Params["rows"]);
            string sort     = request.Params["sort"];
            string order    = request.Params["order"];

            if (page <= 0)
            {
                page = 1;
            }

            string from        = request.Params["from"].ToString();
            string to          = request.Params["to"].ToString();
            string zt          = request.Params["zt"].ToString();
            string gl          = request.Params["gl"].ToString();
            string pc          = request.Params["pc"].ToString();
            string jyddsdsc_xs = request.Params["jyddsdsc_xs"].ToString();
            string mdd         = request.Params["mdd"].ToString();
            string jdrhkh      = request.Params["jdrhkh"].ToString();

            Interfaces.Service.MapService serv = new Interfaces.Service.MapService();
            var list  = serv.getCarControlList(from, to, zt, gl, pc, jyddsdsc_xs, mdd, jdrhkh, pageSize, page, sort, order);
            int count = serv.getCarControlCount(from, to, zt, gl, pc, jyddsdsc_xs, mdd, jdrhkh);

            res.rows  = list;
            res.total = count;
        }
Пример #2
0
        /// <summary>
        /// 验证车牌
        /// </summary>
        /// <param name="context"></param>
        public void VerifyLicensePlate(HttpContext context)
        {
            var             cph    = context.Request.Params["cph"].ToString().Replace(",", ";");
            string          logid  = context.Request.Params["logid"];
            string          token  = DESEncrypt(userid, "tms&sgt#");
            string          param  = "userId=" + userid + "&token=" + token + "&vnos=" + HttpUtility.UrlEncode(cph, Encoding.UTF8);
            string          ret    = PostWebRequest(url, param, Encoding.UTF8);
            MapResponseData mapRes = JsonConvert.DeserializeObject <MapResponseData>(ret);

            if (mapRes.code == "0" || mapRes.code == "3")
            {
                res.result = true;
                res.data   = param;
                if (mapRes.code == "3")
                {
                    res.msg  = "只找到部分车的定位信息:" + mapRes.result;
                    res.data = "userId=" + userid + "&token=" + token + "&vnos="
                               + HttpUtility.UrlEncode(mapRes.result.Replace(",", ";").TrimEnd(';'), Encoding.UTF8);
                }
                if (string.IsNullOrEmpty(logid))
                {
                    Interfaces.Service.MapService serv = new Interfaces.Service.MapService();
                    serv.InsertMapLog(userid, token, cph, res.msg);
                }
            }
            else if (mapRes.code == "1" || mapRes.code == "2")
            {
                res.result = false;
                res.msg    = mapRes.des;
            }
        }
Пример #3
0
        /// <summary>
        /// 查询历史记录
        /// </summary>
        public void GetMapViewHistory(HttpContext context)
        {
            Interfaces.Service.MapService serv = new Interfaces.Service.MapService();
            var list = serv.getCarMapHistory(userid);

            res.result = true;
            res.rows   = list;
        }
Пример #4
0
        public void Sbztcx(HttpContext context)
        {
            var    deviceNums = context.Request.Params["deviceNums"].ToString();
            string logid      = context.Request.Params["logid"];
            string token      = HttpUtility.UrlEncode(DESEncrypt(userid, "tms&sgt#"));
            string param      = "userId=" + userid + "&token=" + token + "&deviceNums=" + deviceNums;
            string ret        = PostWebRequest(url_sbztcx, param, Encoding.UTF8);
            MapResponseData_Sbztcx mapRes_Sbztcx = new MapResponseData_Sbztcx();

            mapRes_Sbztcx = JsonConvert.DeserializeObject <MapResponseData_Sbztcx>(ret);

            if (mapRes_Sbztcx.code == "0" || mapRes_Sbztcx.code == "3")
            {
                res.result = true;
                res.data   = param;
                if (mapRes_Sbztcx.code == "0")
                {
                    //res.msg = mapRes_Sbztcx.MapResponseData_Sbztcx_mxx;
                    //res.data = "userId=" + userid + "&token=" + token + "&vnos="
                    //    + HttpUtility.UrlEncode(mapRes_Sbztcx.result.Replace(",", ";").TrimEnd(';'), Encoding.UTF8);
                    List <yw_hddz_bdsbwhEntity> list = new List <yw_hddz_bdsbwhEntity>();
                    foreach (var m in mapRes_Sbztcx.result)
                    {
                        yw_hddz_bdsbwhEntity model = new yw_hddz_bdsbwhEntity();
                        model.bdyssbh      = m.deviceNum;
                        model.deviceID     = m.deviceID;
                        model.deviceNum    = m.deviceNum;
                        model.adr          = m.adr;
                        model.odometer     = m.odometer;
                        model.onlineStatus = m.onlineStatus;
                        model.status       = m.status;
                        model.vno          = m.vno;
                        list.Add(model);
                    }
                    new Interfaces.Service.MapService().UpdateBdsbwh(list);
                }
                if (string.IsNullOrEmpty(logid))
                {
                    Interfaces.Service.MapService serv = new Interfaces.Service.MapService();
                    serv.InsertMapLog(userid, token, deviceNums, res.msg);
                }
            }
            else if (mapRes_Sbztcx.code == "1" || mapRes_Sbztcx.code == "2")
            {
                res.result = false;
                res.msg    = mapRes_Sbztcx.des;
            }
        }
Пример #5
0
        /// <summary>
        /// 获取车牌列表
        /// </summary>
        public void getLicensePlateList(HttpContext context)
        {
            int page     = int.Parse(request.Params["page"]);
            int pageSize = int.Parse(request.Params["rows"]);

            if (page <= 0)
            {
                page = 1;
            }

            string from = request.Params["from"].ToString();
            string to   = request.Params["to"].ToString();

            Interfaces.Service.MapService serv = new Interfaces.Service.MapService();
            var list  = serv.getCarMapList(from, to, pageSize, page);
            int count = serv.getCarMapCount(from, to);

            res.rows  = list;
            res.total = count;
        }