示例#1
0
        /// <summary>
        /// 开机率,校准率,保养率,巡检率信息
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="sessionID">当前请求所在设备储存的SessionID</param>
        /// <returns>开机率,校准率,保养率,巡检率信息</returns>
        public JsonResult KPI(int userID, string sessionID, string date = "")
        {
            ServiceResultModel <Dictionary <string, Dictionary <string, double> > > result = new ServiceResultModel <Dictionary <string, Dictionary <string, double> > >();

            try
            {
                if (!CheckSessionID(userID, sessionID, result))
                {
                    return(MyJson(result, JsonRequestBehavior.AllowGet));
                }
                result.Data = api.KPI(date);
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(MyJson(result, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        /// <summary>
        /// 开机率,校准率,保养率,巡检率信息
        /// </summary>
        /// <returns>开机率,校准率,保养率,巡检率信息</returns>
        public JsonResult KPI(string date = "")
        {
            ServiceResultModel <Dictionary <string, Dictionary <string, double> > > result = new ServiceResultModel <Dictionary <string, Dictionary <string, double> > >();

            if (WebConfig.CHECK_SESSION_ON_DASHBORAD_API == true && CheckSession() == false)
            {
                return(Json(ResultModelBase.CreateTimeoutModel(), JsonRequestBehavior.AllowGet));
            }
            if (WebConfig.CHECK_SESSION_ON_DASHBORAD_API == true && CheckSessionID() == false)
            {
                return(Json(ResultModelBase.CreateLogoutModel(), JsonRequestBehavior.AllowGet));
            }
            try
            {
                result.Data = api.KPI(date);
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(JsonNetResult(result, JsonRequestBehavior.AllowGet));
        }