This commit is contained in:
李鹏飞 2025-05-12 19:05:18 +08:00
commit d99ff19b09
19 changed files with 906 additions and 98 deletions

BIN
.vs/赛鼎/v17/.wsuo Normal file

Binary file not shown.

View File

@ -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}"
}
]
}
]
}
]
}

View File

@ -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','<EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('5811146E-67D5-4D15-8179-775D5F9BA1BD','BD9C587E-17C2-49F1-82AE-A05117E41D89','괏닸',4)
END
GO

View File

@ -876,7 +876,7 @@
<COMReference Include="Microsoft.Office.Interop.Excel">
<Guid>{00020813-0000-0000-C000-000000000046}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>9</VersionMinor>
<VersionMinor>6</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
@ -885,7 +885,7 @@
<COMReference Include="Microsoft.Office.Interop.Word">
<Guid>{00020905-0000-0000-C000-000000000046}</Guid>
<VersionMajor>8</VersionMajor>
<VersionMinor>7</VersionMinor>
<VersionMinor>4</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>

View File

@ -1,5 +1,4 @@

using Microsoft.SqlServer.Dts.Runtime;
using Model;
using System;
using System.Collections;

View File

@ -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

View File

@ -80,6 +80,16 @@ namespace BLL
{
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
}
/// <summary>
/// 根据流水段获取管线信息
/// </summary>
/// <param name="flowingSection"></param>
/// <returns></returns>
public static Model.HJGL_Pipeline GetPipelineByFlowingSection(string flowingSection)
{
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.FlowingSection == flowingSection);
}
/// <summary>
/// 根据管线id获取管线状态
/// </summary>

View File

@ -1,5 +1,4 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections;

View File

@ -1,5 +1,4 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using Model;
using System;
using System.Collections;

View File

@ -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
{

View File

@ -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

View File

@ -1556,6 +1556,7 @@
<Content Include="HJGL\PreDesign\PackagingManageSelect.aspx" />
<Content Include="HJGL\PreDesign\PackagingManageSelectStock.aspx" />
<Content Include="HJGL\PreDesign\PackagingManageView.aspx" />
<Content Include="HJGL\PreDesign\InstallList.aspx" />
<Content Include="HJGL\PreDesign\PrePipelineQRCodeIn.aspx" />
<Content Include="HJGL\PreDesign\TrainNumberManager.aspx" />
<Content Include="HJGL\PreDesign\TrainNumberManageEdit.aspx" />
@ -10570,6 +10571,13 @@
<Compile Include="HJGL\PreDesign\PackagingManageView.aspx.designer.cs">
<DependentUpon>PackagingManageView.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\PreDesign\InstallList.aspx.cs">
<DependentUpon>InstallList.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\PreDesign\InstallList.aspx.designer.cs">
<DependentUpon>InstallList.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\PreDesign\PrePipelineQRCodeIn.aspx.cs">
<DependentUpon>PrePipelineQRCodeIn.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -16567,7 +16575,7 @@
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">

View File

@ -0,0 +1,135 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InstallList.aspx.cs" Inherits="FineUIPro.Web.HJGL.PreDesign.InstallList" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>安装清单</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="300px" Title="WBS目录"
ShowBorder="true" Layout="VBox" ShowHeader="true" AutoScroll="true" BodyPadding="5px"
IconFont="ArrowCircleLeft">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线"
EmptyText="输入查询条件" Width="280px" LabelWidth="60px">
</f:TextBox>
<f:HiddenField runat="server" ID="hdUnitWorkId"></f:HiddenField>
</Items>
</f:Toolbar>
<f:Toolbar runat="server" ToolbarAlign="Right">
<Items>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnTreeFind" ToolTip="查询" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnTreeFind_Click1" runat="server">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Tree ID="tvControlItem" ShowHeader="false" Height="560px" Title="单位工程"
OnNodeCommand="tvControlItem_NodeCommand" runat="server" ShowBorder="false" EnableCollapse="true"
EnableSingleClickExpand="false" AutoLeafIdentification="true" OnNodeExpand="tvControlItem_TreeNodeExpanded"
EnableTextSelection="true">
</f:Tree>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="管线信息"
TitleToolTip="预制管线信息" AutoScroll="true">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtPipelineCode2" runat="server" Label="管线号"
EmptyText="输入查询条件"
Width="240px" LabelWidth="100px" LabelAlign="Right">
</f:TextBox>
<f:TextBox ID="txtPipelineComponentCode" runat="server" Label="组件编号"
EmptyText="输入查询条件"
Width="240px" LabelWidth="100px" LabelAlign="Right">
</f:TextBox>
<f:ToolbarFill ID="ToolbarFill2" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSearch" Icon="SystemSearch" Text="查询"
EnablePostBack="true" runat="server" OnClick="btnSearch_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出"
Icon="TableGo" EnableAjax="false" EnablePostBack="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="组件信息" ForceFit="false"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipelineCode" AllowCellEditing="true"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="PipelineCode"
AllowSorting="true" SortField="PipelineCode" SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField Width="220px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
TextAlign="Left" Locked="true">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="PipelineComponentCode" DataField="PipelineComponentCode" SortField="PipelineComponentCode"
FieldType="String" HeaderText="组件编号" HeaderTextAlign="Center"
TextAlign="Left" Locked="true">
</f:RenderField>
<f:RenderField Width="320px" ColumnID="matdef" DataField="matdef"
FieldType="String" HeaderText="预制散件材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="Number" DataField="Number"
FieldType="String" HeaderText="数量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PackagingCode" DataField="PackagingCode"
FieldType="String" HeaderText="所在包装编号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="110px" ColumnID="TrainNumber" DataField="TrainNumber"
FieldType="String" HeaderText="车次" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="FlowingSection" DataField="FlowingSection"
FieldType="String" HeaderText="流水段" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</form>
<script type="text/javascript">
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -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 --
/// <summary>
/// 加载树
/// </summary>
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<Model.WBS_UnitWork> unitWork1 = null;
List<Model.WBS_UnitWork> 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<string> flowingSection = new List<string>();
//List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
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
/// <summary>
/// 点击TreeView
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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
/// <summary>
/// 数据绑定
/// </summary>
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();
}
/// <summary>
/// 查询数据
/// </summary>
/// <returns></returns>
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<SqlParameter> listStr = new List<SqlParameter>();
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
/// <summary>
/// 页索引改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 分页选择下拉改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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;
}
/// <summary>
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
if (GridDataTable != null)
{
var q = (from x in GridDataTable.AsEnumerable()
select new
{
线 = x.Field<string>("PipelineCode"),
= x.Field<string>("PipelineComponentCode"),
= !string.IsNullOrWhiteSpace(x.Field<string>("matdef")) ? x.Field<string>("matdef") : "-",
= x.Field<string>("Number"),
= x.Field<string>("PackagingCode"),
= x.Field<string>("TrainNumber"),
= x.Field<string>("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);
}
}
}
}

View File

@ -0,0 +1,197 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class InstallList
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtPipelineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipelineCode;
/// <summary>
/// hdUnitWorkId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdUnitWorkId;
/// <summary>
/// btnTreeFind 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnTreeFind;
/// <summary>
/// tvControlItem 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvControlItem;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// txtPipelineCode2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipelineCode2;
/// <summary>
/// txtPipelineComponentCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipelineComponentCode;
/// <summary>
/// ToolbarFill2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill2;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
}
}

View File

@ -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

View File

@ -1,5 +1,4 @@
using BLL;
using Microsoft.Office.Interop.Word;
using System;
using System.Collections.Generic;
using System.Data;

View File

@ -16,6 +16,7 @@
<TreeNode id="F18CFC0E-47E0-477A-9AB3-72B88D438299" Text="堆场规划" NavigateUrl="HJGL/PreDesign/YardPlanning.aspx"></TreeNode>
<TreeNode id="25DED954-10C9-47CC-99F2-C44FDE9E0A81" Text="包装管理" NavigateUrl="HJGL/PreDesign/PackagingManage.aspx"></TreeNode>
<TreeNode id="EEC0D060-C15E-4D25-B015-C2B91F735DAC" Text="车次管理" NavigateUrl="HJGL/PreDesign/TrainNumberManager.aspx"></TreeNode>
<TreeNode id="BD9C587E-17C2-49F1-82AE-A05117E41D89" Text="安装清单" NavigateUrl="HJGL/PreDesign/InstallList.aspx"></TreeNode>
</TreeNode>
<TreeNode id="9B828E92-733B-4AF9-9DD0-55ECD8B64AB8" Text="材料管理" NavigateUrl=""><TreeNode id="E29C1839-3530-45EC-A752-B26A0027E2CD" Text="入库管理" NavigateUrl=""><TreeNode id="324C72AF-447A-4308-AFB7-ABF788C58240" Text="入库申请" NavigateUrl="CLGL/InPlanMaster.aspx"></TreeNode>
<TreeNode id="4A55351A-2440-4A2D-8509-3FFEE5FC8861" Text="入库单管理" NavigateUrl="CLGL/InputMaster.aspx"></TreeNode>