11212
This commit is contained in:
parent
bd97eda8b0
commit
5871297f1f
|
@ -162,7 +162,7 @@
|
|||
</site>
|
||||
<site name="WebApi" id="2">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="E:\MyProject\ZJ_BSF\Basf_TCC7\HJGL\WebApi" />
|
||||
<virtualDirectory path="/" physicalPath="E:\湛江巴斯夫\Basf_TCC7\HJGL\WebApi" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:3862:localhost" />
|
||||
|
@ -250,7 +250,7 @@
|
|||
</site>
|
||||
<site name="FineUIPro.Web(10)" id="13">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="E:\MyProject\ZJ_BSF\Basf_TCC7\HJGL\FineUIPro.Web" />
|
||||
<virtualDirectory path="/" physicalPath="E:\湛江巴斯夫\Basf_TCC7\HJGL\FineUIPro.Web" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:13960:localhost" />
|
||||
|
|
Binary file not shown.
|
@ -9,7 +9,7 @@
|
|||
<section name="FineUIPro" type="FineUIPro.ConfigSection, FineUIPro" requirePermission="false"/>
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="HJGLDBConnectionString" connectionString="Data Source=.\sql2016;Initial Catalog=HJGLDB_ZJBSF;uid=sa;pwd=1111;"/>
|
||||
<add name="HJGLDBConnectionString" connectionString="Data Source=.;Initial Catalog=HJGLDB_ZJBSF;uid=sa;pwd=Sh@nghai9;"/>
|
||||
<!--<add name="HJGLDBConnectionString" connectionString="Data Source=.;Initial Catalog=HJGLDB;Integrated Security=True"
|
||||
providerName="System.Data.SqlClient" />-->
|
||||
</connectionStrings>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
</Toolbars>
|
||||
<Items>
|
||||
<f:Tree ID="tvControlItem" ShowHeader="false" Title="试压包节点树" OnNodeCommand="tvControlItem_NodeCommand"
|
||||
runat="server" ShowBorder="false" EnableCollapse="true" EnableSingleClickExpand="true" AutoLeafIdentification="true"
|
||||
runat="server" ShowBorder="false" EnableCollapse="true" EnableSingleClickExpand="true" AutoLeafIdentification="true"
|
||||
EnableSingleExpand="true" EnableTextSelection="true">
|
||||
</f:Tree>
|
||||
</Items>
|
||||
|
@ -66,7 +66,8 @@
|
|||
<Items>
|
||||
<f:HiddenField runat="server" ID="hdPTP_ID"></f:HiddenField>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"> </f:ToolbarFill>
|
||||
<f:DropDownList ID="drpPrintTypeList" Width="500" EnableMultiSelect="true" EnableCheckBoxSelect="true" runat="server" Label="打印报表" LabelAlign="Right"></f:DropDownList>
|
||||
<f:DropDownList ID="drpPrintTypeList" Width="500" EnableMultiSelect="true"
|
||||
AutoSelectFirstItem="false" EnableCheckBoxSelect="true" runat="server" Label="打印报表" LabelAlign="Right"></f:DropDownList>
|
||||
<f:Button ID="btnPrint" Text="打印" Icon="Printer" EnableAjax="false" runat="server" DisableControlBeforePostBack="false" EnablePostBack="true" OnClick="btnPrint_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnAudit" Text="审核" ToolTip="审核检测单" AjaxLoadingType="Mask" ShowAjaxLoadingMaskText="true"
|
||||
|
@ -175,8 +176,8 @@
|
|||
</Items>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" Title="试压包明细" EnableCollapse="true" Collapsed="false"
|
||||
runat="server" BoxFlex="1" DataKeyNames="PT_PipeId" AllowCellEditing="true"
|
||||
EnableColumnLines="true" ClicksToEdit="2" DataIDField="PT_PipeId" AllowSorting="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="PipelineId" AllowCellEditing="true"
|
||||
EnableColumnLines="true" ClicksToEdit="2" DataIDField="PipelineId" AllowSorting="true"
|
||||
SortField="WorkAreaCode,PipelineCode" SortDirection="ASC" OnSort="Grid1_Sort" EnableTextSelection="True"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange">
|
||||
<Toolbars>
|
||||
|
@ -214,7 +215,7 @@
|
|||
<f:RenderField HeaderText="不合格数" ColumnID="CountU" DataField="CountU" SortField="CountU"
|
||||
FieldType="Int" HeaderTextAlign="Center" TextAlign="Left" Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="应检测比例" ColumnID="NDTR_Name" DataField="NDTR_Name" SortField="NDTR_Name"
|
||||
<f:RenderField HeaderText="应检测比例" ColumnID="NDTR_Rate" DataField="NDTR_Rate" SortField="NDTR_Rate"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="实际检测比例" ColumnID="Ratio" DataField="Ratio" SortField="Ratio"
|
||||
|
|
|
@ -11,12 +11,14 @@ using System.Web.UI;
|
|||
using System.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
using BLL;
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.SS.Util;
|
||||
using NPOI.XSSF.Streaming;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using BorderStyle = NPOI.SS.UserModel.BorderStyle;
|
||||
|
||||
namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
||||
|
@ -83,7 +85,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
|||
this.drpPrintTypeList.DataTextField = "Title";
|
||||
this.drpPrintTypeList.DataValueField = "Id";
|
||||
this.drpPrintTypeList.DataBind();
|
||||
this.drpPrintTypeList.Items.Insert(0, new ListItem("请选择", ""));
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -659,6 +661,11 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
|||
Alert.ShowInTop("请选择打印报表!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID) )
|
||||
{
|
||||
Alert.ShowInTop("请选择试压包!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
CreateDataExcel(selectValArray);
|
||||
}
|
||||
|
@ -1150,210 +1157,360 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
|||
int rowIndex = 0;
|
||||
var style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 10, true, false, "Arial Unicode MS");
|
||||
|
||||
#region 头部
|
||||
//查询数据
|
||||
string sql = @"select * from (
|
||||
select
|
||||
a.PTP_ID,
|
||||
a.TestPackageNo,
|
||||
d.WorkAreaId,
|
||||
d.WorkAreaCode,
|
||||
c.PipelineId,
|
||||
c.PipelineCode,
|
||||
c.SystemNumber,
|
||||
a.TestHeat,
|
||||
a.TestType,
|
||||
c.SingleNumber,
|
||||
c.DrawingsNum,
|
||||
a.Remark,
|
||||
(select top 1 PageNum from Pipeline_WeldJoint where PipelineId=b.PipelineId order by WeldJointCode) as PageNum
|
||||
from PTP_TestPackage as a
|
||||
inner join
|
||||
PTP_PipelineList as b on a.PTP_ID=b.PTP_ID
|
||||
left join
|
||||
Pipeline_Pipeline as c on b.PipelineId=c.PipelineId
|
||||
left join Project_WorkArea as d on b.WorkAreaId=d.WorkAreaId
|
||||
) as t where PTP_ID=@PTP_ID ";
|
||||
SqlParameter[] parms = new SqlParameter[]{
|
||||
new SqlParameter("@PTP_ID",this.tvControlItem.SelectedNodeID)
|
||||
};
|
||||
var dt = SQLHelper.GetDataTableRunText(sql, parms);
|
||||
//获取试压包第一行记录
|
||||
|
||||
#region 分页数据
|
||||
var tbNum = dt.Rows.Count;
|
||||
var pageNum =tbNum < 34 ? 1
|
||||
: Math.Ceiling((float)(tbNum - 34) / 34) + 1;
|
||||
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex + 14, style, 0, 17, true);
|
||||
ws.GetRow(rowIndex).GetCell(15).SetCellValue("Form No.");
|
||||
ws.GetRow(rowIndex).GetCell(16).SetCellValue("TP-06");
|
||||
//设置列宽度
|
||||
ws.SetColumnWidth(0, 3 * 256);
|
||||
ws.SetColumnWidth(1, 3 * 256);
|
||||
ws.SetColumnWidth(2, 8 * 256);
|
||||
ws.SetColumnWidth(3, 5 * 256);
|
||||
ws.SetColumnWidth(4, 5 * 256);
|
||||
ws.SetColumnWidth(5, 8 * 256);
|
||||
ws.SetColumnWidth(6, 8 * 256);
|
||||
ws.SetColumnWidth(7, 4 * 256);
|
||||
ws.SetColumnWidth(8, 8 * 256);
|
||||
ws.SetColumnWidth(9, 8 * 256);
|
||||
ws.SetColumnWidth(10, 8 * 256);
|
||||
ws.SetColumnWidth(11, 8 * 256);
|
||||
ws.SetColumnWidth(12, 1 * 256);
|
||||
ws.SetColumnWidth(13, 9 * 256);
|
||||
ws.SetColumnWidth(14, 9 * 256);
|
||||
ws.SetColumnWidth(15, 10 * 256);
|
||||
ws.SetColumnWidth(16, 6 * 256);
|
||||
ws.SetColumnWidth(17, 6 * 256);
|
||||
//设置前3行高度
|
||||
ws.GetRow(0).Height = 15 * 20;
|
||||
ws.GetRow(1).Height = 15 * 20;
|
||||
ws.GetRow(2).Height = 14 * 20;
|
||||
|
||||
//设置3-15行的行高度
|
||||
for (int i = 3; i < 15; i++)
|
||||
for (int i = 1; i <= pageNum; i++)
|
||||
{
|
||||
ws.GetRow(i).Height = 18 * 20;
|
||||
#region 头部
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex + 15, style, 0, 17, true);
|
||||
ws.GetRow(rowIndex).GetCell(15).SetCellValue("Form No.");
|
||||
ws.GetRow(rowIndex).GetCell(16).SetCellValue("TP-06");
|
||||
|
||||
#region 设置样式
|
||||
//设置列宽度
|
||||
ws.SetColumnWidth(0, 3 * 256);
|
||||
ws.SetColumnWidth(1, 3 * 256);
|
||||
ws.SetColumnWidth(2, 8 * 256);
|
||||
ws.SetColumnWidth(3, 5 * 256);
|
||||
ws.SetColumnWidth(4, 5 * 256);
|
||||
ws.SetColumnWidth(5, 8 * 256);
|
||||
ws.SetColumnWidth(6, 8 * 256);
|
||||
ws.SetColumnWidth(7, 4 * 256);
|
||||
ws.SetColumnWidth(8, 8 * 256);
|
||||
ws.SetColumnWidth(9, 8 * 256);
|
||||
ws.SetColumnWidth(10, 8 * 256);
|
||||
ws.SetColumnWidth(11, 8 * 256);
|
||||
ws.SetColumnWidth(12, 1 * 256);
|
||||
ws.SetColumnWidth(13, 9 * 256);
|
||||
ws.SetColumnWidth(14, 10 * 256);
|
||||
ws.SetColumnWidth(15, 10 * 256);
|
||||
ws.SetColumnWidth(16, 10 * 256);
|
||||
ws.SetColumnWidth(17, 6 * 256);
|
||||
//设置前3行高度
|
||||
ws.GetRow(rowIndex + 0).Height = 15 * 20;
|
||||
ws.GetRow(rowIndex + 1).Height = 15 * 20;
|
||||
ws.GetRow(rowIndex + 2).Height = 14 * 20;
|
||||
ws.GetRow(rowIndex + 3).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 4).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 5).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 6).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 7).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 8).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 9).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 10).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 11).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 12).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 13).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 14).Height = 18 * 20;
|
||||
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex+0, rowIndex+0, 1, 1), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex+1, rowIndex+1, 17, 17), ws);
|
||||
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(rowIndex+1, rowIndex + 1, 16, 16), ws);
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(rowIndex + 1, rowIndex + 1, 17, 17), ws);
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(rowIndex + 1, rowIndex + 1, 2, 16), ws);
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(rowIndex + 2, rowIndex + 2, 2, 16), ws);
|
||||
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 1, rowIndex + 14, 0, 0), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 2, rowIndex + 14, 1, 1), ws);
|
||||
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 2, rowIndex + 14, 16, 16), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 2, rowIndex + 14, 17, 17), ws);
|
||||
|
||||
|
||||
RegionUtil.SetBorderLeft(2, new CellRangeAddress(rowIndex + 9, rowIndex + 14, 2, 2), ws);
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex + 7, rowIndex + 7, 2, 16), ws);
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex + 8, rowIndex + 8, 2, 16), ws);
|
||||
#endregion
|
||||
|
||||
#region 插入图片
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 3, rowIndex + 2, 4, 3, img1, 1.2, 1.8);
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 3, rowIndex + 3, 4, 4, img2, 1.9, 1.9);
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 3, rowIndex + 13, 4, 14, img3, 1.5, 1.5);
|
||||
InsertImage(hssfworkbook, ws, rowIndex + 3, rowIndex + 15, 4, 16, img4, 1.5, 1.5);
|
||||
#endregion
|
||||
|
||||
#region 试压包头部分
|
||||
|
||||
string TestPackageNo = string.Empty;
|
||||
string WorkAreaCode = string.Empty;
|
||||
string SystemNo = string.Empty;
|
||||
string TestHeat = string.Empty;
|
||||
string TestType = string.Empty;
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
TestPackageNo = dt.Rows[0]["TestPackageNo"].ToString();
|
||||
WorkAreaCode = dt.Rows[0]["WorkAreaCode"].ToString();
|
||||
SystemNo = dt.Rows[0]["SystemNumber"].ToString();
|
||||
TestHeat = dt.Rows[0]["TestHeat"].ToString();
|
||||
TestType = dt.Rows[0]["TestType"].ToString();
|
||||
}
|
||||
ws.GetRow(rowIndex + 3).GetCell(5).SetCellValue("巴斯夫(广东)一体化项目");
|
||||
var setStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 14, true, true, "Arial Unicode MS");
|
||||
ws.GetRow(rowIndex + 3).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 5, 13));
|
||||
ws.GetRow(rowIndex + 4).GetCell(5).SetCellValue("BASF (GUANGDONG) INTEGRATED PROJECT");
|
||||
ws.GetRow(rowIndex + 4).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 5, 5, 13));
|
||||
ws.GetRow(rowIndex + 5).GetCell(5).SetCellValue("试压包流程图清单");
|
||||
ws.GetRow(rowIndex + 5).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 5, 13));
|
||||
ws.GetRow(rowIndex + 6).GetCell(5).SetCellValue("TEST PACKAGE P&ID DRAWING LIST");
|
||||
ws.GetRow(rowIndex + 6).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
var cellStyle2 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Top, NPOI.SS.UserModel.HorizontalAlignment.Left, 11, false, false, "Arial Unicode MS");
|
||||
ws.GetRow(rowIndex + 9).GetCell(2).SetCellValue("Test Package No");
|
||||
ws.GetRow(rowIndex + 9).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 9).GetCell(5).SetCellValue(TestPackageNo);
|
||||
ws.GetRow(rowIndex + 9).GetCell(5).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 9).GetCell(9).SetCellValue("Area");
|
||||
ws.GetRow(rowIndex + 9).GetCell(9).CellStyle = cellStyle2;
|
||||
ws.GetRow(rowIndex + 9).GetCell(13).SetCellValue(WorkAreaCode);
|
||||
|
||||
ws.GetRow(rowIndex + 10).GetCell(2).SetCellValue("试压包号");
|
||||
ws.GetRow(rowIndex + 10).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 10).GetCell(9).SetCellValue("区域");
|
||||
ws.GetRow(rowIndex + 10).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(2).SetCellValue("System No");
|
||||
ws.GetRow(rowIndex + 11).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(5).SetCellValue(SystemNo);
|
||||
ws.GetRow(rowIndex + 11).GetCell(5).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(9).SetCellValue("Test Pressure");
|
||||
ws.GetRow(rowIndex + 11).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(13).SetCellValue(TestHeat);
|
||||
ws.GetRow(rowIndex + 11).GetCell(13).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 12).GetCell(2).SetCellValue("系统号");
|
||||
ws.GetRow(rowIndex + 12).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 12).GetCell(9).SetCellValue("试验压力");
|
||||
ws.GetRow(rowIndex + 12).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 13).GetCell(9).SetCellValue("Test Type");
|
||||
ws.GetRow(rowIndex + 13).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 13).GetCell(13).SetCellValue(TestType);
|
||||
ws.GetRow(rowIndex + 13).GetCell(13).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 14).GetCell(9).SetCellValue("试验方式");
|
||||
ws.GetRow(rowIndex + 14).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 9, rowIndex + 14, 8, 8), ws);
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 表格部分
|
||||
//数据表头部分
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 5, 13));
|
||||
ws.GetRow(rowIndex+15).GetCell(0).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None);
|
||||
ws.GetRow(rowIndex + 15).GetCell(1).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
ws.GetRow(rowIndex + 15).GetCell(17).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 3, 8));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 9, 13));
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(rowIndex + 15, rowIndex + 15, 2, 16), ws);
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex + 15, rowIndex + 15, 2, 16), ws);
|
||||
ws.GetRow(rowIndex + 15).GetCell(2).SetCellValue("No\r\n序号");
|
||||
ws.GetRow(rowIndex + 15).GetCell(3).SetCellValue("P&ID Drawing No.\r\n流程图号");
|
||||
ws.GetRow(rowIndex + 15).GetCell(9).SetCellValue("Drawing Description\r\n图纸名称");
|
||||
ws.GetRow(rowIndex + 15).GetCell(14).SetCellValue("Rev\r\n版本");
|
||||
ws.GetRow(rowIndex + 15).GetCell(15).SetCellValue("Sheet No.\r\n页码");
|
||||
ws.GetRow(rowIndex + 15).GetCell(16).SetCellValue("Remark\r\n备注");
|
||||
ws.GetRow(rowIndex + 15).Height = 40 * 20;
|
||||
|
||||
style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 11,false, false, "Arial Unicode MS");
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex+16, rowIndex + 50, style, 0, 17, true);
|
||||
|
||||
var dataTit = rowIndex + 16;
|
||||
|
||||
var dStart = 0;
|
||||
var dEnd = 0;
|
||||
if (i == 1)
|
||||
{
|
||||
dStart = 0;
|
||||
dEnd = 34;
|
||||
}
|
||||
else
|
||||
{
|
||||
dStart = i == 2 ? 34 : ((i - 2) * 34) + 34;
|
||||
dEnd = ((i - 1) * 34) + 34;
|
||||
}
|
||||
var pageTb = GetPageToTable(dt, dStart, dEnd);
|
||||
int nextRow = 0;
|
||||
int lastRow = 0;
|
||||
for (int j = 0; j < pageTb.Rows.Count; j++)
|
||||
{
|
||||
int dataIndex = dataTit + j;
|
||||
ws.GetRow(dataIndex).GetCell(2).SetCellValue($"{j + 1}");
|
||||
ws.GetRow(dataIndex).GetCell(3).SetCellValue(pageTb.Rows[i]["PipelineCode"].ToString());
|
||||
ws.GetRow(dataIndex).GetCell(9).SetCellValue(pageTb.Rows[i]["SingleNumber"].ToString());
|
||||
ws.GetRow(dataIndex).GetCell(14).SetCellValue(pageTb.Rows[i]["DrawingsNum"].ToString());
|
||||
ws.GetRow(dataIndex).GetCell(15).SetCellValue(pageTb.Rows[i]["PageNum"].ToString());
|
||||
ws.GetRow(dataIndex).GetCell(16).SetCellValue(pageTb.Rows[i]["Remark"].ToString());
|
||||
ws.GetRow(dataIndex).Height = 14 * 20;
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + dataIndex, rowIndex + dataIndex, 3, 8));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + dataIndex, rowIndex + dataIndex, 9, 13));
|
||||
ws.GetRow(dataIndex).GetCell(1).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
ws.GetRow(dataIndex).GetCell(17).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
RegionUtil.SetBorderLeft(1, new CellRangeAddress(dataIndex, dataIndex, 2, 16), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 2, 2), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 8, 8), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 13, 13), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 14, 14), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 15, 15), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 16, 16), ws);
|
||||
RegionUtil.SetBorderBottom(1, new CellRangeAddress(dataIndex, dataIndex, 2, 16), ws);
|
||||
nextRow = dataIndex;
|
||||
}
|
||||
//如果pageData不满足33行数据的情况下,将设置剩余行高
|
||||
if (pageTb.Rows.Count < 34)
|
||||
{
|
||||
for (int k = 1; k <= 34 - pageTb.Rows.Count; k++)
|
||||
{
|
||||
int dataIndex = rowIndex + nextRow + k;
|
||||
ws.GetRow(dataIndex).Height = 14 * 20;
|
||||
ws.GetRow(dataIndex).GetCell(0).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None);
|
||||
ws.GetRow(dataIndex).GetCell(1).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
ws.GetRow(dataIndex).GetCell(17).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
ws.AddMergedRegion(new CellRangeAddress(dataIndex, dataIndex, 3, 8));
|
||||
ws.AddMergedRegion(new CellRangeAddress(dataIndex, dataIndex, 9, 13));
|
||||
RegionUtil.SetBorderLeft(1, new CellRangeAddress(dataIndex, dataIndex, 2, 16), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 2, 2), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 8, 8), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 13, 13), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 14, 14), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 15, 15), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(dataIndex, dataIndex, 16, 16), ws);
|
||||
RegionUtil.SetBorderBottom(1, new CellRangeAddress(dataIndex, dataIndex, 2, 16), ws);
|
||||
lastRow = nextRow + k;
|
||||
}
|
||||
}
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex + lastRow, rowIndex + lastRow, 2, 16), ws);
|
||||
#endregion
|
||||
|
||||
#region 尾部
|
||||
|
||||
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex+50, rowIndex + 55, style, 0, 17, true);
|
||||
ws.GetRow(rowIndex + 50).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 51).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 52).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 53).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 54).Height = 18 * 20;
|
||||
ws.GetRow(rowIndex + 55).Height = 4 * 20;
|
||||
RegionUtil.SetBorderLeft(2, new CellRangeAddress(rowIndex + 50, rowIndex + 55, 1, 1),ws);
|
||||
RegionUtil.SetBorderLeft(2, new CellRangeAddress(rowIndex + 50, rowIndex + 55, 18, 18), ws);
|
||||
|
||||
RegionUtil.SetBorderLeft(2, new CellRangeAddress(rowIndex + 50, rowIndex + 54, 2, 2), ws);
|
||||
RegionUtil.SetBorderLeft(2, new CellRangeAddress(rowIndex + 50, rowIndex + 54, 17, 17), ws);
|
||||
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex + 52, rowIndex + 52, 2, 16), ws);
|
||||
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 50, rowIndex + 52, 4, 4), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 50, rowIndex + 52, 6, 6), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 50, rowIndex + 52, 9, 9), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 50, rowIndex + 52, 13, 13), ws);
|
||||
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 53, rowIndex + 53, 4, 4), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 53, rowIndex + 53, 4, 4), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 53, rowIndex + 53, 6, 6), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 53, rowIndex + 53, 9, 9), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 53, rowIndex + 53, 13, 13), ws);
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex + 53, rowIndex + 54, 2, 16), ws);
|
||||
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(rowIndex + 54, rowIndex + 54, 2, 6), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 54, rowIndex + 54, 6, 6), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 54, rowIndex + 54, 9, 9), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(rowIndex + 54, rowIndex + 54, 13, 13), ws);
|
||||
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(rowIndex + 55, rowIndex + 55, 1, 17), ws);
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 2, 4));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 5, 6));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 7, 9));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 10, 13));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 14, 16));
|
||||
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 53, 2, 4));
|
||||
ws.GetRow(rowIndex + 53).GetCell(2).SetCellValue("PREPARED");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 53, 5, 6));
|
||||
ws.GetRow(rowIndex + 53).GetCell(5).SetCellValue("REVIEW");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 54, 7, 9));
|
||||
ws.GetRow(rowIndex + 53).GetCell(7).SetCellValue("JIANLI");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 54, 10, 13));
|
||||
ws.GetRow(rowIndex + 53).GetCell(10).SetCellValue("Worley");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 54, 14, 16));
|
||||
ws.GetRow(rowIndex + 53).GetCell(14).SetCellValue("BASF");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 54, rowIndex + 54, 2, 6));
|
||||
ws.GetRow(rowIndex + 54).GetCell(2).SetCellValue("CC7");
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
rowIndex = rowIndex + 60;
|
||||
}
|
||||
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(0, 0, 1, 1), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(1, 1, 17, 17), ws);
|
||||
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(1, 1, 16, 16), ws);
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(1, 1, 17, 17), ws);
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(1, 1, 2, 16), ws);
|
||||
RegionUtil.SetBorderTop(2, new CellRangeAddress(2, 2, 2, 16), ws);
|
||||
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(1, 14, 0, 0), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(2, 14, 1, 1), ws);
|
||||
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(2, 14, 16, 16), ws);
|
||||
RegionUtil.SetBorderRight(2, new CellRangeAddress(2, 14, 17, 17), ws);
|
||||
|
||||
|
||||
RegionUtil.SetBorderLeft(2, new CellRangeAddress(9, 14, 2, 2), ws);
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(7, 7, 2, 16), ws);
|
||||
RegionUtil.SetBorderBottom(2, new CellRangeAddress(8, 8, 2, 16), ws);
|
||||
//插入图片
|
||||
InsertImage(hssfworkbook, ws, 3, 2, 4, 3, img1, 1.2, 1.8);
|
||||
InsertImage(hssfworkbook, ws, 3, 3, 4, 4, img2, 1.9, 1.9);
|
||||
InsertImage(hssfworkbook, ws, 3, 13, 4, 14, img3, 1.5, 1.5);
|
||||
InsertImage(hssfworkbook, ws, 3, 15, 4, 16, img4, 1.5, 1.5);
|
||||
|
||||
ws.GetRow(rowIndex + 3).GetCell(5).SetCellValue("巴斯夫(广东)一体化项目");
|
||||
var setStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 14, true, true, "Arial Unicode MS");
|
||||
ws.GetRow(rowIndex + 3).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 5, 13));
|
||||
ws.GetRow(rowIndex + 4).GetCell(5).SetCellValue("BASF (GUANGDONG) INTEGRATED PROJECT");
|
||||
ws.GetRow(rowIndex + 4).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 5, 5, 13));
|
||||
ws.GetRow(rowIndex + 5).GetCell(5).SetCellValue("试压包流程图清单");
|
||||
ws.GetRow(rowIndex + 5).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 5, 13));
|
||||
ws.GetRow(rowIndex + 6).GetCell(5).SetCellValue("TEST PACKAGE P&ID DRAWING LIST");
|
||||
ws.GetRow(rowIndex + 6).GetCell(5).CellStyle = setStyle;
|
||||
|
||||
var cellStyle2 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Top, NPOI.SS.UserModel.HorizontalAlignment.Left, 11, false, false, "Arial Unicode MS");
|
||||
ws.GetRow(rowIndex + 9).GetCell(2).SetCellValue("Test Package No");
|
||||
ws.GetRow(rowIndex + 9).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 9).GetCell(5).SetCellValue("UG-130-FW-HT-001");
|
||||
ws.GetRow(rowIndex + 9).GetCell(5).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 9).GetCell(9).SetCellValue("Area");
|
||||
ws.GetRow(rowIndex + 9).GetCell(9).CellStyle = cellStyle2;
|
||||
ws.GetRow(rowIndex + 9).GetCell(13).SetCellValue("C400");
|
||||
|
||||
ws.GetRow(rowIndex + 10).GetCell(2).SetCellValue("试压包号");
|
||||
ws.GetRow(rowIndex + 10).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 10).GetCell(9).SetCellValue("区域");
|
||||
ws.GetRow(rowIndex + 10).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(2).SetCellValue("System No");
|
||||
ws.GetRow(rowIndex + 11).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(5).SetCellValue("FIRE WATER");
|
||||
ws.GetRow(rowIndex + 11).GetCell(5).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(9).SetCellValue("Test Pressure");
|
||||
ws.GetRow(rowIndex + 11).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 11).GetCell(13).SetCellValue("2");
|
||||
ws.GetRow(rowIndex + 11).GetCell(13).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 12).GetCell(2).SetCellValue("系统号");
|
||||
ws.GetRow(rowIndex + 12).GetCell(2).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 12).GetCell(9).SetCellValue("试验压力");
|
||||
ws.GetRow(rowIndex + 12).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 13).GetCell(9).SetCellValue("Test Type");
|
||||
ws.GetRow(rowIndex + 13).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 13).GetCell(13).SetCellValue("Hydro Test");
|
||||
ws.GetRow(rowIndex + 13).GetCell(13).CellStyle = cellStyle2;
|
||||
|
||||
ws.GetRow(rowIndex + 14).GetCell(9).SetCellValue("试验方式");
|
||||
ws.GetRow(rowIndex + 14).GetCell(9).CellStyle = cellStyle2;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格部分
|
||||
|
||||
style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 11, true, false, "Arial Unicode MS");
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, 15, rowIndex + 49, style, 0, 17, true);
|
||||
for (int i = 15; i < 50; i++)
|
||||
{
|
||||
ws.GetRow(i).Height = 20 * 20;
|
||||
ws.GetRow(i).GetCell(0).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None);
|
||||
ws.GetRow(i).GetCell(1).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
ws.GetRow(i).GetCell(17).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 3, 8));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 9, 13));
|
||||
}
|
||||
ws.GetRow(15).Height = 40 * 20;
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 5, 13));
|
||||
//数据表头部分
|
||||
ws.GetRow(rowIndex + 15).GetCell(2).SetCellValue("No\r\n序号");
|
||||
ws.GetRow(rowIndex + 15).GetCell(3).SetCellValue("P&ID Drawing No.\r\n流程图号");
|
||||
ws.GetRow(rowIndex + 15).GetCell(9).SetCellValue("Drawing Description\r\n图纸名称");
|
||||
ws.GetRow(rowIndex + 15).GetCell(14).SetCellValue("Rev\r\n版本");
|
||||
ws.GetRow(rowIndex + 15).GetCell(15).SetCellValue("Sheet No.\r\n页码");
|
||||
ws.GetRow(rowIndex + 15).GetCell(16).SetCellValue("Remark\r\n备注");
|
||||
|
||||
#endregion
|
||||
|
||||
#region 尾部
|
||||
|
||||
//此处的尾部行数需要根据 得到的动态数据量 来计算,默认写死从50行开始。
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, 49, rowIndex + 55, style, 0, 17, true);
|
||||
for (int i = 49; i <= 55; i++)
|
||||
{
|
||||
ws.GetRow(i).Height = 18 * 20;
|
||||
ws.GetRow(i).GetCell(0).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.Medium);
|
||||
ws.GetRow(i).GetCell(1).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.Medium);
|
||||
ws.GetRow(i).GetCell(17).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium);
|
||||
}
|
||||
|
||||
for (int i = 2; i < 17; i++)
|
||||
{
|
||||
ws.GetRow(rowIndex + 55).GetCell(i).CellStyle = SetStyle(hssfworkbook, BorderStyle.Medium, BorderStyle.Medium, BorderStyle.None, BorderStyle.None);
|
||||
}
|
||||
ws.GetRow(rowIndex + 55).GetCell(1).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.Medium, BorderStyle.Medium, BorderStyle.None);
|
||||
ws.GetRow(rowIndex + 55).GetCell(16).CellStyle = SetStyle(hssfworkbook, BorderStyle.Medium, BorderStyle.Medium, BorderStyle.None, BorderStyle.None);
|
||||
ws.GetRow(rowIndex + 55).GetCell(17).CellStyle = SetStyle(hssfworkbook, BorderStyle.None, BorderStyle.Medium, BorderStyle.None, BorderStyle.Medium);
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 2, 4));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 5, 6));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 7, 9));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 10, 13));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 50, rowIndex + 52, 14, 16));
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 53, 2, 4));
|
||||
ws.GetRow(rowIndex + 53).GetCell(2).SetCellValue("PREPARED");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 53, 5, 6));
|
||||
ws.GetRow(rowIndex + 53).GetCell(5).SetCellValue("REVIEW");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 54, 7, 9));
|
||||
ws.GetRow(rowIndex + 53).GetCell(7).SetCellValue("JIANLI");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 54, 10, 13));
|
||||
ws.GetRow(rowIndex + 53).GetCell(10).SetCellValue("Worley");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 53, rowIndex + 54, 14, 16));
|
||||
ws.GetRow(rowIndex + 53).GetCell(14).SetCellValue("BASF");
|
||||
//合并单元格
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 54, rowIndex + 54, 2, 6));
|
||||
ws.GetRow(rowIndex + 54).GetCell(2).SetCellValue("CC7");
|
||||
#endregion
|
||||
|
||||
ws.PrintSetup.FitWidth = 1;
|
||||
ws.PrintSetup.FitHeight = 0;
|
||||
ws.PrintSetup.PaperSize = (int)PaperSize.A4_Small;
|
||||
|
||||
ws.PrintSetup.Scale = 85;
|
||||
ws.FitToPage = true;
|
||||
|
||||
//垂直水平居中
|
||||
ws.VerticallyCenter = true;
|
||||
ws.HorizontallyCenter = true;
|
||||
//打印边距设置 厘米/3
|
||||
ws.SetMargin(MarginType.RightMargin, (double)2.4 / 3);
|
||||
ws.SetMargin(MarginType.LeftMargin, (double)2.9 / 3);
|
||||
ws.SetMargin(MarginType.TopMargin, (double)2.4 / 3);
|
||||
ws.SetMargin(MarginType.BottomMargin, (double)2.4 / 3);
|
||||
////打印边距设置 厘米/3
|
||||
//ws.SetMargin(MarginType.RightMargin, (double)2.4 / 3);
|
||||
//ws.SetMargin(MarginType.LeftMargin, (double)2.9 / 3);
|
||||
//ws.SetMargin(MarginType.TopMargin, (double)2.4 / 3);
|
||||
//ws.SetMargin(MarginType.BottomMargin, (double)2.4 / 3);
|
||||
|
||||
//页眉页脚间距
|
||||
ws.SetMargin(MarginType.HeaderMargin, 0);
|
||||
|
@ -3114,9 +3271,8 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
|||
ws.PrintSetup.FitWidth = 1;
|
||||
ws.PrintSetup.FitHeight = 0;
|
||||
ws.PrintSetup.PaperSize = (int)PaperSize.A4_Small;
|
||||
|
||||
ws.PrintSetup.Scale = 85;
|
||||
ws.FitToPage = true;
|
||||
|
||||
//横向打印
|
||||
ws.PrintSetup.Landscape = true;
|
||||
//垂直水平居中
|
||||
|
@ -3132,220 +3288,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
|||
ws.SetMargin(MarginType.HeaderMargin, 0);
|
||||
ws.SetMargin(MarginType.FooterMargin, 0);
|
||||
}
|
||||
//22-射线检测比例确认表SHT 3503-J412-2007
|
||||
private void template22_old(XSSFWorkbook hssfworkbook, XSSFSheet ws)
|
||||
{
|
||||
#region 头部
|
||||
var style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 11, true, false, "宋体");
|
||||
int rowIndex = 0;
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex + 4, style, 0, 20, true);
|
||||
|
||||
//设置列宽
|
||||
ws.SetColumnWidth(0, 11 * 256);
|
||||
ws.SetColumnWidth(1, 5 * 256);
|
||||
ws.SetColumnWidth(2, 8 * 256);
|
||||
ws.SetColumnWidth(3, 5 * 256);
|
||||
ws.SetColumnWidth(4, 5 * 256);
|
||||
ws.SetColumnWidth(5, 6 * 256);
|
||||
ws.SetColumnWidth(6, 6 * 256);
|
||||
ws.SetColumnWidth(7, 6 * 256);
|
||||
ws.SetColumnWidth(8, 6 * 256);
|
||||
ws.SetColumnWidth(9, 6 * 256);
|
||||
ws.SetColumnWidth(10, 6 * 256);
|
||||
ws.SetColumnWidth(11, 6 * 256);
|
||||
ws.SetColumnWidth(12, 21 * 256);
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(0, 3, 0, 2));
|
||||
ws.GetRow(rowIndex).GetCell(0).SetCellValue("SH/T 3503-J412-1-2007");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(0, 0, 3, 17));
|
||||
ws.GetRow(rowIndex).GetCell(3).SetCellValue("管道焊接接头射线检测比例确认表(一)");
|
||||
ws.GetRow(rowIndex).GetCell(3).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 16, true, true);
|
||||
ws.AddMergedRegion(new CellRangeAddress(1, 2, 3, 17));
|
||||
ws.GetRow(rowIndex + 1).GetCell(3).SetCellValue("Pipeline Welding Joints Radiographic Examination Rate Confirmation Form(I)");
|
||||
ws.GetRow(rowIndex + 1).GetCell(3).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 16, true, true);
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(0, 3, 18, 20));
|
||||
ws.AddMergedRegion(new CellRangeAddress(3, 3, 3, 17));
|
||||
|
||||
ws.GetRow(rowIndex).GetCell(18).SetCellValue("工程名称:巴斯夫(广东)一体化项目专用化学品二区\nProject Name:BASF (Guangdong) Integrated Project\n单元名称:Citral\nUnit Name:Citral");
|
||||
ws.GetRow(rowIndex).GetCell(18).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Top, NPOI.SS.UserModel.HorizontalAlignment.Left, 11, true, false);
|
||||
|
||||
ws.GetRow(rowIndex + 3).GetCell(3).SetCellValue("共 1 页 第 1 页");
|
||||
|
||||
ws.GetRow(rowIndex + 4).GetCell(0).SetCellValue("执行标准\r\nApplicable code");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(4, 4, 1, 5));
|
||||
ws.AddMergedRegion(new CellRangeAddress(4, 4, 6, 7));
|
||||
ws.AddMergedRegion(new CellRangeAddress(4, 4, 8, 15));
|
||||
ws.AddMergedRegion(new CellRangeAddress(4, 4, 16, 17));
|
||||
ws.AddMergedRegion(new CellRangeAddress(4, 4, 18, 20));
|
||||
ws.GetRow(rowIndex + 4).GetCell(1).SetCellValue("NB/T47013.2-2015");
|
||||
ws.GetRow(rowIndex + 4).GetCell(6).SetCellValue("检测方法\r\nExam. Method");
|
||||
ws.GetRow(rowIndex + 4).GetCell(8).SetCellValue("射线检测\r\nRT");
|
||||
ws.GetRow(rowIndex + 4).GetCell(16).SetCellValue("检测比例\r\nExam. Rate");
|
||||
ws.GetRow(rowIndex + 4).GetCell(18).SetCellValue("5%");
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格部分
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 5, rowIndex + 6, style, 0, 20, true);
|
||||
|
||||
ws.GetRow(rowIndex + 5).Height = 28 * 20;
|
||||
ws.GetRow(rowIndex + 6).Height = 42 * 20;
|
||||
|
||||
//设置表头部分
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 6, 0, 1));
|
||||
ws.GetRow(rowIndex + 5).GetCell(0).SetCellValue("管道编号\r\nPipeline No.");
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 6, 2, 2));
|
||||
ws.GetRow(rowIndex + 5).GetCell(2).SetCellValue("材质\r\nMaterial");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 5, 3, 4));
|
||||
ws.GetRow(rowIndex + 5).GetCell(3).SetCellValue("规 格/Size");
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 3, 4));
|
||||
ws.GetRow(rowIndex + 6).GetCell(3).SetCellValue("mm");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 5, 5, 8));
|
||||
ws.GetRow(rowIndex + 5).GetCell(5).SetCellValue("管道焊接接头\r\nWelding Joints");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 5, 9, 12));
|
||||
ws.GetRow(rowIndex + 5).GetCell(9).SetCellValue("施焊焊工\r\nWelder");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 5, 13, 16));
|
||||
ws.GetRow(rowIndex + 5).GetCell(13).SetCellValue("检测焊接接头\r\nExanined Joints");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 5, rowIndex + 5, 17, 19));
|
||||
ws.GetRow(rowIndex + 5).GetCell(17).SetCellValue("实际检测比例");
|
||||
|
||||
ws.GetRow(rowIndex + 5).GetCell(20).SetCellValue("检测报告编号");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 5, 6));
|
||||
ws.GetRow(rowIndex + 6).GetCell(5).SetCellValue("总数\r\nTotal");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 7, 8));
|
||||
ws.GetRow(rowIndex + 6).GetCell(7).SetCellValue("固定口数\r\nField Joints");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 9, 10));
|
||||
ws.GetRow(rowIndex + 6).GetCell(9).SetCellValue("焊工代号\r\nWelder No.");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 11, 12));
|
||||
ws.GetRow(rowIndex + 6).GetCell(11).SetCellValue("施焊数量\r\nWelded Joints");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 13, 14));
|
||||
ws.GetRow(rowIndex + 6).GetCell(13).SetCellValue("总数\r\nTotal Joints");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 15, 16));
|
||||
ws.GetRow(rowIndex + 6).GetCell(15).SetCellValue("固定口数\r\nField Joints");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 6, rowIndex + 6, 17, 19));
|
||||
ws.GetRow(rowIndex + 6).GetCell(17).SetCellValue("Actual exam. Rate");
|
||||
|
||||
ws.GetRow(rowIndex + 6).GetCell(20).SetCellValue("Examination Report No.");
|
||||
|
||||
//这里创建行数据
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 7, rowIndex + 16, style, 0, 20, true);
|
||||
for (int i = 7; i < 15; i++)
|
||||
{
|
||||
ws.GetRow(rowIndex + i).Height = 25 * 20;
|
||||
}
|
||||
//这里循环数据
|
||||
ws.GetRow(rowIndex + 15).GetCell(0).SetCellValue("小计\r\nTotal");
|
||||
|
||||
#endregion
|
||||
|
||||
#region 尾部
|
||||
|
||||
ws.GetRow(rowIndex + 16).GetCell(0).SetCellValue("备注\r\nRemark");
|
||||
ws.GetRow(rowIndex + 16).GetCell(1).SetCellValue("焊口位置与检测焊口见管道单线图与无损检测报告。\r\nPlease refer to Pipeline Iso-drawing and NDE Report for joints position and examined joints.");
|
||||
ws.GetRow(rowIndex + 16).GetCell(1).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Left, 10, true, false);
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 1, 20));
|
||||
|
||||
|
||||
style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Left, 11, true, false);
|
||||
var style1 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 11, true, false);
|
||||
|
||||
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 17, rowIndex + 24, style, 0, 20, true);
|
||||
|
||||
ws.GetRow(rowIndex + 17).GetCell(20).CellStyle = style1;
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 17, rowIndex + 17, 0, 3));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 17, rowIndex + 17, 4, 9));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 17, rowIndex + 17, 10, 16));
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 17, rowIndex + 17, 17, 20));
|
||||
|
||||
ws.GetRow(rowIndex + 17).GetCell(0).SetCellValue("建设/监理单位\r\nOwner/Supervision Contractor");
|
||||
ws.GetRow(rowIndex + 17).GetCell(4).SetCellValue("总承包单位\r\nGeneral Contractor");
|
||||
ws.GetRow(rowIndex + 17).GetCell(10).SetCellValue("检 测 单 位\r\nExamination Contractor");
|
||||
ws.GetRow(rowIndex + 17).GetCell(17).SetCellValue("施 工 单 位\r\nConstruction Company");
|
||||
ws.GetRow(rowIndex + 17).GetCell(0).CellStyle = ws.GetRow(rowIndex + 17).GetCell(4).CellStyle = ws.GetRow(rowIndex + 17).GetCell(10).CellStyle = ws.GetRow(rowIndex + 17).GetCell(17).CellStyle = style1;
|
||||
ws.GetRow(rowIndex + 17).Height = 31 * 20;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 0, 3));
|
||||
ws.GetRow(rowIndex + 18).GetCell(0).SetCellValue("专业工程师\r\nDiscipline Engineer:");
|
||||
ws.GetRow(rowIndex + 18).Height = 31 * 20;
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 4, 9));
|
||||
ws.GetRow(rowIndex + 18).GetCell(4).SetCellValue("专业工程师\r\nDiscipline Engineer:");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 10, 16));
|
||||
ws.GetRow(rowIndex + 18).GetCell(10).SetCellValue("专业工程师\r\nDiscipline Engineer:");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 17, 20));
|
||||
ws.GetRow(rowIndex + 18).GetCell(17).SetCellValue("专业工程师\r\nDiscipline Engineer:");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 20, rowIndex + 20, 17, 20));
|
||||
ws.GetRow(rowIndex + 20).GetCell(17).SetCellValue("质量检查员:\r\nQuality Inspector:");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 22, rowIndex + 22, 17, 20));
|
||||
ws.GetRow(rowIndex + 20).GetCell(17).SetCellValue("制表:\r\nPrepared:");
|
||||
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 24, rowIndex + 24, 0, 3));
|
||||
ws.GetRow(rowIndex + 24).GetCell(0).SetCellValue("日期Date: 年 月 日");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 24, rowIndex + 24, 4, 9));
|
||||
ws.GetRow(rowIndex + 24).GetCell(4).SetCellValue("日期Date: 年 月 日");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 24, rowIndex + 24, 10, 16));
|
||||
ws.GetRow(rowIndex + 24).GetCell(10).SetCellValue("日期Date: 年 月 日");
|
||||
|
||||
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 24, rowIndex + 24, 17, 20));
|
||||
ws.GetRow(rowIndex + 24).GetCell(17).SetCellValue("日期Date: 年 月 日");
|
||||
ws.GetRow(rowIndex + 19).Height = ws.GetRow(rowIndex + 21).Height = ws.GetRow(rowIndex + 22).Height = ws.GetRow(rowIndex + 23).Height = 2 * 20;
|
||||
|
||||
|
||||
RegionUtil.SetBorderTop(1, new CellRangeAddress(rowIndex + 18, rowIndex + 18, 0, 20), ws);
|
||||
RegionUtil.SetBorderLeft(1, new CellRangeAddress(rowIndex + 18, rowIndex + 24, 0, 0), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(rowIndex + 18, rowIndex + 24, 20, 20), ws);
|
||||
RegionUtil.SetBorderBottom(1, new CellRangeAddress(rowIndex + 24, rowIndex + 24, 0, 20), ws);
|
||||
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(rowIndex + 18, rowIndex + 24, 3, 3), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(rowIndex + 18, rowIndex + 24, 9, 9), ws);
|
||||
RegionUtil.SetBorderRight(1, new CellRangeAddress(rowIndex + 18, rowIndex + 24, 16, 16), ws);
|
||||
|
||||
#endregion
|
||||
|
||||
ws.PrintSetup.FitWidth = 1;
|
||||
ws.PrintSetup.FitHeight = 0;
|
||||
ws.PrintSetup.PaperSize = (int)PaperSize.A4_Small;
|
||||
|
||||
ws.FitToPage = true;
|
||||
|
||||
//横向打印
|
||||
ws.PrintSetup.Landscape = true;
|
||||
//垂直水平居中
|
||||
ws.VerticallyCenter = true;
|
||||
ws.HorizontallyCenter = true;
|
||||
//打印边距设置 厘米/3
|
||||
ws.SetMargin(MarginType.RightMargin, (double)2.4 / 3);
|
||||
ws.SetMargin(MarginType.LeftMargin, (double)2.4 / 3);
|
||||
ws.SetMargin(MarginType.TopMargin, (double)2.9 / 3);
|
||||
ws.SetMargin(MarginType.BottomMargin, (double)2.4 / 3);
|
||||
|
||||
//页眉页脚间距
|
||||
ws.SetMargin(MarginType.HeaderMargin, 0);
|
||||
ws.SetMargin(MarginType.FooterMargin, 0);
|
||||
}
|
||||
|
||||
|
||||
//22-射线检测比例确认表SHT 3503-J412-2007
|
||||
private void template22(XSSFWorkbook hssfworkbook, XSSFSheet ws)
|
||||
{
|
||||
|
@ -6332,7 +6275,37 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
|||
|
||||
|
||||
#region 私有方法
|
||||
/// <summary>
|
||||
/// 查询指定条数分页
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetPageToTable(DataTable dt, int StartNum, int EndNum)
|
||||
{
|
||||
//0页代表每页数据,直接返回
|
||||
if (EndNum == 0) return dt;
|
||||
//数据源为空返回空DataTable
|
||||
if (dt == null) return new DataTable();
|
||||
|
||||
DataTable newdt = dt.Copy();
|
||||
newdt.Clear();//copy dt的框架
|
||||
|
||||
if (StartNum >= dt.Rows.Count)
|
||||
return newdt;//源数据记录数小于等于要显示的记录,直接返回dt
|
||||
|
||||
if (EndNum > dt.Rows.Count)
|
||||
EndNum = dt.Rows.Count;
|
||||
for (int i = StartNum; i <= EndNum - 1; i++)
|
||||
{
|
||||
DataRow newdr = newdt.NewRow();
|
||||
DataRow dr = dt.Rows[i];
|
||||
foreach (DataColumn column in dt.Columns)
|
||||
{
|
||||
newdr[column.ColumnName] = dr[column.ColumnName];
|
||||
}
|
||||
newdt.Rows.Add(newdr);
|
||||
}
|
||||
return newdt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取某一列的所有值
|
||||
/// </summary>
|
||||
|
|
|
@ -79,6 +79,9 @@
|
|||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="ViewModels\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
@ -1,312 +0,0 @@
|
|||
-- 管线焊工 增加是否 PMI处理
|
||||
alter table Pipeline_WeldJoint add isPMI bit NULL
|
||||
GO
|
||||
update Pipeline_WeldJoint set isPMI=0
|
||||
GO
|
||||
|
||||
ALTER VIEW [dbo].[View_Pipeline_WeldJoint]
|
||||
AS
|
||||
/************焊口信息视图*****************/
|
||||
SELECT WeldJoint.WeldJointId,
|
||||
WeldJoint.ProjectId,
|
||||
WeldJoint.PipelineId,
|
||||
WeldJoint.WeldJointCode,
|
||||
dbo.Fun_GetParseInt(WeldJoint.WeldJointCode) AS ConvertWeldJoint,
|
||||
WeldJoint.WeldTypeId,
|
||||
WeldJoint.Material1Id,
|
||||
WeldJoint.Material2Id,
|
||||
WeldJoint.ANSISCH,
|
||||
WeldJoint.Thickness,
|
||||
WeldJoint.Dia,
|
||||
WeldJoint.Size,
|
||||
WeldJoint.JointAttribute,
|
||||
WeldJoint.JointArea,
|
||||
WeldJoint.WeldingMethodId,
|
||||
WeldJoint.IsHotProess,
|
||||
WeldJoint.WeldingLocationId,
|
||||
WeldJoint.WeldMatId,
|
||||
WeldJoint.WeldSilkId,
|
||||
WeldJoint.GrooveTypeId,
|
||||
WeldJoint.PipeSegment,
|
||||
WeldJoint.PipeAssembly1Id,
|
||||
WeldJoint.PipeAssembly2Id,
|
||||
WeldJoint.PipeAssemblyCount,
|
||||
WeldJoint.HeartNo1,
|
||||
WeldJoint.HeartNo2,
|
||||
WeldJoint.LastTemp,
|
||||
WeldJoint.CellTemp,
|
||||
WeldJoint.PrepareTemp,
|
||||
WeldJoint.Electricity,
|
||||
WeldJoint.SystemNumber,
|
||||
WeldJoint.Remark,
|
||||
WeldJoint.DoneDin,
|
||||
WeldJoint.Voltage,
|
||||
WeldJoint.TestPackageNo,
|
||||
WeldJoint.WeldingDailyCode,
|
||||
WeldJoint.WeldingDailyId,
|
||||
WeldJoint.BackingWelderId,
|
||||
WeldJoint.CoverWelderId,
|
||||
WeldJoint.PipingClassId,
|
||||
WeldJoint.Specification,
|
||||
WeldJoint.CancelResult,
|
||||
Project.ProjectCode,
|
||||
Project.ProjectName,
|
||||
Pipeline.PipelineCode,
|
||||
Pipeline.InstallationId,
|
||||
Pipeline.UnitId,
|
||||
Pipeline.SingleNumber,
|
||||
Pipeline.WorkAreaId,
|
||||
WeldType.WeldTypeCode,
|
||||
Material1.MaterialCode AS Material1Code,
|
||||
Material2.MaterialCode AS Material2Code,
|
||||
WeldingMethod.WeldingMethodCode,
|
||||
WeldingLocation.WeldingLocationCode,
|
||||
WeldMat.ConsumablesCode AS WeldMatCode,
|
||||
--WeldSilk.ConsumablesCode AS WeldSilkCode,
|
||||
'' AS WeldSilkCode,
|
||||
GrooveType.GrooveTypeCode,
|
||||
CASE WHEN WeldJoint.WeldingDailyId IS NULL THEN '否' ELSE '是' END AS Is_hjName,
|
||||
CASE WHEN WeldJoint.IsHotProess=1 THEN '是' ELSE '否' END AS IsHotProessStr,
|
||||
Components1.ComponentsCode AS ComponentsCode1,
|
||||
Components2.ComponentsCode AS ComponentsCode2,
|
||||
BackingWelder.WelderCode AS BackingWelderCode,
|
||||
BackingWelder.WelderName AS BackingWelderName,
|
||||
CoverWelder.WelderCode AS CoverWelderCode,
|
||||
CoverWelder.WelderName AS CoverWelderName,
|
||||
(CASE WHEN CoverWelder.WelderCode IS NOT NULL AND BackingWelder.WelderCode IS NOT NULL
|
||||
THEN CoverWelder.WelderCode + '/' + BackingWelder.WelderCode
|
||||
ELSE (ISNULL(CoverWelder.WelderCode,'') + ISNULL(BackingWelder.WelderCode,'')) END) AS WelderCode, --焊工
|
||||
(CASE WHEN Material1.MaterialCode IS NOT NULL AND Material2.MaterialCode IS NOT NULL
|
||||
THEN Material1.MaterialCode + '/' + Material2.MaterialCode
|
||||
ELSE (ISNULL(Material1.MaterialCode,'') + ISNULL(Material2.MaterialCode,'')) END) AS MaterialCode, --材质
|
||||
pipingClass.PipingClassCode,pip.PIPClassCode,
|
||||
CONVERT(VARCHAR(100), WeldingDaily.WeldingDate, 23) AS WeldingDate,
|
||||
WeldJoint.IsCancel,
|
||||
WeldJoint.IsPMI,
|
||||
WeldJoint.IsGoldJoint,
|
||||
WeldJoint.WPQId,wps.WPQCode,
|
||||
WeldJoint.DetectionType,
|
||||
WeldJoint.PageNum
|
||||
FROM Pipeline_WeldJoint AS WeldJoint
|
||||
LEFT JOIN Base_Project AS Project ON Project.ProjectId=WeldJoint.ProjectId
|
||||
LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId = WeldJoint.PipelineId
|
||||
LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=WeldJoint.WeldTypeId
|
||||
LEFT JOIN Base_Material AS Material1 ON Material1.MaterialId = WeldJoint.Material1Id
|
||||
LEFT JOIN Base_Material AS Material2 ON Material2.MaterialId = WeldJoint.Material2Id
|
||||
LEFT JOIN Base_WeldingMethod AS WeldingMethod ON WeldingMethod.WeldingMethodId=WeldJoint.WeldingMethodId
|
||||
LEFT JOIN Base_WeldingLocation AS WeldingLocation ON WeldingLocation.WeldingLocationId=WeldJoint.WeldingLocationId
|
||||
LEFT JOIN Base_Consumables AS WeldMat ON WeldMat.ConsumablesId=WeldJoint.WeldMatId
|
||||
--LEFT JOIN Base_Consumables AS WeldSilk ON WeldSilk.ConsumablesId=WeldJoint.WeldSilkId
|
||||
LEFT JOIN Base_GrooveType AS GrooveType ON GrooveType.GrooveTypeId=WeldJoint.GrooveTypeId
|
||||
LEFT JOIN Base_Components AS Components1 ON Components1.ComponentsId = WeldJoint.PipeAssembly1Id
|
||||
LEFT JOIN Base_Components AS Components2 ON Components2.ComponentsId = WeldJoint.PipeAssembly2Id
|
||||
LEFT JOIN Welder_Welder AS BackingWelder ON BackingWelder.WelderId=WeldJoint.BackingWelderId
|
||||
LEFT JOIN Welder_Welder AS CoverWelder ON CoverWelder.WelderId=WeldJoint.CoverWelderId
|
||||
LEFT JOIN Pipeline_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=WeldJoint.WeldingDailyId
|
||||
LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=WeldJoint.PipingClassId
|
||||
LEFT JOIN dbo.Base_PIPClass pip ON pip.PIPClassId = Pipeline.PIPClassId
|
||||
LEFT JOIN dbo.WPQ_WPQList wps ON wps.WPQId=WeldJoint.WPQId
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER PROC [dbo].[sp_rpt_JointComprehensive]
|
||||
@projectId NVARCHAR(50),
|
||||
@workAreaId NVARCHAR(50)=NULL,
|
||||
@pipelineIds NVARCHAR(MAX) = NULL
|
||||
|
||||
AS
|
||||
/**********焊口综合信息**********/
|
||||
SELECT
|
||||
weldJoint.WeldJointId,
|
||||
weldJoint.ProjectId,
|
||||
WorkArea.WorkAreaId,
|
||||
WorkArea.WorkAreaCode,
|
||||
weldJoint.SystemNumber,
|
||||
weldJoint.TestPackageNo,
|
||||
pipeline.SingleNumber,
|
||||
pipeline.PipelineCode,
|
||||
pipeline.DrawingsNum,
|
||||
pipingClass.PipingClassCode,pip.PIPClassCode,
|
||||
weldJoint.PageNum,
|
||||
weldJoint.PipeSegment,--所属管段
|
||||
weldJoint.WeldJointCode,
|
||||
weldType.WeldTypeCode,
|
||||
weldJoint.JointAttribute,
|
||||
wl.WeldingLocationCode,
|
||||
weldJoint.Dia,
|
||||
weldJoint.Thickness,--壁厚
|
||||
weldJoint.HeartNo1,
|
||||
weldJoint.HeartNo2,
|
||||
com1.ComponentsName AS PipeAssembly1,
|
||||
com2.ComponentsName AS PipeAssembly2,
|
||||
--material.MaterialCode,
|
||||
mat1.MaterialCode AS MaterialCode1,
|
||||
mat2.MaterialCode AS MaterialCode2,
|
||||
cw.WelderCode AS CoverWelderCode,
|
||||
fw.WelderCode AS BackingWelderCode,
|
||||
WeldMethod.WeldingMethodName,
|
||||
medium.MediumName,
|
||||
weldingDaily.WeldingDate,
|
||||
weldingDaily.WeldingDailyCode,
|
||||
trust.TrustBatchCode,
|
||||
--TrustBatchCode.DetectionRateCode,
|
||||
--TrustBatchCode.AcceptLevel,
|
||||
(CASE WHEN weldJoint.IsHotProess=1 THEN '是' ELSE '否' END) AS IsHotProess,
|
||||
null as TrustBatchCode,
|
||||
null as DetectionRateCode,
|
||||
null as AcceptLevel,
|
||||
nde.NDEDate AS CHT_CHECKDATE,
|
||||
ndeItem.NDEReportNo,
|
||||
CAST(CAST(ISNULL(weldJoint.Size,0) AS REAL) AS NVARCHAR(8)) AS JOT_Size,
|
||||
WeldMaterialMat.ConsumablesCode AS WMT_MatCode,
|
||||
WeldMaterialMat.ConsumablesName AS WMT_Matname,
|
||||
weldJoint.WeldSilkId,
|
||||
--WeldMaterialSilk.ConsumablesCode AS hsCode,
|
||||
--WeldMaterialSilk.ConsumablesName AS hsname,
|
||||
--WeldMaterialSilk.UserFlux,
|
||||
weldJoint.Specification,
|
||||
wps.WPQCode,ndttype.DetectionTypeCode,NULL AS HotReportCode,
|
||||
(CASE WHEN (PointBatchItem.PointState='1' OR PointBatchItem.PointState='2')
|
||||
THEN (CASE WHEN PointBatchItem.IsWelderFirst=1 THEN '是首三口' ELSE '是' END) ELSE '否' END) AS if_dk
|
||||
FROM Pipeline_WeldJoint AS weldJoint
|
||||
LEFT JOIN Pipeline_Pipeline AS pipeline ON pipeline.PipelineId = weldJoint.PipelineId
|
||||
LEFT JOIN Project_WorkArea AS WorkArea ON WorkArea.WorkAreaId = pipeline.WorkAreaId
|
||||
LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = weldJoint.Material1Id
|
||||
LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = weldJoint.Material2Id
|
||||
LEFT JOIN Base_WeldingMethod AS WeldMethod ON WeldMethod.WeldingMethodId = weldJoint.WeldingMethodId
|
||||
LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = weldJoint.WeldTypeId
|
||||
LEFT JOIN dbo.Base_WeldingLocation wl ON wl.WeldingLocationId = weldJoint.WeldingLocationId
|
||||
LEFT JOIN Base_Medium AS medium ON medium.MediumId = pipeline.MediumId
|
||||
LEFT JOIN Base_Components com1 ON com1.ComponentsId=weldJoint.PipeAssembly1Id
|
||||
LEFT JOIN Base_Components com2 ON com2.ComponentsId=weldJoint.PipeAssembly2Id
|
||||
LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=WeldJoint.PipingClassId
|
||||
LEFT JOIN dbo.Base_PIPClass pip ON pip.PIPClassId = Pipeline.PIPClassId
|
||||
LEFT JOIN Pipeline_WeldingDaily AS weldingDaily ON weldingDaily.WeldingDailyId = weldJoint.WeldingDailyId
|
||||
LEFT JOIN dbo.WPQ_WPQList wps ON wps.WPQId = weldJoint.WPQId
|
||||
left join Welder_Welder AS fw on weldJoint.BackingWelderId = fw.WelderId
|
||||
left join Welder_Welder AS cw on weldJoint.CoverWelderId = cw.WelderId
|
||||
LEFT JOIN Base_Consumables AS WeldMaterialMat ON WeldMaterialMat.ConsumablesId =weldJoint.WeldMatId
|
||||
--LEFT JOIN Base_Consumables AS WeldMaterialSilk ON WeldMaterialSilk.ConsumablesId =weldJoint.WeldSilkId
|
||||
LEFT JOIN Batch_PointBatchItem AS PointBatchItem ON PointBatchItem.WeldJointId =weldJoint.WeldJointId
|
||||
LEFT JOIN dbo.Batch_PointBatch point ON point.PointBatchId = PointBatchItem.PointBatchId
|
||||
LEFT JOIN dbo.Base_DetectionType ndttype ON ndttype.DetectionTypeId = point.DetectionTypeId
|
||||
LEFT JOIN dbo.Batch_BatchTrustItem trustItem ON trustItem.PointBatchItemId = PointBatchItem.PointBatchItemId
|
||||
LEFT JOIN dbo.Batch_BatchTrust trust ON trust.TrustBatchId = trustItem.TrustBatchId
|
||||
LEFT JOIN dbo.Batch_NDEItem ndeItem ON ndeItem.TrustBatchItemId = trustItem.TrustBatchItemId
|
||||
LEFT JOIN dbo.Batch_NDE nde ON nde.NDEID = ndeItem.NDEID
|
||||
|
||||
WHERE weldJoint.ProjectId=@projectId
|
||||
AND(pipeline.WorkAreaId=@workAreaId OR @workAreaId IS NULL)
|
||||
AND (CHARINDEX(weldJoint.PipelineId,@pipelineIds)>0 or @pipelineIds IS NULl)
|
||||
--AND(pipeline.PipelineCode=@pipelineCode OR @pipelineCode IS NULl)
|
||||
|
||||
GO
|
||||
|
||||
UPDATE dbo.Template_Files SET title=REPLACE(title,cast(sortindex as nvarchar(50))+'-','')
|
||||
GO
|
||||
|
||||
UPDATE dbo.Template_Files SET SortIndex=SortIndex+1 where SortIndex>24
|
||||
GO
|
||||
|
||||
INSERT INTO [dbo].[Template_Files]([id],[title],[filePath],[SortIndex])
|
||||
VALUES('95125974-3DD4-4E16-B4F0-A9D9C9A1406D','管道焊接接头PMI检测比例确认表','',25)
|
||||
GO
|
||||
|
||||
-- PMI处理委托
|
||||
create table PMI_Delegation
|
||||
(
|
||||
Id nvarchar(50) not null primary key,
|
||||
DelegationNo nvarchar(50) not null,
|
||||
DelegationDate datetime,
|
||||
ProjectId nvarchar(50) not null,
|
||||
InstallationId nvarchar(50),
|
||||
UnitId nvarchar(50),
|
||||
DetectionStandard nvarchar(50),
|
||||
Tabler nvarchar(50),
|
||||
Remark nvarchar(255),
|
||||
CreatedTime datetime default getdate()
|
||||
)
|
||||
go
|
||||
---- PMI处理委托 明细
|
||||
create table PMI_DelegationDetails
|
||||
(
|
||||
Id nvarchar(50) not null primary key,
|
||||
PMIId nvarchar(50) not null,
|
||||
JointId nvarchar(50) not null,
|
||||
QualityNo nvarchar(255),
|
||||
Acceptance nvarchar(255),
|
||||
Status int not null,
|
||||
CreatedTime datetime default getdate()
|
||||
)
|
||||
go
|
||||
|
||||
|
||||
-- 插入PMI委托菜单
|
||||
insert into Sys_Menu values('A6FB44C3-0920-4F77-862F-D814FD5E5D23','PMI检测管理','PMI detection management','',21,0,3,NUll,1)
|
||||
insert into Sys_Menu values(NEWID(),'PMI委托','PMI delegation','/WeldingProcess/PMI/PMIDelegation.aspx',1,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1)
|
||||
insert into Sys_Menu values(NEWID(),'PMI检测录入','PMI detection entry','/WeldingProcess/PMI/PMIDetectionEntry.aspx',2,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1)
|
||||
GO
|
||||
|
||||
|
||||
/*******PMI委托明细视图***********/
|
||||
|
||||
USE [HJGLDB_ZJBSF]
|
||||
GO
|
||||
|
||||
/****** Object: View [dbo].[View_PMI_DelegationDetails] Script Date: 2024-5-13 9:06:44 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
-- 增加报告编号
|
||||
ALTER TABLE dbo.PMI_DelegationDetails ADD reportNo NVARCHAR(50)
|
||||
-- 增加报告日期
|
||||
ALTER TABLE dbo.PMI_DelegationDetails ADD reportTime datetime
|
||||
GO
|
||||
|
||||
|
||||
ALTER VIEW [dbo].[View_PMI_DelegationDetails]
|
||||
AS
|
||||
/********PMI处理明细********/
|
||||
SELECT
|
||||
TrustItem.Id,
|
||||
TrustItem.Acceptance,
|
||||
TrustItem.checkTime,
|
||||
TrustItem.reportTime,
|
||||
TrustItem.JointId as WeldJointId,
|
||||
TrustItem.status,
|
||||
TrustItem.QualityNo,
|
||||
TrustItem.PMIId,
|
||||
Trust.ProjectId,
|
||||
Trust.DelegationNo,
|
||||
Trust.DelegationDate,
|
||||
ISNULL(TrustItem.reportNo,Trust.DelegationNo) as reportNo,
|
||||
WeldJoint.WeldJointCode,
|
||||
Pipeline.PipelineCode,
|
||||
WeldJoint.Specification,
|
||||
Material.MaterialCode,
|
||||
Pipeline.WorkAreaId
|
||||
FROM PMI_DelegationDetails AS TrustItem
|
||||
LEFT JOIN PMI_Delegation AS Trust ON Trust.Id=TrustItem.PMIId
|
||||
LEFT JOIN Pipeline_WeldJoint AS WeldJoint ON WeldJoint.WeldJointId=TrustItem.JointId
|
||||
LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId=WeldJoint.PipelineId
|
||||
LEFT JOIN Base_Material AS Material ON Material.MaterialId=WeldJoint.Material1Id
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
USE [HJGLDB_ZJBSF]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Email_Params] Script Date: 2024-5-17 15:35:13 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Email_Params](
|
||||
[ID] [varchar](50) NOT NULL,
|
||||
[MailClassName] [varchar](100) NULL,
|
||||
[MailClassID] [varchar](50) NOT NULL,
|
||||
[CreateName] [varchar](100) NOT NULL,
|
||||
[CreateTime] [datetime] NOT NULL,
|
||||
[UpdateName] [nchar](10) NULL,
|
||||
[UpdateTime] [datetime] NULL,
|
||||
CONSTRAINT [PK_Email_Params] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[ID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Email_Pop] Script Date: 2024-5-17 15:35:13 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Email_Pop](
|
||||
[EmailID] [varchar](50) NOT NULL,
|
||||
[EmailFwq] [varchar](50) NULL,
|
||||
[EmailDk] [varchar](50) NULL,
|
||||
[EmailYx] [varchar](50) NULL,
|
||||
[EmailUsername] [varchar](50) NULL,
|
||||
[EmailPass] [varchar](50) NULL,
|
||||
[CreateTime] [varchar](50) NULL,
|
||||
[CreateName] [varchar](50) NULL,
|
||||
[UpdateTime] [varchar](50) NULL,
|
||||
[UpdateName] [varchar](50) NULL,
|
||||
CONSTRAINT [PK_Email_Pop] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[EmailID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Email_SendLog] Script Date: 2024-5-17 15:35:13 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Email_SendLog](
|
||||
[EmailId] [varchar](50) NOT NULL,
|
||||
[EmailTile] [varchar](255) NULL,
|
||||
[EmailContent] [text] NULL,
|
||||
[EmailURL] [varchar](50) NULL,
|
||||
[EmailName] [varchar](50) NULL,
|
||||
[EmailStatus] [varchar](10) NULL,
|
||||
[CreateTime] [datetime] NULL,
|
||||
[CreateName] [varchar](50) NULL,
|
||||
CONSTRAINT [PK_Email_Send] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[EmailId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Email_SendTemplate] Script Date: 2024-5-17 15:35:13 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Email_SendTemplate](
|
||||
[EmailId] [varchar](50) NOT NULL,
|
||||
[EmailParamsID] [varchar](50) NOT NULL,
|
||||
[EailTiaoJian] [varchar](500) NULL,
|
||||
[EmailUserYN] [int] NULL,
|
||||
[EmailTitle] [varchar](500) NULL,
|
||||
[EmailContext] [text] NULL,
|
||||
[CreateName] [varchar](500) NULL,
|
||||
[CreateTime] [datetime] NULL,
|
||||
[UpdateName] [varchar](500) NULL,
|
||||
[UpdateTime] [datetime] NULL,
|
||||
[EmailDesc] [varchar](500) NULL,
|
||||
CONSTRAINT [PK_Email_SendTemplate] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[EmailId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Email_ToPeople] Script Date: 2024-5-17 15:35:13 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Email_ToPeople](
|
||||
[EmID] [varchar](50) NOT NULL,
|
||||
[EmtempID] [varchar](50) NOT NULL,
|
||||
[EmuserID] [varchar](50) NULL,
|
||||
[EmuserName] [varchar](50) NULL,
|
||||
[EmuaerEmailAddress] [varchar](100) NULL,
|
||||
[EMPeopleType] [varchar](5) NULL,
|
||||
CONSTRAINT [PK_Email_ToPeople] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[EmID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
INSERT [dbo].[Email_Params] ([ID], [MailClassName], [MailClassID], [CreateName], [CreateTime], [UpdateName], [UpdateTime]) VALUES (N'1a800170-48e2-4b41-a2af-20258aa74907', N'监理审核', N'监理', N'管理员', CAST(N'2024-05-16T14:53:01.747' AS DateTime), N'管理员 ', CAST(N'2024-05-16T17:05:42.987' AS DateTime))
|
||||
GO
|
||||
INSERT [dbo].[Email_Params] ([ID], [MailClassName], [MailClassID], [CreateName], [CreateTime], [UpdateName], [UpdateTime]) VALUES (N'859e5eaf-6a9e-46a8-8eb1-f3ba61f3be79', N'管理公司审核', N'管理公司', N'管理员', CAST(N'2024-05-14T17:39:53.640' AS DateTime), N'管理员 ', CAST(N'2024-05-16T17:05:48.370' AS DateTime))
|
||||
GO
|
||||
INSERT [dbo].[Email_Pop] ([EmailID], [EmailFwq], [EmailDk], [EmailYx], [EmailUsername], [EmailPass], [CreateTime], [CreateName], [UpdateTime], [UpdateName]) VALUES (N'7EC5E991-B7A0-495A-90ED-2BE15370C959', N'smtp.163.com', N'25', N'Scs13965090560@163.com', N'scs', N'CLXGLMKBGQBEXSSW', N'2024-5-16 14:46:25', N'管理员', NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'3cfa3bbf-e73a-494b-bb60-f682b52dad84', N'监理—点口未审核的焊口', N'<p style="text-wrap: wrap;">尊敬的各位领导,</p><p style="text-wrap: wrap;"> </p><p style="text-wrap: wrap;"> 您有<span style="color:#ff0000">2105</span>条点口记录待审核!</p><p><br/></p>', N'jackchenyang@sina.cn', N'jackchenyang@sina.cn', N'发送成功', CAST(N'2024-05-17T14:32:14.573' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'3f61427f-2b6f-42cb-8028-27726807f8e8', N'测试再发送一个邮件', N'这是一个邮件内容,请查收!', N'408299694@qq.com', N'408299694@qq.com', N'发送成功', CAST(N'2024-05-16T14:51:03.117' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'632f4c12-08c6-4f19-88a1-5ed760486ae0', N'测试发邮件', N'这个是一个测试的发送邮件内容。。。。', N'874821510@qq.com', N'874821510@qq.com', N'发送失败', CAST(N'2024-05-16T14:45:45.350' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'6488713b-86f4-4dc2-989c-32152fe53727', N'管理公司—点口未审核的焊口', N'<p style="text-wrap: wrap;">尊敬的各位领导,</p><p style="text-wrap: wrap;"> </p><p style="text-wrap: wrap;"> 您有<span style="color:#ff0000">2176</span>条点口记录待审核!</p><p><br style="text-wrap: wrap;"/></p><p><br/></p>', N'jackchenyang@sina.cn', N'jackchenyang@sina.cn', N'发送成功', CAST(N'2024-05-17T14:32:16.627' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'709cb7de-0564-4ab9-84e6-0b0b2f6732d8', N'测试再发送一个邮件', N'这是一个邮件内容,请查收!', N'874821510@qq.com', N'874821510@qq.com', N'发送成功', CAST(N'2024-05-16T14:51:03.113' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'9857506c-83a4-4b79-b09a-d6e061376f17', N'点口未审核的焊口', N'<p style="text-wrap: wrap;">尊敬的各位领导,</p><p style="text-wrap: wrap;"> </p><p style="text-wrap: wrap;"> 您有<span style="color:#ff0000">2176</span>条点口记录待审核!</p><p><br style="text-wrap: wrap;"/></p><p><br/></p>', N'jackchenyang@sina.cn', N'jackchenyang@sina.cn', N'发送成功', CAST(N'2024-05-17T14:26:32.310' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'd349818c-9434-4ff9-ab73-c868c81de870', N'点口未审核的焊口', N'<p style="text-wrap: wrap;">尊敬的各位领导,</p><p style="text-wrap: wrap;"> </p><p style="text-wrap: wrap;"> 您有<span style="color:#ff0000">2105</span>条点口记录待审核!</p><p><br/></p>', N'jackchenyang@sina.cn', N'jackchenyang@sina.cn', N'发送成功', CAST(N'2024-05-17T14:26:10.880' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendLog] ([EmailId], [EmailTile], [EmailContent], [EmailURL], [EmailName], [EmailStatus], [CreateTime], [CreateName]) VALUES (N'd8740146-2ce5-4582-baa0-45063e967f02', N'测试发邮件', N'这个是一个测试的发送邮件内容。。。。', N'874821510@qq.com', N'874821510@qq.com', N'发送成功', CAST(N'2024-05-16T14:46:31.487' AS DateTime), N'sys')
|
||||
GO
|
||||
INSERT [dbo].[Email_SendTemplate] ([EmailId], [EmailParamsID], [EailTiaoJian], [EmailUserYN], [EmailTitle], [EmailContext], [CreateName], [CreateTime], [UpdateName], [UpdateTime], [EmailDesc]) VALUES (N'1a605eaf-6e0a-49d2-a0db-9e1238b65e8a', N'监理', N'点口未审核的焊口', 1, N'监理点口审核', N'<p style="text-wrap: wrap;">尊敬的各位领导,</p><p style="text-wrap: wrap;"> </p><p style="text-wrap: wrap;"> 您有<span style="color:#ff0000">{{totalCount}}</span>条点口记录待审核!</p><p><br/></p>', N'管理员', CAST(N'2024-05-16T17:04:30.020' AS DateTime), N'管理员', CAST(N'2024-05-17T14:16:54.980' AS DateTime), NULL)
|
||||
GO
|
||||
INSERT [dbo].[Email_SendTemplate] ([EmailId], [EmailParamsID], [EailTiaoJian], [EmailUserYN], [EmailTitle], [EmailContext], [CreateName], [CreateTime], [UpdateName], [UpdateTime], [EmailDesc]) VALUES (N'ad5201c3-0398-4316-a880-0a285e0f06fa', N'管理公司', N'点口未审核的焊口', 1, N'管理公司点口审核', N'<p style="text-wrap: wrap;">尊敬的各位领导,</p><p style="text-wrap: wrap;"> </p><p style="text-wrap: wrap;"> 您有<span style="color:#ff0000">{{totalCount}}</span>条点口记录待审核!</p><p><br style="text-wrap: wrap;"/></p><p><br/></p>', N'管理员', CAST(N'2024-05-16T14:54:15.743' AS DateTime), N'管理员', CAST(N'2024-05-17T14:16:58.267' AS DateTime), NULL)
|
||||
GO
|
||||
INSERT [dbo].[Email_ToPeople] ([EmID], [EmtempID], [EmuserID], [EmuserName], [EmuaerEmailAddress], [EMPeopleType]) VALUES (N'33e99721-b831-46f5-83b6-039be6a89050', N'1a605eaf-6e0a-49d2-a0db-9e1238b65e8a', N'29188391-731e-4645-ad09-c99c2a9fc6ce', N'李庆华', N'jackchenyang@sina.cn', N'0')
|
||||
GO
|
||||
INSERT [dbo].[Email_ToPeople] ([EmID], [EmtempID], [EmuserID], [EmuserName], [EmuaerEmailAddress], [EMPeopleType]) VALUES (N'6144c9f6-6e91-4e88-ae3a-fe9f99bc78af', N'ad5201c3-0398-4316-a880-0a285e0f06fa', N'29188391-731e-4645-ad09-c99c2a9fc6ce', N'李庆华', N'jackchenyang@sina.cn', N'0')
|
||||
GO
|
||||
INSERT [dbo].[Email_ToPeople] ([EmID], [EmtempID], [EmuserID], [EmuserName], [EmuaerEmailAddress], [EMPeopleType]) VALUES (N'd78fa8fb-b675-4264-8040-8a0cf3d9649d', N'1a605eaf-6e0a-49d2-a0db-9e1238b65e8a', N'18485804-501b-4123-9e9a-1afb3c53aed0', N'陈阳', N'874821510@qq.com', N'1')
|
||||
GO
|
||||
INSERT [dbo].[Email_ToPeople] ([EmID], [EmtempID], [EmuserID], [EmuserName], [EmuaerEmailAddress], [EMPeopleType]) VALUES (N'ff5fefa1-2ab8-4643-b3f7-b38fd049597a', N'ad5201c3-0398-4316-a880-0a285e0f06fa', N'18485804-501b-4123-9e9a-1afb3c53aed0', N'陈阳', N'874821510@qq.com', N'1')
|
||||
GO
|
||||
SET ANSI_PADDING ON
|
||||
GO
|
||||
/****** Object: Index [IX_Email_Params] Script Date: 2024-5-17 15:35:13 ******/
|
||||
ALTER TABLE [dbo].[Email_Params] ADD CONSTRAINT [IX_Email_Params] UNIQUE NONCLUSTERED
|
||||
(
|
||||
[MailClassID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
GO
|
||||
SET ANSI_PADDING ON
|
||||
GO
|
||||
/****** Object: Index [IX_Email_SendTemplate] Script Date: 2024-5-17 15:35:13 ******/
|
||||
ALTER TABLE [dbo].[Email_SendTemplate] ADD CONSTRAINT [IX_Email_SendTemplate] UNIQUE NONCLUSTERED
|
||||
(
|
||||
[EmailParamsID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[Email_Params] ADD CONSTRAINT [DF_Email_Params_CreateName] DEFAULT ('sys') FOR [CreateName]
|
||||
GO
|
||||
ALTER TABLE [dbo].[Email_Params] ADD CONSTRAINT [DF_Email_Params_CreateTime] DEFAULT (getdate()) FOR [CreateTime]
|
||||
GO
|
||||
ALTER TABLE [dbo].[Email_ToPeople] ADD CONSTRAINT [DF_Email_ToPeople_EMPeopleType] DEFAULT ((0)) FOR [EMPeopleType]
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_Params', @level2type=N'COLUMN',@level2name=N'MailClassName'
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_Params', @level2type=N'COLUMN',@level2name=N'MailClassID'
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'参数MailClassID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_SendTemplate', @level2type=N'COLUMN',@level2name=N'EmailParamsID'
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容条件说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_SendTemplate', @level2type=N'COLUMN',@level2name=N'EailTiaoJian'
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_SendTemplate', @level2type=N'COLUMN',@level2name=N'EmailTitle'
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件具体内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_SendTemplate', @level2type=N'COLUMN',@level2name=N'EmailContext'
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_SendTemplate', @level2type=N'COLUMN',@level2name=N'EmailDesc'
|
||||
GO
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送人类型 0-发送人 1-抄送人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Email_ToPeople', @level2type=N'COLUMN',@level2name=N'EMPeopleType'
|
||||
GO
|
||||
|
||||
--- 插入菜单
|
||||
INSERT [dbo].[Sys_Menu] ([MenuId], [MenuName], [MenuEnName], [Url], [SortIndex], [SuperMenu], [MenuModule], [IsAudiFlow], [IsUse]) VALUES (N'97143EDB-6A32-4BBA-9F49-E33E87912BC8', N'发送邮件', N'Send Email', N'Email_Send/Email_Send_Edit.aspx', 10, N'D05CSEAC-2854-4822-A7E9-24AD3EAF0A6E', N'2 ', NULL, 1)
|
||||
GO
|
||||
INSERT [dbo].[Sys_Menu] ([MenuId], [MenuName], [MenuEnName], [Url], [SortIndex], [SuperMenu], [MenuModule], [IsAudiFlow], [IsUse]) VALUES (N'9E9DD8E3-D91B-4FD4-B922-2F5CC23D2745', N'邮件配置', N'Send Email Pop', N'Email_Send/Email_Pop_Edit.aspx', 20, N'D05CSEAC-2854-4822-A7E9-24AD3EAF0A6E', N'2 ', NULL, 1)
|
||||
GO
|
||||
INSERT [dbo].[Sys_Menu] ([MenuId], [MenuName], [MenuEnName], [Url], [SortIndex], [SuperMenu], [MenuModule], [IsAudiFlow], [IsUse]) VALUES (N'D05CSEAC-2854-4822-A7E9-24AD3EAF0A6E', N'发送邮件', N'Send Email', N'', 60, N'0', N'2 ', NULL, 1)
|
||||
GO
|
||||
INSERT [dbo].[Sys_Menu] ([MenuId], [MenuName], [MenuEnName], [Url], [SortIndex], [SuperMenu], [MenuModule], [IsAudiFlow], [IsUse]) VALUES (N'F19A6438-C757-4BC2-ADC2-72AAF02089E5', N'邮件类型', N'Mail Parameters', N'Email_Send/Email_Params_List.aspx', 60, N'D05CSEAC-2854-4822-A7E9-24AD3EAF0A6E', N'2 ', NULL, 1)
|
||||
GO
|
||||
INSERT [dbo].[Sys_Menu] ([MenuId], [MenuName], [MenuEnName], [Url], [SortIndex], [SuperMenu], [MenuModule], [IsAudiFlow], [IsUse]) VALUES (N'06EB7C08-6F6E-433B-91A7-579BFC435A0C', N'邮件模板设置', N'Send Email Template', N'Email_Send/Email_SendTemplate_List.aspx', 40, N'D05CSEAC-2854-4822-A7E9-24AD3EAF0A6E', N'2 ', NULL, 1)
|
||||
GO
|
||||
INSERT [dbo].[Sys_Menu] ([MenuId], [MenuName], [MenuEnName], [Url], [SortIndex], [SuperMenu], [MenuModule], [IsAudiFlow], [IsUse]) VALUES (N'5941BE0C-C262-48C7-899F-F0BE5A779926', N'发送邮件日志', N'Send Email Log', N'Email_Send/Email_SendLog_List.aspx', 30, N'D05CSEAC-2854-4822-A7E9-24AD3EAF0A6E', N'2 ', NULL, 1)
|
||||
GO
|
||||
|
||||
|
||||
SELECT * FROM dbo.Sys_Menu WHERE MenuName LIKE '%邮件%'
|
|
@ -1,106 +0,0 @@
|
|||
UPDATE dbo.Batch_PointBatchItem SET PointState=NULL,PointDate=NULL,
|
||||
JLAudit=NULL,GLGSAudit=NULL,QTAudit=NULL
|
||||
WHERE PointState='1' AND
|
||||
PointBatchItemId NOT IN(SELECT PointBatchItemId FROM dbo.Batch_BatchTrustItem)
|
||||
GO
|
||||
|
||||
UPDATE dbo.Batch_PointBatchItem SET IsCompletedPoint=1
|
||||
GO
|
||||
|
||||
alter table PTP_PipelineList add WorkAreaId nvarchar(50)
|
||||
alter table PTP_PipelineList add isAll bit
|
||||
alter table PTP_PipelineList add WeldJonintCode nvarchar(max)
|
||||
GO
|
||||
|
||||
|
||||
ALTER VIEW [dbo].[View_Batch_PointBatchItem]
|
||||
AS
|
||||
/*************点口明细表*************/
|
||||
SELECT PointBatchItem.PointBatchItemId,
|
||||
PointBatchItem.PointBatchId,
|
||||
PointBatch.ProjectId,
|
||||
PointBatch.InstallationId,
|
||||
PointBatch.UnitId,
|
||||
PointBatch.PointBatchCode,
|
||||
PointBatch.DetectionTypeId,
|
||||
Pipeline.WorkAreaId,
|
||||
PointBatchItem.WeldJointId,
|
||||
PointBatchItem.PointState AS PState,
|
||||
(CASE PointBatchItem.PointState WHEN '1' THEN '点口' WHEN '2' THEN '扩透' END) AS PointState,
|
||||
--(CASE PointBatchItem.IsAudit WHEN 1 THEN '是' ELSE '否' END) AS PointIsAudit,
|
||||
--(CASE WHEN PointBatchItem.IsAudit=1 THEN '是'
|
||||
-- WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NOT NULL THEN '否'
|
||||
-- WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NULL THEN '' END) AS PointIsAudit,
|
||||
PointBatchItem.PointDate,--点口日期
|
||||
PointBatchItem.RepairDate,--返修日期
|
||||
PointBatchItem.CutDate,--切除日期
|
||||
PointBatchItem.RepairRecordId,
|
||||
PointBatchItem.IsBuildTrust,--是否委托
|
||||
WorkArea.WorkAreaCode,--工区号
|
||||
jot.WeldJointCode,--焊口号
|
||||
jot.BackingWelderId AS WelderId, --焊工ID
|
||||
jot.JointArea,--焊接区域
|
||||
jot.Dia,
|
||||
jot.Size,--实际寸径
|
||||
WeldingDaily.WeldingDate,--焊接日期
|
||||
jot.PipelineId, --管线ID
|
||||
jot.Material1Id AS Mat, --材质
|
||||
jot.Specification, --规格
|
||||
jot.JointAttribute,
|
||||
weldType.Flag, --焊缝类型
|
||||
Pipeline.PipelineCode, --管线号
|
||||
PipingClass.PipingClassName, --管道等级
|
||||
PointBatchItem.IsWelderFirst,
|
||||
PointBatchItem.IsCompletedPoint,
|
||||
trust.TrustBatchItemId,
|
||||
(CASE WHEN PointBatchItem.JLAudit IS NOT NULL THEN userJL.UserName ELSE (CASE WHEN PointBatchItem.PointState IS NOT NULL THEN '未审核' ELSE '' END) END) AS JLAudit,
|
||||
(CASE WHEN PointBatchItem.GLGSAudit IS NOT NULL THEN userGLGS.UserName ELSE (CASE WHEN PointBatchItem.PointState IS NOT NULL THEN '未审核' ELSE '' END) END) AS GLGSAudit,
|
||||
(CASE WHEN PointBatchItem.QTAudit IS NOT NULL THEN userQT.UserName ELSE (CASE WHEN PointBatchItem.PointState IS NOT NULL THEN '未审核' ELSE '' END) END) AS QTAudit,
|
||||
(CASE WHEN jot.BackingWelderId!=jot.CoverWelderId THEN backingWelder.WelderCode+'/'+coverWelder.WelderCode ELSE backingWelder.WelderCode END) AS WelderCode, --焊工号
|
||||
(CASE WHEN PointBatchItem.JLAudit IS NOT NULL AND PointBatchItem.GLGSAudit IS NOT NULL THEN 1 ELSE 0 END) AS IsPointAudit
|
||||
FROM Batch_PointBatchItem AS PointBatchItem
|
||||
LEFT JOIN Batch_PointBatch AS PointBatch ON PointBatch.PointBatchId=PointBatchItem.PointBatchId
|
||||
LEFT JOIN dbo.Batch_BatchTrustItem trust ON trust.PointBatchItemId = PointBatchItem.PointBatchItemId
|
||||
LEFT JOIN Pipeline_WeldJoint AS jot ON jot.WeldJointId=PointBatchItem.WeldJointId
|
||||
LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId=jot.PipelineId
|
||||
LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = jot.WeldTypeId
|
||||
LEFT JOIN dbo.Welder_Welder backingWelder ON backingWelder.WelderId = jot.BackingWelderId
|
||||
LEFT JOIN dbo.Welder_Welder coverWelder ON coverWelder.WelderId = jot.CoverWelderId
|
||||
LEFT JOIN Project_WorkArea AS WorkArea ON WorkArea.WorkAreaId=Pipeline.WorkAreaId
|
||||
LEFT JOIN Pipeline_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=jot.WeldingDailyId
|
||||
LEFT JOIN Base_PipingClass AS PipingClass ON PipingClass.PipingClassId=Pipeline.PipingClassId
|
||||
LEFT JOIN dbo.Sys_User userJL ON userJL.UserId = PointBatchItem.JLAudit
|
||||
LEFT JOIN dbo.Sys_User userGLGS ON userGLGS.UserId = PointBatchItem.GLGSAudit
|
||||
LEFT JOIN dbo.Sys_User userQT ON userQT.UserId = PointBatchItem.QTAudit
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE VIEW [dbo].[View_TrustBathcIn]
|
||||
AS
|
||||
/*用于导入数据时,查询焊口信息*/
|
||||
SELECT
|
||||
pitem.PointBatchItemId,pitem.PointBatchId,jot.ProjectId
|
||||
,pipeline.InstallationId,ins.InstallationCode
|
||||
,pipeline.WorkAreaId,workArea.WorkAreaCode
|
||||
,jot.PipelineId,pipeline.PipelineCode
|
||||
,pitem.WeldJointId,jot.WeldJointCode
|
||||
,point.DetectionTypeId,nde.DetectionTypeCode
|
||||
,pitem.IsWelderFirst,trust.TrustBatchItemId
|
||||
FROM dbo.Batch_PointBatchItem AS pitem
|
||||
LEFT JOIN dbo.Batch_PointBatch point ON point.PointBatchId = pitem.PointBatchId
|
||||
LEFT JOIN Pipeline_WeldJoint jot ON jot.WeldJointId = pitem.WeldJointId
|
||||
LEFT JOIN Pipeline_Pipeline AS pipeline ON jot.PipelineId = pipeline.PipelineId
|
||||
LEFT JOIN dbo.Project_WorkArea AS workArea ON workArea.WorkAreaId=pipeline.WorkAreaId
|
||||
LEFT JOIN dbo.Project_Installation ins ON ins.InstallationId = workArea.InstallationId
|
||||
LEFT JOIN dbo.Base_DetectionType nde ON nde.DetectionTypeId = point.DetectionTypeId
|
||||
LEFT JOIN dbo.Batch_BatchTrustItem trust ON trust.PointBatchItemId = pitem.PointBatchItemId
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
Loading…
Reference in New Issue