diff --git a/.vs/赛鼎/v17/.wsuo b/.vs/赛鼎/v17/.wsuo new file mode 100644 index 00000000..e2115eb6 Binary files /dev/null and b/.vs/赛鼎/v17/.wsuo differ diff --git a/.vs/赛鼎/v17/DocumentLayout.json b/.vs/赛鼎/v17/DocumentLayout.json new file mode 100644 index 00000000..dc7b8b49 --- /dev/null +++ b/.vs/赛鼎/v17/DocumentLayout.json @@ -0,0 +1,37 @@ +{ + "Version": 1, + "WorkspaceRootPath": "G:\\\u516C\u53F8\u9879\u76EE\\\u8D5B\u9F0E\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 1, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedHeight": 791, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:130:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + } + ] + }, + { + "DockedHeight": 199, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2025-05-12-xiaj.sql b/DataBase/版本日志/SGGLDB_V2025-05-12-xiaj.sql new file mode 100644 index 00000000..a7f1ea01 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-05-12-xiaj.sql @@ -0,0 +1,26 @@ + + + +--ӹԤƹװ嵥 +--1װ嵥 +IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = 'BD9C587E-17C2-49F1-82AE-A05117E41D89') +BEGIN + --װ嵥 + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('BD9C587E-17C2-49F1-82AE-A05117E41D89','װ嵥','HJGL/PreDesign/InstallList.aspx',60,'1E36EA73-D536-4215-BFB9-A8771937BD89','Menu_HJGL',0,1,1) +END +GO +IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = 'BD9C587E-17C2-49F1-82AE-A05117E41D89') +BEGIN + --װ嵥 + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('02D07D69-1140-4A04-81C8-57D902D6D957','BD9C587E-17C2-49F1-82AE-A05117E41D89','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('2608E7A1-0707-4011-BAD7-C7F0D3CBDCA8','BD9C587E-17C2-49F1-82AE-A05117E41D89','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('AD402A21-BAF5-423D-9BCF-79BF8BE933FB','BD9C587E-17C2-49F1-82AE-A05117E41D89','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('5811146E-67D5-4D15-8179-775D5F9BA1BD','BD9C587E-17C2-49F1-82AE-A05117E41D89','',4) +END +GO + diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 8015da45..ddb375f2 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -876,7 +876,7 @@ {00020813-0000-0000-C000-000000000046} 1 - 9 + 6 0 primary False @@ -885,7 +885,7 @@ {00020905-0000-0000-C000-000000000046} 8 - 7 + 4 0 primary False diff --git a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs index b0e38aa9..1788a627 100644 --- a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs +++ b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs @@ -1,5 +1,4 @@  -using Microsoft.SqlServer.Dts.Runtime; using Model; using System; using System.Collections; diff --git a/SGGL/BLL/Common/WordHelp.cs b/SGGL/BLL/Common/WordHelp.cs index 85c331d9..3a65d367 100644 --- a/SGGL/BLL/Common/WordHelp.cs +++ b/SGGL/BLL/Common/WordHelp.cs @@ -341,90 +341,90 @@ namespace BLL } #endregion - public static string GetPathByDocToHTML(string strFile) - { - if (string.IsNullOrEmpty(strFile)) - { - return "0";//没有文件 - } - Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application() - { - Visible = false, - AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable - }; - //Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass(); - // word.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone; - Type wordType = word.GetType(); - Microsoft.Office.Interop.Word.Documents docs = word.Documents; + //public static string GetPathByDocToHTML(string strFile) + //{ + // if (string.IsNullOrEmpty(strFile)) + // { + // return "0";//没有文件 + // } + // Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application() + // { + // Visible = false, + // AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable + // }; + // //Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass(); + // // word.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone; + // Type wordType = word.GetType(); + // Microsoft.Office.Interop.Word.Documents docs = word.Documents; - // 打开文件 - Type docsType = docs.GetType(); + // // 打开文件 + // Type docsType = docs.GetType(); - object fileName = strFile; + // object fileName = strFile; - Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open", - System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true }); + // Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open", + // System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true }); - // 转换格式,另存为html - Type docType = doc.GetType(); - //给文件重新起名 - string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() + - System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString(); + // // 转换格式,另存为html + // Type docType = doc.GetType(); + // //给文件重新起名 + // string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() + + // System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString(); - string strFileFolder = "/html/"; - DateTime dt = DateTime.Now; - //以yyyymmdd形式生成子文件夹名 - string strFileSubFolder = dt.Year.ToString(); - strFileSubFolder += (dt.Month < 10) ? ("0" + dt.Month.ToString()) : dt.Month.ToString(); - strFileSubFolder += (dt.Day < 10) ? ("0" + dt.Day.ToString()) : dt.Day.ToString(); - string strFilePath = strFileFolder + strFileSubFolder + "/"; - // 判断指定目录下是否存在文件夹,如果不存在,则创建 - if (!Directory.Exists(strFilePath)) - { - // 创建up文件夹 - Directory.CreateDirectory(strFilePath); - } + // string strFileFolder = "/html/"; + // DateTime dt = DateTime.Now; + // //以yyyymmdd形式生成子文件夹名 + // string strFileSubFolder = dt.Year.ToString(); + // strFileSubFolder += (dt.Month < 10) ? ("0" + dt.Month.ToString()) : dt.Month.ToString(); + // strFileSubFolder += (dt.Day < 10) ? ("0" + dt.Day.ToString()) : dt.Day.ToString(); + // string strFilePath = strFileFolder + strFileSubFolder + "/"; + // // 判断指定目录下是否存在文件夹,如果不存在,则创建 + // if (!Directory.Exists(strFilePath)) + // { + // // 创建up文件夹 + // Directory.CreateDirectory(strFilePath); + // } - //被转换的html文档保存的位置 - // HttpContext.Current.Server.MapPath("html" + strFileSubFolder + filename + ".html") - string ConfigPath = strFilePath + filename + ".html"; - object saveFileName = ConfigPath; + // //被转换的html文档保存的位置 + // // HttpContext.Current.Server.MapPath("html" + strFileSubFolder + filename + ".html") + // string ConfigPath = strFilePath + filename + ".html"; + // object saveFileName = ConfigPath; - /*下面是Microsoft Word 9 Object Library的写法,如果是10,可能写成: - * docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, - * null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML}); - * 其它格式: - * wdFormatHTML - * wdFormatDocument - * wdFormatDOSText - * wdFormatDOSTextLineBreaks - * wdFormatEncodedText - * wdFormatRTF - * wdFormatTemplate - * wdFormatText - * wdFormatTextLineBreaks - * wdFormatUnicodeText - */ - docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, - null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML }); + // /*下面是Microsoft Word 9 Object Library的写法,如果是10,可能写成: + // * docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, + // * null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML}); + // * 其它格式: + // * wdFormatHTML + // * wdFormatDocument + // * wdFormatDOSText + // * wdFormatDOSTextLineBreaks + // * wdFormatEncodedText + // * wdFormatRTF + // * wdFormatTemplate + // * wdFormatText + // * wdFormatTextLineBreaks + // * wdFormatUnicodeText + // */ + // docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, + // null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML }); - //docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, - // null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML }); + // //docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, + // // null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML }); - //关闭文档 - docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod, - null, doc, new object[] { null, null, null }); + // //关闭文档 + // docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod, + // null, doc, new object[] { null, null, null }); - // 退出 Word - wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null); - //转到新生成的页面 - //return ("/" + filename + ".html"); + // // 退出 Word + // wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null); + // //转到新生成的页面 + // //return ("/" + filename + ".html"); - //转化HTML页面统一编码格式 - TransHTMLEncoding(ConfigPath); + // //转化HTML页面统一编码格式 + // TransHTMLEncoding(ConfigPath); - return (strFilePath + filename + ".html"); - } + // return (strFilePath + filename + ".html"); + //} public static void TransHTMLEncoding(string strFilePath) { try diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs index 8c509ae5..cf722bdc 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs @@ -80,6 +80,16 @@ namespace BLL { return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId); } + + /// + /// 根据流水段获取管线信息 + /// + /// + /// + public static Model.HJGL_Pipeline GetPipelineByFlowingSection(string flowingSection) + { + return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.FlowingSection == flowingSection); + } /// /// 根据管线id获取管线状态 /// diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs index 7fbfa110..52844020 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_DefectService.cs @@ -1,5 +1,4 @@ using FineUIPro; -using Microsoft.SqlServer.Dts.Runtime; using NPOI.SS.Formula.Functions; using System; using System.Collections; diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs index f75c7496..d76ea2fc 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs @@ -1,5 +1,4 @@ using FineUIPro; -using Microsoft.SqlServer.Dts.Runtime; using Model; using System; using System.Collections; diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs index 115aaf95..58031376 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs @@ -1,19 +1,9 @@ using BLL; -using FastReport.Utils; -using FineUIPro.Web.DataShow; -using FineUIPro.Web.HJGL.WeldingManage; -using FineUIPro.Web.ProjectData; -using Microsoft.Office.Interop.Word; using Model; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using static BLL.TwConst; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace FineUIPro.Web.CLGL { diff --git a/SGGL/FineUIPro.Web/DataShow/HJGLWeldingItem.aspx.cs b/SGGL/FineUIPro.Web/DataShow/HJGLWeldingItem.aspx.cs index d0cbf024..60ef1f35 100644 --- a/SGGL/FineUIPro.Web/DataShow/HJGLWeldingItem.aspx.cs +++ b/SGGL/FineUIPro.Web/DataShow/HJGLWeldingItem.aspx.cs @@ -1,10 +1,6 @@ using BLL; -using Microsoft.Office.Interop.Word; -using Model; using System; -using System.Collections.Generic; using System.Data; -using System.Data.SqlClient; using System.Linq; namespace FineUIPro.Web.DataShow diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/材料信息导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/材料信息导入模板.xls index 93bcae86..ef934c5f 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/材料信息导入模板.xls and b/SGGL/FineUIPro.Web/File/Excel/DataIn/材料信息导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index b58cc7c9..0beaad22 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1556,6 +1556,7 @@ + @@ -10570,6 +10571,13 @@ PackagingManageView.aspx + + InstallList.aspx + ASPXCodeBehind + + + InstallList.aspx + PrePipelineQRCodeIn.aspx ASPXCodeBehind @@ -16567,7 +16575,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx new file mode 100644 index 00000000..607a9290 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx @@ -0,0 +1,135 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InstallList.aspx.cs" Inherits="FineUIPro.Web.HJGL.PreDesign.InstallList" %> + + + + + + 安装清单 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.cs new file mode 100644 index 00000000..60908f79 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.cs @@ -0,0 +1,417 @@ +using BLL; +using MiniExcelLibs; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; + +namespace FineUIPro.Web.HJGL.PreDesign +{ + public partial class InstallList : PageBase + { + public int pageSize = 20; + public static DataTable GridDataTable = new DataTable(); + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + this.InitTreeMenu();//加载树 + } + } + + #region 加载树装置-单位-工作区 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + TreeNode rootNode1 = new TreeNode(); + rootNode1.NodeID = "1"; + rootNode1.Text = "建筑工程"; + rootNode1.CommandName = "建筑工程"; + rootNode1.Selectable = false; + this.tvControlItem.Nodes.Add(rootNode1); + + TreeNode rootNode2 = new TreeNode(); + rootNode2.NodeID = "2"; + rootNode2.Text = "安装工程"; + rootNode2.CommandName = "安装工程"; + rootNode2.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode2); + + var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + // 获取当前用户所在单位 + var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId); + + var unitWorkList = (from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null + select x).ToList(); + + List unitWork1 = null; + List unitWork2 = null; + + //// 当前为施工单位,只能操作本单位的数据 + //if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2) + //{ + // unitWork1 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1" + // select x).ToList(); + // unitWork2 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2" + // select x).ToList(); + //} + //else + //{ + unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); + unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); + //} + + if (unitWork1.Count() > 0) + { + 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.FlowingSection).Distinct().Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn1 = new TreeNode(); + tn1.NodeID = q.UnitWorkId; + //tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn1.Text = q.UnitWorkName; + tn1.ToolTip = "施工单位:" + unitNamesUnitIds; + tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + 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); + } + //if (a > 0) + //{ + // BindNodes(tn1); + //} + } + } + if (unitWork2.Count() > 0) + { + 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.FlowingSection).Distinct().Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn2 = new TreeNode(); + tn2.NodeID = q.UnitWorkId; + //tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn2.Text = q.UnitWorkName; + if (q.UnitWorkId == this.hdUnitWorkId.Text) + { + tn2.Expanded = true; + } + tn2.ToolTip = "施工单位:" + unitNamesUnitIds; + tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); + 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); + } + //if (a > 0) + //{ + // BindNodes(tn2); + //} + } + } + } + + private void BindNodes(TreeNode node) + { + List flowingSection = new List(); + //List pipeline = new List(); + var list = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x.FlowingSection).ToList(); + flowingSection = list.Where(x => !string.IsNullOrWhiteSpace(x) == true).Distinct().OrderBy(x => x).ToList(); + //int pageindex = int.Parse(node.CommandName.Split('|')[0]); + //int pageCount = int.Parse(node.CommandName.Split('|')[1]); + //if (pageindex <= pageCount) + //{ + // flowingSection = flowingSection.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList(); + foreach (var item in flowingSection) + { + //var comCount = (from x in Funs.DB.HJGL_Pipeline_Component where x.PipelineId == item.PipelineId select x).Count(); + TreeNode newNode = new TreeNode(); + //newNode.Text = item.PipelineCode + "【" + comCount.ToString() + " " + "组件" + "】"; + newNode.Text = item; + newNode.ToolTip = "流水段"; + newNode.CommandName = "流水段"; + newNode.NodeID = SQLHelper.GetNewID(); + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + } + // if (pageindex < pageCount) + // { + // TreeNode newNode = new TreeNode(); + // newNode.Text = "加载"; + // newNode.NodeID = "加载"; + // //newNode.NodeID = SQLHelper.GetNewID(); + // newNode.CommandName = "加载"; + // newNode.Icon = Icon.ArrowDown; + // newNode.EnableClickEvent = true; + // node.Nodes.Add(newNode); + // } + //} + } + + #endregion + + protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) + { + if (e.Node.Nodes[0].NodeID == "加载流水段...") + { + e.Node.Nodes.Clear(); + BindNodes(e.Node); + } + } + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (e.CommandName == "流水段") + { + Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByFlowingSection(this.tvControlItem.SelectedNode.Text); + this.hdUnitWorkId.Text = string.Empty; + if (pipeline != null) + { + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + } + } + this.BindGrid(); + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + private void BindGrid() + { + if (tvControlItem.SelectedNode == null) return; + DataTable tb = BindData(); + GridDataTable = tb; + // 2.获取当前分页数据 + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + /// + /// 查询数据 + /// + /// + private DataTable BindData() + { + string strSql = @"WITH cte as (select pipeline.PipelineCode as PipelineCode, +comonent.PipelineComponentCode as PipelineComponentCode, +'' as matdef, +packdetail.Number as Number, +pack.PackagingCode as PackagingCode, +trainnumber.TrainNumber as TrainNumber, +pipeline.FlowingSection as FlowingSection, +pipeline.UnitWorkId as UnitWorkId +from HJGL_Pipeline pipeline +left join HJGL_PackagingManageDetail packdetail on pipeline.PipelineId = packdetail.PipelineId +left join HJGL_Pipeline_Component comonent +on packdetail.PipelineComponentId = comonent.PipelineComponentId +left join HJGL_PackagingManage pack on packdetail.PackagingManageId = pack.PackagingManageId +left join HJGL_TrainNumberManage trainnumber on pack.TrainNumberId = TrainNumber.Id +where (packdetail.PipelineComponentId is not null or packdetail.PipelineComponentId != '') +union all +select pipeline.PipelineCode as PipelineCode, +packdetail.MaterialCode as PipelineComponentCode, +matlib.MaterialDef as matdef, +packdetail.Number as Number, +pack.PackagingCode as PackagingCode, +trainnumber.TrainNumber as TrainNumber, +pipeline.FlowingSection as FlowingSection, +pipeline.UnitWorkId as UnitWorkId +from HJGL_Pipeline pipeline +left join HJGL_PackagingManageDetail packdetail on pipeline.PipelineId = packdetail.PipelineId +left join HJGL_MaterialCodeLib matlib on packdetail.MaterialCode = matlib.MaterialCode +left join HJGL_PackagingManage pack on packdetail.PackagingManageId = pack.PackagingManageId +left join HJGL_TrainNumberManage trainnumber on pack.TrainNumberId = TrainNumber.Id +where (packdetail.PipelineComponentId is null or packdetail.PipelineComponentId = '')) +SELECT * FROM cte WHERE 1=1 "; + + List listStr = new List(); + if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2) + { + strSql += " and cte.UnitWorkId =@UnitWorkId"; + listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID)); + } + else if (tvControlItem.SelectedNode.CommandName == "流水段") + { + strSql += " and cte.FlowingSection = @FlowingSection "; + listStr.Add(new SqlParameter("@FlowingSection", this.tvControlItem.SelectedNode.Text)); + } + + if (!string.IsNullOrEmpty(txtPipelineCode2.Text)) + { + strSql += " AND cte.PipelineCode like @PipelineCode"; + listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtPipelineCode2.Text.Trim() + "%")); + } + if (!string.IsNullOrEmpty(txtPipelineComponentCode.Text)) + { + strSql += " AND cte.PipelineComponentCode like @PipelineComponentCode"; + listStr.Add(new SqlParameter("@PipelineComponentCode", "%" + this.txtPipelineComponentCode.Text.Trim() + "%")); + } + //if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.SelectedValue != Const._Null) + //{ + // strSql += " AND cte.FlowingSection =@FlowingSection"; + // listStr.Add(new SqlParameter("@FlowingSection", drpFlowingSection.SelectedValue.ToString())); + //} + strSql += " ORDER BY PipelineCode,PipelineComponentCode "; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + return tb; + } + + #endregion + + #region 分页排序 + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + + #endregion + + #region 查询事件 + + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + + #endregion + + #region 刷新页面 + + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + protected void btnTreeFind_Click1(object sender, EventArgs e) + { + this.InitTreeMenu(); + } + #endregion + + public string ConvertProductionState(object state) + { + string StateName = string.Empty; + if (state != null) + { + if (!string.IsNullOrEmpty(state.ToString())) + { + string txt = HJGL_PipelineComponentService.GetProductionState().FirstOrDefault(x => x.Value == state.ToString()).Text; + return txt; + } + } + return StateName; + } + + /// + /// 导出 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + if (GridDataTable != null) + { + var q = (from x in GridDataTable.AsEnumerable() + select new + { + 管线号 = x.Field("PipelineCode"), + 组件编号 = x.Field("PipelineComponentCode"), + 预制散件材料描述 = !string.IsNullOrWhiteSpace(x.Field("matdef")) ? x.Field("matdef") : "-", + 数量 = x.Field("Number"), + 所在包装编号 = x.Field("PackagingCode"), + 车次 = x.Field("TrainNumber"), + 流水段 = x.Field("FlowingSection") + }); + string path = Funs.RootPath + @"File\Excel\Temp\PrePipelineInstallList.xlsx"; + path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HHmm}", DateTime.Now) + ".xlsx"); + + MiniExcel.SaveAs(path, q); + + string fileName = $"安装清单({(string.Format("{0:yyyy-MM-dd-HHmm}", DateTime.Now))}).xlsx"; + FileInfo info = new FileInfo(path); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(path); + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.designer.cs new file mode 100644 index 00000000..e7f9d40b --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.designer.cs @@ -0,0 +1,197 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HJGL.PreDesign +{ + + + public partial class InstallList + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// txtPipelineCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineCode; + + /// + /// hdUnitWorkId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdUnitWorkId; + + /// + /// btnTreeFind 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnTreeFind; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtPipelineCode2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineCode2; + + /// + /// txtPipelineComponentCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineComponentCode; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs index 26560ab4..329aeb87 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs @@ -1,14 +1,9 @@ using BLL; -using FineUIPro.Web.HJGL.WeldingManage; -using Microsoft.Office.Interop.Word; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; -using System.Data.SqlClient; using System.Linq; -using System.Web.UI.DataVisualization.Charting; -using System.Threading.Tasks; namespace FineUIPro.Web.WeldingProcess.WeldingManage { public partial class WeldReportEdit : PageBase diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs index b9de329e..c305a3f4 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs @@ -1,5 +1,4 @@ using BLL; -using Microsoft.Office.Interop.Word; using System; using System.Collections.Generic; using System.Data; diff --git a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml index 1e8a07a0..9eccc8db 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml @@ -16,6 +16,7 @@ +