焊接优化

This commit is contained in:
李鹏飞 2024-10-18 20:42:11 +08:00
parent 42488d8441
commit cb13fe481d
16 changed files with 518 additions and 52 deletions

Binary file not shown.

View File

@ -41,6 +41,14 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.6.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.6\lib\net40\BouncyCastle.Crypto.dll</HintPath>

View File

@ -604,6 +604,18 @@ namespace BLL
return Guid.NewGuid().ToString();
}
}
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
{
HashSet<TKey> seenKeys = new HashSet<TKey>();
foreach (TSource element in source)
{
if (seenKeys.Add(keySelector(element)))
{
yield return element;
}
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -54,6 +54,14 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="AxInterop.SYNCARDOCXLib">
<HintPath>..\Lib\AxInterop.SYNCARDOCXLib.dll</HintPath>

View File

@ -204,9 +204,8 @@ namespace FineUIPro.Web.CheckManage
//单号
string ndtTypeId = e.Node.NodeID.Split('|')[0];
var checks = (from x in Funs.DB.View_Batch_NDE
where x.NDEDate < Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01").AddMonths(1)
&& x.NDEDate >= Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01").AddMonths(-1)
&& x.ProjectId == this.CurrUser.LoginProjectId && x.NDECode.Contains(this.txtSearchCode.Text.Trim())
where
x.ProjectId == this.CurrUser.LoginProjectId && x.NDECode.Contains(this.txtSearchCode.Text.Trim())
&& x.InstallationId.ToString() == e.Node.NodeID.Split('|')[1]
&& x.UnitId == e.Node.ParentNode.ParentNode.NodeID
&& x.DetectionTypeId == ndtTypeId
@ -217,6 +216,15 @@ namespace FineUIPro.Web.CheckManage
var q = (from x in Funs.DB.View_NoReportNdt select x.NDEID).ToList().Distinct();
checks = checks.Where(x => q.Contains(x.NDEID)).ToList();
}
if (!string.IsNullOrEmpty(this.txtSearchCode.Text.Trim()))
{
checks=checks.Where(x => x.NDECode.Contains(this.txtSearchCode.Text.Trim())).ToList();
}
else
{
checks = checks.Where(x => x.NDEDate < Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01").AddMonths(1)
&& x.NDEDate >= Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01").AddMonths(-1)).ToList();
}
foreach (var check in checks)
{
TreeNode newNode = new TreeNode();

View File

@ -156,9 +156,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
//单号
string ndtTypeId = node.NodeID.Split('|')[0];
var repairs = (from x in Funs.DB.View_RepairRecord
where x.NoticeDate < Convert.ToDateTime(this.txtRepairMonth.Text.Trim() + "-01").AddMonths(1)
&& x.NoticeDate >= Convert.ToDateTime(this.txtRepairMonth.Text.Trim() + "-01").AddMonths(-1)
&& x.ProjectId == this.CurrUser.LoginProjectId && x.RepairRecordCode.Contains(this.txtSearchCode.Text.Trim())
where x.ProjectId == this.CurrUser.LoginProjectId && x.RepairRecordCode.Contains(this.txtSearchCode.Text.Trim())
&& x.InstallationId.ToString() == node.NodeID
&& x.UnitId == node.ParentNode.NodeID
orderby x.RepairRecordCode descending
@ -171,7 +169,16 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
{
repairs = repairs.Where(x => x.TrustBatchItemId != null).ToList();
}
if (!string.IsNullOrEmpty(this.txtSearchCode.Text.Trim()))
{
repairs = repairs.Where(x => x.RepairRecordCode.Contains(this.txtSearchCode.Text.Trim())).ToList();
}
else
{
repairs = repairs.Where(x => x.NoticeDate < Convert.ToDateTime(this.txtRepairMonth.Text.Trim() + "-01").AddMonths(1)
&& x.NoticeDate >= Convert.ToDateTime(this.txtRepairMonth.Text.Trim() + "-01").AddMonths(-1)
).ToList();
}
foreach (var r in repairs)
{
TreeNode newNode = new TreeNode();

View File

@ -110,7 +110,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
tn.ToolTip = "Installation";
// 按管线查询能展开
if (!string.IsNullOrEmpty(this.txtPipeCode.Text))
if (!string.IsNullOrEmpty(this.txtPipeCode.Text.Trim()))
{
tn.Expanded = true;
newNode.Nodes.Add(tn);
@ -154,7 +154,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
if (!string.IsNullOrEmpty(this.txtJotDate.Text))
{
var pitem = from x in Funs.DB.Batch_PointBatchItem
where x.PointBatchId == p.PointBatchId && x.WeldingDate >= sar && x.WeldingDate < end
where x.PointBatchId == p.PointBatchId /*&& x.WeldingDate >= sar && x.WeldingDate < end*/
select x;
if (drpTrustState.SelectedValue == "0")
{
@ -340,7 +340,63 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
DateTime sar = Convert.ToDateTime(startDate).AddMonths(-1);
DateTime end = Convert.ToDateTime(startDate).AddMonths(1);
foreach (var item in pointManages)
/*var list = from x in pointManages
join y in Funs.DB.Batch_PointBatchItem on x.PointBatchId equals y.PointBatchId
where y.WeldingDate >= sar && y.WeldingDate < end
select new { x.PointBatchId, x.PointBatchCode, x.StartDate, x.EndDate, x.IsTrust, y.PointDate, y.IsBuildTrust };*/
var list = pointManages
.Join(Funs.DB.Batch_PointBatchItem,
x => x.PointBatchId,
y => y.PointBatchId,
(x, y) => new { x, y })
.Where(joined => joined.y.WeldingDate >= sar && joined.y.WeldingDate < end)
.Select(joined => new
{
joined.x.PointBatchId,
joined.x.PointBatchCode,
joined.x.StartDate,
joined.x.EndDate,
joined.x.IsTrust,
joined.y.PointDate,
joined.y.IsBuildTrust
});
if (drpTrustState.SelectedValue == "0")
{
list = list.Where(item => item.PointDate.HasValue && (item.IsBuildTrust == null || item.IsBuildTrust == false));
}
if (drpTrustState.SelectedValue == "0")
{
list = list.Where(x => x.PointDate.HasValue && (x.IsBuildTrust == null || x.IsBuildTrust == false));
}
var PointBatchIdList = list.OrderByDescending(x=>x.StartDate). Select(x => x.PointBatchId).Distinct();
foreach (var PointBatchId in PointBatchIdList)
{
var item = list.Where(x => x.PointBatchId == PointBatchId).FirstOrDefault();
TreeNode newNode = new TreeNode
{
NodeID = item.PointBatchId,
ToolTip = "批",
EnableClickEvent = true,
};
// 当天批
if (string.Format("{0:yyyy-MM-dd}", item.StartDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now)
|| string.Format("{0:yyyy-MM-dd}", item.EndDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now))
{
newNode.Text = "<font color='#EE0000'>" + item.PointBatchCode + "</font>";
newNode.ToolTip = "当天批";
}
else
{
newNode.Text = item.PointBatchCode;
}
e.Node.Nodes.Add(newNode);
}
/* foreach (var item in pointManages)
{
if (!string.IsNullOrEmpty(this.txtJotDate.Text))
{
@ -391,7 +447,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
}
}
}
}
*/ }
}
#endregion

View File

@ -200,9 +200,8 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
e.Node.Nodes.Clear();
// 单号
var trusts = from x in Funs.DB.Batch_BatchTrust
where x.TrustDate < Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(1)
&& x.TrustDate >= Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(-1)
&& x.ProjectId == this.CurrUser.LoginProjectId
where
x.ProjectId == this.CurrUser.LoginProjectId
&& x.InstallationId.ToString() == e.Node.ParentNode.NodeID.Split('|')[0]
&& x.UnitId == e.Node.ParentNode.ParentNode.NodeID
&& x.DetectionTypeId == e.Node.NodeID.Split('|')[0]
@ -220,7 +219,11 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
where y.PipelineCode.Contains(txtPipeCode.Text.Trim())
select x;
}
if (txtSearchCode.Text.Trim() == ""&& txtPipeCode.Text.Trim() == "")
{
trusts = from x in trusts where x.TrustDate < Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(1)
&& x.TrustDate >= Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(-1) select x;
}
trusts = trusts.OrderByDescending(x => x.TrustBatchCode);
foreach (var trust in trusts)

View File

@ -21,6 +21,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
{
public partial class PipelineTraceList : PageBase
{
public static DataTable source { get; set; }
public static int percent { get; set; }
public static string url { get; set; }
@ -98,29 +99,12 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// </summary>
private void BindGrid()
{
DataTable tb = GetDataTable();
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
this.Grid1.RecordCount = source.Rows.Count;
var table = this.GetPagedDataTable(Grid1, source);
Grid1.DataSource = table;
Grid1.DataBind();
var distinctPipelineCode = tb.AsEnumerable().GroupBy(row => row.Field<string>("PipelineId")).Select(group => group.First());
var distinctSingleNumber = tb.AsEnumerable().GroupBy(row => row.Field<string>("SingleNumber")).Select(group => group.First());
var backingWelder = tb.AsEnumerable().Where(row => row.Field<string>("BackingWelderCode") != null).GroupBy(row => row.Field<string>("BackingWelderCode")).Select(group => group.First());
var coverWelder = tb.AsEnumerable().Where(row => row.Field<string>("CoverWelderCode") != null).GroupBy(row => row.Field<string>("CoverWelderCode")).Select(group => group.First());
var jotNum = from x in tb.AsEnumerable()
group x by new { pipe = x.Field<string>("PipelineId"), jot = x.Field<string>("WeldJointCode"), Size = x.Field<string>("JOT_Size") }
into g
select new { pipe = g.Key.pipe, jot = g.Key.jot, Size = g.Key.Size };
JObject summary = new JObject();
summary.Add("tfNumber", "合计");
summary.Add("SingleNumber", distinctSingleNumber.Count().ToString());
summary.Add("PipelineCode", distinctPipelineCode.Count().ToString());
summary.Add("WeldJointCode", jotNum.Count());
summary.Add("BackingWelderCode", backingWelder.Count().ToString());
summary.Add("CoverWelderCode", coverWelder.Count().ToString());
Grid1.SummaryData = summary;
}
protected void drpWorkAreaId_OnSelectedIndexChanged(object sender, EventArgs e)
@ -172,6 +156,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
source = GetDataTable();
BindGrid();
}
#endregion
@ -186,10 +171,10 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
percent = 0;
url = "";
Thread t = new Thread(new ThreadStart(() => { Export(); }));
Thread t = new Thread(new ThreadStart(() => { Export2(); }));
t.Start();
PageContext.RegisterStartupScript("showProcessBar()");
//Export2();
}
private void Export()
@ -243,6 +228,311 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
System.Web.HttpContext.Current.Response.Close();
File.Delete(path);*/
}
private void Export2()
{
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
//模板文件
string TempletFileName = rootPath + "HJGL_DataOut\\管道追溯表.xlsx";
//导出文件
string filePath = rootPath + "Temp\\" + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string ReportFileName = filePath + "管道追溯表" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx";
//string ReportFileName = filePath + "out.xlsx";
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
#region JointComprehensive
XSSFSheet reportModel = (XSSFSheet)hssfworkbook.GetSheet("Sheet1");
XSSFFont cs_content_Font1 = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
cs_content_Font1.FontName = "sans-serif";//字体
cs_content_Font1.FontHeightInPoints = 9; //字体大小
ICellStyle style = hssfworkbook.CreateCellStyle();
style.SetFont(cs_content_Font1);
style.BorderDiagonalLineStyle=NPOI.SS.UserModel.BorderStyle.Thin;
style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
XSSFFont cs_content_Font = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
cs_content_Font.FontName = "sans-serif";//字体
cs_content_Font.FontHeightInPoints = 10; //字体大小
cs_content_Font.Color = HSSFColor.Red.Index;
IDataFormat dataformat = hssfworkbook.CreateDataFormat();
ICellStyle styleDate = hssfworkbook.CreateCellStyle();
styleDate.SetFont(cs_content_Font1);
styleDate.DataFormat = dataformat.GetFormat("yyyy-mm-dd");
// 排序
DataTable tb = GetDataTable();
DataColumn dc = null;
dc = tb.Columns.Add("Index", Type.GetType("System.Int32"));
dc = tb.Columns.Add("WeldSilk", Type.GetType("System.String"));
dc = tb.Columns.Add("WeldFlux", Type.GetType("System.String"));
int totalNum = tb.Rows.Count;
if (tb.Rows.Count > 0)
{
var rowIndex = 2;
foreach (DataRow row in tb.Rows)
{
row["Index"] = row.Table.Rows.IndexOf(row) + 1;
row["WeldSilk"] = ConvertWeldSilk(row["WeldSilkId"]);
row["WeldFlux"] = ConvertWeldFlux(row["WeldSilkId"]);
if (reportModel.GetRow(rowIndex) == null) reportModel.CreateRow(rowIndex);
#region
//序号
if (reportModel.GetRow(rowIndex).GetCell(0) == null) reportModel.GetRow(rowIndex).CreateCell(0);
reportModel.GetRow(rowIndex).GetCell(0).SetCellValue((row["Index"].ToString()).ToString());
reportModel.GetRow(rowIndex).GetCell(0).CellStyle = style; //将字体绑定到样式
// 区域
if (reportModel.GetRow(rowIndex).GetCell(1) == null)
reportModel.GetRow(rowIndex).CreateCell(1);
reportModel.GetRow(rowIndex).GetCell(1).SetCellValue(row["WorkAreaCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(1).CellStyle = style;
// 试压包号
if (reportModel.GetRow(rowIndex).GetCell(2) == null)
reportModel.GetRow(rowIndex).CreateCell(2);
reportModel.GetRow(rowIndex).GetCell(2).SetCellValue(row["TestPackageNo"].ToString());
reportModel.GetRow(rowIndex).GetCell(2).CellStyle = style;
// 单线图号
if (reportModel.GetRow(rowIndex).GetCell(3) == null)
reportModel.GetRow(rowIndex).CreateCell(3);
reportModel.GetRow(rowIndex).GetCell(3).SetCellValue(row["SingleNumber"].ToString());
reportModel.GetRow(rowIndex).GetCell(3).CellStyle = style;
// 管线号
if (reportModel.GetRow(rowIndex).GetCell(4) == null)
reportModel.GetRow(rowIndex).CreateCell(4);
reportModel.GetRow(rowIndex).GetCell(4).SetCellValue(row["PipelineCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(4).CellStyle = style;
// PIPClassCode
if (reportModel.GetRow(rowIndex).GetCell(5) == null)
reportModel.GetRow(rowIndex).CreateCell(5);
reportModel.GetRow(rowIndex).GetCell(5).SetCellValue(row["PIPClassCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(5).CellStyle = style;
// DrawingsNum
if (reportModel.GetRow(rowIndex).GetCell(6) == null)
reportModel.GetRow(rowIndex).CreateCell(6);
reportModel.GetRow(rowIndex).GetCell(6).SetCellValue(row["DrawingsNum"].ToString());
reportModel.GetRow(rowIndex).GetCell(6).CellStyle = style;
// PageNum
if (reportModel.GetRow(rowIndex).GetCell(7) == null)
reportModel.GetRow(rowIndex).CreateCell(7);
reportModel.GetRow(rowIndex).GetCell(7).SetCellValue(row["PageNum"].ToString());
reportModel.GetRow(rowIndex).GetCell(7).CellStyle = style;
// WeldJointCode
if (reportModel.GetRow(rowIndex).GetCell(8) == null)
reportModel.GetRow(rowIndex).CreateCell(8);
reportModel.GetRow(rowIndex).GetCell(8).SetCellValue(row["WeldJointCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(8).CellStyle = style;
// WeldTypeCode
if (reportModel.GetRow(rowIndex).GetCell(9) == null)
reportModel.GetRow(rowIndex).CreateCell(9);
reportModel.GetRow(rowIndex).GetCell(9).SetCellValue(row["WeldTypeCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(9).CellStyle = style;
// WeldingLocationCode
if (reportModel.GetRow(rowIndex).GetCell(10) == null)
reportModel.GetRow(rowIndex).CreateCell(10);
reportModel.GetRow(rowIndex).GetCell(10).SetCellValue(row["WeldingLocationCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(10).CellStyle = style;
// Specification
if (reportModel.GetRow(rowIndex).GetCell(11) == null)
reportModel.GetRow(rowIndex).CreateCell(11);
reportModel.GetRow(rowIndex).GetCell(11).SetCellValue(row["Specification"].ToString());
reportModel.GetRow(rowIndex).GetCell(11).CellStyle = style;
// MaterialCode1
if (reportModel.GetRow(rowIndex).GetCell(12) == null)
reportModel.GetRow(rowIndex).CreateCell(12);
reportModel.GetRow(rowIndex).GetCell(12).SetCellValue(row["MaterialCode1"].ToString());
reportModel.GetRow(rowIndex).GetCell(12).CellStyle = style;
// MaterialCode2
if (reportModel.GetRow(rowIndex).GetCell(13) == null)
reportModel.GetRow(rowIndex).CreateCell(13);
reportModel.GetRow(rowIndex).GetCell(13).SetCellValue(row["MaterialCode2"].ToString());
reportModel.GetRow(rowIndex).GetCell(13).CellStyle = style;
// PipeAssembly1
if (reportModel.GetRow(rowIndex).GetCell(14) == null)
reportModel.GetRow(rowIndex).CreateCell(14);
reportModel.GetRow(rowIndex).GetCell(14).SetCellValue(row["PipeAssembly1"].ToString());
reportModel.GetRow(rowIndex).GetCell(14).CellStyle = style;
// PipeAssembly2
if (reportModel.GetRow(rowIndex).GetCell(15) == null)
reportModel.GetRow(rowIndex).CreateCell(15);
reportModel.GetRow(rowIndex).GetCell(15).SetCellValue(row["PipeAssembly2"].ToString());
reportModel.GetRow(rowIndex).GetCell(15).CellStyle = style;
// HeartNo1
if (reportModel.GetRow(rowIndex).GetCell(16) == null)
reportModel.GetRow(rowIndex).CreateCell(16);
reportModel.GetRow(rowIndex).GetCell(16).SetCellValue(row["HeartNo1"].ToString());
reportModel.GetRow(rowIndex).GetCell(16).CellStyle = style;
// HeartNo2
if (reportModel.GetRow(rowIndex).GetCell(17) == null)
reportModel.GetRow(rowIndex).CreateCell(17);
reportModel.GetRow(rowIndex).GetCell(17).SetCellValue(row["HeartNo2"].ToString());
reportModel.GetRow(rowIndex).GetCell(17).CellStyle = style;
// BackingWelderCode
if (reportModel.GetRow(rowIndex).GetCell(18) == null)
reportModel.GetRow(rowIndex).CreateCell(18);
reportModel.GetRow(rowIndex).GetCell(18).SetCellValue(row["BackingWelderCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(18).CellStyle = style;
// CoverWelderCode
if (reportModel.GetRow(rowIndex).GetCell(19) == null)
reportModel.GetRow(rowIndex).CreateCell(19);
reportModel.GetRow(rowIndex).GetCell(19).SetCellValue(row["CoverWelderCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(19).CellStyle = style;
// WeldingMethodName
if (reportModel.GetRow(rowIndex).GetCell(20) == null)
reportModel.GetRow(rowIndex).CreateCell(20);
reportModel.GetRow(rowIndex).GetCell(20).SetCellValue(row["WeldingMethodName"].ToString());
reportModel.GetRow(rowIndex).GetCell(20).CellStyle = style;
// MediumName
if (reportModel.GetRow(rowIndex).GetCell(21) == null)
reportModel.GetRow(rowIndex).CreateCell(21);
reportModel.GetRow(rowIndex).GetCell(21).SetCellValue(row["MediumName"].ToString());
reportModel.GetRow(rowIndex).GetCell(21).CellStyle = style;
// WeldingDate
if (reportModel.GetRow(rowIndex).GetCell(22) == null)
reportModel.GetRow(rowIndex).CreateCell(22);
reportModel.GetRow(rowIndex).GetCell(22).SetCellValue(row["WeldingDate"].ToString());
reportModel.GetRow(rowIndex).GetCell(22).CellStyle = style;
// DetectionTypeCode
if (reportModel.GetRow(rowIndex).GetCell(23) == null)
reportModel.GetRow(rowIndex).CreateCell(23);
reportModel.GetRow(rowIndex).GetCell(23).SetCellValue(row["DetectionTypeCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(23).CellStyle = style;
// if_dk
if (reportModel.GetRow(rowIndex).GetCell(24) == null)
reportModel.GetRow(rowIndex).CreateCell(24);
reportModel.GetRow(rowIndex).GetCell(24).SetCellValue(row["if_dk"].ToString());
reportModel.GetRow(rowIndex).GetCell(24).CellStyle = style;
// DetectionRateCode
if (reportModel.GetRow(rowIndex).GetCell(25) == null)
reportModel.GetRow(rowIndex).CreateCell(25);
reportModel.GetRow(rowIndex).GetCell(25).SetCellValue(row["DetectionRateCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(25).CellStyle = style;
// AcceptLevel
if (reportModel.GetRow(rowIndex).GetCell(26) == null)
reportModel.GetRow(rowIndex).CreateCell(26);
reportModel.GetRow(rowIndex).GetCell(26).SetCellValue(row["AcceptLevel"].ToString());
reportModel.GetRow(rowIndex).GetCell(26).CellStyle = style;
// NDEReportNo
if (reportModel.GetRow(rowIndex).GetCell(27) == null)
reportModel.GetRow(rowIndex).CreateCell(27);
reportModel.GetRow(rowIndex).GetCell(27).SetCellValue(row["NDEReportNo"].ToString());
reportModel.GetRow(rowIndex).GetCell(27).CellStyle = style;
// IsHotProess
if (reportModel.GetRow(rowIndex).GetCell(28) == null)
reportModel.GetRow(rowIndex).CreateCell(28);
reportModel.GetRow(rowIndex).GetCell(28).SetCellValue(row["IsHotProess"].ToString());
reportModel.GetRow(rowIndex).GetCell(28).CellStyle = style;
// HotReportCode
if (reportModel.GetRow(rowIndex).GetCell(29) == null)
reportModel.GetRow(rowIndex).CreateCell(29);
reportModel.GetRow(rowIndex).GetCell(29).SetCellValue(row["HotReportCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(29).CellStyle = style;
// WeldSilk
if (reportModel.GetRow(rowIndex).GetCell(30) == null)
reportModel.GetRow(rowIndex).CreateCell(30);
reportModel.GetRow(rowIndex).GetCell(30).SetCellValue(row["WeldSilk"].ToString());
reportModel.GetRow(rowIndex).GetCell(30).CellStyle = style;
//WMT_MatCode
if (reportModel.GetRow(rowIndex).GetCell(31) == null)
reportModel.GetRow(rowIndex).CreateCell(31);
reportModel.GetRow(rowIndex).GetCell(31).SetCellValue(row["WMT_MatCode"].ToString());
reportModel.GetRow(rowIndex).GetCell(31).CellStyle = style;
// WeldFlux
if (reportModel.GetRow(rowIndex).GetCell(32) == null)
reportModel.GetRow(rowIndex).CreateCell(32);
reportModel.GetRow(rowIndex).GetCell(32).SetCellValue(row["WeldFlux"].ToString());
reportModel.GetRow(rowIndex).GetCell(32).CellStyle = style;
// Remark
if (reportModel.GetRow(rowIndex).GetCell(33) == null)
reportModel.GetRow(rowIndex).CreateCell(33);
reportModel.GetRow(rowIndex).GetCell(33).SetCellValue(row["Remark"].ToString());
reportModel.GetRow(rowIndex).GetCell(33).CellStyle = style;
#endregion
if ((int)(90 * (rowIndex) / totalNum) > percent)
{
percent = (int)(100 * (rowIndex) / totalNum);
}
rowIndex++;
}
}
#endregion
reportModel.ForceFormulaRecalculation = true;
using (FileStream filess = System.IO.File.OpenWrite(ReportFileName))
{
hssfworkbook.Write(filess);
}
percent = 100;
url = ReportFileName.Replace(Server.MapPath("~/"), "");
//FileInfo filet = new FileInfo(ReportFileName);
//Response.Clear();
//Response.Charset = "GB2312";
//Response.ContentEncoding = System.Text.Encoding.UTF8;
//// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
//Response.AddHeader("Content-Disposition", "attachment; filename=焊口综合分析_" + Server.UrlEncode(DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx"));
//// 添加头信息,指定文件大小,让浏览器能够显示下载进度
//Response.AddHeader("Content-Length", filet.Length.ToString());
//// 指定返回的是一个不能被客户端读取的流,必须被下载
//Response.ContentType = "application/ms-excel";
//// 把文件流发送到客户端
//Response.WriteFile(filet.FullName);
//// 停止页面的执行
//Response.End();
}
/// <summary>
/// 导出方法

View File

@ -16,6 +16,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
{
public partial class RepairExTrackingList : PageBase
{
public static DataTable source { get; set; }
public static int percent { get; set; }
public static string url { get; set; }
@ -66,8 +67,48 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
var view_Batch_BatchTrustItemSelect = (from x in Funs.DB.View_Batch_BatchTrustItemSelect
where x.ProjectId == this.CurrUser.LoginProjectId
select x).ToList();
where x.ProjectId == this.CurrUser.LoginProjectId && x.TrustType == "1"
select new {
x.WorkAreaCode,
x.PipelineCode,
x.WeldJointId,
x.WeldJointCode,
x.WelderCode,
x.TeamGroupName,
x.Specification,
x.TrustBatchCode,
x.WorkAreaId,
x.PipelineId,
}).ToList();//点口
var view_Batch_BatchTrustItemSelectEx = (from x in Funs.DB.View_Batch_BatchTrustItemSelect
where x.ProjectId == this.CurrUser.LoginProjectId && x.TrustType == "2"
select new {
x.WorkAreaCode,
x.PipelineCode,
x.WeldJointId,
x.WeldJointCode,
x.WelderCode,
x.TeamGroupName,
x.Specification,
x.TrustBatchCode,
x.WorkAreaId,
x.PipelineId,
}).ToList(); //扩透
var view_Batch_BatchTrustItemSelectRepair = (from x in Funs.DB.View_Batch_BatchTrustItemSelect
where x.ProjectId == this.CurrUser.LoginProjectId && x.TrustType == "3"
select new
{
x.WorkAreaCode,
x.PipelineCode,
x.WeldJointId,
x.WeldJointCode,
x.WelderCode,
x.TeamGroupName,
x.Specification,
x.TrustBatchCode,
x.WorkAreaId,
x.PipelineId,
}).ToList(); //返修
if (drpWorkAreaId.SelectedValue != Const._Null && drpWorkAreaId.SelectedValue != null)
{
view_Batch_BatchTrustItemSelect= view_Batch_BatchTrustItemSelect.Where(x => drpWorkAreaId.SelectedValueArray.Contains(x.WorkAreaId)).ToList();
@ -78,10 +119,9 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
view_Batch_BatchTrustItemSelect = view_Batch_BatchTrustItemSelect.Where(x => drpPipeLine.SelectedValueArray.Contains(x.PipelineId)).ToList();
}
var list = view_Batch_BatchTrustItemSelect.Where(x => x.IsWelderFirst == "是");
foreach (var item in list)
foreach (var item in view_Batch_BatchTrustItemSelect)
{
DataRow dr = dt.NewRow();
dr["WorkAreaCode"] = item.WorkAreaCode;
@ -92,9 +132,9 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
dr["TeamGroupName"] = item.TeamGroupName;
dr["Specification"] = item.Specification;
dr["TrustBatchCode"] = item.TrustBatchCode;
dr["TrustBatchCodeRepair"] = view_Batch_BatchTrustItemSelect.Where(x=>x.TrustBatchCode.Contains(item.TrustBatchCode+"R"))?.FirstOrDefault()?.TrustBatchCode;
dr["TrustBatchCodeRepair"] = view_Batch_BatchTrustItemSelectRepair.Where(x=>x.TrustBatchCode.Contains(item.TrustBatchCode+"R"))?.FirstOrDefault()?.TrustBatchCode;
var exWeldJointCodeList = view_Batch_BatchTrustItemSelect.Where(x => x.TrustBatchCode.Contains(item.TrustBatchCode + "EX")).Select(x=>x.WeldJointCode).ToList();
var exWeldJointCodeList = view_Batch_BatchTrustItemSelectEx.Where(x => x.TrustBatchCode.Contains(item.TrustBatchCode + "EX")).Select(x=>x.WeldJointCode).ToList();
if (exWeldJointCodeList.Count == 1)
{
dr["WeldJointCodeEx1"] = exWeldJointCodeList[0]?.ToString();
@ -120,9 +160,8 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// </summary>
private void BindGrid()
{
DataTable tb = GetDataTable();
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
this.Grid1.RecordCount = source.Rows.Count;
var table = this.GetPagedDataTable(Grid1, source);
Grid1.DataSource = table;
Grid1.DataBind();
}
@ -176,6 +215,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
source = GetDataTable();
BindGrid();
}
#endregion

View File

@ -15,9 +15,11 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
@ -25,42 +27,58 @@ Global
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|x64.ActiveCfg = Debug|x64
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|x64.Build.0 = Debug|x64
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|x86.ActiveCfg = Debug|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|Any CPU.Build.0 = Release|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|x64.ActiveCfg = Release|x64
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|x64.Build.0 = Release|x64
{C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|x86.ActiveCfg = Release|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Debug|x64.ActiveCfg = Debug|x64
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Debug|x64.Build.0 = Debug|x64
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Debug|x86.ActiveCfg = Debug|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Release|Any CPU.Build.0 = Release|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Release|x64.ActiveCfg = Release|x64
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Release|x64.Build.0 = Release|x64
{BBC7282A-9E2B-4BD6-9C6D-333CEFC6F332}.Release|x86.ActiveCfg = Release|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Debug|x64.ActiveCfg = Debug|x64
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Debug|x64.Build.0 = Debug|x64
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Debug|x86.ActiveCfg = Debug|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Release|Any CPU.Build.0 = Release|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Release|x64.ActiveCfg = Release|x64
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Release|x64.Build.0 = Release|x64
{FD1E1931-1688-4B4A-BCD6-335A81465343}.Release|x86.ActiveCfg = Release|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|x64.ActiveCfg = Debug|x64
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|x64.Build.0 = Debug|x64
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|x86.ActiveCfg = Debug|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Debug|x86.Build.0 = Debug|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|Any CPU.Build.0 = Release|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|x64.ActiveCfg = Release|x64
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|x64.Build.0 = Release|x64
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|x86.ActiveCfg = Release|Any CPU
{1F77D831-9854-4463-99F8-8C5E12B29504}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection

View File

@ -41,6 +41,14 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>

View File

@ -266,6 +266,14 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\</OutputPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />