数据治理
This commit is contained in:
@@ -6,7 +6,6 @@ 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
|
||||
@@ -50,17 +49,17 @@ namespace FineUIPro.Web.ProjectData
|
||||
{
|
||||
if (TabStrip1.ActiveTabIndex == 0)
|
||||
{
|
||||
this.Panel1.Title = "未使用项目";
|
||||
this.BindGrid2();
|
||||
this.Panel1.Title = "已上线项目";
|
||||
this.BindGrid();
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 1)
|
||||
{
|
||||
this.Panel1.Title = "已使用项目";
|
||||
this.BindGrid();
|
||||
this.Panel1.Title = "未上线项目";
|
||||
this.BindGrid2();
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 2)
|
||||
{
|
||||
this.Panel1.Title = "申请不用项目";
|
||||
this.Panel1.Title = "申请关闭项目";
|
||||
this.BindGrid3();
|
||||
}
|
||||
else if (TabStrip1.ActiveTabIndex == 3)
|
||||
@@ -102,132 +101,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
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 已上线项目——已关联和待关联(预立项)项目
|
||||
|
||||
|
||||
#region 绑定数据
|
||||
@@ -278,7 +152,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
{
|
||||
Pid = x.ProjectId,
|
||||
ProjectId = x.ProjectId,
|
||||
Pro_Classify = "预立项",
|
||||
Pro_Classify = "待关联",
|
||||
ProjectName = x.ProjectName,
|
||||
ProjectCode = x.ProjectCode,
|
||||
StartDate = x.StartDate,
|
||||
@@ -327,7 +201,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
//}
|
||||
|
||||
int yiGuanLianNum = list.Where(x => x.Pro_Classify == "已关联").Count();
|
||||
int yuLiXiangNum = 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;
|
||||
@@ -339,7 +213,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfNumber", "合计");
|
||||
summary.Add("Pro_Classify", totalNum);
|
||||
summary.Add("Pro_name", $"已关联:{yiGuanLianNum};预立项:{yuLiXiangNum}");
|
||||
summary.Add("Pro_name", $"已关联:{yiGuanLianNum};待关联:{yuLiXiangNum}");
|
||||
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
@@ -395,7 +269,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;
|
||||
@@ -408,7 +282,138 @@ namespace FineUIPro.Web.ProjectData
|
||||
|
||||
#endregion
|
||||
|
||||
#region 申请不用数据
|
||||
|
||||
#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.ReasonType == null || use.ReasonType == "停缓建" || use.ReasonType == "条件受限")))
|
||||
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 != null && (use.ReasonType == null))) ? "待上线" : use.ReasonType,
|
||||
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),
|
||||
ReasonType = use != null ? use.ReasonType : "",
|
||||
Reason = use != null ? use.Reason : "",
|
||||
}).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();
|
||||
int daiShangXianNum = 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();
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfPageIndex", "合计");
|
||||
summary.Add("Pro_Classify", totalNum);
|
||||
summary.Add("Pro_name", $"待上线:{daiShangXianNum};停缓建:{tingHuanJianNum};条件受限:{tiaoJianShouXianNum}");
|
||||
|
||||
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 绑定数据
|
||||
@@ -424,14 +429,15 @@ 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.Is_use == false && use.Reason != null && use.Reason != ""
|
||||
where pro == null && use != null && use.Is_use == false && use.ReasonType != null && use.ReasonType != "停缓建" && use.ReasonType != "条件受限"
|
||||
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_Classify = use != null ? (use.ReasonType == "已完工/撤场" ? "已完工/撤场" : use.ReasonType == "停缓建" ? "停缓建" : use.ReasonType == "不适用" ? "不适用" : "条件受限") : "",
|
||||
Pro_Classify = use != null ? use.ReasonType : "",
|
||||
Pro_name = x.Pro_name,
|
||||
Pro_code = x.Pro_code,
|
||||
Start_date = x.Start_date,
|
||||
@@ -469,9 +475,6 @@ 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;
|
||||
@@ -480,10 +483,13 @@ namespace FineUIPro.Web.ProjectData
|
||||
Grid3.DataBind();
|
||||
|
||||
int totalNum = list.Count();
|
||||
int yiWanGongNum = list.Where(x => x.Pro_Classify == "已完工/撤场").Count();
|
||||
int buShiYong = list.Where(x => x.Pro_Classify == "不适用").Count();
|
||||
|
||||
JObject summary = new JObject();
|
||||
summary.Add("tfPageNo", "合计");
|
||||
summary.Add("Pro_Classify", totalNum);
|
||||
summary.Add("Pro_name", $"已完工:{yiWanGongNum};停缓建:{tingHuanJianNum};条件受限:{tiaoJianShouXianNum}");
|
||||
summary.Add("Pro_name", $"已完工/撤场:{yiWanGongNum};不适用:{buShiYong};");
|
||||
|
||||
Grid3.SummaryData = summary;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user