/// <summary> /// 获取欠费 统计 老 /// Author:王伟 /// </summary> /// <param name="queryJson"></param> /// <returns></returns> public DataTable GetqianfeiDistrictListJson(string queryJson) { IEnumerable <DistrictModel> Newlist = service.GetArrearageStatistics(queryJson); var queryParam = queryJson.ToJObject(); DataTable dt = new DataTable(); dt.Columns.Add("property_name", typeof(string)); //string[] ParamFee = JsonHelper.JSONToObject<string[]>(queryParam["FeeName"].ToString()); //string[] Parampro = JsonHelper.JSONToObject<string[]>(queryParam["propertyID"].ToString()); string[] ParamFee = queryParam["FeeName"].ToString().Split(','); string[] Parampro = queryParam["propertyID"].ToString().Split(','); if (ParamFee != null && ParamFee.Length > 0) { foreach (var Feeid in ParamFee) { dt.Columns.Add("yinshou_" + Feeid, typeof(decimal)); dt.Columns.Add("shoushi_" + Feeid, typeof(decimal)); dt.Columns.Add("zhuijiao_" + Feeid, typeof(string)); dt.Columns.Add("yue_" + Feeid, typeof(decimal)); } } if (Parampro != null && ParamFee.Length > 0) { foreach (var propertyID in Parampro) { DataRow dr = dt.NewRow(); if (ParamFee != null && ParamFee.Length > 0) { foreach (var Feeid in ParamFee) { IEnumerable <DistrictModel> rowlist = Newlist.Where(d => d.feeitem_id == Feeid.ToString() && d.property_id == propertyID.ToString()).ToList(); if (rowlist != null && rowlist.Count() > 0) { foreach (var dd in rowlist) { dr["yinshou_" + Feeid] = dd.yinshou; dr["shoushi_" + Feeid] = dd.shishou; string zj = (dd.zhuijiao * 10000).ToString(); if (zj.IndexOf('.') != -1) { zj = zj.Substring(0, zj.IndexOf('.')); } if (zj.Length == 0) { zj = "0"; } dr["zhuijiao_" + Feeid] = (Convert.ToInt32(zj) / (decimal)100).ToString() + "%"; dr["yue_" + Feeid] = dd.yue; dr["property_name"] = dd.property_name; } } else { dr["yinshou_" + Feeid] = 0; dr["shoushi_" + Feeid] = 0; dr["zhuijiao_" + Feeid] = "0%"; dr["yue_" + Feeid] = 0; } } } if (dr["property_name"] != null && dr["property_name"].ToString() != "") { dt.Rows.Add(dr); } } } return(dt); }
/// <summary> /// 获取应收费用列表(筛选) /// </summary> /// <param name="queryJson"></param> /// <returns></returns> public DataTable GetDelayListJson(string queryJson) { IEnumerable <DelayDetail> Newlist = service.GetDelayListJson(queryJson); var queryParam = queryJson.ToJObject(); DataTable dt = new DataTable(); dt.Columns.Add("property_name", typeof(string)); //string[] ParamFee = JsonHelper.JSONToObject<string[]>(queryParam["FeeName"].ToString()); //string[] Parampro = JsonHelper.JSONToObject<string[]>(queryParam["propertyID"].ToString()); string[] ParamFee = queryParam["FeeName"].ToString().Split(','); string[] Parampro = queryParam["propertyID"].ToString().Split(','); if (ParamFee != null && ParamFee.Length > 0) { foreach (var Feeid in ParamFee) { dt.Columns.Add("linian_" + Feeid, typeof(decimal)); dt.Columns.Add("shangnian_" + Feeid, typeof(decimal)); dt.Columns.Add("dangnian_" + Feeid, typeof(string)); dt.Columns.Add("heji_" + Feeid, typeof(decimal)); } dt.Columns.Add("zonghe", typeof(decimal)); } if (Parampro != null && ParamFee.Length > 0) { foreach (var propertyID in Parampro) { DataRow dr = dt.NewRow(); if (ParamFee != null && ParamFee.Length > 0) { decimal zonghe = 0; foreach (var Feeid in ParamFee) { IEnumerable <DelayDetail> rowlist = Newlist.Where(d => d.feeitem_id == Feeid.ToString() && d.property_id == propertyID.ToString()).ToList(); foreach (var dd in rowlist) { dr["linian_" + Feeid] = dd.linian; dr["shangnian_" + Feeid] = dd.shangnian; dr["dangnian_" + Feeid] = dd.dangnian; dr["heji_" + Feeid] = dd.heji; dr["property_name"] = dd.property_name; zonghe += dd.heji; } } dr["zonghe"] = zonghe; } if (dr["property_name"] != null && dr["property_name"].ToString() != "") { dt.Rows.Add(dr); } } } return(dt); }