614 lines
31 KiB
C#
614 lines
31 KiB
C#
using BLL;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlClient;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.IO;
|
|
using NPOI.SS.Formula.PTG;
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
|
using FineUIPro.Web.common.BaseInfo;
|
|
using Model;
|
|
|
|
namespace FineUIPro.Web.JGZL
|
|
{
|
|
public partial class TestResultsSummary : PageBase
|
|
{
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
//this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
|
|
|
this.drpProjectId.DataTextField = "ProjectCode";
|
|
this.drpProjectId.DataValueField = "ProjectId";
|
|
this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1");
|
|
this.drpProjectId.DataBind();
|
|
Funs.FineUIPleaseSelect(this.drpProjectId);
|
|
|
|
this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId;
|
|
this.InitTreeMenu();//加载树
|
|
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
|
|
this.BindGrid();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载树项目
|
|
/// <summary>
|
|
/// 加载树
|
|
/// </summary>
|
|
private void InitTreeMenu()
|
|
{
|
|
this.tvControlItem.Nodes.Clear();
|
|
TreeNode rootNode = new TreeNode();
|
|
rootNode.Text = "项目";
|
|
rootNode.ToolTip = "项目";
|
|
rootNode.NodeID = "0";
|
|
rootNode.Expanded = true;
|
|
this.tvControlItem.Nodes.Add(rootNode);
|
|
|
|
List<Model.Base_Project> projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1");
|
|
if (this.drpProjectId.SelectedValue != BLL.Const._Null)
|
|
{
|
|
projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList();
|
|
}
|
|
foreach (var item in projects)
|
|
{
|
|
TreeNode rootProjectNode = new TreeNode();//定义根节点
|
|
rootProjectNode.Text = item.ProjectCode;
|
|
rootProjectNode.NodeID = item.ProjectId;
|
|
rootProjectNode.EnableClickEvent = true;
|
|
rootProjectNode.Expanded = true;
|
|
rootProjectNode.ToolTip = item.ProjectName;
|
|
rootProjectNode.CommandName = "项目名称";
|
|
rootNode.Nodes.Add(rootProjectNode);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 点击TreeView
|
|
/// <summary>
|
|
/// 点击TreeView
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
|
{
|
|
if (this.tvControlItem.SelectedNodeID != "0")
|
|
{
|
|
this.BindGrid();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 数据绑定
|
|
/// <summary>
|
|
/// 数据绑定
|
|
/// </summary>
|
|
private void BindGrid()
|
|
{
|
|
List<Model.JGZL_CheckResultsSummary> summaryLists = new List<Model.JGZL_CheckResultsSummary>();
|
|
List<Model.View_CheckResultsSummaryTree> list = (from x in Funs.DB.View_CheckResultsSummaryTree where x.ProjectId == this.tvControlItem.SelectedNodeID select x).ToList();
|
|
foreach (var item in list)
|
|
{
|
|
var pipeIds = item.PipeId.Split('|').ToList();
|
|
string isoClassId = pipeIds[0];//管道等级
|
|
string serviceId = pipeIds[1];//介质
|
|
string steId = pipeIds[2];//材质
|
|
Model.JGZL_CheckResultsSummary newSummary = new Model.JGZL_CheckResultsSummary();
|
|
newSummary.ISO_ID = item.PipeId;
|
|
newSummary.ProjectId = item.ProjectId;
|
|
newSummary.ISO_IsoNo = item.PipeCode;
|
|
newSummary.ISC_IsoName = BLL.HJGL_PipingClassService.GetPipingClassByPipingClassId(isoClassId).ISC_IsoName;
|
|
newSummary.TestingStandard = "NB/T47013-2015";
|
|
var installationCode = (from x in Funs.DB.Project_Installation where x.ProjectId == this.tvControlItem.SelectedNodeID select x.InstallationCode).FirstOrDefault();
|
|
if (!string.IsNullOrEmpty(installationCode))
|
|
{
|
|
newSummary.WorkAreaCode = installationCode;
|
|
}
|
|
summaryLists.Add(newSummary);
|
|
}
|
|
Grid1.DataSource = summaryLists;
|
|
Grid1.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
#region 分页排序
|
|
#region 页索引改变事件
|
|
/// <summary>
|
|
/// 页索引改变事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
|
{
|
|
BindGrid();
|
|
}
|
|
#endregion
|
|
|
|
#region 排序
|
|
/// <summary>
|
|
/// 排序
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
{
|
|
BindGrid();
|
|
}
|
|
#endregion
|
|
|
|
#region 分页选择下拉改变事件
|
|
/// <summary>
|
|
/// 分页选择下拉改变事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
|
BindGrid();
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
#region 查询
|
|
///<summary>
|
|
///查询
|
|
///</summary>
|
|
///<param name="sender"></param>
|
|
///<param name="e"></param>
|
|
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
this.InitTreeMenu();
|
|
this.BindGrid();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
|
{
|
|
this.BindGrid();
|
|
}
|
|
#endregion
|
|
|
|
#region 打印
|
|
/// <summary>
|
|
/// 打印
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnPrint_Click(object sender, EventArgs e)
|
|
{
|
|
string projectId = this.tvControlItem.SelectedNodeID;
|
|
if (projectId != null)
|
|
{
|
|
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
|
|
{
|
|
string initTemplatePath = "";
|
|
string rootPath = Server.MapPath("~/");
|
|
BLL.Common.FastReportService.ResetData();
|
|
|
|
var checkResultSummary = (from x in Funs.DB.View_CheckResultsSummaryTree where x.ProjectId == projectId && x.PipeId == this.Grid1.SelectedRowID select x).FirstOrDefault();
|
|
if (checkResultSummary != null)
|
|
{
|
|
this.hdIsoNo.Text = checkResultSummary.PipeCode;//管道编号
|
|
}
|
|
|
|
var pipeIds = this.Grid1.SelectedRowID.Split('|').ToList();
|
|
if (pipeIds != null)
|
|
{
|
|
string isoClassId = pipeIds[0];//管道等级
|
|
string serviceId = pipeIds[1];//介质
|
|
string steId = pipeIds[2];//材质
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
listStr.Add(new SqlParameter("@ProjectId", projectId));
|
|
listStr.Add(new SqlParameter("@ISC_ID", isoClassId));
|
|
listStr.Add(new SqlParameter("@SER_ID", serviceId));
|
|
listStr.Add(new SqlParameter("@STE_ID", steId));
|
|
listStr.Add(new SqlParameter("@Flag", "0"));
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_CheckResultSummary", parameter);
|
|
|
|
if (tb.Rows.Count > 0)
|
|
{
|
|
DataTable dt = new DataTable();
|
|
dt.TableName = "Data";
|
|
dt.Columns.Add("SingleName");
|
|
dt.Columns.Add("WeldJointCode");
|
|
dt.Columns.Add("WelderCode");
|
|
dt.Columns.Add("PointBatchCode");
|
|
dt.Columns.Add("RTUTResult");
|
|
dt.Columns.Add("RTUTCheckNo");
|
|
dt.Columns.Add("MTPTResult");
|
|
dt.Columns.Add("MTPTCheckNo");
|
|
//dt.Columns.Add("CHT_Remark");
|
|
|
|
DataView dv = tb.DefaultView;//获取表视图
|
|
dv.Sort = "ISO_IsoNo,Sort1,Sort2,Sort3,Sort4,Sort5 asc";//按照ID排序
|
|
tb = dv.ToTable();//转为表
|
|
DataRow[] rows = tb.DefaultView.ToTable().Select();
|
|
|
|
foreach (var row in rows)
|
|
{
|
|
var newRow = dt.NewRow();
|
|
newRow["SingleName"] = row["ISO_IsoNo"].ToString();
|
|
newRow["WeldJointCode"] = row["JOT_JointNo"].ToString();
|
|
newRow["WelderCode"] = row["WED_Code"].ToString();
|
|
newRow["PointBatchCode"] = "/";
|
|
newRow["RTUTResult"] = row["RTUTResult"].ToString();
|
|
newRow["RTUTCheckNo"] = row["RTUTReport"].ToString();
|
|
newRow["MTPTResult"] = row["MTPTResult"].ToString();
|
|
newRow["MTPTCheckNo"] = row["MTPTReport"].ToString();
|
|
//newRow["CHT_Remark"] = row["CHT_Remark"].ToString();
|
|
dt.Rows.Add(newRow);
|
|
}
|
|
BLL.Common.FastReportService.AddFastreportTable(dt);
|
|
}
|
|
|
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
|
keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName);
|
|
//监理单位
|
|
var project = BLL.Base_ProjectService.GetProjectByProjectId(projectId);
|
|
if (!string.IsNullOrEmpty(project.WatchUnit))
|
|
{
|
|
keyValuePairs.Add("UnitName1", project.WatchUnit);//监理单位
|
|
}
|
|
keyValuePairs.Add("UnitName2", "浙江鼎盛石化工程有限公司");//施工单位
|
|
keyValuePairs.Add("CH_NDTCriteria", "NB/T47013-2015");//检测标准
|
|
keyValuePairs.Add("ISOLevel", BLL.HJGL_PipingClassService.GetPipingClassByPipingClassId(isoClassId).ISC_IsoName);//管道级别
|
|
var installationCode = (from x in Funs.DB.Project_Installation where x.ProjectId == projectId select x.InstallationCode).FirstOrDefault();
|
|
if (!string.IsNullOrEmpty(installationCode))
|
|
{
|
|
keyValuePairs.Add("WorkAreaCode", installationCode);//区号
|
|
}
|
|
keyValuePairs.Add("UnitWorkName", "/");//检测类别号
|
|
keyValuePairs.Add("isoCode", this.hdIsoNo.Text.Trim());//管道编号
|
|
|
|
var result = from x in Funs.DB.HJGL_View_CheckResult
|
|
where x.ProjectId == projectId
|
|
&& x.ISC_ID == isoClassId && x.STE_ID == steId
|
|
&& x.SER_ID == serviceId
|
|
select x;
|
|
//RT对焊接头
|
|
string RT1 = string.Empty;
|
|
var rt1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "射线检测" select x;
|
|
if (rt1.Count() > 0)
|
|
{
|
|
var q1 = from x in Funs.DB.HJGL_BO_QualityRating where rt1.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x;
|
|
var q2 = from x in Funs.DB.HJGL_BO_QualityRatingRepair where rt1.Select(y => y.JOT_ID).Contains(x.JOT_ID) select x;
|
|
|
|
string rt1Num = rt1.Count().ToString();
|
|
string rt1FileNum = (q1.Count() + q2.Count()).ToString();
|
|
RT1 = rt1Num + "/" + rt1FileNum;//RT对焊接头
|
|
}
|
|
else
|
|
{
|
|
RT1 = "/";
|
|
}
|
|
keyValuePairs.Add("RTBW", RT1);
|
|
keyValuePairs.Add("RTFW", "-");
|
|
|
|
//RT 支管连接接头
|
|
string RT3 = string.Empty;
|
|
var rt3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "射线检测" select x;
|
|
if (rt3.Count() > 0)
|
|
{
|
|
var q3 = from x in Funs.DB.HJGL_BO_QualityRating where rt3.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x;
|
|
var q4 = from x in Funs.DB.HJGL_BO_QualityRatingRepair where rt3.Select(y => y.JOT_ID).Contains(x.JOT_ID) select x;
|
|
|
|
string rt3Num = rt3.Count().ToString();
|
|
string rt3FileNum = (q3.Count() + q4.Count()).ToString();
|
|
RT3 = rt3Num + "/" + rt3FileNum;//RT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
RT3 = "/";
|
|
}
|
|
keyValuePairs.Add("RTDW", RT3);
|
|
|
|
//RT对焊接头
|
|
string unRT1Count = string.Empty;
|
|
var unRT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "射线检测" select x;
|
|
if (unRT1.Count() > 0)
|
|
{
|
|
var q1 = from x in Funs.DB.HJGL_BO_QualityRating where x.IsPass == "不合格" && unRT1.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x;
|
|
|
|
string unRT1Num = unRT1.Count().ToString();
|
|
string unRT1FileNum = q1.Count().ToString();
|
|
unRT1Count = unRT1Num + "/" + unRT1FileNum;//RT对焊接头
|
|
}
|
|
else
|
|
{
|
|
unRT1Count = "/";
|
|
}
|
|
keyValuePairs.Add("RTNoPassBW", unRT1Count);
|
|
keyValuePairs.Add("RTNoPassFW", "-");
|
|
|
|
// RT支管连接接头
|
|
string unRT3Count = string.Empty;
|
|
var unRT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "射线检测" select x;
|
|
if (unRT3.Count() > 0)
|
|
{
|
|
var q1 = from x in Funs.DB.HJGL_BO_QualityRating where x.IsPass == "不合格" && unRT3.Select(y => y.CH_TrustItemID).Contains(x.CH_TrustItemID) select x;
|
|
|
|
string unRT3Num = unRT3.Count().ToString();
|
|
string unRT3FileNum = q1.Count().ToString();
|
|
unRT3Count = unRT3Num + "/" + unRT3FileNum;//RT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
unRT3Count = "/";
|
|
}
|
|
keyValuePairs.Add("RTNoPassDW", unRT3Count);
|
|
|
|
//UT对焊接头
|
|
string ut1Count = string.Empty;
|
|
var ut1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "超声波检测" select x;
|
|
if (ut1.Count() > 0)
|
|
{
|
|
string ut1Num = ut1.Count().ToString();
|
|
string ut1FileNum = (Convert.ToDouble(ut1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
ut1Count = ut1Num + "/" + ut1FileNum;//UT对焊接头
|
|
}
|
|
else
|
|
{
|
|
ut1Count = "/";
|
|
}
|
|
keyValuePairs.Add("UTBW", ut1Count);
|
|
keyValuePairs.Add("UTFW", "-");
|
|
//UT 支管连接接头
|
|
string ut3Count = string.Empty;
|
|
var ut3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "超声波检测" select x;
|
|
if (ut3.Count() > 0)
|
|
{
|
|
string ut3Num = ut3.Count().ToString();
|
|
string ut3FileNum = (Convert.ToDouble(ut3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
ut3Count = ut3Num + "/" + ut3FileNum;//UT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
ut3Count = "/";
|
|
}
|
|
keyValuePairs.Add("UTDW", ut3Count);
|
|
|
|
//UT对焊接头
|
|
string unUT1Count = string.Empty;
|
|
var unUT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "超声波检测" select x;
|
|
if (unUT1.Count() > 0)
|
|
{
|
|
string unUT1Num = unUT1.Count().ToString();
|
|
string unUT1FileNum = (Convert.ToDouble(unUT1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unUT1Count = unUT1Num + "/" + unUT1FileNum;//UT对焊接头
|
|
}
|
|
else
|
|
{
|
|
unUT1Count = "/";
|
|
}
|
|
keyValuePairs.Add("UTNoPassBW", unUT1Count);
|
|
keyValuePairs.Add("UTNoPassFW", "-");
|
|
// UT支管连接接头
|
|
string unUT3Count = string.Empty;
|
|
var unUT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "超声波检测" select x;
|
|
if (unUT3.Count() > 0)
|
|
{
|
|
string unUT3Num = unUT3.Count().ToString();
|
|
string unUT3FileNum = (Convert.ToDouble(unUT3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unUT3Count = unUT3Num + "/" + unUT3FileNum;//UT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
unUT3Count = "/";
|
|
}
|
|
keyValuePairs.Add("UTNoPassDW", unUT3Count);
|
|
//MT对焊接头
|
|
string mt1Count = string.Empty;
|
|
var mt1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "磁粉检测" select x;
|
|
if (mt1.Count() > 0)
|
|
{
|
|
string mt1Num = mt1.Count().ToString();
|
|
string mt1FileNum = (Convert.ToDouble(mt1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
mt1Count = mt1Num + "/" + mt1FileNum;//MT对焊接头
|
|
}
|
|
else
|
|
{
|
|
mt1Count = "/";
|
|
}
|
|
keyValuePairs.Add("MTBW", mt1Count);
|
|
//MT角焊接头
|
|
string mt2Count = string.Empty;
|
|
var mt2 = from x in result where x.JOTY_Group == "2" && x.States == "2" && x.SysType == "磁粉检测" select x;
|
|
if (mt2.Count() > 0)
|
|
{
|
|
string mt2Num = mt2.Count().ToString();
|
|
string mt2FileNum = (Convert.ToDouble(mt2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
mt2Count = mt2Num + "/" + mt2FileNum;//MT角焊接头
|
|
}
|
|
else
|
|
{
|
|
mt2Count = "/";
|
|
}
|
|
keyValuePairs.Add("MTFW", mt2Count);
|
|
//MT 支管连接接头
|
|
string mt3Count = string.Empty;
|
|
var mt3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "磁粉检测" select x;
|
|
if (mt3.Count() > 0)
|
|
{
|
|
string mt3Num = mt3.Count().ToString();
|
|
string mt3FileNum = (Convert.ToDouble(mt3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
mt3Count = mt3Num + "/" + mt3FileNum;//MT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
mt3Count = "/";
|
|
}
|
|
keyValuePairs.Add("MTDW", mt3Count);
|
|
// MT对焊接头
|
|
string unMT1Count = string.Empty;
|
|
var unMT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "磁粉检测" select x;
|
|
if (unMT1.Count() > 0)
|
|
{
|
|
string unMT1Num = unMT1.Count().ToString();
|
|
string unMT1FileNum = (Convert.ToDouble(unMT1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unMT1Count = unMT1Num + "/" + unMT1FileNum;//MT对焊接头
|
|
}
|
|
else
|
|
{
|
|
unMT1Count = "/";
|
|
}
|
|
keyValuePairs.Add("MTNoPassBW", unMT1Count);
|
|
// MT角焊接头
|
|
string unMT2Count = string.Empty;
|
|
var unMT2 = from x in result where x.JOTY_Group == "2" && x.States == "4" && x.SysType == "磁粉检测" select x;
|
|
if (unMT2.Count() > 0)
|
|
{
|
|
string unMT2Num = unMT2.Count().ToString();
|
|
string unMT2FileNum = (Convert.ToDouble(unMT2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unMT2Count = unMT2Num + "/" + unMT2FileNum;//MT对焊接头
|
|
}
|
|
else
|
|
{
|
|
unMT2Count = "/";
|
|
}
|
|
keyValuePairs.Add("MTNoPassFW", unMT2Count);
|
|
|
|
// MT支管连接接头
|
|
string unMT3Count = string.Empty;
|
|
var unMT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "磁粉检测" select x;
|
|
if (unMT3.Count() > 0)
|
|
{
|
|
string unMT3Num = unMT3.Count().ToString();
|
|
string unMT3FileNum = (Convert.ToDouble(unMT3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unMT3Count = unMT3Num + "/" + unMT3FileNum;//MT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
unMT3Count = "/";
|
|
}
|
|
keyValuePairs.Add("MTNoPassDW", unMT3Count);
|
|
//PT对焊接头
|
|
string pt1Count = string.Empty;
|
|
var pt1 = from x in result where x.JOTY_Group == "1" && x.States == "2" && x.SysType == "渗透检测" select x;
|
|
if (pt1.Count() > 0)
|
|
{
|
|
string pt1Num = pt1.Count().ToString();
|
|
string pt1FileNum = (Convert.ToDouble(pt1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
pt1Count = pt1Num + "/" + pt1FileNum;//PT对焊接头
|
|
}
|
|
else
|
|
{
|
|
pt1Count = "/";
|
|
}
|
|
keyValuePairs.Add("PTBW", pt1Count);
|
|
//PT角焊接头
|
|
string pt2Count = string.Empty;
|
|
var pt2 = from x in result where x.JOTY_Group == "2" && x.States == "2" && x.SysType == "渗透检测" select x;
|
|
if (pt2.Count() > 0)
|
|
{
|
|
string pt2Num = pt2.Count().ToString();
|
|
string pt2FileNum = (Convert.ToDouble(pt2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
pt2Count = pt2Num + "/" + pt2FileNum;//PT角焊接头
|
|
}
|
|
else
|
|
{
|
|
pt2Count = "/";
|
|
}
|
|
keyValuePairs.Add("PTFW", pt2Count);
|
|
//PT 支管连接接头
|
|
string pt3Count = string.Empty;
|
|
var pt3 = from x in result where x.JOTY_Group == "3" && x.States == "2" && x.SysType == "渗透检测" select x;
|
|
if (pt3.Count() > 0)
|
|
{
|
|
string pt3Num = pt3.Count().ToString();
|
|
string pt3FileNum = (Convert.ToDouble(pt3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
pt3Count = pt3Num + "/" + pt3FileNum;//PT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
pt3Count = "/";
|
|
}
|
|
keyValuePairs.Add("PTDW", pt3Count);
|
|
// PT对焊接头
|
|
string unPT1Count = string.Empty;
|
|
var unPT1 = from x in result where x.JOTY_Group == "1" && x.States == "4" && x.SysType == "渗透检测" select x;
|
|
if (unPT1.Count() > 0)
|
|
{
|
|
string unPT1Num = unPT1.Count().ToString();
|
|
string unPT1FileNum = (Convert.ToDouble(unPT1.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unPT1Count = unPT1Num + "/" + unPT1FileNum;//PT对焊接头
|
|
}
|
|
else
|
|
{
|
|
unPT1Count = "/";
|
|
}
|
|
keyValuePairs.Add("PTNoPassBW", unPT1Count);
|
|
// PT角焊接头
|
|
string unPT2Count = string.Empty;
|
|
var unPT2 = from x in result where x.JOTY_Group == "2" && x.States == "4" && x.SysType == "渗透检测" select x;
|
|
if (unPT2.Count() > 0)
|
|
{
|
|
string unPT2Num = unPT2.Count().ToString();
|
|
string unPT2FileNum = (Convert.ToDouble(unPT2.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unPT2Count = unPT2Num + "/" + unPT2FileNum;//PT对焊接头
|
|
}
|
|
else
|
|
{
|
|
unPT2Count = "/";
|
|
}
|
|
keyValuePairs.Add("PTNoPassFW", unPT2Count);
|
|
// PT支管连接接头
|
|
string unPT3Count = string.Empty;
|
|
var unPT3 = from x in result where x.JOTY_Group == "3" && x.States == "4" && x.SysType == "渗透检测" select x;
|
|
if (unPT3.Count() > 0)
|
|
{
|
|
string unPT3Num = unPT3.Count().ToString();
|
|
string unPT3FileNum = (Convert.ToDouble(unPT3.Sum(x => (x.JOT_Dia.HasValue ? x.JOT_Dia.Value : 0))) * 3.14 / 1000).ToString("#0.000");
|
|
unPT3Count = unPT3Num + "/" + unPT3FileNum;//PT支管连接接头
|
|
}
|
|
else
|
|
{
|
|
unPT3Count = "/";
|
|
}
|
|
keyValuePairs.Add("PTNoPassDW", unPT3Count);
|
|
|
|
BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs);
|
|
|
|
initTemplatePath = "File\\Fastreport\\JGZL\\管道无损检测结果汇总表.frx";
|
|
|
|
if (File.Exists(rootPath + initTemplatePath))
|
|
{
|
|
PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
|
|
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
} |