数据治理
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.DataVisualization.Charting;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.ProjectData
|
||||
@@ -49,29 +50,29 @@ namespace FineUIPro.Web.ProjectData
|
||||
{
|
||||
if (TabStrip1.ActiveTabIndex == 0)
|
||||
{
|
||||
this.Panel1.Title = "已关联";
|
||||
this.BindGrid();
|
||||
this.Panel1.Title = "未使用项目";
|
||||
this.BindGrid2();
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 1)
|
||||
{
|
||||
this.Panel1.Title = "待建";
|
||||
this.BindGrid2();
|
||||
this.Panel1.Title = "已使用项目";
|
||||
this.BindGrid();
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 2)
|
||||
{
|
||||
this.Panel1.Title = "申请不用";
|
||||
this.Panel1.Title = "申请不用项目";
|
||||
this.BindGrid3();
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 3)
|
||||
{
|
||||
this.Panel1.Title = "预立项";
|
||||
this.BindGrid4();
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 4)
|
||||
{
|
||||
this.Panel1.Title = "数据汇总";
|
||||
this.BindGrid9();
|
||||
}
|
||||
//else if (TabStrip1.ActiveTabIndex == 3)
|
||||
//{
|
||||
// this.Panel1.Title = "预立项";
|
||||
// this.BindGrid4();
|
||||
//}
|
||||
//else if (TabStrip1.ActiveTabIndex == 4)
|
||||
//{
|
||||
// this.Panel1.Title = "自建";
|
||||
@@ -81,7 +82,152 @@ namespace FineUIPro.Web.ProjectData
|
||||
|
||||
#endregion
|
||||
|
||||
#region 已关联数据
|
||||
/// <summary>
|
||||
/// 合同额(亿)
|
||||
/// </summary>
|
||||
/// <param name="Ori_amt">合同含税金额原始存档(元)</param>
|
||||
/// <param name="Amt_add">增补合同本币含税金额(元)</param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertAmount(decimal? Ori_amt, decimal? Amt_add)
|
||||
{
|
||||
string result = string.Empty;
|
||||
Ori_amt = Ori_amt == null ? 0 : Ori_amt;
|
||||
Amt_add = Amt_add == null ? 0 : Amt_add;
|
||||
decimal? all = Amt_add + Ori_amt;
|
||||
if (all != null)
|
||||
{
|
||||
double amount = all == null ? 0 : (Math.Round((double)(all / 100000000m), 2));
|
||||
result = amount.ToString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#region 未使用项目——待建数据
|
||||
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid2()
|
||||
{
|
||||
var list = new List<MasterProjectDataInfo>();
|
||||
var db = Funs.DB;
|
||||
var query = (from x in masterProDatas
|
||||
join pro in db.Base_Project on x.Pro_id equals pro.MasterSysId into proGroup
|
||||
from pro in proGroup.DefaultIfEmpty()
|
||||
join use in db.Project_MasterDataUsage on x.Pro_id equals use.Pro_id into useGroup
|
||||
from use in useGroup.DefaultIfEmpty()
|
||||
where pro == null && (use == null || (use != null && (use.Reason == null || use.Reason == "")))
|
||||
select new MasterProjectDataInfo
|
||||
{
|
||||
//Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}|{(use != null ? use.Id : "")}",
|
||||
//Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}",
|
||||
Pid = x.Pro_id,
|
||||
Pro_id = x.Pro_id,
|
||||
Pro_Classify = "待建",
|
||||
Pro_name = x.Pro_name,
|
||||
Pro_code = x.Pro_code,
|
||||
Start_date = x.Start_date,
|
||||
Con_mode_desc = x.Con_mode_desc,
|
||||
Pro_nature = x.Pro_nature,
|
||||
Pro_status = x.Pro_status,
|
||||
Org_name = x.Org_name,
|
||||
Amount = ConvertAmount(x.Ori_amt_sum_vat_fc, x.Amt_add_sum_vat_fc_local)
|
||||
}).ToList();
|
||||
|
||||
string startDate = this.txtStartTime2.Text.Trim();
|
||||
string endDate = this.txtEndTime2.Text.Trim();
|
||||
if (!string.IsNullOrWhiteSpace(startDate))
|
||||
{
|
||||
query = query.Where(x => Funs.GetNewDateTime(x.Start_date) >= Funs.GetNewDateTime(startDate)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(endDate))
|
||||
{
|
||||
query = query.Where(x => Funs.GetNewDateTime(x.Start_date) <= Funs.GetNewDateTime(endDate)).ToList();
|
||||
}
|
||||
query = query.OrderByDescending(x => x.StartDate).ToList();
|
||||
list.AddRange(query);
|
||||
|
||||
string proName = this.txtProName2.Text.Trim();
|
||||
string proCode = this.txtProCode2.Text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(proName))
|
||||
{
|
||||
list = list.Where(x => x.Pro_name.Contains(proName)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(proCode))
|
||||
{
|
||||
list = list.Where(x => x.Pro_code.Contains(proCode)).ToList();
|
||||
}
|
||||
|
||||
DataTable tb = Funs.LINQToDataTable(list);
|
||||
Grid2.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid2, tb);
|
||||
Grid2.DataSource = table;
|
||||
Grid2.DataBind();
|
||||
|
||||
int totalNum = list.Count();
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfPageIndex", "合计");
|
||||
summary.Add("Pro_Classify", totalNum);
|
||||
summary.Add("Pro_name", $"待建:{totalNum}");
|
||||
|
||||
Grid2.SummaryData = summary;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Grid
|
||||
|
||||
protected void TextBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid2();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid2_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
this.BindGrid2();
|
||||
}
|
||||
|
||||
|
||||
protected void Grid2_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
this.BindGrid2();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
|
||||
/// <summary>
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("集团主数据在建项目数据分析(未使用项目)" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid2.PageSize = this.Grid2.RecordCount;
|
||||
this.BindGrid2();
|
||||
Response.Write(GetGridMultiHeaderTableHtml2(Grid2));
|
||||
//Response.Write(GetGridTableHtml(Grid2));
|
||||
Response.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 已使用项目——已关联和预立项项目
|
||||
|
||||
|
||||
#region 绑定数据
|
||||
@@ -97,13 +243,14 @@ namespace FineUIPro.Web.ProjectData
|
||||
from pro in proGroup.DefaultIfEmpty()
|
||||
//join use in db.Project_MasterDataUsage on x.Pro_id equals use.Pro_id into useGroup
|
||||
//from use in useGroup.DefaultIfEmpty()
|
||||
where pro != null && pro.MasterSysId != null
|
||||
where pro != null && pro.MasterSysId != null
|
||||
//&& pro.ProjectState == Const.ProjectState_1
|
||||
select new MasterProjectDataInfo
|
||||
{
|
||||
//Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}|{(use != null ? use.Id : "")}",
|
||||
Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}",
|
||||
Pro_id = x.Pro_id,
|
||||
Pro_Classify = "已关联",
|
||||
Pro_name = x.Pro_name,
|
||||
Pro_code = x.Pro_code,
|
||||
Start_date = x.Start_date,
|
||||
@@ -121,52 +268,37 @@ namespace FineUIPro.Web.ProjectData
|
||||
RelateName = pro != null && pro.MasterSysId != null ? "已关联" : "未关联",
|
||||
}).ToList();
|
||||
|
||||
query = query.OrderByDescending(x => x.StartDate).ToList();
|
||||
list.AddRange(query);
|
||||
|
||||
var projects = ProjectService.GetProjectWorkList();
|
||||
var listYulixiang = (from x in projects
|
||||
where x.MasterSysId == null
|
||||
select new MasterProjectDataInfo
|
||||
{
|
||||
Pid = x.ProjectId,
|
||||
ProjectId = x.ProjectId,
|
||||
Pro_Classify = "预立项",
|
||||
ProjectName = x.ProjectName,
|
||||
ProjectCode = x.ProjectCode,
|
||||
StartDate = x.StartDate,
|
||||
ProjectState = x.ProjectState,
|
||||
}).ToList();
|
||||
listYulixiang = listYulixiang.OrderByDescending(x => x.StartDate).ToList();
|
||||
list.AddRange(listYulixiang);
|
||||
|
||||
string startDate = this.txtStartTime.Text.Trim();
|
||||
string endDate = this.txtEndTime.Text.Trim();
|
||||
if (!string.IsNullOrWhiteSpace(startDate))
|
||||
{
|
||||
query = query.Where(x => Funs.GetNewDateTime(x.Start_date) >= Funs.GetNewDateTime(startDate)).ToList();
|
||||
list = list.Where(x => Funs.GetNewDateTime(x.Start_date) >= Funs.GetNewDateTime(startDate)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(endDate))
|
||||
{
|
||||
query = query.Where(x => Funs.GetNewDateTime(x.Start_date) <= Funs.GetNewDateTime(endDate)).ToList();
|
||||
list = list.Where(x => Funs.GetNewDateTime(x.Start_date) <= Funs.GetNewDateTime(endDate)).ToList();
|
||||
}
|
||||
query = query.OrderByDescending(x => x.StartDate).ToList();
|
||||
list.AddRange(query);
|
||||
|
||||
|
||||
////// 获取施工中的项目
|
||||
//getProjects = getProjects.Where(x => x.MasterSysId == null).OrderByDescending(x => x.StartDate).ToList();
|
||||
//foreach (var pro in getProjects)
|
||||
//{
|
||||
// list.Add(new MasterProjectDataInfo
|
||||
// {
|
||||
// Pid = $"|{pro.ProjectId}",
|
||||
// Pro_id = "",
|
||||
// Pro_name = "",
|
||||
// Pro_code = "",
|
||||
// Start_date = "",
|
||||
// Con_mode_desc = "",
|
||||
// Pro_nature = "",
|
||||
// Pro_status = "",
|
||||
// Org_name = "",
|
||||
// Amount = "",
|
||||
// ProjectId = pro != null ? pro.ProjectId : null,
|
||||
// ProjectName = pro != null ? pro.ProjectName : "",
|
||||
// ProjectCode = pro != null ? pro.ProjectCode : "",
|
||||
// StartDate = pro != null ? pro.StartDate : null,
|
||||
// ProjectState = pro != null ? pro.ProjectState : "",
|
||||
// Relate = 3,
|
||||
// RelateName = "未对应",
|
||||
// UseId = null,
|
||||
// //Use = use == null ? "" : (use != null && use.Is_use == true) ? "已使用" : "未使用",
|
||||
// ReasonType = "",
|
||||
// Reason = "",
|
||||
// //Situation = use != null ? use.Situation : "",
|
||||
// //Remark = use != null ? use.Remark : "",
|
||||
// });
|
||||
//}
|
||||
|
||||
string proName = this.txtProName.Text.Trim();
|
||||
string proCode = this.txtProCode.Text.Trim();
|
||||
string projectName = this.txtProjectName.Text.Trim();
|
||||
@@ -194,6 +326,9 @@ namespace FineUIPro.Web.ProjectData
|
||||
// list = list.Where(x => x.Relate == relate).ToList();
|
||||
//}
|
||||
|
||||
int yiGuanLianNum = list.Where(x => x.Pro_Classify == "已关联").Count();
|
||||
int yuLiXiangNum = list.Where(x => x.Pro_Classify == "预立项").Count();
|
||||
|
||||
DataTable tb = Funs.LINQToDataTable(list);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
@@ -203,31 +338,12 @@ namespace FineUIPro.Web.ProjectData
|
||||
int totalNum = list.Count();
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfNumber", "合计");
|
||||
summary.Add("Pro_name", totalNum);
|
||||
summary.Add("Pro_Classify", totalNum);
|
||||
summary.Add("Pro_name", $"已关联:{yiGuanLianNum};预立项:{yuLiXiangNum}");
|
||||
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合同额(亿)
|
||||
/// </summary>
|
||||
/// <param name="Ori_amt">合同含税金额原始存档(元)</param>
|
||||
/// <param name="Amt_add">增补合同本币含税金额(元)</param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertAmount(decimal? Ori_amt, decimal? Amt_add)
|
||||
{
|
||||
string result = string.Empty;
|
||||
Ori_amt = Ori_amt == null ? 0 : Ori_amt;
|
||||
Amt_add = Amt_add == null ? 0 : Amt_add;
|
||||
decimal? all = Amt_add + Ori_amt;
|
||||
if (all != null)
|
||||
{
|
||||
double amount = all == null ? 0 : (Math.Round((double)(all / 100000000m), 2));
|
||||
result = amount.ToString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目状态
|
||||
/// </summary>
|
||||
@@ -279,7 +395,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("集团主数据在建项目数据分析(正常)" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("集团主数据在建项目数据分析(已使用项目)" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = this.Grid1.RecordCount;
|
||||
@@ -292,128 +408,6 @@ namespace FineUIPro.Web.ProjectData
|
||||
|
||||
#endregion
|
||||
|
||||
#region 待建数据
|
||||
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid2()
|
||||
{
|
||||
var list = new List<MasterProjectDataInfo>();
|
||||
var db = Funs.DB;
|
||||
var query = (from x in masterProDatas
|
||||
join pro in db.Base_Project on x.Pro_id equals pro.MasterSysId into proGroup
|
||||
from pro in proGroup.DefaultIfEmpty()
|
||||
join use in db.Project_MasterDataUsage on x.Pro_id equals use.Pro_id into useGroup
|
||||
from use in useGroup.DefaultIfEmpty()
|
||||
where pro == null && (use == null || (use != null && (use.Reason == null || use.Reason == "")))
|
||||
select new MasterProjectDataInfo
|
||||
{
|
||||
//Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}|{(use != null ? use.Id : "")}",
|
||||
//Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}",
|
||||
Pid = x.Pro_id,
|
||||
Pro_id = x.Pro_id,
|
||||
Pro_name = x.Pro_name,
|
||||
Pro_code = x.Pro_code,
|
||||
Start_date = x.Start_date,
|
||||
Con_mode_desc = x.Con_mode_desc,
|
||||
Pro_nature = x.Pro_nature,
|
||||
Pro_status = x.Pro_status,
|
||||
Org_name = x.Org_name,
|
||||
Amount = ConvertAmount(x.Ori_amt_sum_vat_fc, x.Amt_add_sum_vat_fc_local)
|
||||
}).ToList();
|
||||
|
||||
string startDate = this.txtStartTime2.Text.Trim();
|
||||
string endDate = this.txtEndTime2.Text.Trim();
|
||||
if (!string.IsNullOrWhiteSpace(startDate))
|
||||
{
|
||||
query = query.Where(x => Funs.GetNewDateTime(x.Start_date) >= Funs.GetNewDateTime(startDate)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(endDate))
|
||||
{
|
||||
query = query.Where(x => Funs.GetNewDateTime(x.Start_date) <= Funs.GetNewDateTime(endDate)).ToList();
|
||||
}
|
||||
query = query.OrderByDescending(x => x.StartDate).ToList();
|
||||
list.AddRange(query);
|
||||
|
||||
string proName = this.txtProName2.Text.Trim();
|
||||
string proCode = this.txtProCode2.Text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(proName))
|
||||
{
|
||||
list = list.Where(x => x.Pro_name.Contains(proName)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(proCode))
|
||||
{
|
||||
list = list.Where(x => x.Pro_code.Contains(proCode)).ToList();
|
||||
}
|
||||
|
||||
DataTable tb = Funs.LINQToDataTable(list);
|
||||
Grid2.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid2, tb);
|
||||
Grid2.DataSource = table;
|
||||
Grid2.DataBind();
|
||||
|
||||
int totalNum = list.Count();
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfPageIndex", "合计");
|
||||
summary.Add("Pro_name", totalNum);
|
||||
|
||||
Grid2.SummaryData = summary;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Grid
|
||||
|
||||
protected void TextBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid2();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid2_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
this.BindGrid2();
|
||||
}
|
||||
|
||||
|
||||
protected void Grid2_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
this.BindGrid2();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
|
||||
/// <summary>
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("集团主数据在建项目数据分析(待建)" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid2.PageSize = this.Grid2.RecordCount;
|
||||
this.BindGrid2();
|
||||
Response.Write(GetGridMultiHeaderTableHtml2(Grid2));
|
||||
//Response.Write(GetGridTableHtml(Grid2));
|
||||
Response.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 申请不用数据
|
||||
|
||||
|
||||
@@ -430,13 +424,14 @@ namespace FineUIPro.Web.ProjectData
|
||||
from pro in proGroup.DefaultIfEmpty()
|
||||
join use in db.Project_MasterDataUsage on x.Pro_id equals use.Pro_id into useGroup
|
||||
from use in useGroup.DefaultIfEmpty()
|
||||
where pro == null && use != null && use.Reason != null && use.Reason != ""
|
||||
where pro == null && use != null && use.Is_use == false && use.Reason != null && use.Reason != ""
|
||||
select new MasterProjectDataInfo
|
||||
{
|
||||
//Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}|{(use != null ? use.Id : "")}",
|
||||
//Pid = $"{x.Pro_id}|{(pro != null ? $"{pro.ProjectId}" : "")}",
|
||||
Pid = x.Pro_id,
|
||||
Pro_id = x.Pro_id,
|
||||
Pro_Classify = use != null ? (use.ReasonType == "已完工" ? "已完工" : use.ReasonType == "停缓建" ? "停缓建" : "条件受限") : "",
|
||||
Pro_name = x.Pro_name,
|
||||
Pro_code = x.Pro_code,
|
||||
Start_date = x.Start_date,
|
||||
@@ -474,6 +469,10 @@ namespace FineUIPro.Web.ProjectData
|
||||
list = list.Where(x => x.Pro_code.Contains(proCode)).ToList();
|
||||
}
|
||||
|
||||
int yiWanGongNum = list.Where(x => x.Pro_Classify == "已完工").Count();
|
||||
int tingHuanJianNum = list.Where(x => x.Pro_Classify == "停缓建").Count();
|
||||
int tiaoJianShouXianNum = list.Where(x => x.Pro_Classify == "条件受限").Count();
|
||||
|
||||
DataTable tb = Funs.LINQToDataTable(list);
|
||||
Grid3.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid3, tb);
|
||||
@@ -483,7 +482,8 @@ namespace FineUIPro.Web.ProjectData
|
||||
int totalNum = list.Count();
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfPageNo", "合计");
|
||||
summary.Add("Pro_name", totalNum);
|
||||
summary.Add("Pro_Classify", totalNum);
|
||||
summary.Add("Pro_name", $"已完工:{yiWanGongNum};停缓建:{tingHuanJianNum};条件受限:{tiaoJianShouXianNum}");
|
||||
|
||||
Grid3.SummaryData = summary;
|
||||
}
|
||||
@@ -525,7 +525,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("集团主数据在建项目数据分析(申请不用)" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("集团主数据在建项目数据分析(申请不用项目)" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid3.PageSize = this.Grid3.RecordCount;
|
||||
@@ -538,115 +538,6 @@ namespace FineUIPro.Web.ProjectData
|
||||
|
||||
#endregion
|
||||
|
||||
#region 预立项数据
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid4()
|
||||
{
|
||||
//var list = new List<MasterProjectDataInfo>();
|
||||
var db = Funs.DB;
|
||||
var projects = ProjectService.GetProjectWorkList();
|
||||
var list = (from x in projects
|
||||
where x.MasterSysId == null
|
||||
select new MasterProjectDataInfo
|
||||
{
|
||||
Pid = x.ProjectId,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = x.ProjectName,
|
||||
ProjectCode = x.ProjectCode,
|
||||
StartDate = x.StartDate,
|
||||
ProjectState = x.ProjectState,
|
||||
}).ToList();
|
||||
|
||||
string projectName = this.txtProjectName4.Text.Trim();
|
||||
string projectCode = this.txtProjectCode4.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(projectName))
|
||||
{
|
||||
list = list.Where(x => x.ProjectName.Contains(projectName)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(projectCode))
|
||||
{
|
||||
list = list.Where(x => x.ProjectCode.Contains(projectCode)).ToList();
|
||||
}
|
||||
string startDate = this.txtStartTime4.Text.Trim();
|
||||
string endDate = this.txtEndTime4.Text.Trim();
|
||||
if (!string.IsNullOrWhiteSpace(startDate))
|
||||
{
|
||||
list = list.Where(x => x.StartDate >= Funs.GetNewDateTime(startDate)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(endDate))
|
||||
{
|
||||
list = list.Where(x => x.StartDate <= Funs.GetNewDateTime(endDate)).ToList();
|
||||
}
|
||||
//list = list.OrderByDescending(x => x.StartDate).ToList();
|
||||
//list.AddRange(query);
|
||||
|
||||
DataTable tb = Funs.LINQToDataTable(list);
|
||||
Grid4.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid4, tb);
|
||||
Grid4.DataSource = table;
|
||||
Grid4.DataBind();
|
||||
|
||||
int totalNum = list.Count();
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfPageNum", "合计");
|
||||
summary.Add("ProjectCode", totalNum);
|
||||
|
||||
Grid4.SummaryData = summary;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Grid
|
||||
|
||||
protected void TextBox4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid4();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid4_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
this.BindGrid4();
|
||||
}
|
||||
|
||||
|
||||
protected void Grid4_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
this.BindGrid4();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
|
||||
/// <summary>
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut4_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("集团主数据在建项目数据分析(预立项)" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid4.PageSize = this.Grid4.RecordCount;
|
||||
this.BindGrid4();
|
||||
Response.Write(GetGridMultiHeaderTableHtml2(Grid4));
|
||||
//Response.Write(GetGridTableHtml(Grid4));
|
||||
Response.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 数据汇总
|
||||
|
||||
@@ -657,8 +548,8 @@ namespace FineUIPro.Web.ProjectData
|
||||
private void BindGrid9()
|
||||
{
|
||||
var db = Funs.DB;
|
||||
var list = (from x in db.Project_MasterDataAnalysis
|
||||
orderby x.ReportDate descending,x.DataDate descending
|
||||
var list = (from x in db.View_Project_MasterDataAnalysis
|
||||
orderby x.ReportDate descending
|
||||
select x).ToList().Take(30);
|
||||
|
||||
string startDate = this.txtStartTime9.Text.Trim();
|
||||
@@ -746,7 +637,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
else
|
||||
{
|
||||
string message = string.Empty;
|
||||
string code = ProjectMasterDataAnalysisService.ReportProjectMasterDataAnalysis(this.CurrUser.UserName,ref message);
|
||||
string code = ProjectMasterDataAnalysisService.ReportProjectMasterDataAnalysis(this.CurrUser.UserName, ref message);
|
||||
if (code == "1")
|
||||
{
|
||||
this.BindGrid9();
|
||||
|
||||
Reference in New Issue
Block a user