From a82f96f3d2d2fc10478d20be47f855f691302f23 Mon Sep 17 00:00:00 2001 From: gaofei <181547018@qq.com> Date: Thu, 8 Jun 2023 20:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A9=BF=E9=80=8F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataShow/QualityAcceptance.aspx | 34 +++-- .../DataShow/QualityAcceptance.aspx.cs | 121 +++++++++++++++--- .../QualityAcceptance.aspx.designer.cs | 70 +++++++--- SGGL/FineUIPro.Web/ErrLog.txt | 37 ++++++ 4 files changed, 211 insertions(+), 51 deletions(-) diff --git a/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx b/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx index 5f9a72c3..e26aaeab 100644 --- a/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx +++ b/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx @@ -16,7 +16,7 @@ ShowHeader="true" Layout="VBox" BoxConfigAlign="Stretch"> @@ -61,18 +61,26 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.cs b/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.cs index c5467a88..e2b35a5e 100644 --- a/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.cs +++ b/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.cs @@ -30,32 +30,17 @@ namespace FineUIPro.Web.DataShow } #endregion - #region 加载页面 /// /// 绑定数据 /// private void BindGrid() { - string strSql = @"select NEWID() as ID, v.ProjectId,v.ProjectCode,v.ProjectName,v.allcount,v.ccount,isnull(v.allCount,0)-ISNULL(v.cCount,0) as ucCount, - (case when isnull(v.allCount,0) > 0 then cast(ISNULL(v.cCount,0) *1.0 /isnull(v.allCount,0)*100 as decimal(18, 2)) - else 0 end) as rateV - from (select B.ProjectId,p.ProjectCode,p.ProjectName,COUNT(*) as allCount, - isnull((select COUNT(*) - from ProcessControl_InspectionManagementDetail AS Detail - LEFT JOIN WBS_BreakdownProject AS Breakp ON Detail.ControlPointType=Breakp.BreakdownProjectId - LEFT JOIN ProcessControl_InspectionManagement AS Inspection ON Detail.InspectionId=Inspection.InspectionId - where Breakp.CheckAcceptType =@type AND Inspection.IsOnceQualified = 1 - group by Breakp.ProjectId),0) as cCount - FROM ProcessControl_InspectionManagementDetail AS A - LEFT JOIN WBS_BreakdownProject AS B ON A.ControlPointType=B.BreakdownProjectId - left join Base_Project as p on B.ProjectId=p.ProjectId - where p.projectId is not null AND B.CheckAcceptType =@type "; - + string strSql = @"select ProjectId,ProjectCode, ProjectName from Base_Project where ProjectState =1 "; List listStr = new List(); - listStr.Add(new SqlParameter("@type", this.rbType.SelectedValue)); + string cpara = string.Empty; if (this.drpProject.SelectedValue != Const._Null) { - strSql += " AND B.projectId = @projectId"; ///状态为已完成 + strSql += " AND projectId = @projectId"; ///状态为已完成 listStr.Add(new SqlParameter("@projectId", this.drpProject.SelectedValue)); } @@ -63,13 +48,17 @@ namespace FineUIPro.Web.DataShow //{ // strSql += " AND h.RegisterDate >=@StartTime"; // listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text)); + + // cpara += " AND c.RegisterDate >=" + this.txtStartTime.Text; //} //if (!string.IsNullOrEmpty(this.txtEndTime.Text)) //{ // strSql += " AND h.RegisterDate <=@EndTime"; // listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text)); + + // cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text; //} - strSql += " group by B.ProjectId,p.ProjectCode,p.ProjectName) as v"; + SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; @@ -77,7 +66,6 @@ namespace FineUIPro.Web.DataShow Grid1.DataSource = table; Grid1.DataBind(); } - #endregion #region 查询 /// @@ -133,5 +121,98 @@ namespace FineUIPro.Web.DataShow BindGrid(); } #endregion + + /// + /// 数量 + /// + /// + /// + protected int Count1(object projectId) + { + int cout1 = 0; + if (projectId != null) + { + var getT = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId + join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId + where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue + select x).Distinct().ToList(); + cout1 = getT.Count(); + } + return cout1; + } + + /// + /// 数量 + /// + /// + /// + protected int Count2(object projectId) + { + int cout1 = 0; + if (projectId != null) + { + var getT = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId + join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId + where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true + select x).Distinct().ToList(); + cout1 = getT.Count(); + } + return cout1; + } + + /// + /// 数量 + /// + /// + /// + protected int Count3(object projectId) + { + int cout1 = 0; + if (projectId != null) + { + var getT1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId + join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId + where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue + select x).Distinct().ToList(); + var getT2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId + join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId + where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true + select x).Distinct().ToList(); + cout1 = getT1.Count() - getT2.Count(); + } + return cout1; + } + + /// + /// 数量 + /// + /// + /// + protected string Count4(object projectId) + { + string rate = string.Empty; + if (projectId != null) + { + var getT1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId + join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId + where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue + select x).Distinct().ToList(); + var getT2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail + join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId + join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId + where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true + select x).Distinct().ToList(); + if (getT1.Count() > 0) + { + rate = Math.Round(getT2.Count() * 1.0 / getT1.Count() * 100, 2).ToString(); + } + } + return rate; + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.designer.cs index d628a759..7926e041 100644 --- a/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DataShow/QualityAcceptance.aspx.designer.cs @@ -7,13 +7,11 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.DataShow -{ - - - public partial class QualityAcceptance - { - +namespace FineUIPro.Web.DataShow { + + + public partial class QualityAcceptance { + /// /// form1 控件。 /// @@ -22,7 +20,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -31,7 +29,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -40,7 +38,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -49,7 +47,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -58,7 +56,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// drpProject 控件。 /// @@ -67,7 +65,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpProject; - + /// /// rbType 控件。 /// @@ -76,7 +74,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.RadioButtonList rbType; - + /// /// btnClose 控件。 /// @@ -85,7 +83,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnClose; - + /// /// labNumber 控件。 /// @@ -94,7 +92,43 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label labNumber; - + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label4; + /// /// ToolbarSeparator1 控件。 /// @@ -103,7 +137,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -112,7 +146,7 @@ namespace FineUIPro.Web.DataShow /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 6b37a6a2..14236d57 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -4159,3 +4159,40 @@ IP地址:::1 出错时间:06/07/2023 18:39:10 出错时间:06/07/2023 18:39:10 + +错误信息开始=====> +错误类型:SqlException +错误信息:列名 'isDelete' 无效。 +列名 'isDelete' 无效。 +错误堆栈: + 在 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.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) + 在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) + 在 BLL.SQLHelper.GetDataTableRunText(String strSql, SqlParameter[] parameters) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\SQLHelper.cs:行号 311 + 在 FineUIPro.Web.DataShow.QualityAcceptance.BindGrid() 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\DataShow\QualityAcceptance.aspx.cs:行号 63 + 在 FineUIPro.Web.DataShow.QualityAcceptance.Page_Load(Object sender, EventArgs e) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\DataShow\QualityAcceptance.aspx.cs:行号 27 + 在 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) +出错时间:06/08/2023 20:35:05 +出错文件:http://localhost:9733/DataShow/QualityAcceptance.aspx +IP地址:::1 + +出错时间:06/08/2023 20:35:05 + +