示例#1
0
        private static JTYResultModel CallApiGetLiftVideo(string registercode)
        {
            JTYResultModel resultModel = new JTYResultModel();

            resultModel.issuccess = false;
            try
            {
                string token = "";
                if (!GetToken(out token))
                {
                    resultModel.head      = token;
                    resultModel.issuccess = false;
                    return(resultModel);
                }
                var para = new
                {
                    head = new
                    {
                        version = _version,
                        partner = _partner,
                        key     = _key
                    },
                    para = new
                    {
                        registercode = registercode
                    }
                };
                string  data = string.Format("data={0}", JsonConvert.SerializeObject(para));
                string  url  = string.Format("{0}/GetLiftVideo.ashx", _host);
                dynamic d    = JsonConvert.DeserializeObject(HttpService.Post(data, url));
                if (d.head.code == 100)
                {
                    resultModel.head      = JsonConvert.SerializeObject(d.head);
                    resultModel.para      = JsonConvert.SerializeObject(d.para);
                    resultModel.issuccess = true;
                }
                else
                {
                    resultModel.head      = JsonConvert.SerializeObject(d.head);
                    resultModel.para      = "";
                    resultModel.issuccess = false;
                }
                return(resultModel);
            }
            catch (Exception ex)
            {
                LogHelper.Dbbug("金太阳GetLiftVideo失败=>" + ex.ToString());
                resultModel.head = ex.ToString();
                return(resultModel);
            }
        }
示例#2
0
 /// <summary>
 /// 电梯明细
 /// </summary>
 /// <param name="registercodes">电梯注册码</param>
 /// <param name="result"></param>
 /// <returns></returns>
 public static JTYResultModel GetLiftDetail(string registercode)
 {
     lock (_lockLiftDetailOBj)
     {
         var obj = CacheHelper.GetCache("GetLiftDetail_" + registercode);
         if (obj == null)
         {
             JTYResultModel resultModel = CallApiGetLiftDetail(registercode);
             if (resultModel.issuccess)
             {
                 CacheHelper.SetCache("GetLiftDetail_" + registercode, resultModel, CacheHelper.ExpireTime);
             }
             return(resultModel);
         }
         else
         {
             JTYResultModel result = obj as JTYResultModel;
             return(result);
         }
     }
 }
示例#3
0
 public static JTYResultModel GetLiftVideo(string registercode)
 {
     lock (_lockLiftVideoOBj)
     {
         var obj = CacheHelper.GetCache("GetLiftVideo_" + registercode);
         if (obj == null)
         {
             JTYResultModel resultModel = CallApiGetLiftVideo(registercode);
             //if (resultModel.issuccess)
             //{
             //    CacheHelper.SetCache("GetLiftVideo_" + registercode, resultModel, DateTime.Now.AddMinutes(1));
             //}
             return(resultModel);
         }
         else
         {
             JTYResultModel result = obj as JTYResultModel;
             return(result);
         }
     }
 }
示例#4
0
        /// <summary>
        /// 获取运行监控
        /// </summary>
        /// <param name="registercodes"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static JTYResultModel GetLiftRunData(string[] registercodes)
        {
            JTYResultModel result = CallApiGetLiftRunData(registercodes);

            return(result);
        }