/// <summary>
        /// 获取表单预警
        /// </summary>
        /// <param name="pt"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public ActionResult GetEarlyWarningFormInfo(PageSearchRequest pt, string param)
        {
            DateTime?SDT       = null;
            DateTime?EDT       = null;
            int      state     = 0;
            string   UserId    = OperatorProvider.Provider.CurrentUser.UserId;
            string   ProjectId = OperatorProvider.Provider.CurrentUser.ProjectId;

            if (string.IsNullOrEmpty(param))
            {
                state = 0;
                SDT   = null;
                EDT   = null;
            }
            else
            {
                JObject jo = (JObject)JsonConvert.DeserializeObject(param);
                state = Convert.ToInt32(jo["state"]);
                if (jo["SDT"].ToString() != "{}" && jo["SDT"].ToString() != "")
                {
                    SDT = Convert.ToDateTime(jo["SDT"]);
                }
                if (jo["EDT"].ToString() != "{}" && jo["EDT"].ToString() != "")
                {
                    EDT = Convert.ToDateTime(jo["EDT"]).AddDays(1);
                }
            }
            var data = _earlyWarning.GetEarlyWarningFormInfo(pt, UserId, ProjectId, state, SDT, EDT);

            return(Content(data.ToJson()));
        }
Пример #2
0
        /// <summary>
        /// 表单预警消息列表
        /// </summary>
        /// <param name="pt"></param>
        /// <param name="UserId"></param>
        /// <param name="state"></param>
        /// <param name="SDT"></param>
        /// <param name="EDT"></param>
        /// <returns></returns>
        public HttpResponseMessage GetEarlyWarningFormInfo([FromUri] OARequest pt)
        {
            var data = _earlyWarning.GetEarlyWarningFormInfo(pt, pt.UserId, pt.ProjectId, pt.state, pt.SDT, pt.EDT);

            return(AjaxResult.Success(data).ToJsonApi());
        }