From 68c7b95405e3231f471464c15b86fdefe8840e59 Mon Sep 17 00:00:00 2001
From: panhf <754998852@qq.com>
Date: Fri, 2 Feb 2024 16:23:51 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E4=BA=A4=E9=80=92=E5=A2=9E=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
SGGL/BLL/Common/ChartControlService.cs | 44 +
.../Controls/ChartControl.ascx.cs | 142 ++
SGGL/FineUIPro.Web/ErrLog.txt | 40 +
.../Transfer/Chart/TransferChart.aspx | 6 +-
.../Transfer/Chart/TransferChart.aspx.cs | 1654 ++++++++++++++++-
.../Chart/TransferChart.aspx.designer.cs | 9 +
SGGL/FineUIPro.Web/common/Menu_HSSE.xml | 4 +-
SGGL/FineUIPro.Web/common/Menu_SysSet.xml | 1 -
SGGL/FineUIPro.Web/common/Menu_TestRun.xml | 4 +-
SGGL/FineUIPro.Web/common/Menu_Transfer.xml | 1 +
10 files changed, 1887 insertions(+), 18 deletions(-)
diff --git a/SGGL/BLL/Common/ChartControlService.cs b/SGGL/BLL/Common/ChartControlService.cs
index 32096b9d..e022e9fc 100644
--- a/SGGL/BLL/Common/ChartControlService.cs
+++ b/SGGL/BLL/Common/ChartControlService.cs
@@ -109,5 +109,49 @@
return chart;
}
#endregion
+
+ ///
+ /// 给chart类赋值
+ ///
+ /// 数据源表值
+ /// 图标题
+ /// 图类型
+ /// 图显示宽度
+ /// 图显示高度
+ /// 是否显示3D效果
+ /// 返回图
+ public static Model.DataSourceChart GetDataSourceChartByYijiao(DataTable dt, string title, string type, int width, int height, bool isNotEnable3D)
+ {
+ Model.DataSourceChart dataSourceChart = new Model.DataSourceChart
+ {
+ Width = width,
+ Height = height,
+ Title = title,
+ IsNotEnable3D = isNotEnable3D,
+ ChartType = GetChartType(type)
+ };
+ List dataSourceTeams = new List();
+ for (int i = 1; i < dt.Columns.Count; i++)
+ {
+ Model.DataSourceTeam dataSourceTeam = new Model.DataSourceTeam
+ {
+ DataPointName = dt.Columns[i].ToString()
+ };
+ List dataSourcePoints = new List();
+ for (int j = 0; j < dt.Rows.Count; j++)
+ {
+ Model.DataSourcePoint dataSourcePoint = new Model.DataSourcePoint
+ {
+ PointText = dt.Rows[j][0].ToString(),
+ PointValue = dt.Rows[j][i].ToString()
+ };
+ dataSourcePoints.Add(dataSourcePoint);
+ }
+ dataSourceTeam.DataSourcePoints = dataSourcePoints;
+ dataSourceTeams.Add(dataSourceTeam);
+ }
+ dataSourceChart.DataSourceTeams = dataSourceTeams;
+ return dataSourceChart;
+ }
}
}
diff --git a/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs b/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs
index cb6c6d73..e0fc300b 100644
--- a/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs
+++ b/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs
@@ -282,5 +282,147 @@ namespace Web.Controls
Controls.Add(chart1);
}
+
+ ///
+ /// 创建Chart图形百分比
+ ///
+ /// Chart类
+ public void CreateChartBaifenbi(Model.DataSourceChart dataSourceChart)
+ {
+ Chart chart1 = new Chart
+ {
+ ID = "chart1",
+ BackColor = Color.WhiteSmoke,
+ ImageLocation = "~/Images/ChartPic_#SEQ(300,3)",
+ BorderlineDashStyle = ChartDashStyle.Solid,
+ Palette = ChartColorPalette.BrightPastel,
+ BackSecondaryColor = Color.White,
+ BackGradientStyle = GradientStyle.TopBottom,
+ BorderWidth = 2,
+ BorderColor = Color.FromArgb(26, 59, 105),
+ ImageType = ChartImageType.Png,
+
+ Width = dataSourceChart.Width,
+ Height = dataSourceChart.Height
+ };
+
+ Title title = new Title
+ {
+ Text = dataSourceChart.Title,
+ ShadowColor = Color.FromArgb(32, 0, 0, 0),
+ Font = new Font("Trebuchet MS", 10F, FontStyle.Bold),
+ ShadowOffset = 3,
+ ForeColor = Color.FromArgb(26, 59, 105)
+ };
+ chart1.Titles.Add(title);
+
+ Legend legend = new Legend
+ {
+ Name = dataSourceChart.Title,
+ TextWrapThreshold = 1,
+ Docking = Docking.Top,
+ Alignment = StringAlignment.Center,
+ BackColor = Color.Transparent,
+ Font = new Font(new FontFamily("Trebuchet MS"), 8),
+ LegendStyle = LegendStyle.Row,
+ IsEquallySpacedItems = true,
+ IsTextAutoFit = false
+ };
+ chart1.Legends.Add(legend);
+
+ ChartArea chartArea = new ChartArea
+ {
+ Name = dataSourceChart.Title,
+ BackColor = Color.Transparent
+ };
+ chartArea.AxisX.IsLabelAutoFit = false;
+ chartArea.AxisY.IsLabelAutoFit = false;
+ chartArea.AxisX.LabelStyle.Font = new Font("Verdana,Arial,Helvetica,sans-serif", 8F, FontStyle.Regular);
+ chartArea.AxisY.LabelStyle.Font = new Font("Verdana,Arial,Helvetica,sans-serif", 8F, FontStyle.Regular);
+ chartArea.AxisY.LineColor = Color.FromArgb(64, 64, 64, 64);
+ chartArea.AxisX.LineColor = Color.FromArgb(64, 64, 64, 64);
+ chartArea.AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
+ chartArea.AxisX.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
+ chartArea.AxisX.Interval = 1;
+ chartArea.Area3DStyle.Enable3D = dataSourceChart.IsNotEnable3D;
+
+ chartArea.AxisY.LabelStyle.Format = " 0% "; // 格式化,为了显示百分号
+
+
+ chart1.ChartAreas.Add(chartArea);
+
+ if (dataSourceChart.ChartType == SeriesChartType.Pie)
+ {
+ foreach (Model.DataSourceTeam dataSourceTeam in dataSourceChart.DataSourceTeams)
+ {
+ this.lblTotal.Text = "累计值为:";
+ if (dataSourceTeam.DataPointName == "累计")
+ {
+ foreach (Model.DataSourcePoint dataSourcePoint in dataSourceTeam.DataSourcePoints)
+ {
+ this.lblTotal.Text += (dataSourcePoint.PointText + ":" + dataSourcePoint.PointValue + ",");
+ }
+ if (this.lblTotal.Text != "累计值为:")
+ {
+ this.lblTotal.Text = this.lblTotal.Text.Substring(0, this.lblTotal.Text.LastIndexOf(","));
+ }
+ }
+ else
+ {
+ this.lblTotal.Visible = false;
+ chart1.Series.Add(dataSourceTeam.DataPointName);
+ chart1.Series[dataSourceTeam.DataPointName].ChartType = dataSourceChart.ChartType;
+ chart1.Series[dataSourceTeam.DataPointName].Name = dataSourceTeam.DataPointName;
+ chart1.Series[dataSourceTeam.DataPointName].IsValueShownAsLabel = true;
+ chart1.Series[dataSourceTeam.DataPointName].BorderWidth = 2;
+ chart1.Series[dataSourceTeam.DataPointName].Label = "#PERCENT{P1}";
+ chart1.Series[dataSourceTeam.DataPointName]["DrawingStyle"] = "Cylinder";
+ int m = 0;
+ foreach (Model.DataSourcePoint dataSourcePoint in dataSourceTeam.DataSourcePoints)
+ {
+ chart1.Series[dataSourceTeam.DataPointName].Points.AddXY(dataSourcePoint.PointText, dataSourcePoint.PointValue);
+ chart1.Series[dataSourceTeam.DataPointName].Points[m].LegendText = dataSourcePoint.PointText + "#PERCENT{P1}";
+ m++;
+ }
+ }
+ }
+ }
+ else
+ {
+ foreach (Model.DataSourceTeam dataSourceTeam in dataSourceChart.DataSourceTeams)
+ {
+ this.lblTotal.Text = "累计值为:";
+ if (dataSourceTeam.DataPointName == "累计")
+ {
+ foreach (Model.DataSourcePoint dataSourcePoint in dataSourceTeam.DataSourcePoints)
+ {
+ this.lblTotal.Text += (dataSourcePoint.PointText + ":" + dataSourcePoint.PointValue + ",");
+ }
+ if (this.lblTotal.Text != "累计值为:")
+ {
+ this.lblTotal.Text = this.lblTotal.Text.Substring(0, this.lblTotal.Text.LastIndexOf(","));
+ }
+ }
+ else
+ {
+ this.lblTotal.Visible = false;
+ chart1.Series.Add(dataSourceTeam.DataPointName);
+ chart1.Series[dataSourceTeam.DataPointName].ChartType = dataSourceChart.ChartType;
+ chart1.Series[dataSourceTeam.DataPointName].Name = dataSourceTeam.DataPointName;
+ chart1.Series[dataSourceTeam.DataPointName].IsValueShownAsLabel = true;
+ chart1.Series[dataSourceTeam.DataPointName].BorderWidth = 2;
+ chart1.Series[dataSourceTeam.DataPointName]["DrawingStyle"] = "Cylinder";
+
+ chart1.Series[dataSourceTeam.DataPointName].Label = "#VAL{P}";//设置标签文本 (在设计期通过属性窗口编辑更直观)
+ chart1.Series[dataSourceTeam.DataPointName].IsValueShownAsLabel = true;//显示标签
+ foreach (Model.DataSourcePoint dataSourcePoint in dataSourceTeam.DataSourcePoints)
+ {
+ chart1.Series[dataSourceTeam.DataPointName].Points.AddXY(dataSourcePoint.PointText, dataSourcePoint.PointValue);
+ }
+ }
+ }
+ }
+ Controls.Add(chart1);
+ }
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt
index e69de29b..4d24ae20 100644
--- a/SGGL/FineUIPro.Web/ErrLog.txt
+++ b/SGGL/FineUIPro.Web/ErrLog.txt
@@ -0,0 +1,40 @@
+
+错误信息开始=====>
+错误类型:SqlException
+错误信息:执行超时已过期。完成操作之前已超时或服务器未响应。
+错误堆栈:
+ 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
+ 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
+ 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
+ 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
+ 在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
+ 在 System.Data.SqlClient.SqlDataReader.get_MetaData()
+ 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
+ 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
+ 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
+ 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
+ 在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
+ 在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
+ 在 System.Data.Common.DbCommand.ExecuteReader()
+ 在 System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
+ 在 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
+ 在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
+ 在 System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
+ 在 System.Linq.Queryable.Count[TSource](IQueryable`1 source)
+ 在 FineUIPro.Web.common.main_new.Page_Load(Object sender, EventArgs e) 位置 E:\2023公司项目\五环新\CNCEC_SUBQHSE_WUHUAN\SGGL\FineUIPro.Web\common\main_new.aspx.cs:行号 67
+ 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
+ 在 System.EventHandler.Invoke(Object sender, EventArgs e)
+ 在 System.Web.UI.Control.OnLoad(EventArgs e)
+ 在 System.Web.UI.Control.LoadRecursive()
+ 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+----错误类型:Win32Exception
+----错误信息:
+----等待的操作过时。
+----错误堆栈:
+ 出错时间:02/02/2024 11:24:03
+出错文件:http://localhost:8579/common/main_new.aspx
+IP地址:::1
+操作人员:JT
+
+出错时间:02/02/2024 11:24:12
+
diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx b/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx
index 8b66772e..9a83c9cc 100644
--- a/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx
+++ b/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx
@@ -1,5 +1,5 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TransferChart.aspx.cs" Inherits="FineUIPro.Web.Transfer.Chart.TransferChart" %>
-
+<%@ Register Src="~/Controls/ChartControl.ascx" TagName="ChartControl" TagPrefix="uc1" %>
@@ -74,9 +74,9 @@
TabPosition="Top" MarginBottom="5px" EnableTabCloseMenu="false" runat="server">
+ runat="server" TitleToolTip="图表">
-
+
diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.cs
index 99add796..0e62c056 100644
--- a/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.cs
+++ b/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.cs
@@ -78,6 +78,7 @@ namespace FineUIPro.Web.Transfer.Chart
}
var AfinishedCountSum = 0;//总的实际完成数量
var PfinishedCountSum = 0;//总的计划完成数量
+ //获取总的实际完成数量和总的计划完成数量
switch (drpType.SelectedValue)
{
#region 全部
@@ -85,7 +86,7 @@ namespace FineUIPro.Web.Transfer.Chart
//根据当前计划完成日期 查询总的计划完成的数量
var systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId
&& x.FDate >= sTime
- && x.FDate < eTime
+ && x.FDate <= eTime
&& x.Status.ToLower() == "finished").ToList();
//查询TestPackage 去重
var testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct();
@@ -112,17 +113,725 @@ namespace FineUIPro.Web.Transfer.Chart
}
-
+ //获取当前日期内实际完成的数量
+ systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId
+ && x.ADate >= sTime
+ && x.ADate <= eTime
+ && x.Status.ToLower() == "finished").ToList();
+ testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+
+ #region Piping
+
+
+ case "Piping":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate1 = Funs.DB.Transfer_Piping.Where(x => x.ProjectId == ProjectId
+ && x.TestPackageFINISH >= sTime
+ && x.TestPackageFINISH <= eTime
+ && x.FINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate1 select x.TestPackage).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate1 = Funs.DB.Transfer_Piping.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINALStatus.ToLower() == "finished").ToList();
+ testpackageList = (from x in systemListbyDate1 select x.TestPackage).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Static Equipment
+
+
+ case "Static Equipment":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate2 = Funs.DB.Transfer_StaticEquipment.Where(x => x.ProjectId == ProjectId
+ && x.TestPackageFINISH >= sTime
+ && x.TestPackageFINISH <= eTime
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate2 select x.TestPackage).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate2=Funs.DB.Transfer_StaticEquipment.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+ testpackageList = (from x in systemListbyDate2 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Rotating Equipment
+
+
+ case "Rotating Equipment":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate3 = Funs.DB.Transfer_RotatingEquipment.Where(x => x.ProjectId == ProjectId
+ && x.TestPackageFINISH >= sTime
+ && x.TestPackageFINISH <= eTime
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate3 select x.TestPackage).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate3 = Funs.DB.Transfer_RotatingEquipment.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate3 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Instrumentation
+
+
+ case "Instrumentation":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate4 = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate4 select x.Test_Package).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate4 = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate4 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Electrical
+
+
+ case "Electrical":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate5 = Funs.DB.Transfer_Electrical.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate5 select x.Test_Package).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate5 = Funs.DB.Transfer_Electrical.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate5 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Civil Structure
+
+
+ case "Civil Structure":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate6 = Funs.DB.Transfer_Civil_Structure.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate6 select x.Test_Package).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate6 = Funs.DB.Transfer_Civil_Structure.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate6 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Firefighting
+
+
+ case "Firefighting":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate7 = Funs.DB.Transfer_Firefighting.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate7 select x.Test_Package).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate7 = Funs.DB.Transfer_Firefighting.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate7 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Telecom
+
+
+ case "Telecom":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate8 = Funs.DB.Transfer_Telecom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate8 select x.Test_Package).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate8 = Funs.DB.Transfer_Telecom.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate8 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region Plumbing
+
+
+ case "Plumbing":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate9 = Funs.DB.Transfer_Plumbing.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate9 select x.Test_Package).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate9 = Funs.DB.Transfer_Plumbing.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate9 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
+ break;
+ #endregion
+ #region HVAC
+
+
+ case "HVAC":
+ //根据当前计划完成日期 查询总的计划完成的数量
+ var systemListbyDate10 = Funs.DB.Transfer_HVAC.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage 去重
+ testpackageList = (from x in systemListbyDate10 select x.Test_Package).Distinct();
+
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ PfinishedCountSum += 1;
+ }
+
+ }
+
+ //获取当前日期内实际完成的数量
+ systemListbyDate10 = Funs.DB.Transfer_HVAC.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime <= eTime
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+
+ testpackageList = (from x in systemListbyDate10 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCountSum += 1;
+ }
+ }
+ else
+ {
+ AfinishedCountSum += 1;
+ }
+
+ }
break;
#endregion
-
}
DataTable dtTime = new DataTable();
dtTime.Columns.Add("日期", typeof(string));
- dtTime.Columns.Add("Actual Finished", typeof(string));
- dtTime.Columns.Add("Plan Finished", typeof(string));
+ dtTime.Columns.Add("Actual Finished(%)", typeof(string));
+ dtTime.Columns.Add("Plan Finished(%)", typeof(string));
for (var i = sTime; i <= eTime; i = i.AddMonths(1)) {
var AfinishedCount = 0;//实际完成数量
@@ -133,22 +842,949 @@ namespace FineUIPro.Web.Transfer.Chart
{
#region 全部
case "":
+ //递增形式,开始日期就是选中的开始日期
//根据当前计划完成日期 查询完成的数量
var systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId
- && x.FDate >= Convert.ToDateTime(rowTime["日期"])
+ && x.FDate >= sTime
&& x.FDate < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
&& x.Status.ToLower()== "finished").ToList();
//查询TestPackage的总数量,状态是完成的。
var testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct();
- foreach (var item in testpackageList) {
-
+ foreach (var item in testpackageList) {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
}
- break;
+ //完成的数量:xx完成/总的完成 *100
+ var Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount==0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId
+ && x.ADate >= sTime
+ && x.ADate < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ var Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ if (AfinishedCount==0)
+ {
+ Acount = 0;
+ }
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ continue;
#endregion
+ #region Piping
+ case "Piping":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate1 = Funs.DB.Transfer_Piping.Where(x => x.ProjectId == ProjectId
+ && x.TestPackageFINISH >= sTime
+ && x.TestPackageFINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate1 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate1 = Funs.DB.Transfer_Piping.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate1 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+
+ continue;
+ #endregion
+
+ #region Static Equipment
+ case "Static Equipment":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate2 = Funs.DB.Transfer_StaticEquipment.Where(x => x.ProjectId == ProjectId
+ && x.TestPackageFINISH >= sTime
+ && x.TestPackageFINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate2 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate2 = Funs.DB.Transfer_StaticEquipment.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate2 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region Rotating Equipment
+ case "Rotating Equipment":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate3 = Funs.DB.Transfer_RotatingEquipment.Where(x => x.ProjectId == ProjectId
+ && x.TestPackageFINISH >= sTime
+ && x.TestPackageFINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate3 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate3 = Funs.DB.Transfer_RotatingEquipment.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.MechanicalFINALStatus.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate3 select x.TestPackage).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region Instrumentation
+ case "Transfer_Instrumentation":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate4 = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate4 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate4 = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate4 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region Electrical
+ case "Electrical":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate5 = Funs.DB.Transfer_Electrical.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate5 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate5 = Funs.DB.Transfer_Electrical.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate5 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region Civil Structure
+ case "Civil Structure":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate6 = Funs.DB.Transfer_Civil_Structure.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate6 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate6 = Funs.DB.Transfer_Civil_Structure.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate6 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region Firefighting
+ case "Firefighting":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate8 = Funs.DB.Transfer_Firefighting.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate8 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate8 = Funs.DB.Transfer_Firefighting.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate8 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region Telecom
+ case "Telecom":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate9 = Funs.DB.Transfer_Telecom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate9 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate9 = Funs.DB.Transfer_Telecom.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate9 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region Plumbing
+ case "Plumbing":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate10 = Funs.DB.Transfer_Plumbing.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate10 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate10 = Funs.DB.Transfer_Plumbing.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate10 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
+ #region HVAC
+ case "HVAC":
+ //递增形式,开始日期就是选中的开始日期
+ //根据当前计划完成日期 查询完成的数量
+ var systemListbyDate11 = Funs.DB.Transfer_HVAC.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package_FINISH >= sTime
+ && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate11 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ PfinishedCount += 1;
+ }
+ }
+ else
+ {
+ PfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ Pcount = ((Convert.ToDouble(PfinishedCount) / Convert.ToDouble(PfinishedCountSum)));
+ if (PfinishedCount == 0)
+ {
+ Pcount = 0;
+ }
+ rowTime["Plan Finished(%)"] = Pcount;
+
+
+ //实际的完成数量
+ systemListbyDate11 = Funs.DB.Transfer_HVAC.Where(x => x.ProjectId == ProjectId
+ && x.CompleteTime >= sTime
+ && x.CompleteTime < Convert.ToDateTime(rowTime["日期"]).AddMonths(1)
+ && x.FINAL_Status.ToLower() == "finished").ToList();
+ //查询TestPackage的总数量,状态是完成的。
+ testpackageList = (from x in systemListbyDate11 select x.Test_Package).Distinct();
+ foreach (var item in testpackageList)
+ {
+ //查询第12个表的数量
+ var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
+ && x.Test_Package == item
+ ).ToList();
+ //如果查到
+ if (punchlistFromList.Count > 0)
+ {
+ //12表当前日期完成的数量
+ var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
+ //如果完成的数量等于总得数量,则是完成
+ if (punchlistFromFinshCount == punchlistFromList.Count)
+ {
+ AfinishedCount += 1;
+ }
+ }
+ else
+ {
+ AfinishedCount += 1;
+ }
+ }
+ //完成的数量:xx完成/总的完成 *100
+ if (AfinishedCount == 0)
+ {
+ Acount = 0;
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ else
+ {
+ Acount = ((Convert.ToDouble(AfinishedCount) / Convert.ToDouble(AfinishedCountSum)));
+ rowTime["Actual Finished(%)"] = Acount;
+ dtTime.Rows.Add(rowTime);
+ }
+ continue;
+ #endregion
+
}
+
}
+ this.ChartUc.CreateChartBaifenbi(BLL.ChartControlService.GetDataSourceChartByYijiao(dtTime, "PROGRESS REPORT", "Line", 1100, 600, false));
}
#endregion
}
diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.designer.cs
index dcc82d4a..0576a553 100644
--- a/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/Transfer/Chart/TransferChart.aspx.designer.cs
@@ -130,5 +130,14 @@ namespace FineUIPro.Web.Transfer.Chart
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ContentPanel cpCostTime;
+
+ ///
+ /// ChartUc 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::Web.Controls.ChartControl ChartUc;
}
}
diff --git a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml
index 1544f676..f3c15865 100644
--- a/SGGL/FineUIPro.Web/common/Menu_HSSE.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_HSSE.xml
@@ -20,7 +20,7 @@
-
+
@@ -153,7 +153,7 @@
-
+
diff --git a/SGGL/FineUIPro.Web/common/Menu_SysSet.xml b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml
index 51a57bc0..753efb73 100644
--- a/SGGL/FineUIPro.Web/common/Menu_SysSet.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_SysSet.xml
@@ -24,7 +24,6 @@
-
diff --git a/SGGL/FineUIPro.Web/common/Menu_TestRun.xml b/SGGL/FineUIPro.Web/common/Menu_TestRun.xml
index 08203a41..a8df02b8 100644
--- a/SGGL/FineUIPro.Web/common/Menu_TestRun.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_TestRun.xml
@@ -44,6 +44,7 @@
+
@@ -60,16 +61,13 @@
-
-
-
diff --git a/SGGL/FineUIPro.Web/common/Menu_Transfer.xml b/SGGL/FineUIPro.Web/common/Menu_Transfer.xml
index 0cc40f8e..5180b459 100644
--- a/SGGL/FineUIPro.Web/common/Menu_Transfer.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_Transfer.xml
@@ -14,6 +14,7 @@
+
\ No newline at end of file