public object GetProblemInfo(string json) { string res = string.Empty; //json.Value<string>("json"); dynamic dy = JsonConvert.DeserializeObject <ExpandoObject>(json); if (null == curUser) { curUser = GetOperator(dy.userid); if (curUser == null) { return(new { code = -1, count = 0, info = "当前用户不存在,请核对用户信息!" }); } } string hiddenid = dy.data.hiddenid; //隐患主键 //var baseInfo = htbaseinfobll.GetHiddenByKeyValue(hiddenid); string sql = string.Format(@"select hidname,hiddescribe,changemeasure,changedeadine,changepersonname from v_basehiddeninfo where id='{0}'", hiddenid); DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); //HiddenEntity entity = new HiddenEntity(); //if (dt.Rows.Count > 0) //{ // entity.hidname = dt.Rows[0][0].ToString(); // entity.hiddescribe = dt.Rows[0][1].ToString(); // entity.changemeasure = dt.Rows[0][2].ToString(); // entity.Changedeadine = dt.Rows[0][3].ToString(); // entity.changepersonname = dt.Rows[0][4].ToString(); //} return(new { code = 0, count = 0, info = "获取成功", data = dt.ToJson() }); }
public object GetEarlyWarning([FromBody] JObject json) { string res = json.Value <string>("json"); dynamic dy = JsonConvert.DeserializeObject <ExpandoObject>(res); var type = dy.type; if (null == curUser) { curUser = GetOperator(dy.userid); if (curUser == null) { return(new { code = -1, count = 0, info = "当前用户不存在,请核对用户信息!" }); } } string sql = string.Format("select d.changedeadine,d.hidpointname,changemeasure,d.workstream from v_basehiddeninfo d where 1=1 "); //组织机构 if (curUser != null && !string.IsNullOrEmpty(curUser.OrganizeCode)) { //省级单位 if (curUser.RoleName.Contains("省级用户")) { sql += string.Format(@" and deptcode like '{0}%' ", curUser.NewDeptCode); } else { sql += string.Format(@" and hiddepart = '{0}' ", curUser.OrganizeId); } } //时间筛选 if (!string.IsNullOrEmpty(type) && type == "1") {//当天预警信息 sql += string.Format(" and Changedeadine > to_date('{0}', 'yyyy-MM-dd HH24:mi:ss') and Changedeadine < to_date('{1}', 'yyyy-MM-dd HH24:mi:ss') ", DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.AddDays(1)); } //流程状态 if (!string.IsNullOrEmpty(res)) { sql += string.Format(@" and workstream != '整改结束'"); } DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); return(new { code = 0, info = "获取数据成功", count = 1, data = dt.ToJson() }); }