From 913b9cdee445b9dd4057d6ad1ee98f69eae82bcd Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Mon, 25 May 2026 14:41:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(hjgl):=20=E6=8C=89=E8=AF=95=E5=8E=8B?= =?UTF-8?q?=E5=8C=85=E9=87=8D=E6=9E=84=E7=AE=A1=E7=BA=BF=E6=A0=91=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 管线与试压包存在明确业务归属,相关焊接管理页面统一按 “单位工程-试压包-管线”展示和筛选,避免管线在单位工程下直接平铺。 --- DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql | 1 + SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- .../DataImport/MaterialInformation.aspx.cs | 157 +++++++++++------- .../HJGL/PreDesign/PrePipeline.aspx.cs | 99 ++++++++--- .../HJGL/WeldingManage/JotTwoDesign.aspx.cs | 138 +++++++++------ .../HJGL/WeldingManage/WeldMatMatch.aspx.cs | 111 +++++++++---- SGGL/FineUIPro.Web/common/Menu_DigData.xml | 63 ++++++- SGGL/FineUIPro.Web/common/Menu_HJGL.xml | 12 +- SGGL/FineUIPro.Web/common/Menu_HTGL.xml | 6 +- SGGL/FineUIPro.Web/common/Menu_JDGL.xml | 6 +- SGGL/FineUIPro.Web/common/Menu_PHTGL.xml | 2 +- SGGL/FineUIPro.Web/common/Menu_ZHGL.xml | 42 ----- 12 files changed, 418 insertions(+), 221 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql diff --git a/DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql b/DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql new file mode 100644 index 00000000..d91b7bf3 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql @@ -0,0 +1 @@ +UPDATE Sys_Menu set SuperMenu ='0' , SortIndex ='14' where MenuId ='1C6F9CA9-FDAC-4CE5-A19C-5536538851E1'; \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 4637a5cb..8bc11dec 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -17034,7 +17034,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs index a4f68d43..ff4ba3b1 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs @@ -90,26 +90,7 @@ namespace FineUIPro.Web.HJGL.DataImport { foreach (var q in unitWork1) { - string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]"; - strSql += "where [t0].[UnitWorkId] =@UnitWorkId "; - List listStr = new List(); - listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId)); - - if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim())) - { - strSql += " and [t1].[MaterialCode] like @MaterialCode"; - listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%")); - - } - if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim())) - { - strSql += " and [t0].[PipelineCode] like @PipelineCode"; - listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%")); - - } - SqlParameter[] parameter = listStr.ToArray(); - DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter); - var a = dt.Rows.Count; + var a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); //int a = (from x in DBpipeline // join y in dbpipeLineMat on x.PipelineId equals y.PipelineId @@ -121,16 +102,13 @@ namespace FineUIPro.Web.HJGL.DataImport tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; tn1.ToolTip = "施工单位:" + unitNamesUnitIds; - tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn1.CommandName = "单位工程"; tn1.EnableExpandEvent = true; + tn1.EnableClickEvent = true; rootNode1.Nodes.Add(tn1); if (a > 0) { - // BindNodes(tn1); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn1.Nodes.Add(newNode); + BindTestPackageNodes(tn1); } } } @@ -139,27 +117,7 @@ namespace FineUIPro.Web.HJGL.DataImport foreach (var q in unitWork2) { - string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]"; - strSql += "where [t0].[UnitWorkId] =@UnitWorkId "; - List listStr = new List(); - listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId)); - - if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim())) - { - strSql += " and [t1].[MaterialCode] like @MaterialCode"; - listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%")); - - } - if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim())) - { - strSql += " and [t0].[PipelineCode] like @PipelineCode"; - listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%")); - - } - SqlParameter[] parameter = listStr.ToArray(); - DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter); - - var a = dt.Rows.Count; + var a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); //var b = (from x in Funs.DB.HJGL_Pipeline // join y in Funs.DB.HJGL_PipeLineMat on x.PipelineId equals y.PipelineId @@ -184,18 +142,14 @@ namespace FineUIPro.Web.HJGL.DataImport // tn2.Expanded = true; //} tn2.ToolTip = "施工单位:" + unitNamesUnitIds; - tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn2.CommandName = "单位工程"; tn2.EnableExpandEvent = true; tn2.EnableClickEvent = true; rootNode2.Nodes.Add(tn2); if (a > 0) { - // BindNodes(tn2); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn2.Nodes.Add(newNode); + BindTestPackageNodes(tn2); } } } @@ -205,10 +159,99 @@ namespace FineUIPro.Web.HJGL.DataImport #region 暂不有 private void BindNodes(TreeNode node) { - BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), txtMaterialCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize); + var pipeline = GetTestPackagePipelineList(node.NodeID); + var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + int pageindex = int.Parse(node.CommandName.Split('|')[0]); + int pageCount = int.Parse(node.CommandName.Split('|')[1]); + if (pageindex <= pageCount) + { + pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList(); + foreach (var item in pipeline) + { + var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId select x).Count(); + TreeNode newNode = new TreeNode(); + newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; + newNode.NodeID = item.PipelineId; + newNode.CommandName = "管线"; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + } + if (pageindex < pageCount) + { + TreeNode newNode = new TreeNode(); + newNode.Text = "加载"; + newNode.NodeID = SQLHelper.GetNewID(); + newNode.CommandName = "加载"; + newNode.Icon = Icon.ArrowDown; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + } + } } #endregion + private int GetUnitWorkTestPackagePipelineCount(string unitWorkId) + { + return (from x in Funs.DB.HJGL_Pipeline + join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId + join z in Funs.DB.PTP_TestPackage on y.PTP_ID equals z.PTP_ID + join m in Funs.DB.HJGL_PipeLineMat.Where(e => e.MaterialCode.Contains(txtMaterialCode.Text.Trim())) + on x.PipelineId equals m.PipelineId into temp + from m in temp.DefaultIfEmpty() + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkId + && z.UnitWorkId == unitWorkId + && x.PipelineCode.Contains(tvPipeCode.Text.Trim()) + && (string.IsNullOrEmpty(txtMaterialCode.Text.Trim()) || m != null) + select x.PipelineId).Distinct().Count(); + } + + private void BindTestPackageNodes(TreeNode unitWorkNode) + { + var testPackages = (from x in Funs.DB.PTP_TestPackage + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkNode.NodeID + orderby x.TestPackageNo + select x).ToList(); + + foreach (var item in testPackages) + { + int pipelineCount = GetTestPackagePipelineList(item.PTP_ID).Count(); + if (pipelineCount == 0) + { + continue; + } + + TreeNode newNode = new TreeNode(); + newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线"; + newNode.NodeID = item.PTP_ID; + newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize); + newNode.EnableClickEvent = true; + newNode.EnableExpandEvent = true; + unitWorkNode.Nodes.Add(newNode); + + TreeNode loadNode = new TreeNode(); + loadNode.Text = "加载管线..."; + loadNode.NodeID = "加载管线..."; + newNode.Nodes.Add(loadNode); + } + } + + private List GetTestPackagePipelineList(string ptpId) + { + return (from x in Funs.DB.HJGL_Pipeline + join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId + join m in Funs.DB.HJGL_PipeLineMat.Where(e => e.MaterialCode.Contains(txtMaterialCode.Text.Trim())) + on x.PipelineId equals m.PipelineId into temp + from m in temp.DefaultIfEmpty() + where y.PTP_ID == ptpId + && x.ProjectId == this.CurrUser.LoginProjectId + && x.PipelineCode.Contains(tvPipeCode.Text.Trim()) + && (string.IsNullOrEmpty(txtMaterialCode.Text.Trim()) || m != null) + orderby x.PipelineCode + select x).Distinct().ToList(); + } + protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { if (e.Node.Nodes[0].NodeID == "加载管线...") @@ -246,7 +289,7 @@ namespace FineUIPro.Web.HJGL.DataImport this.hdUnitWorkId.Text = string.Empty; if (pipeline != null) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.hdUnitWorkId.Text = pipeline.UnitWorkId; this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); @@ -696,7 +739,7 @@ namespace FineUIPro.Web.HJGL.DataImport protected void TabStrip1_TabIndexChanged(object sender, EventArgs e) { string pipelineid = ""; - if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.CommandName != "单位工程") + if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.CommandName == "管线") { pipelineid = this.tvControlItem.SelectedNodeID; } @@ -1021,4 +1064,4 @@ namespace FineUIPro.Web.HJGL.DataImport } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs index 416882b3..219cbb56 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs @@ -89,23 +89,19 @@ namespace FineUIPro.Web.HJGL.PreDesign { foreach (var q in unitWork1) { - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x).Count(); + int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; tn1.ToolTip = "施工单位:" + unitNamesUnitIds; - tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn1.CommandName = "单位工程"; tn1.EnableClickEvent = true; tn1.EnableExpandEvent = true; rootNode1.Nodes.Add(tn1); if (a > 0) { - // BindNodes(tn1); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn1.Nodes.Add(newNode); + BindTestPackageNodes(tn1); } //if (a > 0) //{ @@ -117,7 +113,7 @@ namespace FineUIPro.Web.HJGL.PreDesign { foreach (var q in unitWork2) { - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x).Count(); + int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; @@ -127,17 +123,13 @@ namespace FineUIPro.Web.HJGL.PreDesign tn2.Expanded = true; } tn2.ToolTip = "施工单位:" + unitNamesUnitIds; - tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn2.CommandName = "单位工程"; tn2.EnableClickEvent = true; tn2.EnableExpandEvent = true; rootNode2.Nodes.Add(tn2); if (a > 0) { - // BindNodes(tn1); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn2.Nodes.Add(newNode); + BindTestPackageNodes(tn2); } //if (a > 0) //{ @@ -152,10 +144,11 @@ namespace FineUIPro.Web.HJGL.PreDesign List pipeline = new List(); var pipelines = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" select x; pipeline = (from x in pipelines - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID + join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId + where y.PTP_ID == node.NodeID && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode - select x).ToList(); + select x).Distinct().ToList(); int pageindex = int.Parse(node.CommandName.Split('|')[0]); int pageCount = int.Parse(node.CommandName.Split('|')[1]); if (pageindex <= pageCount) @@ -187,6 +180,61 @@ namespace FineUIPro.Web.HJGL.PreDesign } + + private int GetUnitWorkTestPackagePipelineCount(string unitWorkId) + { + return (from x in Funs.DB.HJGL_Pipeline + join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId + join z in Funs.DB.PTP_TestPackage on y.PTP_ID equals z.PTP_ID + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkId + && z.UnitWorkId == unitWorkId + && x.PipeArea == "1" + && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) + select x.PipelineId).Distinct().Count(); + } + + private void BindTestPackageNodes(TreeNode unitWorkNode) + { + var testPackages = (from x in Funs.DB.PTP_TestPackage + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkNode.NodeID + orderby x.TestPackageNo + select x).ToList(); + + foreach (var item in testPackages) + { + int pipelineCount = GetTestPackagePipelineCount(item.PTP_ID); + if (pipelineCount == 0) + { + continue; + } + + TreeNode newNode = new TreeNode(); + newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线"; + newNode.NodeID = item.PTP_ID; + newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize); + newNode.EnableClickEvent = true; + newNode.EnableExpandEvent = true; + unitWorkNode.Nodes.Add(newNode); + + TreeNode loadNode = new TreeNode(); + loadNode.Text = "加载管线..."; + loadNode.NodeID = "加载管线..."; + newNode.Nodes.Add(loadNode); + } + } + + private int GetTestPackagePipelineCount(string ptpId) + { + return (from x in Funs.DB.HJGL_Pipeline + join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId + where y.PTP_ID == ptpId + && x.ProjectId == this.CurrUser.LoginProjectId + && x.PipeArea == "1" + && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) + select x.PipelineId).Distinct().Count(); + } #endregion protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { @@ -205,20 +253,26 @@ namespace FineUIPro.Web.HJGL.PreDesign /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { - if (e.CommandName.Split('|').Length == 2) + if (e.CommandName == "单位工程") { this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; WeldingDailyService.InitDownListByUnitWortId(drpWeldingDailyCode, true, this.tvControlItem.SelectedNodeID); } + else if (e.CommandName.Split('|').Length == 2) + { + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + + WeldingDailyService.InitDownListByUnitWortId(drpWeldingDailyCode, true, this.hdUnitWorkId.Text); + } else if (e.CommandName == "管线") { Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); this.hdUnitWorkId.Text = string.Empty; if (pipeline != null) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.hdUnitWorkId.Text = pipeline.UnitWorkId; } } else if (e.CommandName == "加载") @@ -255,12 +309,17 @@ namespace FineUIPro.Web.HJGL.PreDesign List listStr = new List(); - if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2) + if (tvControlItem.SelectedNode.CommandName == "单位工程") { strSql += " and pipe.UnitWorkId =@UnitWorkId"; listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID)); } + else if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2) + { + strSql += " and exists(select 1 from PTP_PipelineList ptpPipe where ptpPipe.PipelineId = pipe.PipelineId and ptpPipe.PTP_ID = @PTP_ID)"; + listStr.Add(new SqlParameter("@PTP_ID", this.tvControlItem.SelectedNodeID)); + } else if (tvControlItem.SelectedNode.CommandName == "管线") { strSql += " and com.PipelineId = @PipelineId "; @@ -708,4 +767,4 @@ if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection. } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs index ccae6c1a..fbfcbb9a 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs @@ -86,31 +86,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage int a = 0; if (cbAllPipeline.Checked) { - a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); + a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); } else { - a = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - && (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0 - select x).Count(); + a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); } var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; tn1.ToolTip = "施工单位:" + unitNamesUnitIds; - tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn1.CommandName = "单位工程"; tn1.EnableClickEvent = true; tn1.EnableExpandEvent = true; rootNode1.Nodes.Add(tn1); if (a > 0) { - // BindNodes(tn1); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn1.Nodes.Add(newNode); + BindTestPackageNodes(tn1); } } } @@ -121,14 +114,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage int a = 0; if (cbAllPipeline.Checked) { - a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); + a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); } else { - a = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - && (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0 - select x).Count(); + a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); } var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); TreeNode tn2 = new TreeNode(); @@ -139,17 +129,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn2.Expanded = true; } tn2.ToolTip = "施工单位:" + unitNamesUnitIds; - tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn2.CommandName = "单位工程"; tn2.EnableClickEvent = true; tn2.EnableExpandEvent = true; rootNode2.Nodes.Add(tn2); if (a > 0) { - // BindNodes(tn1); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn2.Nodes.Add(newNode); + BindTestPackageNodes(tn2); } } } @@ -158,27 +144,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage private void BindNodes(TreeNode node) { List pipeline = new List(); - pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID - && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - orderby x.PipelineCode - select x).ToList(); if (cbAllPipeline.Checked) { - pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID - && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - orderby x.PipelineCode - select x).ToList(); + pipeline = GetTestPackagePipelineList(node.NodeID); } else { - pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID - && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - && (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0 - orderby x.PipelineCode - select x).ToList(); + pipeline = GetTestPackagePipelineList(node.NodeID); } var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); @@ -224,6 +196,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; newNode.ToolTip = "管线号【焊口数】"; newNode.NodeID = item.PipelineId; + newNode.CommandName = "管线"; newNode.EnableClickEvent = true; node.Nodes.Add(newNode); } @@ -240,6 +213,65 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } + private int GetUnitWorkTestPackagePipelineCount(string unitWorkId) + { + var testPackages = (from x in Funs.DB.PTP_TestPackage + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkId + select x.PTP_ID).ToList(); + + return testPackages.Select(x => GetTestPackagePipelineList(x).Count()).Sum(); + } + + private void BindTestPackageNodes(TreeNode unitWorkNode) + { + var testPackages = (from x in Funs.DB.PTP_TestPackage + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkNode.NodeID + orderby x.TestPackageNo + select x).ToList(); + + foreach (var item in testPackages) + { + int pipelineCount = GetTestPackagePipelineList(item.PTP_ID).Count(); + if (pipelineCount == 0) + { + continue; + } + + TreeNode newNode = new TreeNode(); + newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线"; + newNode.NodeID = item.PTP_ID; + newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize); + newNode.EnableClickEvent = true; + newNode.EnableExpandEvent = true; + unitWorkNode.Nodes.Add(newNode); + + TreeNode loadNode = new TreeNode(); + loadNode.Text = "加载管线..."; + loadNode.NodeID = "加载管线..."; + newNode.Nodes.Add(loadNode); + } + } + + private List GetTestPackagePipelineList(string ptpId) + { + var pipeline = (from x in Funs.DB.HJGL_Pipeline + join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId + where y.PTP_ID == ptpId + && x.ProjectId == this.CurrUser.LoginProjectId + && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) + orderby x.PipelineCode + select x).Distinct().ToList(); + + if (!cbAllPipeline.Checked) + { + pipeline = pipeline.Where(x => (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0).ToList(); + } + + return pipeline; + } + #region 点击TreeView /// /// 点击TreeView @@ -263,12 +295,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage { if (pipeline != null) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.hdUnitWorkId.Text = pipeline.UnitWorkId; this.BindGrid(); } else { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; + this.hdUnitWorkId.Text = e.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID; NoAuditBindGrid(); } @@ -362,8 +394,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage WHERE IsTwoJoint = 1"; List listStr = new List { }; - strSql += " AND UnitWorkId =@UnitWorkId"; - listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID)); + if (this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2) + { + strSql += " AND EXISTS(SELECT 1 FROM PTP_PipelineList ptpPipe WHERE ptpPipe.PipelineId = View_HJGL_WeldJoint.PipelineId AND ptpPipe.PTP_ID = @PTP_ID)"; + listStr.Add(new SqlParameter("@PTP_ID", this.tvControlItem.SelectedNodeID)); + } + else + { + strSql += " AND UnitWorkId =@UnitWorkId"; + listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID)); + } if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim())) { @@ -417,12 +457,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage this.hdUnitWorkId.Text = string.Empty; if (pipeline != null) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.hdUnitWorkId.Text = pipeline.UnitWorkId; this.BindGrid(); } else { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID; NoAuditBindGrid(); } @@ -1228,12 +1268,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage this.hdUnitWorkId.Text = string.Empty; if (pipeline != null) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.hdUnitWorkId.Text = pipeline.UnitWorkId; this.BindGrid(); } else { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID; NoAuditBindGrid(); } } @@ -1244,14 +1284,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage this.hdUnitWorkId.Text = string.Empty; if (pipeline != null) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.hdUnitWorkId.Text = pipeline.UnitWorkId; this.BindGrid(); } else { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID; NoAuditBindGrid(); } } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs index 23e995f0..2c7c3521 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs @@ -155,22 +155,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage foreach (var q in unitWork1) { - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea && x.WarehouseId == WarehouseId select x).Count(); + int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; tn1.ToolTip = "施工单位:" + unitNamesUnitIds; - tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn1.CommandName = "单位工程"; tn1.EnableExpandEvent = true; + tn1.EnableClickEvent = true; + tn1.EnableCheckBox = false; rootNode1.Nodes.Add(tn1); if (a > 0) { - // BindNodes(tn1); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn1.Nodes.Add(newNode); + BindTestPackageNodes(tn1); } } } @@ -178,7 +176,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea && x.WarehouseId == WarehouseId select x).Count(); + int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId); // var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(q.UnitWorkId); //int a = NowComPipelineCode.Count(); var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); @@ -190,7 +188,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn2.Expanded = true; } tn2.ToolTip = "施工单位:" + unitNamesUnitIds; - tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + tn2.CommandName = "单位工程"; tn2.EnableExpandEvent = true; tn2.EnableClickEvent = true; tn2.EnableCheckBox = false; @@ -198,11 +196,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage rootNode2.Nodes.Add(tn2); if (a > 0) { - // BindNodes(tn2); - TreeNode newNode = new TreeNode(); - newNode.Text = "加载管线..."; - newNode.NodeID = "加载管线..."; - tn2.Nodes.Add(newNode); + BindTestPackageNodes(tn2); } } } @@ -215,22 +209,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage // node.Text += "|" + NowComPipelineCode.Count(); //} - var CompleteInOutPlanDetail_RelationList = from x in Funs.DB.Tw_InOutPlanDetail_Relation - join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id - where y.State == (int)TwConst.State.已完成 && y.WarehouseCode == drpWarehouse.SelectedValue - select x; - - var pipeline = (from x in Funs.DB.HJGL_Pipeline - join y in CompleteInOutPlanDetail_RelationList on x.PipelineId equals y.PipelineId into temp - from y in temp.DefaultIfEmpty() - where y == null && x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID - && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) && x.WarehouseId==WarehouseId - orderby x.PipelineCode - select x).ToList(); - if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.SelectedValue != Const._Null) - { - pipeline = pipeline.Where(x => x.FlowingSection == drpFlowingSection.SelectedValue).ToList(); - } + var pipeline = GetTestPackagePipelineList(node.NodeID); //pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList(); if (!node.Text.Contains("|")) { @@ -268,6 +247,74 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } + private int GetUnitWorkTestPackagePipelineCount(string unitWorkId) + { + var testPackageIds = (from x in Funs.DB.PTP_TestPackage + where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == unitWorkId + select x.PTP_ID).ToList(); + + return testPackageIds.Select(x => GetTestPackagePipelineList(x).Count()).Sum(); + } + + private void BindTestPackageNodes(TreeNode unitWorkNode) + { + var testPackages = (from x in Funs.DB.PTP_TestPackage + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkNode.NodeID + orderby x.TestPackageNo + select x).ToList(); + + foreach (var item in testPackages) + { + int pipelineCount = GetTestPackagePipelineList(item.PTP_ID).Count(); + if (pipelineCount == 0) + { + continue; + } + + TreeNode newNode = new TreeNode(); + newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线"; + newNode.NodeID = item.PTP_ID; + newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize); + newNode.EnableClickEvent = true; + newNode.EnableExpandEvent = true; + newNode.EnableCheckBox = false; + unitWorkNode.Nodes.Add(newNode); + + TreeNode loadNode = new TreeNode(); + loadNode.Text = "加载管线..."; + loadNode.NodeID = "加载管线..."; + loadNode.EnableCheckBox = false; + newNode.Nodes.Add(loadNode); + } + } + + private List GetTestPackagePipelineList(string ptpId) + { + var completeInOutPlanDetailRelationList = from x in Funs.DB.Tw_InOutPlanDetail_Relation + join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id + where y.State == (int)TwConst.State.已完成 && y.WarehouseCode == drpWarehouse.SelectedValue + select x; + + var pipeline = (from x in Funs.DB.HJGL_Pipeline + join p in Funs.DB.PTP_PipelineList on x.PipelineId equals p.PipelineId + join y in completeInOutPlanDetailRelationList on x.PipelineId equals y.PipelineId into temp + from y in temp.DefaultIfEmpty() + where y == null + && p.PTP_ID == ptpId + && x.ProjectId == this.CurrUser.LoginProjectId + && x.PipeArea == PipeArea + && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) + && x.WarehouseId == WarehouseId + orderby x.PipelineCode + select x).ToList(); + if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.SelectedValue != Const._Null) + { + pipeline = pipeline.Where(x => x.FlowingSection == drpFlowingSection.SelectedValue).ToList(); + } + return pipeline.Distinct().ToList(); + } + protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { if (e.Node.Nodes[0].NodeID == "加载管线...") @@ -491,7 +538,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage parameter3D.TagNum = ""; parameter3D.ButtonType = "3"; - if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) + if (this.tvControlItem.SelectedNode.CommandName == "单位工程") { parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID); var pipeline = (from x in Funs.DB.HJGL_Pipeline @@ -517,7 +564,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage this.hdUnitWorkId.Text = string.Empty; if (pipeline != null) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.hdUnitWorkId.Text = pipeline.UnitWorkId; this.BindGrid(); } diff --git a/SGGL/FineUIPro.Web/common/Menu_DigData.xml b/SGGL/FineUIPro.Web/common/Menu_DigData.xml index b532a9bb..bb7a7a34 100644 --- a/SGGL/FineUIPro.Web/common/Menu_DigData.xml +++ b/SGGL/FineUIPro.Web/common/Menu_DigData.xml @@ -1,9 +1,51 @@  - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16,12 +58,15 @@ + + + - - - - - + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml index 562f836f..b5ac8281 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml @@ -12,14 +12,15 @@ + + - - - + + @@ -28,7 +29,7 @@ - + @@ -62,8 +63,7 @@ - - + diff --git a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml index 95eeab91..129ab5fd 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml @@ -1,8 +1,8 @@  - - - + + + diff --git a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml index 8d4aa005..fd6a0762 100644 --- a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml @@ -1,7 +1,11 @@  - + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml index 56efca63..53b0bd32 100644 --- a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml @@ -4,10 +4,10 @@ - + diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 33fbfbf6..bd506a52 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -58,51 +58,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -