SGGL_SHJ/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs

1316 lines
104 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public static class TestPackagePrintService
{
/// <summary>
/// 类别Map
/// </summary>
public static Dictionary<int, string> TypeIntMap = new Dictionary<int, string>()
{
//{ 0, "File\\Fastreport\\JGZL\\管道试压包文件资料.frx" },
//{ 1, "File\\Fastreport\\JGZL\\管道压力试验技术要求.frx" },
//{ 2, "File\\Fastreport\\JGZL\\管道压力包文件资料目录.frx" },
//{ 3, "File\\Fastreport\\JGZL\\管道系统压力试验条件确认记录.frx" },
//{ 4, "File\\Fastreport\\JGZL\\管道试压包尾项清单.frx" },
//{ 5, "File\\Fastreport\\JGZL\\管道系统压力试验记录.frx" },
//{ 6, "File\\Fastreport\\JGZL\\管道材料材质标识检查记录.frx" },
//{ 7, "File\\Fastreport\\JGZL\\管道焊接工作记录.frx" },
//{ 8, "File\\Fastreport\\JGZL\\管道无损检测数量统计表.frx" },
//{ 9, "File\\Fastreport\\JGZL\\无损检测结果汇总表.frx" }
{ 0, "管道试压包文件资料" },
{ 1, "管道压力试验技术要求" },
{ 2, "管道压力包文件资料目录" },
{ 3, "管道系统压力试验条件确认记录" },
{ 4, "管道试压包尾项清单" },
{ 5, "管道系统压力试验记录" },
{ 6, "管道材料材质标识检查记录" },
{ 7, "管道焊接工作记录" },
{ 8, "管道无损检测数量统计表" },
{ 9, "无损检测结果汇总表" }
};
public static List<Model.PTP_TestPackagePrint> GetListByPTP_ID(string PTP_ID)
{
return Funs.DB.PTP_TestPackagePrint.Where(x => x.PTP_ID == PTP_ID).OrderBy(x => x.TypeInt).ToList();
}
/// <summary>
/// 根据试压包ID和类别打印次数+1
/// </summary>
/// <param name="PTP_ID"></param>
/// <param name="typeInt"></param>
public static void AddPrintCountByTypeInt(string PTP_ID, int typeInt)
{
Model.PTP_TestPackagePrint table = Funs.DB.PTP_TestPackagePrint.FirstOrDefault(x => x.PTP_ID == PTP_ID && x.TypeInt == typeInt);
if (table != null)
{
table.PrintCount = table.PrintCount + 1;
}
else
{
table = new Model.PTP_TestPackagePrint
{
Id = Guid.NewGuid().ToString(),
PTP_ID = PTP_ID,
TypeInt = typeInt,
PrintCount = 1
};
Funs.DB.PTP_TestPackagePrint.InsertOnSubmit(table);
}
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据试压包ID打印所有类别打印次数+1
/// </summary>
/// <param name="PTP_ID"></param>
public static void AddPrintCountByPTP_ID(string PTP_ID)
{
var list = Funs.DB.PTP_TestPackagePrint.Where(x => x.PTP_ID == PTP_ID).ToList();
//检查是否所有类型都存在如果不存在则添加PrintCount 初始化为 0
foreach (var typeInt in TypeIntMap.Keys)
{
if (!list.Any(x => x.TypeInt == typeInt))
{
var newEntry = new Model.PTP_TestPackagePrint
{
Id= Guid.NewGuid().ToString(),
PTP_ID = PTP_ID,
TypeInt = typeInt,
PrintCount = 1
};
Funs.DB.PTP_TestPackagePrint.InsertOnSubmit(newEntry);
}
}
// 循环所有类型PrintCount +1
foreach (var table in list)
{
table.PrintCount = table.PrintCount + 1;
}
Funs.DB.SubmitChanges();
}
public static void Add(Model.PTP_TestPackagePrint newtable)
{
Model.PTP_TestPackagePrint table = new Model.PTP_TestPackagePrint
{
Id = newtable.Id,
PTP_ID = newtable.PTP_ID,
TypeInt = newtable.TypeInt,
PrintCount = newtable.PrintCount,
};
Funs.DB.PTP_TestPackagePrint.InsertOnSubmit(table);
Funs.DB.SubmitChanges();
}
public static void Update(Model.PTP_TestPackagePrint newtable)
{
Model.PTP_TestPackagePrint table = Funs.DB.PTP_TestPackagePrint.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.PTP_ID = newtable.PTP_ID;
table.TypeInt = newtable.TypeInt;
table.PrintCount = newtable.PrintCount;
Funs.DB.SubmitChanges();
}
}
public static void DeleteById(string Id)
{
Model.PTP_TestPackagePrint table = Funs.DB.PTP_TestPackagePrint.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
Funs.DB.PTP_TestPackagePrint.DeleteOnSubmit(table);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 获取打印明细
/// </summary>
/// <param name="updateTestPackage"></param>
/// <param name="printType"></param>
/// <param name="ptp_id"></param>
/// <param name="projectid"></param>
/// <returns></returns>
public static Model.FastReportItem GetFastReportItem(Model.PTP_TestPackage updateTestPackage, string printType, string ptp_id,string projectid )
{
string initTemplatePath = "";
Model.FastReportItem fastReportItem = new Model.FastReportItem();
switch (printType)
{
case "0"://管道试压包文件资料
{
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
keyValuePairs.Add("ProjectName", projectName);
keyValuePairs.Add("InstallationName", projectName + InstallationName);
keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道试压包文件资料.frx";
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
}
break;
case "1"://管道压力试验技术要求
{
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道压力试验技术要求.frx";
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
}
break;
case "2"://管道压力包文件资料目录
{
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道压力包文件资料目录.frx";
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
}
break;
case "3"://管道系统压力试验条件确认记录
{
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
keyValuePairs.Add("ProjectName", projectName);
keyValuePairs.Add("InstallationName", InstallationName);
keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo);
keyValuePairs.Add("TestPackageName", updateTestPackage.TestPackageName);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验条件确认记录.frx";
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
}
break;
case "4"://管道试压包尾项清单
{
string sql = @"select ItemCheckId,PTP_ID,PTP_ItemEndCheck.PipelineId,Content,ItemType,Result,HJGL_Pipeline.PipelineCode from PTP_ItemEndCheck
left join PTP_ItemEndCheckList on PTP_ItemEndCheckList.ItemEndCheckListId = PTP_ItemEndCheck.ItemEndCheckListId
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = PTP_ItemEndCheck.PipelineId
where PTP_ItemEndCheckList.PTP_ID=@ptp_id";
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@ptp_id", ptp_id),
};
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
DataTable dt = new DataTable();
dt.TableName = "Data";
dt.Columns.Add("SortNumber");
dt.Columns.Add("PipelineCode");
dt.Columns.Add("Content");
dt.Columns.Add("ItemType");
for (int i = 0; i < tb.Rows.Count; i++)
{
var newRows = dt.NewRow();
newRows["SortNumber"] = (i + 1).ToString();
newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString();
newRows["Content"] = tb.Rows[i]["Content"].ToString();
newRows["ItemType"] = tb.Rows[i]["ItemType"].ToString();
dt.Rows.Add(newRows);
}
BLL.FastReportService.AddFastreportTable(dt);
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道试压包尾项清单.frx";
List<DataTable> dataTables = new List<DataTable>();
dataTables.Add(dt);
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
fastReportItem.DataTables = dataTables;
}
break;
case "5"://管道系统压力试验记录
{
string sql = @"SELECT ptpPipe.PT_PipeId,
ptpPipe.PTP_ID,
ptpPipe.PipelineId,
IsoInfo.DesignPress, --设计压力
IsoInfo.DesignTemperature, --设计温度
IsoInfo.TestPressure, --试验压力
IsoInfo.PipelineCode,--管道编号/单线号
testMedium.MediumName,--试验介质
testPackage.AmbientTemperature,--试验环境温度
testPackage.TestMediumTemperature--试验介质温度
FROM dbo.PTP_PipelineList AS ptpPipe
LEFT JOIN dbo.HJGL_Pipeline AS IsoInfo ON ptpPipe.PipelineId = IsoInfo.PipelineId
LEFT JOIN dbo.Base_TestMedium AS testMedium ON testMedium.TestMediumId = IsoInfo.TestMedium
left join PTP_TestPackage as testPackage on testPackage.PTP_ID = ptpPipe.PTP_ID
where ptpPipe.PTP_ID=@ptp_id";
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@ptp_id", ptp_id),
};
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
DataTable dt = new DataTable();
dt.TableName = "Data";
dt.Columns.Add("PipelineCode");
dt.Columns.Add("DesignPress");
dt.Columns.Add("DesignTemperature");
dt.Columns.Add("MediumName");
dt.Columns.Add("TestPressure");
dt.Columns.Add("AmbientTemperature");
dt.Columns.Add("TestMediumTemperature");
for (int i = 0; i < tb.Rows.Count; i++)
{
var newRows = dt.NewRow();
newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString();
newRows["DesignPress"] = tb.Rows[i]["DesignPress"].ToString();
newRows["DesignTemperature"] = tb.Rows[i]["DesignTemperature"].ToString();
newRows["MediumName"] = tb.Rows[i]["MediumName"].ToString();
newRows["TestPressure"] = tb.Rows[i]["TestPressure"].ToString();
newRows["AmbientTemperature"] = tb.Rows[i]["AmbientTemperature"].ToString();
var temp = tb.Rows[i]["TestMediumTemperature"].ToString();
newRows["TestMediumTemperature"] = tb.Rows[i]["TestMediumTemperature"].ToString();
dt.Rows.Add(newRows);
}
BLL.FastReportService.AddFastreportTable(dt);
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("ProjectName", projectName);
keyValuePairs.Add("InstallationName", InstallationName);
keyValuePairs.Add("TestPackageNo", updateTestPackage.TestPackageNo);
keyValuePairs.Add("TestPackageName", updateTestPackage.TestPackageName);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验记录.frx";
List<DataTable> dataTables = new List<DataTable>();
dataTables.Add(dt);
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
fastReportItem.DataTables = dataTables;
}
break;
case "6"://管道材料材质标识检查记录
{
string sql = @"select PT_PipeId, PTP_ID,pipelineList.PipelineId,pipeline.PipelineCode
from PTP_PipelineList as pipelineList
left join HJGL_Pipeline as pipeline on pipeline.PipelineId = pipelineList.PipelineId
where PTP_ID=@ptp_id";
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@ptp_id", ptp_id),
};
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
DataTable dt = new DataTable();
dt.TableName = "Data";
dt.Columns.Add("PipelineCode");
dt.Columns.Add("ManterialCode");
dt.Columns.Add("Specification");
for (int i = 0; i < tb.Rows.Count; i++)
{
var newRows = dt.NewRow();
newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString();
newRows["ManterialCode"] = getMaterialCodeByPipelineId(tb.Rows[i]["PipelineId"].ToString());
newRows["Specification"] = getSpecificationByPipelineId(tb.Rows[i]["PipelineId"].ToString());
dt.Rows.Add(newRows);
}
BLL.FastReportService.AddFastreportTable(dt);
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("ProjectName", projectName);
keyValuePairs.Add("InstallationName", InstallationName);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道材料材质标识检查记录.frx";
List<DataTable> dataTables = new List<DataTable>();
dataTables.Add(dt);
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
fastReportItem.DataTables = dataTables;
}
break;
case "7"://管道焊接工作记录
{
var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id);
if (iosList.Count > 0)
{
var q = iosList[0];
var isoIds = string.Join("','", iosList.Select(x => x.PipelineId).ToArray());
string sql = @"select weldJoint.WeldJointId,
weldJoint.PipelineId,
weldJoint.ProjectId,
weldJoint.PipelineCode,--管线号
weldJoint.WeldJointCode,--焊口号
(case when person.WelderCode is not null then
case when person2.WelderCode is not null and person.WelderCode<>person2.WelderCode
then person.WelderCode+'/'+person2.WelderCode
else person2.WelderCode end
else person.WelderCode end) as WelderCode,--焊工代号
weldJoint.Specification, --规格
(case when material1.MaterialCode is not null then
case when material2.MaterialCode is not null and material1.MaterialCode<>material2.MaterialCode
then material1.MaterialCode+'/'+material2.MaterialCode
else material2.MaterialCode end
else material1.MaterialCode end) as MaterialCode, --材质
weldJoint.WeldingLocationId,--焊接位置
weldingMethod.WeldingMethodCode,--焊接方法
(case
when consumables1.ConsumablesName is not null then
case
when consumables2.ConsumablesName is not null and consumables1.ConsumablesName <> consumables2.ConsumablesName
then consumables1.ConsumablesName + '+' + consumables2.ConsumablesName
else consumables1.ConsumablesName end
else consumables2.ConsumablesName end) as WeldingMaterial,--焊材牌号
convert(varchar(10),weldingDaily.WeldingDate,111) as WeldingDate --焊接日期
from HJGL_WeldJoint as weldJoint
left join HJGL_Pipeline as pipeline on pipeline.PipelineId = weldJoint.PipelineId
left join SitePerson_Person as person on person.PersonId = weldJoint.CoverWelderId
left join SitePerson_Person as person2 on person2.PersonId = weldJoint.BackingWelderId
left join Base_Material as material1 on material1.MaterialId = weldJoint.Material1Id
left join Base_Material as material2 on material2.MaterialId = weldJoint.Material2Id
left join HJGL_WeldingDaily as weldingDaily on weldingDaily.WeldingDailyId = weldJoint.WeldingDailyId
left join Base_WeldingMethod as weldingMethod on weldingMethod.WeldingMethodId = weldJoint.WeldingMethodId
left join Base_Consumables as consumables1 on consumables1.ConsumablesId = weldJoint.WeldingWire
left join Base_Consumables as consumables2 on consumables2.ConsumablesId = weldJoint.WeldingRod
where weldJoint.WeldingDailyId is not null and weldJoint.PipelineId in ('" + isoIds + "')";
List<SqlParameter> listStr = new List<SqlParameter>
{
//new SqlParameter("@ptp_id", this.PTP_ID),
};
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
DataTable dt = new DataTable();
dt.TableName = "Data";
dt.Columns.Add("PipelineCode");
dt.Columns.Add("WeldJointCode");
dt.Columns.Add("WelderCode");
dt.Columns.Add("Specification");
dt.Columns.Add("MaterialCode");
dt.Columns.Add("WeldingLocationId");
dt.Columns.Add("WeldingMethodCode");
dt.Columns.Add("WeldingMaterial");
dt.Columns.Add("WeldingDate");
for (int i = 0; i < tb.Rows.Count; i++)
{
var newRows = dt.NewRow();
newRows["PipelineCode"] = tb.Rows[i]["PipelineCode"].ToString();
newRows["WeldJointCode"] = tb.Rows[i]["WeldJointCode"].ToString();
newRows["WelderCode"] = tb.Rows[i]["WelderCode"].ToString();
newRows["Specification"] = tb.Rows[i]["Specification"].ToString();
newRows["MaterialCode"] = tb.Rows[i]["MaterialCode"].ToString();
newRows["WeldingLocationId"] = tb.Rows[i]["WeldingLocationId"].ToString();
newRows["WeldingMethodCode"] = tb.Rows[i]["WeldingMethodCode"].ToString();
newRows["WeldingMaterial"] = tb.Rows[i]["WeldingMaterial"].ToString();
newRows["WeldingDate"] = tb.Rows[i]["WeldingDate"].ToString();
dt.Rows.Add(newRows);
}
BLL.FastReportService.AddFastreportTable(dt);
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
var InstallationName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("ProjectName", projectName);
keyValuePairs.Add("InstallationName", InstallationName);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道焊接工作记录.frx";
List<DataTable> dataTables = new List<DataTable>();
dataTables.Add(dt);
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
fastReportItem.DataTables = dataTables;
}
}
break;
case "8"://管道无损检测数量统计表
{
var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id);
if (iosList.Count > 0)
{
var q = iosList[0];
var isoIds = string.Join("','", iosList.Select(x => x.PipelineId).ToArray());
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
var UnitWorkName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
keyValuePairs.Add("projectName", projectName);
keyValuePairs.Add("UnitWorkName", UnitWorkName);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
string sql3 = @"SELECT isoList.PT_PipeId,
isoList.PTP_ID,
isoList.PipelineId,
testPackage.ProjectId,
isoInfo.PipelineCode,
isoInfo.SingleNumber,
(convert(nvarchar(10),dr.DetectionRateValue)+'%') as DetectionRateValue,
'' as totalJotCountBW,
'' as RTtotalJotCountBW,
'' as UTtotalJotCountBW,
'' as MTtotalJotCountBW,
'' as PTtotalJotCountBW,
'' as totalJotCountFW,
'' as MTtotalJotCountFW,
'' as PTtotalJotCountFW,
'' as totalJotCountDW,
'' as RTtotalJotCountDW,
'' as UTtotalJotCountDW,
'' as MTtotalJotCountDW,
'' as PTtotalJotCountDW
FROM PTP_PipelineList AS isoList
LEFT JOIN PTP_TestPackage AS testPackage ON testPackage.PTP_ID = isoList.PTP_ID
LEFT JOIN HJGL_Pipeline AS isoInfo ON isoInfo.PipelineId = isoList.PipelineId
left join Base_DetectionRate as dr on dr.DetectionRateId = isoInfo.DetectionRateId
where isoList.PipelineId in ('" + isoIds + "')";
DataTable dt = SQLHelper.GetDataTableRunText(sql3, null);
if (dt != null)
{
dt.TableName = "Data";
for (int i = 0; i < dt.Rows.Count; i++)
{
#region
int totalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "BW"
select x).Count();//对接检测合格数量
int RTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "BW"
&& w.DetectionTypeCode == "RT"
select x).Count();//RT对接检测合格数量
int UTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "BW"
&& w.DetectionTypeCode == "UT"
select x).Count();//UT对接检测合格数量
int MTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "BW"
&& w.DetectionTypeCode == "MT"
select x).Count();// MT对接检测合格数量
int PTtotalJotCountBW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "BW"
&& w.DetectionTypeCode == "PT"
select x).Count();//PT对接检测合格数量
dt.Rows[i]["totalJotCountBW"] = totalJotCountBW.ToString();
dt.Rows[i]["RTtotalJotCountBW"] = RTtotalJotCountBW.ToString();
dt.Rows[i]["UTtotalJotCountBW"] = UTtotalJotCountBW.ToString();
dt.Rows[i]["MTtotalJotCountBW"] = MTtotalJotCountBW.ToString();
dt.Rows[i]["PTtotalJotCountBW"] = PTtotalJotCountBW.ToString();
#endregion
#region
int totalJotCountFW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& (z.WeldTypeCode == "C" || z.WeldTypeCode == "E")
select x).Count();//对接检测合格数量
int MTtotalJotCountFW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& (z.WeldTypeCode == "C" || z.WeldTypeCode == "E")
&& w.DetectionTypeCode == "MT"
select x).Count();//MT对接检测合格数量
int PTtotalJotCountFW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& (z.WeldTypeCode == "C" || z.WeldTypeCode == "E")
&& w.DetectionTypeCode == "PT"
select x).Count();//PT对接检测合格数量
dt.Rows[i]["totalJotCountFW"] = totalJotCountFW.ToString();
dt.Rows[i]["MTtotalJotCountFW"] = MTtotalJotCountFW.ToString();
dt.Rows[i]["PTtotalJotCountFW"] = PTtotalJotCountFW.ToString();
#endregion
#region
int totalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "D"
select x).Count();//支管检测合格数量
int RTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "D"
&& w.DetectionTypeCode == "RT"
select x).Count();//支管检测合格数量
int UTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "D"
&& w.DetectionTypeCode == "UT"
select x).Count();//支管检测合格数量
int MTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "D"
&& w.DetectionTypeCode == "MT"
select x).Count();//支管检测合格数量
int PTtotalJotCountDW = (from x in Funs.DB.HJGL_Batch_NDEItem
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join y in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals y.WeldJointId
join z in Funs.DB.Base_WeldType on y.WeldTypeId equals z.WeldTypeId
join w in Funs.DB.Base_DetectionType on x.DetectionTypeId equals w.DetectionTypeId
where y.PipelineId == dt.Rows[i]["PipelineId"].ToString()
&& x.CheckResult == "1"
&& z.WeldTypeCode == "D"
&& w.DetectionTypeCode == "PT"
select x).Count();//支管检测合格数量
dt.Rows[i]["totalJotCountDW"] = totalJotCountDW.ToString();
dt.Rows[i]["RTtotalJotCountDW"] = RTtotalJotCountDW.ToString();
dt.Rows[i]["UTtotalJotCountDW"] = UTtotalJotCountDW.ToString();
dt.Rows[i]["MTtotalJotCountDW"] = MTtotalJotCountDW.ToString();
dt.Rows[i]["PTtotalJotCountDW"] = PTtotalJotCountDW.ToString();
#endregion
}
}
BLL.FastReportService.AddFastreportTable(dt);
initTemplatePath = "File\\Fastreport\\JGZL\\管道无损检测数量统计表.frx";
List<DataTable> dataTables = new List<DataTable>();
dataTables.Add(dt);
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
fastReportItem.DataTables = dataTables;
}
}
break;
case "9"://无损检测结果汇总表
{
var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id);
if (iosList.Count > 0)
{
var q = iosList[0];
var isoNos = string.Join(",", iosList.Select(x => x.PipelineCode).ToArray());
var isoIds = string.Join("','", iosList.Select(x => x.PipelineId).ToArray());
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
var UnitWorkName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
var unitNames = BLL.UnitService.GetUnitNameByUnitId(updateTestPackage.UnitId);
keyValuePairs.Add("ProjectName", projectName);
keyValuePairs.Add("UnitWorkName", UnitWorkName);
keyValuePairs.Add("UnitName2", unitNames);//施工单位
if (!string.IsNullOrEmpty(q.PipingClassId))
{
var PipingClass = BLL.Base_PipingClassService.GetPipingClassByPipingClassId(q.PipingClassId);
if (PipingClass != null)
{
keyValuePairs.Add("ISOLevel", PipingClass.PipingClassName);
}
}
keyValuePairs.Add("isoCode", isoNos);
//监理单位
var Unit1 = BLL.UnitService.GetUnitByProjectIdUnitTypeList(projectid, BLL.Const.ProjectUnitType_3);
if (Unit1 != null)
{
var unitNames1 = string.Join(",", Unit1.Select(x => x.UnitName).ToArray());
keyValuePairs.Add("UnitName1", unitNames1);
}
#region
int rtdjJoint = 0;//RT对接焊口数
int? rtdjFilm = 0;//RT对接片数
int rtjhJoint = 0;//RT角焊焊口数
int? rtjhFilm = 0;//RT角焊片数
int rtzgJoint = 0;//RT支管连接焊口数
int? rtzgFilm = 0;//RT支管连接片数
int utdjJoint = 0;//UT对接焊口数
//int? utdjFilm = 0;//UT对接片数
int utjhJoint = 0;//UT角焊焊口数
//int? utjhFilm = 0;//UT角焊片数
int utzgJoint = 0;//UT支管连接焊口数
//int? utzgFilm = 0;//UT支管连接片数
int mtdjJoint = 0;//MT对接焊口数
//int? mtdjFilm = 0;//MT对接片数
int mtjhJoint = 0;//MT角焊焊口数
//int? mtjhFilm = 0;//MT角焊片数
int mtzgJoint = 0;//MT支管连接焊口数
//int? mtzgFilm = 0;//MT支管连接片数
int ptdjJoint = 0;//PT对接焊口数
//int? ptdjFilm = 0;//PT对接片数
int ptjhJoint = 0;//PT角焊焊口数
//int? ptjhFilm = 0;//PT角焊片数
int ptzgJoint = 0;//PT支管连接焊口数
//int? ptzgFilm = 0;//PT支管连接片数
int rtdjNoPassJoint = 0;
int? rtdjNoPassFilm = 0;
int rtjhNoPassJoint = 0;
int? rtjhNoPassFilm = 0;
int rtzgNoPassJoint = 0;
int? rtzgNoPassFilm = 0;
int utdjNoPassJoint = 0;
decimal? utdjNoPassFilm = 0;
int utjhNoPassJoint = 0;
decimal? utjhNoPassFilm = 0;
int utzgNoPassJoint = 0;
decimal? utzgNoPassFilm = 0;
int mtdjNoPassJoint = 0;
decimal? mtdjNoPassFilm = 0;
int mtjhNoPassJoint = 0;
decimal? mtjhNoPassFilm = 0;
int mtzgNoPassJoint = 0;
decimal? mtzgNoPassFilm = 0;
int ptdjNoPassJoint = 0;
decimal? ptdjNoPassFilm = 0;
int ptjhNoPassJoint = 0;
decimal? ptjhNoPassFilm = 0;
int ptzgNoPassJoint = 0;
decimal? ptzgNoPassFilm = 0;
#endregion
foreach (var iso in iosList)
{
#region
#region RT对焊接头
rtdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId
select x).Count();//RT对接焊口数
rtdjFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId
select x.TotalFilm).Sum();//RT对接片数
#endregion
#region RT角焊接头
rtjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId
select x).Count();//RT角焊焊口数
rtjhFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId
select x.TotalFilm).Sum();//RT角焊片数
#endregion
#region RT支管连接焊口数
rtzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId
select x).Count();//RT支管连接焊口数
rtzgFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId
select x.TotalFilm).Sum();//RT支管连接片数
#endregion
#region UT对焊接头
utdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId
select x).Count();//UT对接焊口数
//utdjFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//UT对接片数
#endregion
#region UT角焊接头
utjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId
select x).Count();//UT角焊焊口数
//utjhFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "FW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//UT角焊片数
#endregion
#region UT支管连接焊口数
utzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId
select x).Count();//UT支管连接焊口数
//utzgFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "DW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//UT支管连接片数
#endregion
#region MT对焊接头
mtdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId
select x).Count();//MT对接焊口数
//mtdjFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//MT对接片数
#endregion
#region MT角焊接头
mtjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId
select x).Count();//MT角焊焊口数
//mtjhFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "FW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//MT角焊片数
#endregion
#region MT支管连接焊口数
mtzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId
select x).Count();//MT支管连接焊口数
//mtzgFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "DW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//MT支管连接片数
#endregion
#region PT对焊接头
ptdjJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId
select x).Count();//PT对接焊口数
//ptdjFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//PT对接片数
#endregion
#region PT角焊接头
ptjhJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId
select x).Count();//PT角焊焊口数
//ptjhFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "FW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//PT角焊片数
#endregion
#region PT支管连接焊口数
ptzgJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId
select x).Count();//PT支管连接焊口数
//ptzgFilm += (from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.Base_DetectionType on x.CHT_CheckMethod equals y.DetectionTypeId
// join z in Funs.DB.PW_JointInfo on x.JOT_ID equals z.JOT_ID
// join w in Funs.DB.Base_WeldType on z.JOTY_ID equals w.WeldTypeId
// where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "DW" && z.ISO_ID == iso.ISO_ID
// select x.CHT_TotalFilm).Sum();//PT支管连接片数
#endregion
#endregion
#region
#region RT对焊接头
rtdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//RT对接焊口数
rtdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select (x.TotalFilm - x.PassFilm)).Sum();//RT对接片数
#endregion
#region RT角焊接头
rtjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//RT角焊焊口数
rtjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select (x.TotalFilm - x.PassFilm)).Sum();//RT角焊片数
#endregion
#region RT支管连接焊口数
rtzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//RT支管连接焊口数
rtzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "RT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select (x.TotalFilm - x.PassFilm)).Sum();//RT支管连接片数
#endregion
#region UT对焊接头
utdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//UT对接焊口数
utdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//UT对接片数
#endregion
#region UT角焊接头
utjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//UT角焊焊口数
utjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//UT角焊片数
#endregion
#region UT支管连接焊口数
utzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//UT支管连接焊口数
utzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "UT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//UT支管连接片数
#endregion
#region MT对焊接头
mtdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//MT对接焊口数
mtdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//MT对接片数
#endregion
#region MT角焊接头
mtjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//MT角焊焊口数
mtjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//MT角焊片数
#endregion
#region MT支管连接焊口数
mtzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//MT支管连接焊口数
mtzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "MT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//MT支管连接片数
#endregion
#region PT对焊接头
ptdjNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//PT对接焊口数
ptdjNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "BW" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//PT对接片数
#endregion
#region PT角焊接头
ptjhNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//PT角焊焊口数
ptjhNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && (w.WeldTypeCode == "C" || w.WeldTypeCode == "E") && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//PT角焊片数
#endregion
#region PT支管连接焊口数
ptzgNoPassJoint += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x).Count();//PT支管连接焊口数
ptzgNoPassFilm += (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.Base_DetectionType on x.DetectionTypeId equals y.DetectionTypeId
join t in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId
join z in Funs.DB.HJGL_WeldJoint on t.WeldJointId equals z.WeldJointId
join w in Funs.DB.Base_WeldType on z.WeldTypeId equals w.WeldTypeId
where y.DetectionTypeCode == "PT" && w.WeldTypeCode == "D" && z.PipelineId == iso.PipelineId && x.CheckResult == "2"
select x.TotalFilm - x.PassFilm).Sum();//PT支管连接片数
#endregion
#endregion
}
keyValuePairs.Add("RTBW", (rtdjJoint > 0 ? rtdjJoint.ToString() + "道" : "") + "/" + (rtdjFilm > 0 ? rtdjFilm.ToString() + "张" : ""));
keyValuePairs.Add("RTFW", (rtjhJoint > 0 ? rtjhJoint.ToString() + "道" : "") + "/" + (rtjhFilm > 0 ? rtjhFilm.ToString() + "张" : ""));
keyValuePairs.Add("RTDW", (rtzgJoint > 0 ? rtzgJoint.ToString() + "道" : "") + "/" + (rtzgFilm > 0 ? rtzgFilm.ToString() + "张" : ""));
keyValuePairs.Add("UTBW", (utdjJoint > 0 ? utdjJoint.ToString() + "道" : "") + "/" + (utdjJoint > 0 ? utdjJoint.ToString() + "米" : ""));
keyValuePairs.Add("UTFW", (utjhJoint > 0 ? utjhJoint.ToString() + "道" : "") + "/" + (utjhJoint > 0 ? utjhJoint.ToString() + "米" : ""));
keyValuePairs.Add("UTDW", (utzgJoint > 0 ? utzgJoint.ToString() + "道" : "") + "/" + (utzgJoint > 0 ? utzgJoint.ToString() + "米" : ""));
keyValuePairs.Add("MTBW", (mtdjJoint > 0 ? mtdjJoint.ToString() + "道" : "") + "/" + (mtdjJoint > 0 ? mtdjJoint.ToString() + "米" : ""));
keyValuePairs.Add("MTFW", (mtjhJoint > 0 ? mtjhJoint.ToString() + "道" : "") + "/" + (mtjhJoint > 0 ? mtjhJoint.ToString() + "米" : ""));
keyValuePairs.Add("MTDW", (mtzgJoint > 0 ? mtzgJoint.ToString() + "道" : "") + "/" + (mtzgJoint > 0 ? mtzgJoint.ToString() + "米" : ""));
keyValuePairs.Add("PTBW", (ptdjJoint > 0 ? ptdjJoint.ToString() + "道" : "") + "/" + (ptdjJoint > 0 ? ptdjJoint.ToString() + "米" : ""));
keyValuePairs.Add("PTFW", (ptjhJoint > 0 ? ptjhJoint.ToString() + "道" : "") + "/" + (ptjhJoint > 0 ? ptjhJoint.ToString() + "米" : ""));
keyValuePairs.Add("PTDW", (ptzgJoint > 0 ? ptzgJoint.ToString() + "道" : "") + "/" + (ptzgJoint > 0 ? ptzgJoint.ToString() + "米" : ""));
keyValuePairs.Add("RTNoPassBW", (rtdjNoPassJoint > 0 ? rtdjNoPassJoint.ToString() + "道" : "") + "/" + (rtdjNoPassFilm > 0 ? rtdjNoPassFilm.ToString() + "张" : ""));
keyValuePairs.Add("RTNoPassFW", (rtjhNoPassJoint > 0 ? rtjhNoPassJoint.ToString() + "道" : "") + "/" + (rtjhNoPassFilm > 0 ? rtjhNoPassFilm.ToString() + "张" : ""));
keyValuePairs.Add("RTNoPassDW", (rtzgNoPassJoint > 0 ? rtzgNoPassJoint.ToString() + "道" : "") + "/" + (rtzgNoPassFilm > 0 ? rtzgNoPassFilm.ToString() + "张" : ""));
keyValuePairs.Add("UTNoPassBW", (utdjNoPassJoint > 0 ? utdjNoPassJoint.ToString() + "道" : "") + "/" + (utdjNoPassFilm > 0 ? utdjNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("UTNoPassFW", (utjhNoPassJoint > 0 ? utjhNoPassJoint.ToString() + "道" : "") + "/" + (utjhNoPassFilm > 0 ? utjhNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("UTNoPassDW", (utzgNoPassJoint > 0 ? utzgNoPassJoint.ToString() + "道" : "") + "/" + (utzgNoPassFilm > 0 ? utzgNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("MTNoPassBW", (mtdjNoPassJoint > 0 ? mtdjNoPassJoint.ToString() + "道" : "") + "/" + (mtdjNoPassFilm > 0 ? mtdjNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("MTNoPassFW", (mtjhNoPassJoint > 0 ? mtjhNoPassJoint.ToString() + "道" : "") + "/" + (mtjhNoPassFilm > 0 ? mtjhNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("MTNoPassDW", (mtzgNoPassJoint > 0 ? mtzgNoPassJoint.ToString() + "道" : "") + "/" + (mtzgNoPassFilm > 0 ? mtzgNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("PTNoPassBW", (ptdjNoPassJoint > 0 ? ptdjNoPassJoint.ToString() + "道" : "") + "/" + (ptdjNoPassFilm > 0 ? ptdjNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("PTNoPassFW", (ptjhNoPassJoint > 0 ? ptjhNoPassJoint.ToString() + "道" : "") + "/" + (ptjhNoPassFilm > 0 ? ptjhNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("PTNoPassDW", (ptzgNoPassJoint > 0 ? ptzgNoPassJoint.ToString() + "道" : "") + "/" + (ptzgNoPassFilm > 0 ? ptzgNoPassFilm.ToString() + "处" : ""));
keyValuePairs.Add("isoIds", isoIds);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
string sql3 = @"select nDEItem.NDEItemID,
i.SingleName,
i.PipelineCode,
j.WeldJointCode,
(case when j.CoverWelderId is not null then (
case when j.BackingWelderId is not null and j.CoverWelderId<>j.BackingWelderId
then cWelder.JobNum+'/'+fWelder.JobNum
else cWelder.JobNum end) else fWelder.JobNum end) as WelderCode,
(case when d.DetectionTypeCode='RT' or d.DetectionTypeCode='UT' then
(case nDEItem.CheckResult when '1' then '合格' when '2' then '不合格' else '/' end) else '/' end) as RTUTResult,
(case when d.DetectionTypeCode='RT' or d.DetectionTypeCode='UT' then nDEItem.NDEReportNo else '/' end) as RTUTCheckNo,
(case when d.DetectionTypeCode='MT' or d.DetectionTypeCode='PT' then
(case nDEItem.CheckResult when '1' then '合格' when '2' then '不合格' else '/' end) else '/' end) as MTPTResult,
(case when d.DetectionTypeCode='MT' or d.DetectionTypeCode='PT' then nDEItem.NDEReportNo else '/' end) as MTPTCheckNo,
nDEItem.Remark as CHT_Remark,pointBatch.PointBatchCode
from HJGL_Batch_NDEItem as nDEItem
left join HJGL_Batch_NDE as c on c.NDEID = nDEItem.NDEID
left join HJGL_Batch_BatchTrustItem as t on t.TrustBatchItemId = nDEItem.TrustBatchItemId
left join HJGL_WeldJoint as j on j.WeldJointId = t.WeldJointId
left join HJGL_Pipeline as i on i.PipelineId =j.PipelineId
left join Person_Persons as cWelder on cWelder.PersonId = j.CoverWelderId
left join Person_Persons as fWelder on fWelder.PersonId = j.BackingWelderId
left join Base_DetectionType as d on d.DetectionTypeId = nDEItem.DetectionTypeId
left join HJGL_Batch_PointBatchItem as pointBatchItem on pointBatchItem.PointBatchItemId = t.PointBatchItemId
left join HJGL_Batch_PointBatch as pointBatch on pointBatch.PointBatchId = pointBatchItem.PointBatchId
where j.PipelineId in ('" + isoIds + "')";
List<SqlParameter> listStr = new List<SqlParameter>();
SqlParameter[] parameter = listStr.ToArray();
DataTable dt0 = SQLHelper.GetDataTableRunText(sql3, parameter);
sql3 += " order by PipelineCode,WeldJointCode";
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");
dt0.DefaultView.Sort = "PipelineCode,WeldJointCode asc";
DataRow[] rows = dt0.DefaultView.ToTable().Select();
foreach (var row in rows)
{
var newRow = dt.NewRow();
newRow["SingleName"] = row["SingleName"].ToString();
newRow["WeldJointCode"] = row["WeldJointCode"].ToString();
newRow["WelderCode"] = row["WelderCode"].ToString();
newRow["PointBatchCode"] = row["PointBatchCode"].ToString();
newRow["RTUTResult"] = row["RTUTResult"].ToString();
newRow["RTUTCheckNo"] = row["RTUTCheckNo"].ToString();
newRow["MTPTResult"] = row["MTPTResult"].ToString();
newRow["MTPTCheckNo"] = row["MTPTCheckNo"].ToString();
newRow["CHT_Remark"] = row["CHT_Remark"].ToString();
dt.Rows.Add(newRow);
}
BLL.FastReportService.AddFastreportTable(dt);
initTemplatePath = "File\\Fastreport\\JGZL\\管道无损检测结果汇总表.frx";
List<DataTable> dataTables = new List<DataTable>();
dataTables.Add(dt);
fastReportItem.ReportPath = initTemplatePath;
fastReportItem.ParameterValues = keyValuePairs;
fastReportItem.DataTables = dataTables;
}
}
break;
}
return fastReportItem;
}
#region
public static string getMaterialCodeByPipelineId(string pipelineId)
{
string materialCode = string.Empty;
if (!string.IsNullOrEmpty(pipelineId))
{
var weldjoint = (from x in Funs.DB.HJGL_WeldJoint
join y in Funs.DB.Base_Material on x.Material1Id equals y.MaterialId
join z in Funs.DB.Base_Material on x.Material2Id equals z.MaterialId
where x.PipelineId == pipelineId
select new { MaterialCode1 = y.MaterialCode, MaterialCode2 = z.MaterialCode }).FirstOrDefault();
if (weldjoint != null)
{
if (!string.IsNullOrEmpty(weldjoint.MaterialCode1) && !string.IsNullOrEmpty(weldjoint.MaterialCode2))
{
materialCode = weldjoint.MaterialCode1 + "/" + weldjoint.MaterialCode2;
}
else
{
if (!string.IsNullOrEmpty(weldjoint.MaterialCode1))
{
materialCode = weldjoint.MaterialCode1;
}
else
{
materialCode = weldjoint.MaterialCode2;
}
}
}
}
return materialCode;
}
public static string getSpecificationByPipelineId(string pipelineId)
{
string spcificaation = string.Empty;
if (!string.IsNullOrEmpty(pipelineId))
{
var weldjoint = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId select x).FirstOrDefault();
if (weldjoint != null)
{
spcificaation = weldjoint.Specification;
}
}
return spcificaation;
}
#endregion
}
}