public ActionResult GetCheckStat(string orgCode = "", string orgId = "") { Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current(); if (user.RoleName.Contains("集团用户")) { if (!string.IsNullOrEmpty(orgCode)) { user = new Operator { OrganizeId = orgId, OrganizeCode = orgCode, DeptCode = orgCode, RoleName = "公司级用户,公司领导" }; } else { user = new Operator { OrganizeId = orgId, OrganizeCode = "00", DeptCode = "00", RoleName = "公司级用户,公司领导" }; } } var data = saftycheckdatabll.GetCheckStat(user); return(ToJsonResult(data)); }
public string GetAllWorkState() { RiskBLL riskBLL = new RiskBLL(); //安全风险 SaftyCheckDataBLL saBLL = new SaftyCheckDataBLL(); //安全检查 HTBaseInfoBLL htBLL = new HTBaseInfoBLL(); //事故隐患 List <object> data = new List <object>(); OrganizeBLL orgBll = new OrganizeBLL(); DataTable dt = orgBll.GetDTList(); ClassificationBLL classBLL = new ClassificationBLL(); foreach (DataRow dr in dt.Rows) { Operator user = new Operator { OrganizeId = dr["orgid"].ToString(), OrganizeCode = dr["encode"].ToString(), DeptCode = dr["encode"].ToString(), RoleName = "公司级用户,公司领导" }; decimal[] fxArr = riskBLL.GetHomeStat(user); DataTable dtJC = saBLL.GetCheckStat(user); DataTable dtHT = htBLL.QueryHidWorkList(user); //首页双控工作 data.Add(new { name = dr[1].ToString(), code = dr[0].ToString(), yjfx = fxArr[1], ejfx = fxArr[2], jccs = dtJC.Rows[0][0].ToString(), ybyh = dtHT.Rows[3][2].ToString(), zdyh1 = dtHT.Rows[1][2].ToString(), zdyh2 = dtHT.Rows[2][2].ToString(), yzgs = dtHT.Rows[0][3].ToString(), wzgs = dtHT.Rows[0][4].ToString(), zgl = dtHT.Rows[0][6].ToString() }); } return(Newtonsoft.Json.JsonConvert.SerializeObject(data)); }
public object getFiveTypeInfo([FromBody] JObject json) { string res = json.Value <string>("json"); dynamic dy = JsonConvert.DeserializeObject <ExpandoObject>(res); try { if (null != curUser) { //安全检查 SaftyCheckDataBLL saftycheckdatabll = new SaftyCheckDataBLL(); var dtcheck = saftycheckdatabll.GetCheckStat(curUser); decimal checknum = 0;//安全检查次数 if (dtcheck.Rows.Count > 0) { checknum = decimal.Parse(dtcheck.Rows[0][0].ToString()); } //隐患排查 HTBaseInfoBLL htbaseinfobll = new HTBaseInfoBLL(); decimal registernum = 0; //登记的隐患 decimal changenum = 0; //整改的隐患 decimal lllegalnum = 0; //违章的次数 decimal drillplannum = 0; //应急演练数量 var dtht = htbaseinfobll.GetAppHidStatistics(curUser.DeptCode, 4); //登记的隐患数量 if (dtht.Rows.Count > 0) { registernum = decimal.Parse(dtht.Rows[0][0].ToString()); //登记的隐患数量 changenum = decimal.Parse(dtht.Rows[1][0].ToString()); //整改的隐患数量 lllegalnum = decimal.Parse(dtht.Rows[2][0].ToString()); //违章的次数 drillplannum = decimal.Parse(dtht.Rows[3][0].ToString()); //应急演练数量 } return(new { Code = 0, Count = 0, Info = "获取数据成功", data = new { checknum = checknum, //安全检查数 registernum = registernum, //登记的隐患 changenum = changenum, //整改的隐患 lllegalnum = lllegalnum, //违章的次数 drillplannum = drillplannum //应急演练数量 } }); } else { return(new { Code = -1, Count = 0, Info = "用户不存在!" }); } } catch (Exception ex) { return(new { Code = -1, Count = 0, Info = ex.Message }); throw; } }