diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index da1f4f68..f326ce86 100644 Binary files a/.vs/SGGL_SeDin_New/v17/.wsuo and b/.vs/SGGL_SeDin_New/v17/.wsuo differ diff --git a/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json b/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json index 3e78a4fd..6c1cb586 100644 --- a/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json +++ b/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json @@ -69,11 +69,11 @@ }, { "$type": "Bookmark", - "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" }, { "$type": "Bookmark", - "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" + "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" } ] } diff --git a/.vs/SGGL_SeDin_New/v17/DocumentLayout.json b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json index 6c1cb586..75ab69a7 100644 --- a/.vs/SGGL_SeDin_New/v17/DocumentLayout.json +++ b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json @@ -67,10 +67,6 @@ "$type": "Bookmark", "Name": "ST:2:0:{b9f91511-5ca5-40ec-9726-f3e3a7e534e2}" }, - { - "$type": "Bookmark", - "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" - }, { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" diff --git a/DataBase/版本日志/SGGLDB_V2025-09-24-001-lpf.sql b/DataBase/版本日志/SGGLDB_V2025-09-24-001-lpf.sql new file mode 100644 index 00000000..a15a3116 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-09-24-001-lpf.sql @@ -0,0 +1,96 @@ +CREATE VIEW dbo.View_HJGL_WeldJointDetectionType AS + WITH BaseData AS ( + SELECT + jot.[ProjectId] --ĿId + , jot.[PipelineCode] --ߺ + , pipe.DetectionType --̽Id(ܶм|ָ) + , pipe.PipelineId --Id + , STUFF((SELECT ',' + DetectionTypeCode + FROM Base_DetectionType + WHERE CHARINDEX('|' + LTRIM(DetectionTypeId) + '|', '|' + pipe.DetectionType + '|') > 0 + FOR XML PATH('')), 1, 1, '') AS DetectionTypeStr --̽ͣܶм,ָ + , (case when charindex('/', jot.WeldJointCode) > 0 + then RIGHT(jot.WeldJointCode, CHARINDEX('/', REVERSE(jot.WeldJointCode)) - 1) + else jot.WeldJointCode end) as WeldJointNumStr + , jot.[WeldJointId] --Id + , jot.[WeldJointCode] --ں + FROM [dbo].[HJGL_WeldJoint] jot + LEFT JOIN dbo.HJGL_Pipeline pipe ON pipe.PipelineId = jot.PipelineId + ) + SELECT + ProjectId, + PipelineCode, + DetectionType, + DetectionTypeStr, + -- ޸ĺJointDetectionTypeStr + (CASE + -- DetectionTypeStrΪ'/'ʱ'/' + WHEN DetectionTypeStr = '/' THEN '/' + -- WeldJointNumStrһַĸʱ + WHEN WeldJointNumStr LIKE '[A-Za-z]%' THEN + CASE + -- DetectionTypeStr'/'򷵻'/'ַ + WHEN CHARINDEX('/', DetectionTypeStr) > 0 THEN + SUBSTRING(DetectionTypeStr, CHARINDEX('/', DetectionTypeStr) + 1, LEN(DetectionTypeStr)) + -- '/'򷵻DetectionTypeStr + ELSE DetectionTypeStr + END + -- WeldJointNumStrһַĸʱ'/'ǰַ + ELSE + CASE + -- DetectionTypeStr'/'򷵻'/'ǰַ + WHEN CHARINDEX('/', DetectionTypeStr) > 0 THEN + LEFT(DetectionTypeStr, CHARINDEX('/', DetectionTypeStr) - 1) + -- '/'򷵻DetectionTypeStr + ELSE DetectionTypeStr + END + END) AS JointDetectionTypeStr, + -- ѡֶ + WeldJointId, + WeldJointCode, + WeldJointNumStr + FROM BaseData + +GO + +CREATE TABLE [dbo].[Base_MaterialColor] ( + [MaterialColorId] nvarchar(50) NOT NULL DEFAULT(NEWID()) PRIMARY KEY, + [UnitId] nvarchar(50), + [ProjectId] nvarchar(50), + [MaterialId] nvarchar(50) , + [ColorName] NVARCHAR(50) , + [ColorCardNo] NVARCHAR(50), + [RGB] NVARCHAR(20), + [Remark] NVARCHAR(200) +); + +go +exec sp_addextendedproperty 'MS_Description', N'λid', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'UnitId' +go + +exec sp_addextendedproperty 'MS_Description', N'id', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'MaterialId' +go + + +exec sp_addextendedproperty 'MS_Description', N'ɫ', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'ColorName' +go + +exec sp_addextendedproperty 'MS_Description', N'ɫ', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'ColorCardNo' +go + +exec sp_addextendedproperty 'MS_Description', N'ע', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'Remark' +go + +alter table dbo.HJGL_PackagingManageDetail + add TwOutputDetailId nvarchar(50) +go + +exec sp_addextendedproperty 'MS_Description', N'ϸ', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_PackagingManageDetail', + 'COLUMN', 'TwOutputDetailId' +go + diff --git a/SGGL/BLL/API/HJGL/APIPackagingManageService.cs b/SGGL/BLL/API/HJGL/APIPackagingManageService.cs index 97e9ef52..8e5c0e25 100644 --- a/SGGL/BLL/API/HJGL/APIPackagingManageService.cs +++ b/SGGL/BLL/API/HJGL/APIPackagingManageService.cs @@ -42,6 +42,8 @@ namespace BLL using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { PackagingManageItem packagingManageItem = new PackagingManageItem(); + List packagingPrepipeItem = new List(); + var q = (from x in db.HJGL_PackagingManage join n in db.Base_Project on x.ProjectId equals n.ProjectId join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt @@ -62,20 +64,24 @@ namespace BLL TrainNumber = x.TrainNumber, }).FirstOrDefault(); var tb_packing = (from x in db.HJGL_PackagingManage where x.PackagingManageId==packagingManageId select x ).FirstOrDefault() ; - var PipelineComponentIdList = tb_packing.PipelineComponentId.Split(','); - var packagingPrepipeItem = (from x in db.HJGL_Pipeline_Component - join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId - join z in db.WBS_UnitWork on y.UnitWorkId equals z.UnitWorkId - where PipelineComponentIdList.Contains(x.PipelineComponentId) - select new PackagingPrepipeItem - { - PipelineComponentId = x.PipelineComponentId, - PipelineComponentCode = x.PipelineComponentCode, - PreUnit = "1/个", - UnitWorkName = z.UnitWorkName, - PlanStartDate = string.Format("{0:g}", y.PlanStartDate), + var PipelineComponentIdList = tb_packing?.PipelineComponentId?.Split(','); + if (PipelineComponentIdList != null && PipelineComponentIdList.Count() > 0) + { + packagingPrepipeItem = (from x in db.HJGL_Pipeline_Component + join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId + join z in db.WBS_UnitWork on y.UnitWorkId equals z.UnitWorkId + where PipelineComponentIdList.Contains(x.PipelineComponentId) + select new PackagingPrepipeItem + { + PipelineComponentId = x.PipelineComponentId, + PipelineComponentCode = x.PipelineComponentCode, + PreUnit = "1/个", + UnitWorkName = z.UnitWorkName, + PlanStartDate = string.Format("{0:g}", y.PlanStartDate), - }).ToList(); + }).ToList(); + } + bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId); if (!isPower) { diff --git a/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs b/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs index fcf9ea3e..47cbabf3 100644 --- a/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs +++ b/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs @@ -8,8 +8,17 @@ using System.Web.UI.WebControls; namespace BLL { - public class TestPackageEditService + public partial class TestPackageEditService { + public enum State : int + { + 未确认 = 0, + 已确认 = 1, + 待整改 = 2, + 已整改 = 3, + 已完成 = 4, + } + /// /// 根据试压Id获取用于试压信息 /// @@ -428,7 +437,11 @@ namespace BLL var q = Funs.DB.PTP_TestPackage.Where(e => e.UnitWorkId == unitworkId).ToList(); return q; } - + public static List GetTestPackageByProjectId(string projectid) + { + var q = Funs.DB.PTP_TestPackage.Where(e => e.ProjectId == projectid).ToList(); + return q; + } public static void DeletePipelineListByUnitWorkId(string unitworkId) { @@ -480,5 +493,196 @@ namespace BLL Funs.DB.SubmitChanges(); } } + + /// + /// 计算试压包页面 ShowGridItem 需要的统计信息。 + /// - 根据项目系统设置(SetId = "5")判断是否按管线组批(包含 "6") + /// - 若按管线组批:按 PTP_PipelineList 对应的每条管线计算统计(等价于页面分行判断),返回 Count1..Count4 + /// - 若不按管线组批:按页面原逻辑汇总整包的统计并返回(含 lab12.Label) + /// 注意:方法只返回统计结果与标志,具体 UI 行样式仍由页面根据数据及返回结果决定。 + /// + public static TestPackageAnalyzeOutput getTestPackageAnalyze(string PTP_ID, string projectId) + { + // 返回结果对象,包含统计信息 + var result = new TestPackageAnalyzeOutput(); + Model.SGGLDB db = Funs.DB; + var testPackage = db.PTP_TestPackage.FirstOrDefault(p => p.PTP_ID == PTP_ID); + if (testPackage == null) return null; // 无效试压包,直接返回空结果 + result.PTP_ID= PTP_ID; + result.TestPackageNo = testPackage.TestPackageNo; + result.UnitWorkName = BLL.UnitWorkService.GetUnitWorkALLName(testPackage.UnitWorkId); + //判断当前试压包的状态 + result.StateStr = State.未确认.ToString(); + + if (testPackage.AduditDate.HasValue) + { + result.StateStr=State.已确认.ToString(); + } + var PtpItemEndCheckList=(from x in db.PTP_ItemEndCheckList where x.PTP_ID==PTP_ID select x).FirstOrDefault(); + if (PtpItemEndCheckList != null ) + { + if (PtpItemEndCheckList.State == Const.TestPackage_Complete) + { + result.StateStr = State.已整改.ToString(); + + } + else + { + result.StateStr = State.待整改.ToString(); + + } + } + if (testPackage.FinishDate.HasValue) + { + result.StateStr = State.已完成.ToString(); + + } + // 当前试压包下所有管线ID集合 + var pipelineIds = (from p in db.PTP_PipelineList where p.PTP_ID == PTP_ID select p.PipelineId).ToList(); + result.TotalPipelines = pipelineIds.Count; + if (result.TotalPipelines == 0) + return result; + + // 当前试压包下的焊口总数 + result.TotalWeldJoints = db.HJGL_WeldJoint.Count(w => pipelineIds.Contains(w.PipelineId)); + // 当前试压包下已焊接的焊口数 + result.CompletedWeldJoints = db.HJGL_WeldJoint.Count(w => pipelineIds.Contains(w.PipelineId) && w.WeldingDailyId != null); + // 当前试压包下已检测的焊口数(去重) + result.DetectedWeldJoints = (from x in db.HJGL_Batch_NDEItem + join t in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join j in db.HJGL_WeldJoint on t.WeldJointId equals j.WeldJointId + where pipelineIds.Contains(j.PipelineId) + select t.WeldJointId).Distinct().Count(); + if (result.TotalWeldJoints > 0) + { + // 焊口完成百分比 + result.WeldCompletionPercent = Math.Round((decimal)result.CompletedWeldJoints / result.TotalWeldJoints * 100, 2); + // 检测完成百分比 + result.DetectionCompletionPercent = Math.Round((decimal)result.DetectedWeldJoints / result.TotalWeldJoints * 100, 2); + } + + // 全通过管线计数 + int passCount = 0; + // 系统设置,判断是否按管线组批 + var batch = BLL.Project_SysSetService.GetSysSetBySetId("5", projectId); + if (batch != null && batch.SetValue != null && batch.SetValue.Contains("6")) + { + // 按管线组批,逐管线判断是否全通过 + var pipelineList = (from p in db.PTP_PipelineList + join iso in db.HJGL_Pipeline on p.PipelineId equals iso.PipelineId + where p.PTP_ID == PTP_ID + select new { p.PipelineId, Iso = iso }).ToList(); + foreach (var item in pipelineList) + { + // 当前管线总焊口数 + int total = db.HJGL_WeldJoint.Count(w => w.PipelineId == item.PipelineId); + // 当前管线已焊接焊口数 + int finished = db.HJGL_WeldJoint.Count(w => w.PipelineId == item.PipelineId && w.WeldingDailyId != null); + // 当前管线应检测比例 + int? rateValue = null; + if (!string.IsNullOrEmpty(item.Iso.DetectionRateId)) + { + var rate = db.Base_DetectionRate.FirstOrDefault(r => r.DetectionRateId == item.Iso.DetectionRateId); + if (rate != null) rateValue = rate.DetectionRateValue; + } + // 当前管线已检测焊口数 + int detected = (from x in db.HJGL_Batch_NDEItem + join t in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join j in db.HJGL_WeldJoint on t.WeldJointId equals j.WeldJointId + where j.PipelineId == item.PipelineId + select t.WeldJointId).Distinct().Count(); + // 检测比例 + decimal ratio = (total > 0) ? (decimal)detected / total * 100 : 0M; + // 检查返修焊口的最新检测是否全部合格 + bool allNDEItemOK = true; + var lastRepair = (from x in db.HJGL_RepairRecord + join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId + where x.ProjectId == projectId && y.PipelineId == item.PipelineId + orderby x.NoticeDate descending + select x).FirstOrDefault(); + if (lastRepair != null) + { + // 返修批次 + var batchTrustItem = db.HJGL_Batch_BatchTrustItem.FirstOrDefault(b => b.RepairRecordId == lastRepair.RepairRecordId); + if (batchTrustItem != null) + { + // 返修检测单 + var lastNDE = db.HJGL_Batch_NDE.FirstOrDefault(n => n.TrustBatchId == batchTrustItem.TrustBatchId); + if (lastNDE != null) + { + // 检测单下所有检测项 + var lastNDEItems = db.HJGL_Batch_NDEItem.Where(ni => ni.NDEID == lastNDE.NDEID); + if (lastNDEItems.Any()) + { + foreach (var ni in lastNDEItems) + { + // 检查是否有未全部合格的项 + if (ni.TotalFilm != null && ni.PassFilm != null && ni.TotalFilm != ni.PassFilm) + { + allNDEItemOK = false; + break; + } + } + } + else allNDEItemOK = false; + } + else allNDEItemOK = false; + } + else allNDEItemOK = false; + } + // 满足所有条件才算全通过 + if (!(total > finished) && !(rateValue.HasValue && rateValue.Value > ratio) && allNDEItemOK) + passCount++; + } + } + else + { + // 整包判断 + var pipelineItem = db.PTP_PipelineList.FirstOrDefault(x => x.PTP_ID == PTP_ID); + if (pipelineItem == null) return result; + var pipeline = db.HJGL_Pipeline.FirstOrDefault(x => x.PipelineId == pipelineItem.PipelineId); + if (pipeline == null) return result; + // 整包所有焊口 + var totalJoint = from x in db.HJGL_WeldJoint + join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId + join z in db.PTP_PipelineList on y.PipelineId equals z.PipelineId + where z.PTP_ID == PTP_ID + && y.DetectionRateId == pipeline.DetectionRateId + && y.DetectionType.Contains(pipeline.DetectionType) + select x; + int totalJointNum = totalJoint.Count(); // 整包总焊口数 + int totalWeldingJointNum = totalJoint.Count(x => x.WeldingDailyId != null); // 整包已焊口数 + int notCloseBatch = (from x in db.HJGL_Batch_PointBatch + join y in db.PTP_PipelineList on x.PipelineId equals y.PipelineId + where y.PTP_ID == PTP_ID + && x.DetectionRateId == pipeline.DetectionRateId + && x.DetectionTypeId == pipeline.DetectionType && x.EndDate == null + select x).Count(); // 未关闭批次数 + int allPointJointNum = (from x in db.HJGL_Batch_PointBatchItem + join y in db.HJGL_Batch_PointBatch on x.PointBatchId equals y.PointBatchId + join j in db.HJGL_WeldJoint on x.WeldJointId equals j.WeldJointId + join p in db.PTP_PipelineList on j.PipelineId equals p.PipelineId + where p.PTP_ID == PTP_ID + && y.DetectionRateId == pipeline.DetectionRateId + && y.DetectionTypeId == pipeline.DetectionType && x.PointState != null + select x).Count(); // 所有检测点数 + int allOKCheckNum = (from x in db.HJGL_Batch_NDEItem + join y in db.HJGL_Batch_NDE on x.NDEID equals y.NDEID + join t in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals t.TrustBatchItemId + join z in db.HJGL_Batch_BatchTrust on t.TrustBatchId equals z.TrustBatchId + join j in db.HJGL_WeldJoint on t.WeldJointId equals j.WeldJointId + join p in db.PTP_PipelineList on j.PipelineId equals p.PipelineId + where p.PTP_ID == PTP_ID + && z.DetectionRateId == pipeline.DetectionRateId + && x.DetectionTypeId == pipeline.DetectionType && x.CheckResult == "1" + select x).Count(); // 所有合格检测点数 + // 满足所有条件才算全通过 + if (!(totalJointNum > totalWeldingJointNum) && !(notCloseBatch > 0) && !(allPointJointNum > allOKCheckNum)) + passCount = result.TotalPipelines; + } + // 计算是否具备试压条件:全通过数量 == 管线数量且管线数>0 + result.CanPressureTest = (result.TotalPipelines > 0 && passCount == result.TotalPipelines); + return result; + } } } diff --git a/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs b/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs index b3edb223..60b6dc82 100644 --- a/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs +++ b/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs @@ -8,8 +8,10 @@ using System.Threading.Tasks; namespace BLL { - public static class TestPackagePrintService + public static class TestPackagePrintService { + #region Fields + /// /// 类别Map /// @@ -37,9 +39,54 @@ namespace BLL { 9, "无损检测结果汇总表" } }; - public static List GetListByPTP_ID(string PTP_ID) + #endregion Fields + + #region Methods + + public static void Add(Model.PTP_TestPackagePrint newtable) { - return Funs.DB.PTP_TestPackagePrint.Where(x => x.PTP_ID == PTP_ID).OrderBy(x => x.TypeInt).ToList(); + 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(); + } + + /// + /// 根据试压包ID,打印所有类别,打印次数+1 + /// + /// + 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(); } /// @@ -69,79 +116,43 @@ namespace BLL Funs.DB.SubmitChanges(); } - /// - /// 根据试压包ID,打印所有类别,打印次数+1 - /// - /// - 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(); } - } + + /// + /// 获取无损检测结果统计 + /// + /// + /// + /// + public static (int djJoint, int djFilm, int jhJoint, int jhFilm, int zgJoint, int zgFilm) GetDetectionStats(string pipelineId, string detectionType) + { + var baseQuery = from x in Funs.DB.HJGL_Batch_NDEItem + 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 + join d in Funs.DB.View_HJGL_WeldJointDetectionType on t.WeldJointId equals d.WeldJointId + where d.JointDetectionTypeStr == detectionType && z.PipelineId == pipelineId + select new { x, w.WeldTypeCode }; + + return ( + djJoint: baseQuery.Where(q => q.WeldTypeCode == "BW").Count(), + djFilm: baseQuery.Where(q => q.WeldTypeCode == "BW").Sum(q => q.x.TotalFilm) ?? 0, + jhJoint: baseQuery.Where(q => q.WeldTypeCode == "C" || q.WeldTypeCode == "E" || q.WeldTypeCode == "SW").Count(), + jhFilm: baseQuery.Where(q => q.WeldTypeCode == "C" || q.WeldTypeCode == "E" || q.WeldTypeCode == "SW").Sum(q => q.x.TotalFilm) ?? 0, + zgJoint: baseQuery.Where(q => q.WeldTypeCode == "D" || q.WeldTypeCode == "OLET" || q.WeldTypeCode == "FW").Count(), + zgFilm: baseQuery.Where(q => q.WeldTypeCode == "D" || q.WeldTypeCode == "OLET" || q.WeldTypeCode == "FW").Sum(q => q.x.TotalFilm) ?? 0 + ); + } + /// /// 获取打印明细 /// @@ -150,7 +161,7 @@ namespace BLL /// /// /// - public static Model.FastReportItem GetFastReportItem(Model.PTP_TestPackage updateTestPackage, string printType, string ptp_id,string projectid ) + public static Model.FastReportItem GetFastReportItem(Model.PTP_TestPackage updateTestPackage, string printType, string ptp_id, string projectid) { string initTemplatePath = ""; Model.FastReportItem fastReportItem = new Model.FastReportItem(); @@ -171,6 +182,7 @@ namespace BLL fastReportItem.ParameterValues = keyValuePairs; } break; + case "1"://管道压力试验技术要求 { Dictionary keyValuePairs = new Dictionary(); @@ -181,6 +193,7 @@ namespace BLL fastReportItem.ParameterValues = keyValuePairs; } break; + case "2"://管道压力包文件资料目录 { Dictionary keyValuePairs = new Dictionary(); @@ -191,6 +204,7 @@ namespace BLL fastReportItem.ParameterValues = keyValuePairs; } break; + case "3"://管道系统压力试验条件确认记录 { Dictionary keyValuePairs = new Dictionary(); @@ -207,9 +221,10 @@ namespace BLL fastReportItem.ParameterValues = keyValuePairs; } break; + case "4"://管道试压包尾项清单 { - string sql = @"select ItemCheckId,PTP_ID,PTP_ItemEndCheck.PipelineId,Content,ItemType,Result,HJGL_Pipeline.PipelineCode from PTP_ItemEndCheck + 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"; @@ -252,11 +267,12 @@ namespace BLL fastReportItem.DataTables = dataTables; } break; + case "5"://管道系统压力试验记录 { - string sql = @"SELECT ptpPipe.PT_PipeId, - ptpPipe.PTP_ID, - ptpPipe.PipelineId, + string sql = @"SELECT ptpPipe.PT_PipeId, + ptpPipe.PTP_ID, + ptpPipe.PipelineId, IsoInfo.DesignPress, --设计压力 IsoInfo.DesignTemperature, --设计温度 IsoInfo.TestPressure, --试验压力 @@ -264,7 +280,7 @@ namespace BLL testMedium.MediumName,--试验介质 testPackage.AmbientTemperature,--试验环境温度 testPackage.TestMediumTemperature--试验介质温度 - FROM dbo.PTP_PipelineList AS ptpPipe + 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 @@ -320,6 +336,7 @@ namespace BLL fastReportItem.DataTables = dataTables; } break; + case "6"://管道材料材质标识检查记录 { string sql = @"select PT_PipeId, PTP_ID,pipelineList.PipelineId,pipeline.PipelineCode @@ -366,6 +383,7 @@ namespace BLL fastReportItem.DataTables = dataTables; } break; + case "7"://管道焊接工作记录 { var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id); @@ -378,13 +396,13 @@ namespace BLL weldJoint.ProjectId, weldJoint.PipelineCode,--管线号 weldJoint.WeldJointCode,--焊口号 - (case when person.WelderCode is not null then + (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 + 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 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 @@ -464,6 +482,7 @@ namespace BLL } } break; + case "8"://管道无损检测数量统计表 { var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id); @@ -491,14 +510,14 @@ namespace BLL '' as UTtotalJotCountBW, '' as MTtotalJotCountBW, '' as PTtotalJotCountBW, - '' as totalJotCountFW, + '' as totalJotCountFW, '' as MTtotalJotCountFW, '' as PTtotalJotCountFW, '' as totalJotCountDW, '' as RTtotalJotCountDW, '' as UTtotalJotCountDW, '' as MTtotalJotCountDW, - '' as PTtotalJotCountDW + '' 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 @@ -508,157 +527,50 @@ namespace BLL if (dt != null) { dt.TableName = "Data"; + // 一次性获取所有管道的数据 + var pipelineIds = dt.AsEnumerable().Select(row => row["PipelineId"].ToString()).ToList(); - for (int i = 0; i < dt.Rows.Count; i++) + // 获取所有合格数据 + var allQualifiedData = (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.View_HJGL_WeldJointDetectionType on t.WeldJointId equals w.WeldJointId + where pipelineIds.Contains(y.PipelineId) && x.CheckResult == "1" + select new + { + PipelineId = y.PipelineId, + WeldTypeCode = z.WeldTypeCode, + DetectionType = w.JointDetectionTypeStr + }).ToList(); + + // 处理数据 + foreach (DataRow row in dt.Rows) { - #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对接检测合格数量 + string pipelineId = row["PipelineId"].ToString(); + var pipelineData = allQualifiedData.Where(d => d.PipelineId == pipelineId); - 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 + // 对接焊接头 + var bwData = pipelineData.Where(d => d.WeldTypeCode == "BW"); + row["totalJotCountBW"] = bwData.Count().ToString(); + row["RTtotalJotCountBW"] = bwData.Count(d => d.DetectionType == "RT").ToString(); + row["UTtotalJotCountBW"] = bwData.Count(d => d.DetectionType == "UT").ToString(); + row["MTtotalJotCountBW"] = bwData.Count(d => d.DetectionType == "MT").ToString(); + row["PTtotalJotCountBW"] = bwData.Count(d => d.DetectionType == "PT").ToString(); - #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对接检测合格数量 + // 角焊接头 + var fwData = pipelineData.Where(d => d.WeldTypeCode == "C" || d.WeldTypeCode == "E" || d.WeldTypeCode == "SW"); + row["totalJotCountFW"] = fwData.Count().ToString(); + row["MTtotalJotCountFW"] = fwData.Count(d => d.DetectionType == "MT").ToString(); + row["PTtotalJotCountFW"] = fwData.Count(d => d.DetectionType == "PT").ToString(); - 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 + // 支管连接接头 + var dwData = pipelineData.Where(d => d.WeldTypeCode == "D" || d.WeldTypeCode == "OLET" || d.WeldTypeCode == "FW"); + row["totalJotCountDW"] = dwData.Count().ToString(); + row["RTtotalJotCountDW"] = dwData.Count(d => d.DetectionType == "RT").ToString(); + row["UTtotalJotCountDW"] = dwData.Count(d => d.DetectionType == "UT").ToString(); + row["MTtotalJotCountDW"] = dwData.Count(d => d.DetectionType == "MT").ToString(); + row["PTtotalJotCountDW"] = dwData.Count(d => d.DetectionType == "PT").ToString(); } } BLL.FastReportService.AddFastreportTable(dt); @@ -671,6 +583,7 @@ namespace BLL } } break; + case "9"://无损检测结果汇总表 { var iosList = BLL.TestPackageEditService.GetPipeLineListByPTP_ID(ptp_id); @@ -686,7 +599,7 @@ namespace BLL var unitNames = BLL.UnitService.GetUnitNameByUnitId(updateTestPackage.UnitId); keyValuePairs.Add("ProjectName", projectName); keyValuePairs.Add("UnitWorkName", UnitWorkName); - keyValuePairs.Add("UnitWorkCode", UnitWorkCode); + keyValuePairs.Add("UnitWorkCode", UnitWorkCode); keyValuePairs.Add("UnitName2", unitNames);//施工单位 if (!string.IsNullOrEmpty(q.PipingClassId)) { @@ -704,9 +617,10 @@ namespace BLL { 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角焊焊口数 @@ -762,404 +676,58 @@ namespace BLL decimal? ptjhNoPassFilm = 0; int ptzgNoPassJoint = 0; decimal? ptzgNoPassFilm = 0; - #endregion + + #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角焊焊口数 + // RT统计 + var rtStats = GetDetectionStats(iso.PipelineId, "RT"); + rtdjJoint += rtStats.djJoint; rtdjFilm += rtStats.djFilm; + rtjhJoint += rtStats.jhJoint; rtjhFilm += rtStats.jhFilm; + rtzgJoint += rtStats.zgJoint; rtzgFilm += rtStats.zgFilm; - 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支管连接焊口数 + // UT统计 + var utStats = GetDetectionStats(iso.PipelineId, "UT"); + utdjJoint += utStats.djJoint; utjhJoint += utStats.jhJoint; utzgJoint += utStats.zgJoint; - 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 + // MT统计 + var mtStats = GetDetectionStats(iso.PipelineId, "MT"); + mtdjJoint += mtStats.djJoint; mtjhJoint += mtStats.jhJoint; mtzgJoint += mtStats.zgJoint; - #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对接焊口数 + // PT统计 + var ptStats = GetDetectionStats(iso.PipelineId, "PT"); + ptdjJoint += ptStats.djJoint; ptjhJoint += ptStats.jhJoint; ptzgJoint += ptStats.zgJoint; - //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 + #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 + // RT不合格统计 + var rtNoPassStats = GetNoPassDetectionStats(iso.PipelineId, "RT"); + rtdjNoPassJoint += rtNoPassStats.djJoint; rtdjNoPassFilm += rtNoPassStats.djFilm; + rtjhNoPassJoint += rtNoPassStats.jhJoint; rtjhNoPassFilm += rtNoPassStats.jhFilm; + rtzgNoPassJoint += rtNoPassStats.zgJoint; rtzgNoPassFilm += rtNoPassStats.zgFilm; - #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对接焊口数 + // 其他不合格统计类似... + var utNoPassStats = GetNoPassDetectionStats(iso.PipelineId, "UT"); + utdjNoPassJoint += utNoPassStats.djJoint; utdjNoPassFilm += utNoPassStats.djFilm; + utjhNoPassJoint += utNoPassStats.jhJoint; utjhNoPassFilm += utNoPassStats.jhFilm; + utzgNoPassJoint += utNoPassStats.zgJoint; utzgNoPassFilm += utNoPassStats.zgFilm; - 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 + var mtNoPassStats = GetNoPassDetectionStats(iso.PipelineId, "MT"); + mtdjNoPassJoint += mtNoPassStats.djJoint; mtdjNoPassFilm += mtNoPassStats.djFilm; + mtjhNoPassJoint += mtNoPassStats.jhJoint; mtjhNoPassFilm += mtNoPassStats.jhFilm; + mtzgNoPassJoint += mtNoPassStats.zgJoint; mtzgNoPassFilm += mtNoPassStats.zgFilm; - #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 + var ptNoPassStats = GetNoPassDetectionStats(iso.PipelineId, "PT"); + ptdjNoPassJoint += ptNoPassStats.djJoint; ptdjNoPassFilm += ptNoPassStats.djFilm; + ptjhNoPassJoint += ptNoPassStats.jhJoint; ptjhNoPassFilm += ptNoPassStats.jhFilm; + ptzgNoPassJoint += ptNoPassStats.zgJoint; ptzgNoPassFilm += ptNoPassStats.zgFilm; - #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 + #endregion 不合格情况统计 } keyValuePairs.Add("RTBW", (rtdjJoint > 0 ? rtdjJoint.ToString() + "道" : "") + "/" + (rtdjFilm > 0 ? rtdjFilm.ToString() + "张" : "")); keyValuePairs.Add("RTFW", (rtjhJoint > 0 ? rtjhJoint.ToString() + "道" : "") + "/" + (rtjhFilm > 0 ? rtjhFilm.ToString() + "张" : "")); @@ -1190,30 +758,30 @@ namespace BLL 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 + 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.WelderCode+'/'+fWelder.WelderCode + else cWelder.WelderCode end) else fWelder.WelderCode end) as WelderCode, + (case when d.JointDetectionTypeStr='RT' or d.JointDetectionTypeStr='UT' then + (case nDEItem.CheckResult when '1' then '合格' when '2' then '不合格' else '/' end) else '/' end) as RTUTResult, + (case when d.JointDetectionTypeStr='RT' or d.JointDetectionTypeStr='UT' then nDEItem.NDEReportNo else '/' end) as RTUTCheckNo, + (case when d.JointDetectionTypeStr='MT' or d.JointDetectionTypeStr='PT' then + (case nDEItem.CheckResult when '1' then '合格' when '2' then '不合格' else '/' end) else '/' end) as MTPTResult, + (case when d.JointDetectionTypeStr='MT' or d.JointDetectionTypeStr='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 SitePerson_Person as cWelder on cWelder.PersonId = j.CoverWelderId + left join SitePerson_Person as fWelder on fWelder.PersonId = j.BackingWelderId + left join View_HJGL_WeldJointDetectionType as d on d.WeldJointId = t.WeldJointId + 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 listStr = new List(); @@ -1265,8 +833,53 @@ namespace BLL return fastReportItem; } + public static List GetListByPTP_ID(string PTP_ID) + { + return Funs.DB.PTP_TestPackagePrint.Where(x => x.PTP_ID == PTP_ID).OrderBy(x => x.TypeInt).ToList(); + } + + /// + /// 不合格检测统计方法 + /// + /// + /// + /// + public static (int djJoint, int djFilm, int jhJoint, int jhFilm, int zgJoint, int zgFilm) GetNoPassDetectionStats(string pipelineId, string detectionType) + { + var baseQuery = from x in Funs.DB.HJGL_Batch_NDEItem + 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 + join d in Funs.DB.View_HJGL_WeldJointDetectionType on t.WeldJointId equals d.WeldJointId + where d.JointDetectionTypeStr == detectionType && z.PipelineId == pipelineId && x.CheckResult == "2" + select new { x, w.WeldTypeCode }; + + return ( + djJoint: baseQuery.Where(q => q.WeldTypeCode == "BW").Count(), + djFilm: baseQuery.Where(q => q.WeldTypeCode == "BW").Sum(q => (q.x.TotalFilm - q.x.PassFilm)) ?? 0, + jhJoint: baseQuery.Where(q => q.WeldTypeCode == "C" || q.WeldTypeCode == "E").Count(), + jhFilm: baseQuery.Where(q => q.WeldTypeCode == "C" || q.WeldTypeCode == "E").Sum(q => (q.x.TotalFilm - q.x.PassFilm)) ?? 0, + zgJoint: baseQuery.Where(q => q.WeldTypeCode == "D").Count(), + zgFilm: baseQuery.Where(q => q.WeldTypeCode == "D").Sum(q => (q.x.TotalFilm - q.x.PassFilm)) ?? 0 + ); + } + + 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(); + } + } + #endregion Methods #region 格式化字符串 + public static string getMaterialCodeByPipelineId(string pipelineId) { string materialCode = string.Empty; @@ -1294,7 +907,6 @@ namespace BLL materialCode = weldjoint.MaterialCode2; } } - } } return materialCode; @@ -1313,7 +925,7 @@ namespace BLL } return spcificaation; } - #endregion + #endregion 格式化字符串 } -} +} \ No newline at end of file diff --git a/SGGL/BLL/ProjectData/UnitWorkService.cs b/SGGL/BLL/ProjectData/UnitWorkService.cs index f9033af4..a025f94b 100644 --- a/SGGL/BLL/ProjectData/UnitWorkService.cs +++ b/SGGL/BLL/ProjectData/UnitWorkService.cs @@ -670,7 +670,7 @@ namespace BLL } return name; } - + /// /// 获取主项及设计专业名称 /// diff --git a/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测数量统计表.frx b/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测数量统计表.frx index b32bbdad..7cc4996d 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测数量统计表.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测数量统计表.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + @@ -208,7 +208,7 @@ namespace FastReport - + @@ -232,9 +232,9 @@ namespace FastReport - + - + @@ -256,8 +256,8 @@ namespace FastReport - - + + @@ -306,7 +306,7 @@ namespace FastReport - + diff --git a/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测结果汇总表.frx b/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测结果汇总表.frx index 228ddc37..68e5c1aa 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测结果汇总表.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/JGZL/管道无损检测结果汇总表.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -67,7 +67,7 @@ namespace FastReport } } - + @@ -138,7 +138,7 @@ namespace FastReport - + @@ -159,7 +159,7 @@ namespace FastReport - + @@ -180,7 +180,7 @@ namespace FastReport - + @@ -193,11 +193,11 @@ namespace FastReport - + - + @@ -258,7 +258,7 @@ namespace FastReport - + @@ -290,7 +290,7 @@ namespace FastReport - + @@ -309,17 +309,17 @@ namespace FastReport - + - + - - + + @@ -348,7 +348,7 @@ namespace FastReport - + diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx index c30c758c..9ab8abfc 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx @@ -65,82 +65,128 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.cs index 13658910..128a2fe2 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.cs @@ -113,11 +113,11 @@ namespace FineUIPro.Web.HJGL.TestPackage #region 加载页面 /// - /// 加载页面 - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { @@ -130,6 +130,7 @@ namespace FineUIPro.Web.HJGL.TestPackage this.Grid1.Columns[4].HeaderText = "压力试验压力kpa(g)"; } this.InitTreeMenu();//加载树 + BindGrid2(); } } #endregion @@ -306,7 +307,7 @@ namespace FineUIPro.Web.HJGL.TestPackage ptpPipe.TestMediumTemperature, ptpPipe.TestPressure, ptpPipe.HoldingTime,IsoInfo.PipelineCode,testMedium.MediumName 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 dbo.Base_TestMedium AS testMedium ON testMedium.TestMediumId = IsoInfo.TestMedium WHERE ptpPipe.PTP_ID=@PTP_ID"; List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); @@ -321,6 +322,32 @@ namespace FineUIPro.Web.HJGL.TestPackage Grid1.DataBind(); } + /// + /// 获取当前项目下所有试压包分析 + /// + private void BindGrid2() + { + // 获取当前项目下所有试压包 + var projectTestPackages = BLL.TestPackageEditService.GetTestPackageByProjectId(this.CurrUser.LoginProjectId); + if (projectTestPackages == null || projectTestPackages.Count == 0) + { + Grid2.DataSource = null; + Grid2.DataBind(); + return; + } + // 分析每个试压包 + var analyzeList = new List(); + foreach (var pkg in projectTestPackages) + { + var analyze = BLL.TestPackageEditService.getTestPackageAnalyze(pkg.PTP_ID, pkg.ProjectId); + analyzeList.Add(analyze); + } + // 绑定到Grid1 + Grid2.RecordCount = analyzeList.Count; + Grid2.DataSource = analyzeList; + Grid2.DataBind(); + } + #region 加载页面输入保存信息 /// /// 加载页面输入保存信息 diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.designer.cs index 47dc3a8e..051fbef4 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageComplete.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HJGL.TestPackage { - - - public partial class TestPackageComplete { - +namespace FineUIPro.Web.HJGL.TestPackage +{ + + + public partial class TestPackageComplete + { + /// /// Head1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlHead Head1; - + /// /// form1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelLeftRegion 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelLeftRegion; - + /// /// txtCode 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCode; - + /// /// tvControlItem 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tree tvControlItem; - + /// /// hdPTP_ID 控件。 /// @@ -83,7 +85,34 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdPTP_ID; - + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// panelTopRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelTopRegion; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + /// /// panelCenterRegion 控件。 /// @@ -92,7 +121,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelCenterRegion; - + /// /// SimpleForm1 控件。 /// @@ -101,7 +130,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// txtTestPackageNo 控件。 /// @@ -110,7 +139,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTestPackageNo; - + /// /// txtTestPackageName 控件。 /// @@ -119,7 +148,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTestPackageName; - + /// /// txtadjustTestPressure 控件。 /// @@ -128,7 +157,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtadjustTestPressure; - + /// /// txtTestDate 控件。 /// @@ -137,7 +166,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTestDate; - + /// /// txtAmbientTemperature 控件。 /// @@ -146,7 +175,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtAmbientTemperature; - + /// /// txtTestMediumTemperature 控件。 /// @@ -155,7 +184,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTestMediumTemperature; - + /// /// txtHoldingTime 控件。 /// @@ -164,7 +193,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtHoldingTime; - + /// /// txtFinishDef 控件。 /// @@ -173,7 +202,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtFinishDef; - + /// /// lb1 控件。 /// @@ -182,7 +211,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lb1; - + /// /// Grid1 控件。 /// @@ -191,7 +220,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// ToolbarSeparator1 控件。 /// @@ -200,7 +229,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -209,7 +238,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -218,7 +247,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -227,7 +256,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Window2 控件。 /// @@ -236,7 +265,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window2; - + /// /// Menu1 控件。 /// @@ -245,7 +274,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuModify 控件。 /// @@ -254,7 +283,7 @@ namespace FineUIPro.Web.HJGL.TestPackage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuModify; - + /// /// btnPrinter 控件。 /// diff --git a/SGGL/Model/HJGL/TestPackageAnalyzeOutput.cs b/SGGL/Model/HJGL/TestPackageAnalyzeOutput.cs new file mode 100644 index 00000000..8bb8625a --- /dev/null +++ b/SGGL/Model/HJGL/TestPackageAnalyzeOutput.cs @@ -0,0 +1,58 @@ +namespace Model +{ + public class TestPackageAnalyzeOutput + { + /// + /// 试压包号 + /// + public string PTP_ID { get; set; } + /// + /// 试压包编号 + /// + public string TestPackageNo { get; set; } + /// + /// 单位工程名称 + /// + public string UnitWorkName { get; set; } + + /// + /// 是否具备试压条件(全通过数量 == 管线数量,且未通过数为0)。 + /// + public bool CanPressureTest { get; set; } + + /// + /// 检测完成百分比(已检测焊口 / 总焊口 * 100,保留两位小数)。 + /// + public decimal DetectionCompletionPercent { get; set; } + + /// + /// 焊口完成百分比(已焊口 / 总焊口 * 100,保留两位小数)。 + /// + public decimal WeldCompletionPercent { get; set; } + /// + /// 状态 + /// + public string StateStr { get; set; } + + /// + /// 当前试压包下的管线总数。 + /// + public int TotalPipelines { get; set; } + + /// + /// 当前试压包下的焊口总数。 + /// + public int TotalWeldJoints { get; set; } + + /// + /// 当前试压包下已焊接的焊口数。 + /// + public int CompletedWeldJoints { get; set; } + + /// + /// 当前试压包下已检测的焊口数(去重)。 + /// + public int DetectedWeldJoints { get; set; } + } + +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 25c686a1..ff130da6 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -6969,6 +6969,14 @@ namespace Model } } + public System.Data.Linq.Table View_HJGL_WeldJointDetectionType + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table View_HJGL_WPQ { get @@ -295600,6 +295608,159 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_HJGL_WeldJointDetectionType")] + public partial class View_HJGL_WeldJointDetectionType + { + + private string _ProjectId; + + private string _PipelineCode; + + private string _DetectionType; + + private string _DetectionTypeStr; + + private string _JointDetectionTypeStr; + + private string _WeldJointId; + + private string _WeldJointCode; + + private string _WeldJointNumStr; + + public View_HJGL_WeldJointDetectionType() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineCode", DbType="NVarChar(50)")] + public string PipelineCode + { + get + { + return this._PipelineCode; + } + set + { + if ((this._PipelineCode != value)) + { + this._PipelineCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DetectionType", DbType="NVarChar(150)")] + public string DetectionType + { + get + { + return this._DetectionType; + } + set + { + if ((this._DetectionType != value)) + { + this._DetectionType = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DetectionTypeStr", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string DetectionTypeStr + { + get + { + return this._DetectionTypeStr; + } + set + { + if ((this._DetectionTypeStr != value)) + { + this._DetectionTypeStr = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JointDetectionTypeStr", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string JointDetectionTypeStr + { + get + { + return this._JointDetectionTypeStr; + } + set + { + if ((this._JointDetectionTypeStr != value)) + { + this._JointDetectionTypeStr = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string WeldJointId + { + get + { + return this._WeldJointId; + } + set + { + if ((this._WeldJointId != value)) + { + this._WeldJointId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointCode", DbType="NVarChar(50)")] + public string WeldJointCode + { + get + { + return this._WeldJointCode; + } + set + { + if ((this._WeldJointCode != value)) + { + this._WeldJointCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointNumStr", DbType="NVarChar(50)")] + public string WeldJointNumStr + { + get + { + return this._WeldJointNumStr; + } + set + { + if ((this._WeldJointNumStr != value)) + { + this._WeldJointNumStr = value; + } + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_HJGL_WPQ")] public partial class View_HJGL_WPQ { diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index 4fd03303..6060b537 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -245,6 +245,7 @@ +