From 183af3a610eedd18a016bd4418937dd308470f5e Mon Sep 17 00:00:00 2001 From: panhf <754998852@qq.com> Date: Tue, 30 Jan 2024 16:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=8E=82=E7=A7=BB=E4=BA=A4=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/FineUIPro.Web/ErrLog.txt | 123 ++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user | 2 +- .../Transfer/Chart/Instrumentation.aspx | 27 +- .../Transfer/Chart/Instrumentation.aspx.cs | 268 +++++++++++++----- .../Chart/Instrumentation.aspx.designer.cs | 4 +- .../Transfer/CivilStructureDataIn.aspx.cs | 71 ++--- .../Transfer/ElectricalDataIn.aspx.cs | 71 ++--- .../Transfer/FirefightingDataIn.aspx.cs | 69 ++--- .../FineUIPro.Web/Transfer/HVACDataIn.aspx.cs | 71 ++--- .../Transfer/InstrumentationDataIn.aspx.cs | 74 ++--- .../Transfer/PlumbingDataIn.aspx.cs | 71 ++--- .../Transfer/PunchlistFromDataIn.aspx.cs | 95 ++++--- .../Transfer/TelecomDataIn.aspx.cs | 71 ++--- SGGL/FineUIPro.Web/Web.config | 4 +- SGGL/WebAPI/WebAPI.csproj.user | 2 +- 15 files changed, 650 insertions(+), 373 deletions(-) diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 6e590a65..8dcb5402 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -755,3 +755,126 @@ IP地址:::1 出错时间:01/29/2024 15:51:59 出错时间:01/29/2024 15:51:59 + +错误信息开始=====> +错误类型:HttpCompileException +错误信息:e:\2023公司项目\五环新\CNCEC_SUBQHSE_WUHUAN\SGGL\FineUIPro.Web\Transfer\Chart\Instrumentation.aspx(66): error CS0123: “tvControlItem_NodeCommand”的重载均与委托“System.EventHandler”不匹配 +错误堆栈: + 在 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) + 在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) + 在 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) + 在 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) + 在 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) + 在 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) + 在 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) + 在 System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) + 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +出错时间:01/30/2024 10:25:17 +出错文件:http://localhost:8579/Transfer/Chart/Instrumentation.aspx +IP地址:::1 + +出错时间:01/30/2024 10:25:18 + + +错误信息开始=====> +错误类型:HttpParseException +错误信息:FineUIPro.RegionCollection 必须具有类型为“FineUIPro.Region”的项。“f:Tree”的类型为“FineUIPro.Tree”。 +错误堆栈: + 在 System.Web.UI.TemplateParser.ProcessException(Exception ex) + 在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) + 在 System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) +----错误类型:HttpException +----错误信息: +----FineUIPro.RegionCollection 必须具有类型为“FineUIPro.Region”的项。“f:Tree”的类型为“FineUIPro.Tree”。 +----错误堆栈: + 在 System.Web.UI.CollectionBuilder.GetChildControlType(String tagName, IDictionary attribs) + 在 System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) + 在 System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) + 在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) +出错时间:01/30/2024 10:33:19 +出错文件:http://localhost:8579/Transfer/Chart/Instrumentation.aspx +IP地址:::1 + +出错时间:01/30/2024 10:33:19 + + +错误信息开始=====> +错误类型: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 +----错误信息: +----等待的操作过时。 +----错误堆栈: + 出错时间:01/30/2024 10:40:32 +出错文件:http://localhost:8579/common/main_new.aspx +IP地址:127.0.0.1 +操作人员:JT + +出错时间:01/30/2024 10:40:32 + + +错误信息开始=====> +错误类型: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 +----错误信息: +----等待的操作过时。 +----错误堆栈: + 出错时间:01/30/2024 10:41:13 +出错文件:http://localhost:8579/common/main_new.aspx +IP地址:127.0.0.1 +操作人员:JT + +出错时间:01/30/2024 10:41:13 + diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user index f8ca7c7a..c4484e3e 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true false diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx b/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx index b8290120..05366324 100644 --- a/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx @@ -5,12 +5,12 @@ - +
- + @@ -22,7 +22,7 @@ - + --%> + + @@ -62,11 +64,22 @@ - - + + <%-- + --%> + <%-- + --%> + - + + diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.cs index e6051bf0..c096b319 100644 --- a/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.cs @@ -52,6 +52,12 @@ namespace FineUIPro.Web.Transfer.Chart /// private void AnalyseData() { + if (string.IsNullOrEmpty(ProjectId)) + { + Alert.ShowInTop("项目未获取到,请刷新页面。", MessageBoxIcon.Warning); + return; + } + var sTime = DateTime.Now.AddDays(-7); var eTime = DateTime.Now; ; @@ -64,8 +70,9 @@ namespace FineUIPro.Web.Transfer.Chart } //查询当前日期中的system的具体数目,去除重复 - var list = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId - && x.Test_Package_FINISH >= sTime && x.Test_Package_FINISH <= eTime).ToList(); + var list = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId + && x.FDate >= sTime && x.FDate <= eTime).ToList(); + var SystemList = (from x in list select x.SystemName).Distinct(); //先加载左侧system 树菜单 @@ -87,39 +94,63 @@ namespace FineUIPro.Web.Transfer.Chart Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem(); rowTime["日期"] = string.Format("{0:yyyy-MM-dd}", i); ; //根据日期查询当前system的数量 - var systemListbyDate = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId - && x.Test_Package_FINISH >= Convert.ToDateTime(rowTime["日期"]) - && x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList(); + var systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId + && x.FDate >= Convert.ToDateTime(rowTime["日期"]) + && x.FDate < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList(); - //具体的system 去重 - var systemList = (from x in systemListbyDate select x.SystemName).Distinct(); - if (systemList.ToList().Count>0) + //查询TestPackage 去重 + var testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct(); + + if (testpackageList.ToList().Count>0) { systemBol = true; } - foreach (var item in systemList) + foreach (var item in testpackageList) { - //查询当前日期每个system的数量 - var systemSumCount = systemListbyDate.Where(x => x.SystemName == item).ToList().Count; + //查询当前日期每个testpackage的数量 + var systemSumCount = systemListbyDate.Where(x => x.TestPackage == item).ToList().Count; + //子系统中完成的数量 - var subSystemSumCount = systemListbyDate.Where(x => x.SystemName == item && - x.FINAL_Status.ToLower() == "finished").ToList().Count; + var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item && + x.Status.ToLower() == "finished").ToList().Count; //子系统中没完成的情况 - var subSystemSumNotStartCount = systemListbyDate.Where(x => x.SystemName == item && - x.FINAL_Status.ToLower() == "not start").ToList().Count; + var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item && + (x.Status.ToLower() == "not start"|| x.Status=="" || x.Status==null )).ToList().Count; + //如果总数量等于完成的数量,完成量+1 if (systemSumCount == subSystemSumCount) { - finishedCount += 1; + //如果都是完成,需要最后 12表 test packge 必须是Finished才能是完成 + var punchlistFromList= Funs.DB.Transfer_PunchlistFrom.Where(x=>x.ProjectId==ProjectId + && x.Test_Package==item + && x.PUNCH_ITEM_FINISH_DATE>= Convert.ToDateTime(rowTime["日期"]) + && x.PUNCH_ITEM_FINISH_DATE < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList(); + //如果查到 + if (punchlistFromList.Count > 0) + { + //12表当前日期完成的数量 + var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count(); + //如果完成的数量等于总得数量,则是完成 + if (punchlistFromFinshCount == punchlistFromList.Count) + { + finishedCount += 1; + } + else { + inProgress += 1; + } + } + else { + inProgress += 1; + } } + //如果总数量等于not start,未开始量+1 else if (systemSumCount== subSystemSumNotStartCount) { notStart += 1; } else { inProgress += 1; - } } rowTime["Finished"] = finishedCount; @@ -130,7 +161,7 @@ namespace FineUIPro.Web.Transfer.Chart } if (systemBol) { - this.ChartUc.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "Instrumentation PROGRESS", this.drpChartType.SelectedValue, 1100, 600, false)); + this.ChartUc.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "PROGRESS REPORT", this.drpChartType.SelectedValue, 1100, 600, false)); } @@ -161,75 +192,158 @@ namespace FineUIPro.Web.Transfer.Chart private void LoadData(IEnumerable list) { - Tree1.Nodes.Clear(); - // 模拟从数据库返回数据表 - DataTable table = CreateDataTable(list); - - DataSet ds = new DataSet(); - ds.Tables.Add(table); - ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["Id"], ds.Tables[0].Columns["ParentId"]); - - foreach (DataRow row in ds.Tables[0].Rows) + this.trRectify.Nodes.Clear(); + this.trRectify.ShowBorder = false; + this.trRectify.ShowHeader = false; + this.trRectify.EnableIcons = true; + this.trRectify.AutoScroll = true; + this.trRectify.EnableSingleClickExpand = true; + TreeNode rootNode = new TreeNode { - if (row.IsNull("ParentId")) - { - TreeNode node = new TreeNode(); - node.Text = row["Text"].ToString(); - Tree1.Nodes.Add(node); - - ResolveSubTree(row, node); - } - } + Text = "全部", + NodeID = "ALL", + EnableClickEvent = true, + Expanded = true + }; + this.trRectify.Nodes.Add(rootNode); + BoundTree(rootNode.Nodes, list); } - private void ResolveSubTree(DataRow dataRow, TreeNode treeNode) + /// + /// 加载树 + /// + /// + /// + private void BoundTree(TreeNodeCollection nodes, IEnumerable list) { - DataRow[] rows = dataRow.GetChildRows("TreeRelation"); - if (rows.Length > 0) - { - // 如果是目录,则默认展开 - treeNode.Expanded = true; - foreach (DataRow row in rows) - { - TreeNode node = new TreeNode(); - node.Text = row["Text"].ToString(); - treeNode.Nodes.Add(node); - - ResolveSubTree(row, node); - } - } - } - - #region CreateDataTable - - private DataTable CreateDataTable(IEnumerable list) - { - DataTable table = new DataTable(); - DataColumn column1 = new DataColumn("Id", typeof(string)); - DataColumn column2 = new DataColumn("Text", typeof(String)); - DataColumn column3 = new DataColumn("ParentId", typeof(string)); - table.Columns.Add(column1); - table.Columns.Add(column2); - table.Columns.Add(column3); - - DataRow row = table.NewRow(); - row[0] = "ALL"; - row[1] = "全部"; - row[2] = DBNull.Value; - table.Rows.Add(row); - + TreeNode tn = null; foreach (var item in list) { - row = table.NewRow(); - row[0] = item.ToString(); - row[1] = item.ToString(); - row[2] = "ALL"; - table.Rows.Add(row); + tn = new TreeNode + { + Text = item.ToString(), + NodeID = item.ToString(), + EnableClickEvent = true + }; + nodes.Add(tn); } - return table; } + + + + #region 点击树节点 + protected void trRectify_NodeCommand(object sender, TreeCommandEventArgs e) { + var SystemName = this.trRectify.SelectedNodeID; + if (SystemName == "ALL") + { + AnalyseData(); + } + else + { + var sTime = DateTime.Now.AddDays(-7); + var eTime = DateTime.Now; ; + + //如果没有填写日期,则是七天内的 + if (!string.IsNullOrEmpty(txtStarTime.Text) && !string.IsNullOrEmpty(txtEndTime.Text)) + { + sTime = Convert.ToDateTime(txtStarTime.Text); + eTime = Convert.ToDateTime(txtEndTime.Text); + + } + DataTable dtTime = new DataTable(); + dtTime.Columns.Add("日期", typeof(string)); + dtTime.Columns.Add("Finished", typeof(string)); + dtTime.Columns.Add("In Progress", typeof(string)); + dtTime.Columns.Add("Not Start", typeof(string)); + + var systemBol = false; + for (var i = sTime; i <= eTime; i = i.AddDays(1)) + { + var finishedCount = 0; + var inProgress = 0; + var notStart = 0; + DataRow rowTime = dtTime.NewRow(); + Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem(); + rowTime["日期"] = string.Format("{0:yyyy-MM-dd}", i); ; + //根据日期查询当前system的数量 + var systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId && x.SystemName == SystemName + && x.FDate >= Convert.ToDateTime(rowTime["日期"]) + && x.FDate < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList(); + + //查询TestPackage 去重 + var testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct(); + + if (testpackageList.ToList().Count > 0) + { + systemBol = true; + } + foreach (var item in testpackageList) + { + //查询当前日期每个testpackage的数量 + var systemSumCount = systemListbyDate.Where(x => x.TestPackage == item).ToList().Count; + + //子系统中完成的数量 + var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item && + x.Status.ToLower() == "finished").ToList().Count; + + //子系统中没完成的情况 + var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item && + (x.Status.ToLower() == "not start" || x.Status == "" || x.Status == null)).ToList().Count; + + //如果总数量等于完成的数量,完成量+1 + if (systemSumCount == subSystemSumCount) + { + //如果都是完成,需要最后 12表 test packge 必须是Finished才能是完成 + var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId + && x.SystemName==SystemName + && x.Test_Package == item + && x.PUNCH_ITEM_FINISH_DATE >= Convert.ToDateTime(rowTime["日期"]) + && x.PUNCH_ITEM_FINISH_DATE < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList(); + //如果查到 + if (punchlistFromList.Count > 0) + { + //12表当前日期完成的数量 + var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count(); + //如果完成的数量等于总得数量,则是完成 + if (punchlistFromFinshCount == punchlistFromList.Count) + { + finishedCount += 1; + } + else + { + inProgress += 1; + } + } + else + { + inProgress += 1; + } + } + //如果总数量等于not start,未开始量+1 + else if (systemSumCount == subSystemSumNotStartCount) + { + notStart += 1; + } + else + { + inProgress += 1; + } + } + rowTime["Finished"] = finishedCount; + rowTime["In Progress"] = inProgress; + rowTime["Not Start"] = notStart; + dtTime.Rows.Add(rowTime); + + } + if (systemBol) + { + this.ChartUc.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "SYSTEM PROGRESS REPORT", this.drpChartType.SelectedValue, 1100, 600, false)); + } + } + + } #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.designer.cs index e9e5e8af..2be7ed02 100644 --- a/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/Chart/Instrumentation.aspx.designer.cs @@ -141,12 +141,12 @@ namespace FineUIPro.Web.Transfer.Chart protected global::Web.Controls.ChartControl ChartUc; /// - /// Tree1 控件。 + /// trRectify 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Tree Tree1; + protected global::FineUIPro.Tree trRectify; } } diff --git a/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs index d7472dc3..bdb57aa1 100644 --- a/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs @@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer } } string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row4)) + if (!string.IsNullOrEmpty(row5)) { try { @@ -329,41 +329,44 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Civil_Structure == pds.Rows[i][0].ToString().Trim() + if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Civil_Structure == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly==null) - { - Model.Transfer_Civil_Structure model = new Model.Transfer_Civil_Structure(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.Civil_Structure = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; + if (modelOnly == null) + { + Model.Transfer_Civil_Structure model = new Model.Transfer_Civil_Structure(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.Civil_Structure = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.Test_Package_FINISH = t2; - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - list.Add(model); - } - else - { - //修改 - modelOnly.Civil_Structure = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - Funs.DB.SubmitChanges(); + model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.Civil_Structure = pds.Rows[i][0].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.Test_Package_FINISH = t2; + modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs index add980dc..9fd99938 100644 --- a/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs @@ -180,7 +180,7 @@ namespace FineUIPro.Web.Transfer } } string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row4)) + if (!string.IsNullOrEmpty(row5)) { try { @@ -328,41 +328,44 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Electrical.FirstOrDefault(x => x.ELECTRICAL == pds.Rows[i][0].ToString().Trim() + if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_Electrical.FirstOrDefault(x => x.ELECTRICAL == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) - { - Model.Transfer_Electrical model = new Model.Transfer_Electrical(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.ELECTRICAL = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; + if (modelOnly == null) + { + Model.Transfer_Electrical model = new Model.Transfer_Electrical(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.ELECTRICAL = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.Test_Package_FINISH = t2; - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - list.Add(model); - } - else - { - //修改 - modelOnly.ELECTRICAL = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - Funs.DB.SubmitChanges(); + model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.ELECTRICAL = pds.Rows[i][0].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.Test_Package_FINISH = t2; + modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs index 25961140..aeb83cbf 100644 --- a/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/FirefightingDataIn.aspx.cs @@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer } } string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row4)) + if (!string.IsNullOrEmpty(row5)) { try { @@ -329,40 +329,43 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Firefighting.FirstOrDefault(x => x.Firefighting == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) + if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) { - Model.Transfer_Firefighting model = new Model.Transfer_Firefighting(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.Firefighting = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_Firefighting.FirstOrDefault(x => x.Firefighting == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); + if (modelOnly == null) + { + Model.Transfer_Firefighting model = new Model.Transfer_Firefighting(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.Firefighting = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.Test_Package_FINISH = t2; - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - list.Add(model); - } - else - { - //修改 - modelOnly.Firefighting = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - Funs.DB.SubmitChanges(); + model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.Firefighting = pds.Rows[i][0].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.Test_Package_FINISH = t2; + modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/HVACDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/HVACDataIn.aspx.cs index 3b779322..09b7148a 100644 --- a/SGGL/FineUIPro.Web/Transfer/HVACDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/HVACDataIn.aspx.cs @@ -180,7 +180,7 @@ namespace FineUIPro.Web.Transfer } } string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row4)) + if (!string.IsNullOrEmpty(row5)) { try { @@ -328,41 +328,44 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_HVAC.FirstOrDefault(x => x.HVAC == pds.Rows[i][0].ToString().Trim() + if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_HVAC.FirstOrDefault(x => x.HVAC == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) - { - Model.Transfer_HVAC model = new Model.Transfer_HVAC(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.HVAC = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; + if (modelOnly == null) + { + Model.Transfer_HVAC model = new Model.Transfer_HVAC(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.HVAC = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.Test_Package_FINISH = t2; - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - list.Add(model); - } - else - { - //修改 - modelOnly.HVAC = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - Funs.DB.SubmitChanges(); + model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.HVAC = pds.Rows[i][0].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.Test_Package_FINISH = t2; + modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/InstrumentationDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/InstrumentationDataIn.aspx.cs index afe7ca2f..af824d08 100644 --- a/SGGL/FineUIPro.Web/Transfer/InstrumentationDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/InstrumentationDataIn.aspx.cs @@ -106,7 +106,7 @@ namespace FineUIPro.Web.Transfer oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; oleDBConnString += "Data Source="; oleDBConnString += fileName; - oleDBConnString += ";Extended Properties=Excel 8.0;"; + oleDBConnString += ";Extended Properties='Excel 8.0';"; OleDbConnection oleDBConn = null; OleDbDataAdapter oleAdMaster = null; DataTable m_tableName = new DataTable(); @@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer } } string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row4)) + if (!string.IsNullOrEmpty(row5)) { try { @@ -329,40 +329,46 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Instrumentation.FirstOrDefault(x => x.INSTRUMENTATION == pds.Rows[i][0].ToString().Trim() - && x.ProjectId==CurrUser.LoginProjectId); - if (modelOnly == null) + if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) { - Model.Transfer_Instrumentation model = new Model.Transfer_Instrumentation(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_Instrumentation.FirstOrDefault(x => x.INSTRUMENTATION == pds.Rows[i][0].ToString().Trim() + && x.ProjectId == CurrUser.LoginProjectId); + if (modelOnly == null) + { + Model.Transfer_Instrumentation model = new Model.Transfer_Instrumentation(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.Test_Package_FINISH = t2; + + model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.Test_Package_FINISH = t2; + modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } + - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - list.Add(model); - } - else { - //修改 - modelOnly.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - Funs.DB.SubmitChanges(); } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs index 1a358706..3974b8f4 100644 --- a/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/PlumbingDataIn.aspx.cs @@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer } } string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row4)) + if (!string.IsNullOrEmpty(row5)) { try { @@ -329,41 +329,44 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Plumbing.FirstOrDefault(x => x.Plumbing == pds.Rows[i][0].ToString().Trim() + if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_Plumbing.FirstOrDefault(x => x.Plumbing == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) - { - Model.Transfer_Plumbing model = new Model.Transfer_Plumbing(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.Plumbing = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; + if (modelOnly == null) + { + Model.Transfer_Plumbing model = new Model.Transfer_Plumbing(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.Plumbing = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.Test_Package_FINISH = t2; - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - list.Add(model); - } - else - { - //修改 - modelOnly.Plumbing = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - Funs.DB.SubmitChanges(); + model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.Plumbing = pds.Rows[i][0].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.Test_Package_FINISH = t2; + modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/PunchlistFromDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/PunchlistFromDataIn.aspx.cs index 6922c30a..39924624 100644 --- a/SGGL/FineUIPro.Web/Transfer/PunchlistFromDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/PunchlistFromDataIn.aspx.cs @@ -317,57 +317,60 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_PunchlistFrom.FirstOrDefault(x => x.Punch_No == pds.Rows[i][0].ToString().Trim() + if (!string.IsNullOrEmpty(pds.Rows[i][1].ToString().Trim())) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_PunchlistFrom.FirstOrDefault(x => x.Punch_No == pds.Rows[i][1].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) - { - Model.Transfer_PunchlistFrom model = new Model.Transfer_PunchlistFrom(); + if (modelOnly == null) + { + Model.Transfer_PunchlistFrom model = new Model.Transfer_PunchlistFrom(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; - model.Item_No = pds.Rows[i][0].ToString().Trim(); - model.Punch_No = pds.Rows[i][1].ToString().Trim(); - model.SystemName = pds.Rows[i][2].ToString().Trim(); - model.Subsystem = pds.Rows[i][3].ToString().Trim(); + model.Item_No = pds.Rows[i][0].ToString().Trim(); + model.Punch_No = pds.Rows[i][1].ToString().Trim(); + model.SystemName = pds.Rows[i][2].ToString().Trim(); + model.Subsystem = pds.Rows[i][3].ToString().Trim(); - model.Test_Package = pds.Rows[i][4].ToString().Trim(); - model.Discipline = pds.Rows[i][5].ToString().Trim(); - model.DESCRIPTION = pds.Rows[i][6].ToString().Trim(); - model.Identified = pds.Rows[i][7].ToString().Trim(); - model.Category = pds.Rows[i][8].ToString().Trim(); - DateTime t1; - if (DateTime.TryParse(pds.Rows[i][9].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][9].ToString())) - model.PUNCH_ITEM_FINISH_DATE = t1; - + model.Test_Package = pds.Rows[i][4].ToString().Trim(); + model.Discipline = pds.Rows[i][5].ToString().Trim(); + model.DESCRIPTION = pds.Rows[i][6].ToString().Trim(); + model.Identified = pds.Rows[i][7].ToString().Trim(); + model.Category = pds.Rows[i][8].ToString().Trim(); + DateTime t1; + if (DateTime.TryParse(pds.Rows[i][9].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][9].ToString())) + model.PUNCH_ITEM_FINISH_DATE = t1; - model.Action_By = pds.Rows[i][10].ToString().Trim(); - model.Required_By = pds.Rows[i][11].ToString().Trim(); - model.PUNCH_ITEM_STATUS = pds.Rows[i][12].ToString().Trim(); - model.Comments = pds.Rows[i][13].ToString().Trim(); - list.Add(model); - } - else - { - //修改 - modelOnly.Item_No = pds.Rows[i][0].ToString().Trim(); - modelOnly.Punch_No = pds.Rows[i][1].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][2].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][3].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][4].ToString().Trim(); - modelOnly.Discipline = pds.Rows[i][5].ToString().Trim(); - modelOnly.DESCRIPTION = pds.Rows[i][6].ToString().Trim(); - modelOnly.Identified = pds.Rows[i][7].ToString().Trim(); - modelOnly.Category = pds.Rows[i][8].ToString().Trim(); - DateTime t1; - if (DateTime.TryParse(pds.Rows[i][9].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][9].ToString())) - modelOnly.PUNCH_ITEM_FINISH_DATE = t1; - modelOnly.Action_By = pds.Rows[i][10].ToString().Trim(); - modelOnly.Required_By = pds.Rows[i][11].ToString().Trim(); - modelOnly.PUNCH_ITEM_STATUS = pds.Rows[i][12].ToString().Trim(); - modelOnly.Comments = pds.Rows[i][13].ToString().Trim(); - Funs.DB.SubmitChanges(); + + model.Action_By = pds.Rows[i][10].ToString().Trim(); + model.Required_By = pds.Rows[i][11].ToString().Trim(); + model.PUNCH_ITEM_STATUS = pds.Rows[i][12].ToString().Trim(); + model.Comments = pds.Rows[i][13].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.Item_No = pds.Rows[i][0].ToString().Trim(); + modelOnly.Punch_No = pds.Rows[i][1].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][2].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][3].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][4].ToString().Trim(); + modelOnly.Discipline = pds.Rows[i][5].ToString().Trim(); + modelOnly.DESCRIPTION = pds.Rows[i][6].ToString().Trim(); + modelOnly.Identified = pds.Rows[i][7].ToString().Trim(); + modelOnly.Category = pds.Rows[i][8].ToString().Trim(); + DateTime t1; + if (DateTime.TryParse(pds.Rows[i][9].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][9].ToString())) + modelOnly.PUNCH_ITEM_FINISH_DATE = t1; + modelOnly.Action_By = pds.Rows[i][10].ToString().Trim(); + modelOnly.Required_By = pds.Rows[i][11].ToString().Trim(); + modelOnly.PUNCH_ITEM_STATUS = pds.Rows[i][12].ToString().Trim(); + modelOnly.Comments = pds.Rows[i][13].ToString().Trim(); + Funs.DB.SubmitChanges(); + } } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs index bc640cba..2475a6b4 100644 --- a/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs @@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer } } string row5 = pds.Rows[i][5].ToString(); - if (!string.IsNullOrEmpty(row4)) + if (!string.IsNullOrEmpty(row5)) { try { @@ -329,41 +329,44 @@ namespace FineUIPro.Web.Transfer List list = new List(); for (int i = 1; i < ir; i++) { - //查询第一列,没查到的情况下作导入处理 - var modelOnly = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Telecom == pds.Rows[i][0].ToString().Trim() + if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim())) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Telecom == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId); - if (modelOnly == null) - { - Model.Transfer_Telecom model = new Model.Transfer_Telecom(); - model.Id = Guid.NewGuid().ToString(); - model.ProjectId = CurrUser.LoginProjectId; - model.Telecom = pds.Rows[i][0].ToString().Trim(); - model.SystemName = pds.Rows[i][1].ToString().Trim(); - model.Subsystem = pds.Rows[i][2].ToString().Trim(); - model.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - model.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - model.Test_Package_FINISH = t2; + if (modelOnly == null) + { + Model.Transfer_Telecom model = new Model.Transfer_Telecom(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.Telecom = pds.Rows[i][0].ToString().Trim(); + model.SystemName = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.Test_Package_FINISH = t2; - model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - list.Add(model); - } - else - { - //修改 - modelOnly.Telecom = pds.Rows[i][0].ToString().Trim(); - modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); - modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); - modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); - DateTime t1, t2; - if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) - modelOnly.Test_Package_START = t1; - if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) - modelOnly.Test_Package_FINISH = t2; - modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); - Funs.DB.SubmitChanges(); + model.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.Telecom = pds.Rows[i][0].ToString().Trim(); + modelOnly.SystemName = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.Test_Package_START = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.Test_Package_FINISH = t2; + modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } } } if (list.Count > 0) diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index 5dd4914b..58334a96 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -11,7 +11,7 @@ - + @@ -77,7 +77,7 @@ - + diff --git a/SGGL/WebAPI/WebAPI.csproj.user b/SGGL/WebAPI/WebAPI.csproj.user index 4edb5e0f..6bc24ada 100644 --- a/SGGL/WebAPI/WebAPI.csproj.user +++ b/SGGL/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true