From 134edd89d56a80c47cb479dac2936dd948302266 Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Fri, 18 Nov 2022 16:50:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?2022-11-18=20=E7=84=8A=E6=8E=A5=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=85=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?dn=E5=85=AC=E7=A7=B0=E7=9B=B4=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/SGGL_SeDin/v17/.wsuo | Bin 0 -> 15360 bytes .vs/VSWorkspaceState.json | 1 + DataBase/版本日志/SGGLDB_V2022-011-18-001.sql | 170 ++++ SGGL/BLL/Common/Funs.cs | 34 + .../HJGL/WeldingManage/WeldJointService.cs | 9 + .../DataIn/PDMS输出(设计)数据模板.xlsx | Bin 9891 -> 10006 bytes SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- .../WeldingManage/PipelineListPDMSIn.aspx | 8 +- .../WeldingManage/PipelineListPDMSIn.aspx.cs | 894 ++++++++++++++++-- .../PipelineListPDMSIn.aspx.designer.cs | 9 + .../HJGL/WeldingManage/WeldJointList.aspx | 6 +- .../HJGL/WeldingManage/WeldJointList.aspx.cs | 2 +- SGGL/Model/Model.cs | 60 ++ 13 files changed, 1104 insertions(+), 91 deletions(-) create mode 100644 .vs/SGGL_SeDin/v17/.wsuo create mode 100644 DataBase/版本日志/SGGLDB_V2022-011-18-001.sql diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo new file mode 100644 index 0000000000000000000000000000000000000000..7dcba977af1c67714bcd71faa60a58c67f660472 GIT binary patch literal 15360 zcmeHNTWlOx89vUXO_S25v=k^MY!_3~*52;T>)oX(vDbEDY9~(CaUykvnVmUnPd&S{ znwhnoRzdK9govt&7jEJrq!tONfWiZ6QBz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*l55j)q?BwXqojwDIYmj8JBBs` zYz@x6!PDIB1JAQ~7Vj>4!D9SO^WpJ0&Y6Or!PZ^(R`4CRJHwV1+YVC{MgM_!Mjmb&09qbA0*m1>Pbd<6od3?Qp%2c!oMTJY>+T1nl z!*W|!ENLC&$O0T3OZBp@NoyY;6!oX&9_$;6Em%a=s>i%Xs*mya#@!v-kj0AV>P7LF(&Jl zR24^Rtr}tdpwqHyE=vrPHBHu3UE0xnMKNr=KViCL+249LSyPP$wJa@ZNX1_3DdJuw z9o;~(29J|9+fiUj4Lr8yKR+rLm1W)JfGKkYg*SRxR2ee{mlDg?!bE_z|0rSNt2 z#E!<_2aS(TP2I$L9x;sf!l#>2+k;DAxUeqI?A+X#8t{J?3v*?8wDbGl|JLt+?f*a6 z`TrkJ$@u@no96$2Zu!a*mJlY(1poi%kKZ}}`~N)u>$Fq!eIm?tXa9F|@BjV_yXh75 literal 0 HcmV?d00001 diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 6b611411..75b31f26 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -2,5 +2,6 @@ "ExpandedNodes": [ "" ], + "SelectedNode": "\\SGGL.sln", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2022-011-18-001.sql b/DataBase/版本日志/SGGLDB_V2022-011-18-001.sql new file mode 100644 index 00000000..36039ea0 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2022-011-18-001.sql @@ -0,0 +1,170 @@ +alter table HJGL_WeldJoint add DNDia varchar(50) + + +/****** 对象: View [dbo].[View_HJGL_WeldJoint] 脚本日期: 2022/11/18 14:39:08 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +ALTER VIEW [dbo].[View_HJGL_WeldJoint] +AS +SELECT jot.[ProjectId] --项目Id + ,pipe.[UnitWorkId] --单位工程Id + ,uw.UnitWorkName --单位工程 + ,pipe.[UnitId] --单位Id + ,unit.UnitName --单位 + ,jot.[PipelineCode] --管线号 + ,pipe.[SingleNumber] --单线图号 + ,pipe.[SingleName] --图纸名称 + ,pipe.[MediumId] --介质Id + ,medium.MediumCode + ,medium.MediumName --介质名称 + ,pipe.[PipingClassId] --管道等级Id + ,pipingClass.PipingClassCode --管道等级 + ,pipe.[DetectionRateId] --探伤比例Id + ,dr.DetectionRateCode --探伤比例(例如5,10,20) + ,pipe.DetectionType --探伤类型Id(可能多个,中间用|分隔) + ,STUFF((SELECT ',' + DetectionTypeCode FROM Base_DetectionType + WHERE CHARINDEX('|'+LTRIM(DetectionTypeId)+'|','|'+ pipe.DetectionType + '|') > 0 FOR XML PATH('') ), 1, 1, '') AS DetectionTypeStr --探伤类型(可能多个,中间用,分隔) + ,pipe.DesignTemperature --设计温度℃ + ,pipe.DesignPress --设计压力Mpa(g) + ,pipe.TestMedium --压力试验介质Id + ,tm.MediumName AS TestMediumName --压力试验介质 + ,pipe.TestPressure --压力试验压力Mpa(g) + ,pipe.PressurePipingClassId --压力管道级别Id + ,ppc.PressurePipingClassCode --压力管道级别 + ,pipe.PipeLenth --管线长度(m) + ,pipe.LeakMedium --泄露性试验介质Id + ,tm2.MediumName AS LeakMediumName --泄露性试验介质 + ,pipe.LeakPressure --泄露性试验压力Mpa(g) + ,pipe.PCMedium --吹洗要求Id + ,pm.PurgeMethodCode --吹洗要求 + ,pipe.VacuumPressure --真空试验压力Kpa(a) + ,pipe.MaterialId --材质Id + ,mat.MaterialCode AS PipeMaterialCode --材质 + ,pipe.Remark AS PipeRemark --备注 + + ,jot.[WeldJointId] --焊口Id + ,jot.[WeldJointCode] --焊口号 + ,jot.[Material1Id] --材质1Id + ,mat1.MaterialCode AS Material1Code --材质1 + ,jot.[Material2Id] --材质2Id + ,mat2.MaterialCode AS Material2Code --材质2 + ,jot.[Dia] --外径 + ,jot.DNDia --DN公称直径 + ,jot.[Size] --达因 + ,jot.[Thickness] --壁厚 + ,jot.[Specification] --规格 + ,jot.[WeldTypeId] --焊缝类型Id + ,WeldType.WeldTypeCode --焊缝类型 + ,jot.[DetectionTypeId] --检测类型Id + ,ndt.DetectionTypeCode --检测类型 + ,jot.[Components1Id] --组件1号Id + ,com1.ComponentsCode AS ComponentsCode1 --组件1号 + ,jot.[Components2Id] --组件2号Id + ,com2.ComponentsCode AS ComponentsCode2 --组件2号 + ,jot.DesignIsHotProess --是否热处理 + ,CASE jot.DesignIsHotProess WHEN 1 THEN '是' ELSE '否' END AS DesignIsHotProessStr --是否热处理 + ,jot.[WeldingMethodId] --焊接方法Id + ,WeldingMethod.WeldingMethodCode --焊接方法 + ,jot.WPQId --WPS的Id + ,wps.WPQCode --WPS编号 + ,jot.[GrooveTypeId] --坡口类型Id + ,GrooveType.GrooveTypeCode --坡口类型 + ,jot.[WeldingRod] --焊条Id + ,rod.ConsumablesCode AS WeldingRodCode --焊条 + ,jot.[WeldingWire] --焊丝Id + ,wire.ConsumablesCode AS WeldingWireCode --焊丝 + ,jot.PreTemperature --预热温度 + ,jot.[JointAttribute] --焊口属性 + ,jot.TwoJointType --二次焊口新增类型 + ,CONVERT(VARCHAR(100), daily.WeldingDate, 23) AS WeldingDate --焊接日期 + ,BackingWelder.WelderCode AS BackingWelderCode --打底焊工 + ,CoverWelder.WelderCode AS CoverWelderCode --盖面焊工 + ,(CASE (SELECT COUNT(*) FROM [dbo].[HJGL_HotProess_TrustItem] hpti + WHERE hpti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 ISNULL(ReportNo,'') FROM [dbo].[HJGL_HotProess_Trust] hpt + LEFT JOIN [dbo].[HJGL_HotProess_TrustItem] hpti ON hpti.HotProessTrustId=hpt.HotProessTrustId + WHERE hpti.WeldJointId=jot.WeldJointId) END) AS HotProessReportNo --热处理报告编号 + ,(CASE (SELECT TOP 1 IsCompleted FROM [dbo].[HJGL_HotProess_TrustItem] hpti + WHERE hpti.WeldJointId=jot.WeldJointId) WHEN 1 THEN '完成' WHEN 0 THEN '未完成' ELSE '未热处理' END) AS HotProessResult --热处理检测结果 + ,(CASE (SELECT COUNT(*) FROM [dbo].HJGL_Hard_TrustItem hti + WHERE hti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 ISNULL(InspectionNum,'') FROM [dbo].HJGL_Hard_Trust ht + LEFT JOIN [dbo].HJGL_Hard_TrustItem hti ON hti.HardTrustID=ht.HardTrustID + WHERE hti.WeldJointId=jot.WeldJointId) END) AS HardReportNo --硬度报告编号 + ,(CASE (SELECT TOP 1 IsPass FROM [dbo].HJGL_Hard_TrustItem hti + WHERE hti.WeldJointId=jot.WeldJointId) WHEN 1 THEN '合格' WHEN 0 THEN '不合格' ELSE '待检测' END) AS HardResult --硬度检测结果 + ,(CASE (SELECT COUNT(*) FROM [dbo].HJGL_Batch_BatchTrustItem bti + WHERE bti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 TrustBatchCode FROM [dbo].HJGL_Batch_BatchTrust bt + LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchId=bt.TrustBatchId + WHERE bti.WeldJointId=jot.WeldJointId) END) AS TrustBatchCode --委托单编号 + ,(CASE (SELECT COUNT(*) FROM [dbo].HJGL_Batch_NDEItem ndei + LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchItemId=ndei.TrustBatchItemId + WHERE bti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 ISNULL(NDECode,'') FROM [dbo].HJGL_Batch_NDE nde + LEFT JOIN [dbo].HJGL_Batch_NDEItem ndei ON ndei.NDEID=nde.NDEID + LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchItemId=ndei.TrustBatchItemId + WHERE bti.WeldJointId=jot.WeldJointId) END) AS NDECode --检测单编号 + ,(CASE (SELECT TOP 1 CheckResult FROM [dbo].HJGL_Batch_NDEItem ndei + LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchItemId=ndei.TrustBatchItemId + WHERE bti.WeldJointId=jot.WeldJointId) WHEN '1' THEN '合格' WHEN '2' THEN '不合格' ELSE '' END) AS CheckResult --检测结果 + ,jot.PipelineId + ,jot.[JointArea] + ,jot.[WeldingLocationId] + ,jot.[HeartNo1] + ,jot.[HeartNo2] + ,jot.[IsHotProess] + ,jot.[WeldingDailyId] + ,jot.[BackingWelderId] + ,jot.[CoverWelderId] + ,jot.WeldingMode + ,jot.Remark + ,jot.IsTwoJoint + ,jot.SubmitMan + ,jot.AuditMan + ,jot.AuditDate + ,WeldingLocation.WeldingLocationCode + ,CASE WHEN jot.WeldingDailyId IS NULL THEN '否' ELSE '是' END AS IsWelding + ,CASE WHEN jot.IsHotProess=1 THEN '是' ELSE '否' END AS IsHotProessStr, + BackingWelder.PersonName AS BackingWelderName, + CoverWelder.PersonName AS CoverWelderName, + (CASE WHEN CoverWelder.WelderCode IS NOT NULL AND BackingWelder.WelderCode IS NOT NULL + THEN CoverWelder.WelderCode + '/' + BackingWelder.WelderCode + ELSE (ISNULL(CoverWelder.WelderCode,'') + ISNULL(BackingWelder.WelderCode,'')) END) AS WelderCode, --焊工 + (CASE WHEN mat1.MaterialCode IS NOT NULL AND mat2.MaterialCode IS NOT NULL + THEN mat1.MaterialCode + '/' + mat2.MaterialCode + ELSE (ISNULL(mat1.MaterialCode,'') + ISNULL(mat2.MaterialCode,'')) END) AS MaterialCode, --材质 + + daily.WeldingDailyCode, + pointItem.PointBatchId, + point.PointBatchCode, + (CASE WHEN pointItem.PointState='1' THEN '已点口' WHEN pointItem.PointState='2' THEN '已扩透' ELSE '' END) AS IsPoint + FROM [dbo].[HJGL_WeldJoint] jot +LEFT JOIN dbo.HJGL_Pipeline pipe ON pipe.PipelineId=jot.PipelineId +LEFT JOIN dbo.WBS_UnitWork uw ON uw.UnitWorkId=pipe.UnitWorkId +LEFT JOIN dbo.Base_Unit unit ON unit.UnitId=pipe.UnitId +LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=jot.WeldTypeId +LEFT JOIN dbo.Base_DetectionRate dr ON dr.DetectionRateId = pipe.DetectionRateId +LEFT JOIN Base_TestMedium tm ON tm.TestMediumId=pipe.TestMedium +LEFT JOIN Base_TestMedium tm2 ON tm2.TestMediumId=pipe.LeakMedium +LEFT JOIN Base_PurgeMethod pm ON pm.PurgeMethodId=pipe.PCMedium +LEFT JOIN Base_PressurePipingClass ppc ON ppc.PressurePipingClassId=pipe.PressurePipingClassId +LEFT JOIN Base_Material AS mat ON mat.MaterialId = pipe.MaterialId +LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = jot.Material1Id +LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = jot.Material2Id +LEFT JOIN Base_WeldingMethod AS WeldingMethod ON WeldingMethod.WeldingMethodId=jot.WeldingMethodId +LEFT JOIN Base_WeldingLocation AS WeldingLocation ON WeldingLocation.WeldingLocationId=jot.WeldingLocationId +LEFT JOIN Base_Consumables AS wire ON wire.ConsumablesId=jot.WeldingWire +LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId=jot.WeldingRod +LEFT JOIN Base_GrooveType AS GrooveType ON GrooveType.GrooveTypeId=jot.GrooveTypeId +LEFT JOIN Base_Components AS com1 ON com1.ComponentsId = jot.Components1Id +LEFT JOIN Base_Components AS com2 ON com2.ComponentsId = jot.Components2Id +LEFT JOIN SitePerson_Person AS BackingWelder ON BackingWelder.PersonId=jot.BackingWelderId +LEFT JOIN SitePerson_Person AS CoverWelder ON CoverWelder.PersonId=jot.CoverWelderId +LEFT JOIN dbo.HJGL_WeldingDaily AS daily ON daily.WeldingDailyId=jot.WeldingDailyId +LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=pipe.PipingClassId +LEFT JOIN dbo.Base_Medium medium ON medium.MediumId = pipe.MediumId +LEFT JOIN dbo.Base_DetectionType ndt ON ndt.DetectionTypeId = jot.DetectionTypeId +LEFT JOIN dbo.WPQ_WPQList wps ON wps.WPQId = jot.WPQId +LEFT JOIN dbo.HJGL_Batch_PointBatchItem pointItem ON pointItem.WeldJointId = jot.WeldJointId +LEFT JOIN dbo.HJGL_Batch_PointBatch point ON point.PointBatchId = pointItem.PointBatchId diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index f912140b..1316fc53 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -1,10 +1,13 @@ namespace BLL { + using MiniExcelLibs; using Model; using System; using System.Collections.Generic; using System.Data; using System.Globalization; + using System.IO; + using System.Linq; using System.Reflection; using System.Text; @@ -1161,6 +1164,37 @@ namespace BLL dv.RowFilter = $"({filterRule})"; return dv.ToTable(); } + + public static IEnumerable QueryWithoutEmptyRow(Stream stream, bool useHeaderRow, string sheetName, ExcelType excelType, string startCell, IConfiguration configuration) + { + var rows = stream.Query(useHeaderRow, sheetName, excelType, startCell, configuration); + foreach (IDictionary row in rows) + { + if (row.Keys.Any(key => row[key] != null)) + yield return row; + } + } + /// + + /// Linqȥ,չҪŵ̬ + /// + /// + /// + /// + /// + /// + public static IEnumerable DistinctBy(this IEnumerable source, Func keySelector) + { + HashSet seenKeys = new HashSet(); + foreach (TSource element in source) + { + if (seenKeys.Add(keySelector(element))) + { + yield return element; + } + } + } + } } diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs index d21a20c9..ef34565d 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs @@ -78,6 +78,7 @@ namespace BLL Material2Id = weldJoint.Material2Id, Thickness = weldJoint.Thickness, Dia = weldJoint.Dia, + DNDia=weldJoint.DNDia, Size = weldJoint.Size, DetectionTypeId = weldJoint.DetectionTypeId, JointArea = weldJoint.JointArea, @@ -107,6 +108,13 @@ namespace BLL db.SubmitChanges(); } + public static void AddBulkWeldJoint(List weldJoints) + { + Model.SGGLDB db = Funs.DB; + db.HJGL_WeldJoint.InsertAllOnSubmit(weldJoints); + db.SubmitChanges(); + } + /// /// 修改 /// @@ -126,6 +134,7 @@ namespace BLL newWeldJoint.Material2Id = weldJoint.Material2Id; newWeldJoint.Thickness = weldJoint.Thickness; newWeldJoint.Dia = weldJoint.Dia; + newWeldJoint.DNDia = weldJoint.DNDia; newWeldJoint.Size = weldJoint.Size; newWeldJoint.DetectionTypeId = weldJoint.DetectionTypeId; newWeldJoint.JointArea = weldJoint.JointArea; diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/PDMS输出(设计)数据模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/PDMS输出(设计)数据模板.xlsx index a16dc883677447f4cc533aed70413e16805ecd68..06446cc363376cb546830ce8513b166fd99483aa 100644 GIT binary patch delta 3754 zcmZ9PcQhM}*T)khNE6f^vG=B`R%+CYk)mc>ySA7$Y6V3rwkS%~9;NndQ8P+g4Y9YU zwj!va6mOsRJ?HKD{qA4)ocsOnj?ecN8)hQwzJbuNScKOo2>_r70sv?L06?&(RFJoy zhl97bhh#9yv&3}RYgUc+gT=P8WvKiyn{*E*o(^VG(sZX3A(>f(v)KoSPFdHI8fQ4x zhDWJr-t9CsJG=RU(7O2+${(YjV_B#A`e*CXmoV9LiqGP5H5KC7%PPH4cGe6XUgxm& zVsztOQhyrOSYEi`o8@txsU|gw&Q|YZ<~v`7?tFm)mSa=sO8xK+7~w)z5jNg(nD{*& z*&;hJ7xOfIy>GmQrcQ6xrdvFmVth^cf)5p09F&}{Lp4pEGpg7$2^qo#w*2B!lde`r zu(rg(Cogl;2K^$l>oVSa2Q#o*twLQM>Y{HTdUgf8*!8JYnJ=f~daRbn%JQmiFd>Ye zzi|gNnPC?XxaOD!9`IQ14J<#=mCz@MmHD^X3oI}<_{m%Dk+QVdCdH}We_;-%T)Z|q z%kD+Jy?fV65AU(X#*bG`HEz$R75`D3UTPOG%kfdm+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>94X`Gi8W? z*T}p1Tffp!wKY`>mv9+LgDmm(kch>k6t~=xOdq}xV0rn}F5+ug1r0>zoi`>9{f0DP0g_%o|O$=`MY*y?vW3xh?};mkd>jz$9@ zvYATx$FR~!U?^+IP?(v`c&h^9-5qUKf-C38t{}@aMbT#2{I)>sjgwZ#zStAl3tRiN zC@7PjWv_yt#=4)pZ~=vO;puk;$o#(XRc$WVXTqbzHZc}FR6JEhoC|n5NU@+Ptk$)8b0iE!&WdHyG diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 33e1c816..67cbe688 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -37,7 +37,7 @@ bin\ DEBUG;TRACE prompt - 4 + 3 AnyCPU false diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx index 057b082b..0914fd47 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx @@ -21,6 +21,10 @@ + + + + @@ -57,9 +61,9 @@ /// 将Dataset的数据导入数据库 @@ -249,6 +252,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage var getMaterial = from x in Funs.DB.Base_Material select x; var getWeldType = from x in Funs.DB.Base_WeldType select x; //var getComponents = from x in Funs.DB.Base_Components where x.ProjeceId == this.CurrUser.LoginProjectId select x; + + for (int i = 0; i < ir; i++) { Model.View_HJGL_WeldJoint pipeline = new Model.View_HJGL_WeldJoint(); @@ -268,18 +273,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } else { - pipeline.PipelineCode = col0; - //var oldPipeline = getPipeline.FirstOrDefault(x => x.PipelineCode == col0 && x.UnitWorkId == Request.Params["UnitWorkId"]); - //if (oldPipeline != null) - //{ - // pipeLineId = oldPipeline.PipelineId; - // pipeline.PipelineId = oldPipeline.PipelineId; - //} - //else - //{ - // pipeLineId = SQLHelper.GetNewID(); - // pipeline.PipelineId = pipeLineId; - //} + pipeline.PipelineCode = col0; } pipeline.SingleNumber = pds.Rows[i][1].ToString(); @@ -538,27 +532,46 @@ namespace FineUIPro.Web.HJGL.WeldingManage } string col22 = pds.Rows[i][22].ToString().Replace("Φ", ""); - if (!string.IsNullOrEmpty(col22)) + string col27 = pds.Rows[i][22].ToString(); + if (rbDiaType.SelectedValue=="1") { - try + if (!string.IsNullOrEmpty(col27)) { - decimal Dia = Convert.ToDecimal(col22); - pipeline.Dia = Dia; - //var inch = BLL.Base_DNCompareService.GetSizeByDia(Dia); - //if (inch != null) - //{ - // pipeline.Size = inch; - //} + try + { + decimal Dia = Convert.ToDecimal(col27); + pipeline.Dia = Dia; + + //var inch = BLL.Base_DNCompareService.GetSizeByDia(Dia); + //if (inch != null) + //{ + // pipeline.Size = inch; + //} + } + catch (Exception) + { + result += "第" + (i + 2).ToString() + "行," + "外径格式输入有误" + "|"; + } } - catch (Exception) + else { - result += "第" + (i + 2).ToString() + "行," + "外径格式输入有误" + "|"; + result += "第" + (i + 2).ToString() + "行," + "外径" + "," + "此项为必填项!" + "|"; } } else { - result += "第" + (i + 2).ToString() + "行," + "外径" + "," + "此项为必填项!" + "|"; + if (!string.IsNullOrEmpty(col22)) + { + pipeline.DNDia = col22; + + } + else + { + result += "第" + (i + 2).ToString() + "行," + "DN公称直径" + "," + "此项为必填项!" + "|"; + } + } + string col23 = pds.Rows[i][23].ToString(); if (!string.IsNullOrEmpty(col23)) @@ -604,8 +617,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage { result += "第" + (i + 2).ToString() + "行," + "壁厚" + "," + "此项为必填项!" + "|"; } + if (rbDiaType.SelectedValue=="1") + { + pipeline.Specification = "Φ" + (pipeline.Dia ?? 0).ToString() + "*" + (pipeline.Thickness ?? 0).ToString(); - pipeline.Specification = "Φ" + (pipeline.Dia ?? 0).ToString() + "*" + (pipeline.Thickness ?? 0).ToString(); + } + else + { + pipeline.Specification = pipeline.DNDia + "*" + (pipeline.Thickness ?? 0).ToString(); + + } string col25 = pds.Rows[i][25].ToString(); if (!string.IsNullOrEmpty(col25)) @@ -689,6 +710,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (!string.IsNullOrEmpty(pipeline.PipelineCode) && !string.IsNullOrEmpty(pipeline.WeldJointCode)) { + pipeline.ProjectId = this.CurrUser.LoginProjectId; PipelineList.Add(pipeline); } @@ -698,10 +720,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage PipelineList.Clear(); result = result.Substring(0, result.LastIndexOf("|")); errorInfos = result; - Alert alert = new Alert(); - alert.Message = result; - alert.Target = Target.Self; - alert.Show(); + responeData.code = 0; + responeData.message = errorInfos; } else { @@ -719,6 +739,521 @@ namespace FineUIPro.Web.HJGL.WeldingManage } return responeData; } + private Model.ResponeData AddDatasetToSQL(List pds, int count) + { + Model.ResponeData responeData = new Model.ResponeData(); + string result = string.Empty; + //pds = BLL.Funs.FilterBlankLines(pds); + if (count < 28) + { + responeData.code = 0; + responeData.message = "导入Excel格式错误!Excel只有" + count.ToString().Trim() + "列"; + return responeData; + } + if (pds.Count > 0 && pds != null) + { + + var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x; + var getMedium = from x in Funs.DB.Base_Medium where x.ProjectId == this.CurrUser.LoginProjectId select x;//介质 + var getPipeLineClass = from x in Funs.DB.Base_PipingClass where x.ProjectId == this.CurrUser.LoginProjectId select x;//管道等级 + var getDetectionRate = from x in Funs.DB.Base_DetectionRate select x;//探伤比例 + var getDetectionType = from x in Funs.DB.Base_DetectionType select x;//探伤类型 + var getPressurePipingClass = from x in Funs.DB.Base_PressurePipingClass select x;//压力管道级别 + var getTestMedium = from x in Funs.DB.Base_TestMedium where x.TestType == "1" select x;//压力试验介质 + var getLeakMedium = from x in Funs.DB.Base_TestMedium where x.TestType == "2" select x;//泄露性试验介质 + var getPurgeMethod = from x in Funs.DB.Base_PurgeMethod select x; + var getMaterial = from x in Funs.DB.Base_Material select x; + var getWeldType = from x in Funs.DB.Base_WeldType select x; + //var getComponents = from x in Funs.DB.Base_Components where x.ProjeceId == this.CurrUser.LoginProjectId select x; + + + for (int i = 1; i < pds.Count; i++) + { + Model.View_HJGL_WeldJoint pipeline = new Model.View_HJGL_WeldJoint(); + //pipeline.PipelineId = SQLHelper.GetNewID(); + Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(Request.Params["UnitWorkId"]); + if (unitWork != null) + { + pipeline.UnitWorkId = Request.Params["UnitWorkId"]; + pipeline.UnitId = unitWork.UnitId; + } + + string col0 = pds[i].A.ToString(); + string pipeLineId = string.Empty; + if (string.IsNullOrEmpty(col0)) + { + result += "第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|"; + } + else + { + pipeline.PipelineCode = col0; + } + + pipeline.SingleNumber = pds[i].B.ToString(); + pipeline.SingleName = pds[i].C.ToString(); + + string col3 = pds[i].D.ToString(); + if (string.IsNullOrEmpty(col3)) + { + result += "第" + (i + 1).ToString() + "行," + "介质名称" + "," + "此项为必填项!" + "|"; + } + else + { + var Medium = getMedium.FirstOrDefault(x => x.MediumName == col3); + if (Medium == null) + { + result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|"; + } + else + { + pipeline.MediumId = Medium.MediumId; + pipeline.MediumName = col3; + } + } + string col4 = pds[i].E.ToString(); + if (string.IsNullOrEmpty(col4)) + { + result += "第" + (i + 1).ToString() + "行," + "管道等级" + "," + "此项为必填项!" + "|"; + } + else + { + var PipeLineClass = getPipeLineClass.FirstOrDefault(x => x.PipingClassCode == col4); + if (PipeLineClass == null) + { + result += "第" + (i + 1).ToString() + "行," + "该管道等级不存在!" + "|"; + } + else + { + pipeline.PipingClassId = PipeLineClass.PipingClassId; + pipeline.PipingClassCode = col4; + } + } + string col5 = pds[i].F.ToString(); + if (!string.IsNullOrEmpty(col5)) + { + var DetectionRate = getDetectionRate.FirstOrDefault(x => x.DetectionRateValue.ToString() == col5.Replace("%", "") || x.DetectionRateCode == col5); + if (DetectionRate == null) + { + result += "第" + (i + 1).ToString() + "行," + "该探伤比例不存在!" + "|"; + } + else + { + pipeline.DetectionRateId = DetectionRate.DetectionRateId; + pipeline.DetectionRateCode = col5; + } + } + else + { + result += "第" + (i + 1).ToString() + "行," + "探伤比例" + "," + "此项为必填项!" + "|"; + } + + string col6 = pds[i].G.ToString(); + if (!string.IsNullOrEmpty(col6)) + { + string[] types = col6.ToString().Split(','); + foreach (string t in types) + { + var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == t); + if (type == null) + { + result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|"; + } + else + { + pipeline.DetectionType += type.DetectionTypeId + "|"; + } + } + if (!string.IsNullOrEmpty(pipeline.DetectionType)) + { + pipeline.DetectionType = pipeline.DetectionType.Substring(0, pipeline.DetectionType.Length - 1); + pipeline.DetectionTypeStr = col6; + } + + } + else + { + result += "第" + (i + 1).ToString() + "行," + "探伤类型" + "," + "此项为必填项!" + "|"; + } + + string col7 = pds[i].H.ToString(); + if (!string.IsNullOrEmpty(col7)) + { + pipeline.DesignTemperature = col7; + } + string col8 = pds[i].I.ToString(); + if (!string.IsNullOrEmpty(col8)) + { + pipeline.DesignPress = col8; + } + string col9 = pds[i].J.ToString(); + if (!string.IsNullOrEmpty(col9)) + { + var TestMedium = getTestMedium.FirstOrDefault(x => x.MediumName == col9); + if (TestMedium == null) + { + result += "第" + (i + 1).ToString() + "行," + "该压力试验介质不存在!" + "|"; + } + else + { + pipeline.TestMedium = TestMedium.TestMediumId; + pipeline.TestMediumName = col9; + } + } + string col10 = pds[i].K.ToString(); + if (!string.IsNullOrEmpty(col10)) + { + pipeline.TestPressure = col10; + } + string col11 = pds[i].L.ToString(); + if (!string.IsNullOrEmpty(col11)) + { + var PressurePipingClass = getPressurePipingClass.FirstOrDefault(x => x.PressurePipingClassCode == col11); + if (PressurePipingClass == null) + { + result += "第" + (i + 1).ToString() + "行," + "该压力管道级别不存在!" + "|"; + } + else + { + pipeline.PressurePipingClassId = PressurePipingClass.PressurePipingClassId; + pipeline.PressurePipingClassCode = col11; + } + } + string col12 = pds[i].M.ToString(); + if (!string.IsNullOrEmpty(col12)) + { + try + { + var PipeLenth = Funs.GetNewDecimal(col12); + pipeline.PipeLenth = PipeLenth; + } + catch (Exception) + { + result += "第" + (i + 1).ToString() + "行," + "管线长度(m)格式输入有误" + "|"; + } + } + string col13 = pds[i].N.ToString(); + if (!string.IsNullOrEmpty(col13)) + { + var LeakMedium = getLeakMedium.FirstOrDefault(x => x.MediumName == col13); + if (LeakMedium == null) + { + result += "第" + (i + 1).ToString() + "行," + "该泄露试验介质不存在!" + "|"; + } + else + { + pipeline.LeakMedium = LeakMedium.TestMediumId; + pipeline.LeakMediumName = col13; + } + } + string col14 = pds[i].O.ToString(); + if (!string.IsNullOrEmpty(col14)) + { + pipeline.LeakPressure = col14; + } + string col15 = pds[i].P.ToString(); + if (!string.IsNullOrEmpty(col15)) + { + var PurgeMethod = getPurgeMethod.FirstOrDefault(x => x.PurgeMethodCode == col15); + if (PurgeMethod == null) + { + result += "第" + (i + 1).ToString() + "行," + "该吹洗要求不存在!" + "|"; + } + else + { + pipeline.PCMedium = PurgeMethod.PurgeMethodId; + pipeline.PurgeMethodCode = col15; + + } + } + string col16 = pds[i].Q.ToString(); + if (!string.IsNullOrEmpty(col16)) + { + pipeline.VacuumPressure = col16; + } + string col17 = pds[i].R.ToString(); + if (!string.IsNullOrEmpty(col17)) + { + var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col17); + if (material == null) + { + result += "第" + (i + 1).ToString() + "行," + "该材质不存在!" + "|"; + } + else + { + pipeline.MaterialId = material.MaterialId; + pipeline.PipeMaterialCode = col17; + } + } + pipeline.Remark = pds[i].S.ToString(); + + // 以下是焊口信息 + string col19 = pds[i].T.ToString(); + if (string.IsNullOrEmpty(col19)) + { + result += "第" + (i + 1).ToString() + "行," + "焊口号" + "," + "此项为必填项!" + "|"; + } + else + { + //var oldWeldJoint = getPipeline.FirstOrDefault(x => x.PipelineId == pipeLineId && x.WeldJointCode == col19); + //if (oldWeldJoint != null) + //{ + // pipeline.WeldJointId = oldWeldJoint.WeldJointId; + //} + //else + //{ + // pipeline.WeldJointId = SQLHelper.GetNewID(); + //} + pipeline.WeldJointCode = col19; + } + + string col20 = pds[i].U.ToString(); + if (!string.IsNullOrEmpty(col20)) + { + var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col20); + if (material == null) + { + result += "第" + (i + 1).ToString() + "行," + "该材质1不存在!" + "|"; + } + else + { + pipeline.Material1Id = material.MaterialId; + pipeline.Material1Code = col20; + } + } + else + { + result += "第" + (i + 1).ToString() + "行," + "材质1" + "," + "此项为必填项!" + "|"; + } + + string col21 = pds[i].V.ToString(); + if (!string.IsNullOrEmpty(col21)) + { + var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col21); + if (material == null) + { + result += "第" + (i + 1).ToString() + "行," + "该材质2不存在!" + "|"; + } + else + { + pipeline.Material2Id = material.MaterialId; + pipeline.Material2Code = col21; + } + } + else + { + result += "第" + (i + 1).ToString() + "行," + "材质2" + "," + "此项为必填项!" + "|"; + } + + string col22 = pds[i].W.ToString(); + string col27 = pds[i].AB.ToString().Replace("Φ", ""); + if (rbDiaType.SelectedValue == "1") + { + if (!string.IsNullOrEmpty(col27)) + { + try + { + decimal Dia = Convert.ToDecimal(col27); + pipeline.Dia = Dia; + + //var inch = BLL.Base_DNCompareService.GetSizeByDia(Dia); + //if (inch != null) + //{ + // pipeline.Size = inch; + //} + } + catch (Exception) + { + result += "第" + (i + 1).ToString() + "行," + "外径格式输入有误" + "|"; + } + } + else + { + result += "第" + (i + 1).ToString() + "行," + "外径" + "," + "此项为必填项!" + "|"; + } + } + else + { + if (!string.IsNullOrEmpty(col22)) + { + pipeline.DNDia = col22; + + } + else + { + result += "第" + (i + 1).ToString() + "行," + "DN公称直径" + "," + "此项为必填项!" + "|"; + } + + } + + + string col23 = pds[i].X.ToString(); + if (!string.IsNullOrEmpty(col23)) + { + try + { + decimal Size = Convert.ToDecimal(col23); + pipeline.Size = Size; + } + catch (Exception) + { + result += "第" + (i + 1).ToString() + "行," + "达因格式输入有误" + "|"; + } + } + else + { + result += "第" + (i + 1).ToString() + "行," + "达因" + "," + "此项为必填项!" + "|"; + } + + string col24 = pds[i].Y.ToString(); + if (!string.IsNullOrEmpty(col24)) + { + try + { + var Thickness = Convert.ToDecimal(col24); + pipeline.Thickness = Thickness; + //是否根据壁厚计算达因 + //Model.Project_Sys_Set thicknessSet = BLL.Project_SysSetService.GetSysSetBySetId("7", this.CurrUser.LoginProjectId); + //if (thicknessSet != null && thicknessSet.IsAuto == true) + //{ + // if (pipeline.Size != null) + // { + // pipeline.Size = Convert.ToDecimal(BLL.WeldJointService.GetSizeByThickness(pipeline.Size, Thickness)); + // } + //} + } + catch (Exception) + { + result += "第" + (i + 1).ToString() + "行," + "壁厚格式输入有误" + "|"; + } + } + else + { + result += "第" + (i + 1).ToString() + "行," + "壁厚" + "," + "此项为必填项!" + "|"; + } + if (rbDiaType.SelectedValue == "1") + { + pipeline.Specification = "Φ" + (pipeline.Dia ?? 0).ToString() + "*" + (pipeline.Thickness ?? 0).ToString(); + + } + else + { + pipeline.Specification = pipeline.DNDia + "*" + (pipeline.Thickness ?? 0).ToString(); + + } + + string col25 = pds[i].Z.ToString(); + if (!string.IsNullOrEmpty(col25)) + { + var weldType = getWeldType.FirstOrDefault(x => x.WeldTypeCode == col25); + if (weldType == null) + { + result += "第" + (i + 1).ToString() + "行," + "该焊缝类型不存在!" + "|"; + } + else + { + pipeline.WeldTypeId = weldType.WeldTypeId; + pipeline.WeldTypeCode = col25; + + if (col25.Contains("B")) + { + if (col6.Contains("RT")) + { + Model.Base_DetectionType rt = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("RT"); + if (rt != null) + { + pipeline.DetectionTypeId = rt.DetectionTypeId; + } + } + else + { + Model.Base_DetectionType ut = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("UT"); + if (ut != null) + { + pipeline.DetectionTypeId = ut.DetectionTypeId; + } + } + } + else + { + if (col6.Contains("MT")) + { + Model.Base_DetectionType mt = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("MT"); + if (mt != null) + { + pipeline.DetectionTypeId = mt.DetectionTypeId; + } + } + else + { + Model.Base_DetectionType pt = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("PT"); + if (pt != null) + { + pipeline.DetectionTypeId = pt.DetectionTypeId; + } + } + } + } + } + else + { + result += "第" + (i + 1).ToString() + "行," + "焊缝类型" + "," + "此项为必填项!" + "|"; + } + string col26 = pds[i].AA.ToString(); + if (!string.IsNullOrEmpty(col26)) + { + var JointAttribute = BLL.DropListService.HJGL_JointAttribute(); + + var q = JointAttribute.Where(x => x.Value == col26); + if (q == null) + { + result += "第" + (i + 1).ToString() + "行," + "该焊口属性不存在!" + "|"; + + } + else + { + pipeline.JointAttribute = col26; + } + + } + else + { + result += "第" + (i + 1).ToString() + "行," + "焊口属性" + "," + "此项为必填项!" + "|"; + + } + + if (!string.IsNullOrEmpty(pipeline.PipelineCode) && !string.IsNullOrEmpty(pipeline.WeldJointCode)) + { + pipeline.ProjectId = this.CurrUser.LoginProjectId; + PipelineList.Add(pipeline); + } + + } + if (!string.IsNullOrEmpty(result)) + { + PipelineList.Clear(); + result = result.Substring(0, result.LastIndexOf("|")); + errorInfos = result; + responeData.code = 0; + responeData.message = errorInfos; + } + else + { + errorInfos = string.Empty; + + + } + + } + else + { + responeData.code = 0; + responeData.message = "导入数据为空!"; + } + + + return responeData; + } + #endregion #endregion @@ -853,74 +1388,256 @@ namespace FineUIPro.Web.HJGL.WeldingManage ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); } } - public void AddView_HJGL_WeldJoint(List PipelineList) { - var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x; + string unitworkId = Request.Params["UnitWorkId"]; - for (int i = 0; i < PipelineList.Count(); i++) + addPipelines(PipelineList, unitworkId); + addHJGL_WeldJoints(PipelineList, unitworkId); + + } + //public void AddView_HJGL_WeldJoint(List PipelineList) + //{ + // string unitworkId = Request.Params["UnitWorkId"]; + + // var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId== unitworkId select x; + // List weldJoints_add = new List(); + + // for (int i = 0; i < PipelineList.Count(); i++) + // { + // var pipeLineId = string.Empty; + // var WeldJointId = string.Empty; + + // Model.HJGL_Pipeline pipeline = new Model.HJGL_Pipeline(); + // pipeline.PipelineId = PipelineList[i].PipelineId; + // pipeline.ProjectId = this.CurrUser.LoginProjectId; + // pipeline.UnitId = PipelineList[i].UnitId; + // pipeline.UnitWorkId = PipelineList[i].UnitWorkId; + // pipeline.PipelineCode = PipelineList[i].PipelineCode; + // pipeline.SingleName = PipelineList[i].SingleName; + // pipeline.SingleNumber = PipelineList[i].SingleNumber; + // pipeline.MediumId = PipelineList[i].MediumId; + // pipeline.PipingClassId = PipelineList[i].PipingClassId; + // pipeline.DetectionRateId = PipelineList[i].DetectionRateId; + // pipeline.DetectionType = PipelineList[i].DetectionType; + // pipeline.DesignPress = PipelineList[i].DesignPress; + // pipeline.DesignTemperature = PipelineList[i].DesignTemperature; + // pipeline.TestMedium = PipelineList[i].TestMedium; + // pipeline.TestPressure = PipelineList[i].TestPressure; + // pipeline.PressurePipingClassId = PipelineList[i].PressurePipingClassId; + // pipeline.PipeLenth = PipelineList[i].PipeLenth; + // pipeline.LeakMedium = PipelineList[i].LeakMedium; + // pipeline.LeakPressure = PipelineList[i].LeakPressure; + // pipeline.VacuumPressure = PipelineList[i].VacuumPressure; + // pipeline.PCMedium = PipelineList[i].PCMedium; + // pipeline.MaterialId = PipelineList[i].MaterialId; + // pipeline.Remark = PipelineList[i].Remark; + + // var isExistPipelineCode = getPipeline.FirstOrDefault(x => x.PipelineCode == pipeline.PipelineCode && x.UnitWorkId == Request.Params["UnitWorkId"]); + // if (isExistPipelineCode != null) // 更新管线 + // { + // pipeLineId = isExistPipelineCode.PipelineId; + // pipeline.PipelineId = isExistPipelineCode.PipelineId; + // BLL.PipelineService.UpdatePipeline(pipeline); + // } + // else // 增加管线 + // { + // pipeLineId = SQLHelper.GetNewID(); + // pipeline.PipelineId = pipeLineId; + // BLL.PipelineService.AddPipeline(pipeline); + + // } + + // Model.HJGL_WeldJoint weldJoint = new Model.HJGL_WeldJoint(); + // weldJoint.PipelineId = pipeLineId; + // weldJoint.WeldJointCode = PipelineList[i].WeldJointCode; + // weldJoint.PipelineCode = PipelineList[i].PipelineCode; + // weldJoint.Material1Id = PipelineList[i].Material1Id; + // weldJoint.Material2Id = PipelineList[i].Material2Id; + // weldJoint.Dia = PipelineList[i].Dia; + // weldJoint.Size = PipelineList[i].Size; + // weldJoint.Thickness = PipelineList[i].Thickness; + // weldJoint.Specification = PipelineList[i].Specification; + // weldJoint.WeldTypeId = PipelineList[i].WeldTypeId; + // weldJoint.DetectionTypeId = PipelineList[i].DetectionTypeId; + // weldJoint.JointAttribute = PipelineList[i].JointAttribute; + // weldJoint.ProjectId= PipelineList[i].ProjectId; + // var isExistJot = getPipeline.FirstOrDefault(x => x.PipelineId == pipeLineId && x.WeldJointCode == PipelineList[i].WeldJointCode); + // if (isExistJot != null) // 更新焊口 + // { + // weldJoint.WeldJointId = isExistJot.WeldJointId; + // BLL.WeldJointService.UpdateWeldJoint(weldJoint); + // } + // else // 增加焊口 + // { + // weldJoint.WeldJointId=SQLHelper.GetNewID(); + // weldJoints_add.Add(weldJoint); + // //BLL.WeldJointService.AddWeldJoint(weldJoint); + // } + // } + // if (weldJoints_add.Count>0) + // { + // BLL.WeldJointService.AddBulkWeldJoint(weldJoints_add); + + // } + + //} + #endregion + void addPipelines(List PipelineList, string UnitWorkId) + { + var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId == UnitWorkId select x; + var pipelines = (from x in PipelineList + select new Model.HJGL_Pipeline + { + PipelineId = x.PipelineId, + ProjectId = this.CurrUser.LoginProjectId, + UnitId = x.UnitId, + UnitWorkId = x.UnitWorkId, + PipelineCode = x.PipelineCode, + SingleName = x.SingleName, + SingleNumber = x.SingleNumber, + MediumId = x.MediumId, + PipingClassId = x.PipingClassId, + DetectionRateId = x.DetectionRateId, + DetectionType = x.DetectionType, + DesignPress = x.DesignPress, + DesignTemperature = x.DesignTemperature, + TestMedium = x.TestMedium, + TestPressure = x.TestPressure, + PressurePipingClassId = x.PressurePipingClassId, + PipeLenth = x.PipeLenth, + LeakMedium = x.LeakMedium, + LeakPressure = x.LeakPressure, + VacuumPressure = x.VacuumPressure, + PCMedium = x.PCMedium, + MaterialId = x.MaterialId, + Remark = x.Remark + }).DistinctBy(temp => new + { + temp.PipelineId, + temp.ProjectId, + temp.UnitId, + temp.UnitWorkId, + temp.PipelineCode, + temp.SingleName, + temp.SingleNumber, + temp.MediumId, + temp.PipingClassId, + temp.DetectionRateId, + temp.DetectionType, + temp.DesignPress, + temp.DesignTemperature, + temp.TestMedium, + temp.TestPressure, + temp.PressurePipingClassId, + temp.PipeLenth, + temp.LeakMedium, + temp.LeakPressure, + temp.VacuumPressure, + temp.PCMedium, + temp.MaterialId, + temp.Remark + }).ToList(); + for (int i = 0; i < pipelines.Count(); i++) { - var pipeLineId = string.Empty; - var WeldJointId = string.Empty; - Model.HJGL_Pipeline pipeline = new Model.HJGL_Pipeline(); - - pipeline.PipelineId = PipelineList[i].PipelineId; + pipeline.PipelineId = pipelines[i].PipelineId; pipeline.ProjectId = this.CurrUser.LoginProjectId; - pipeline.UnitId = PipelineList[i].UnitId; - pipeline.UnitWorkId = PipelineList[i].UnitWorkId; - pipeline.PipelineCode = PipelineList[i].PipelineCode; - pipeline.SingleName = PipelineList[i].SingleName; - pipeline.SingleNumber = PipelineList[i].SingleNumber; - pipeline.MediumId = PipelineList[i].MediumId; - pipeline.PipingClassId = PipelineList[i].PipingClassId; - pipeline.DetectionRateId = PipelineList[i].DetectionRateId; - pipeline.DetectionType = PipelineList[i].DetectionType; - pipeline.DesignPress = PipelineList[i].DesignPress; - pipeline.DesignTemperature = PipelineList[i].DesignTemperature; - pipeline.TestMedium = PipelineList[i].TestMedium; - pipeline.TestPressure = PipelineList[i].TestPressure; - pipeline.PressurePipingClassId = PipelineList[i].PressurePipingClassId; - pipeline.PipeLenth = PipelineList[i].PipeLenth; - pipeline.LeakMedium = PipelineList[i].LeakMedium; - pipeline.LeakPressure = PipelineList[i].LeakPressure; - pipeline.VacuumPressure = PipelineList[i].VacuumPressure; - pipeline.PCMedium = PipelineList[i].PCMedium; - pipeline.MaterialId = PipelineList[i].MaterialId; - pipeline.Remark = PipelineList[i].Remark; + pipeline.UnitId = pipelines[i].UnitId; + pipeline.UnitWorkId = pipelines[i].UnitWorkId; + pipeline.PipelineCode = pipelines[i].PipelineCode; + pipeline.SingleName = pipelines[i].SingleName; + pipeline.SingleNumber = pipelines[i].SingleNumber; + pipeline.MediumId = pipelines[i].MediumId; + pipeline.PipingClassId = pipelines[i].PipingClassId; + pipeline.DetectionRateId = pipelines[i].DetectionRateId; + pipeline.DetectionType = pipelines[i].DetectionType; + pipeline.DesignPress = pipelines[i].DesignPress; + pipeline.DesignTemperature = pipelines[i].DesignTemperature; + pipeline.TestMedium = pipelines[i].TestMedium; + pipeline.TestPressure = pipelines[i].TestPressure; + pipeline.PressurePipingClassId = pipelines[i].PressurePipingClassId; + pipeline.PipeLenth = pipelines[i].PipeLenth; + pipeline.LeakMedium = pipelines[i].LeakMedium; + pipeline.LeakPressure = pipelines[i].LeakPressure; + pipeline.VacuumPressure = pipelines[i].VacuumPressure; + pipeline.PCMedium = pipelines[i].PCMedium; + pipeline.MaterialId = pipelines[i].MaterialId; + pipeline.Remark = pipelines[i].Remark; - var isExistPipelineCode = Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.PipelineCode == pipeline.PipelineCode && x.UnitWorkId == Request.Params["UnitWorkId"]); + var isExistPipelineCode = getPipeline.FirstOrDefault(x => x.PipelineCode == pipeline.PipelineCode && x.UnitWorkId == UnitWorkId); if (isExistPipelineCode != null) // 更新管线 { - pipeLineId = isExistPipelineCode.PipelineId; pipeline.PipelineId = isExistPipelineCode.PipelineId; BLL.PipelineService.UpdatePipeline(pipeline); } else // 增加管线 { - pipeLineId = SQLHelper.GetNewID(); - pipeline.PipelineId = pipeLineId; + pipeline.PipelineId = SQLHelper.GetNewID(); BLL.PipelineService.AddPipeline(pipeline); - - } + } + + } + void addHJGL_WeldJoints(List PipelineList, string UnitWorkId) + { + var getweldjonts = from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId == UnitWorkId select x; + var getpipelines= from y in Funs.DB.HJGL_Pipeline where y.UnitWorkId== UnitWorkId select y; + List weldJoints_add = new List(); + + var weldJoints = (from x in PipelineList + select new Model.HJGL_WeldJoint + { + WeldJointCode = x.WeldJointCode, + PipelineCode = x.PipelineCode, + Material1Id = x.Material1Id, + Material2Id = x.Material2Id, + Dia = x.Dia, + DNDia=x.DNDia, + Size = x.Size, + Thickness = x.Thickness, + Specification = x.Specification, + WeldTypeId = x.WeldTypeId, + DetectionTypeId = x.DetectionTypeId, + JointAttribute = x.JointAttribute, + ProjectId = this.CurrUser.LoginProjectId + }).DistinctBy(temp => new + { + temp.WeldJointCode , + temp.PipelineCode , + temp.Material1Id , + temp.Material2Id , + temp.Dia, + temp.DNDia, + temp.Size, + temp.Thickness, + temp.Specification, + temp.WeldTypeId, + temp.DetectionTypeId, + temp.JointAttribute, + temp.ProjectId + }).ToList(); + + for (int i = 0; i < weldJoints.Count(); i++) + { Model.HJGL_WeldJoint weldJoint = new Model.HJGL_WeldJoint(); - // weldJoint.WeldJointId = PipelineList[i].WeldJointId; - weldJoint.PipelineId = pipeLineId; - weldJoint.WeldJointCode = PipelineList[i].WeldJointCode; - weldJoint.PipelineCode = PipelineList[i].PipelineCode; - weldJoint.Material1Id = PipelineList[i].Material1Id; - weldJoint.Material2Id = PipelineList[i].Material2Id; - weldJoint.Dia = PipelineList[i].Dia; - weldJoint.Size = PipelineList[i].Size; - weldJoint.Thickness = PipelineList[i].Thickness; - weldJoint.Specification = PipelineList[i].Specification; - weldJoint.WeldTypeId = PipelineList[i].WeldTypeId; - weldJoint.DetectionTypeId = PipelineList[i].DetectionTypeId; - weldJoint.JointAttribute = PipelineList[i].JointAttribute; - weldJoint.ProjectId= this.CurrUser.LoginProjectId; - var isExistJot = Funs.DB.HJGL_WeldJoint.FirstOrDefault(x => x.PipelineId == pipeLineId && x.WeldJointCode == PipelineList[i].WeldJointCode); + weldJoint.PipelineId = getpipelines.Where(x=>x.PipelineCode== weldJoints[i].PipelineCode).FirstOrDefault().PipelineId; + weldJoint.WeldJointCode = weldJoints[i].WeldJointCode; + weldJoint.PipelineCode = weldJoints[i].PipelineCode; + weldJoint.Material1Id = weldJoints[i].Material1Id; + weldJoint.Material2Id = weldJoints[i].Material2Id; + weldJoint.Dia = weldJoints[i].Dia; + weldJoint.DNDia = weldJoints[i].DNDia; + weldJoint.Size = weldJoints[i].Size; + weldJoint.Thickness = weldJoints[i].Thickness; + weldJoint.Specification = weldJoints[i].Specification; + weldJoint.WeldTypeId = weldJoints[i].WeldTypeId; + weldJoint.DetectionTypeId = weldJoints[i].DetectionTypeId; + weldJoint.JointAttribute = weldJoints[i].JointAttribute; + weldJoint.ProjectId = weldJoints[i].ProjectId; + + var isExistJot = getweldjonts.FirstOrDefault(x => x.PipelineId == weldJoint.PipelineId && x.WeldJointCode == PipelineList[i].WeldJointCode); if (isExistJot != null) // 更新焊口 { weldJoint.WeldJointId = isExistJot.WeldJointId; @@ -928,13 +1645,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage } else // 增加焊口 { - weldJoint.WeldJointId=SQLHelper.GetNewID(); - BLL.WeldJointService.AddWeldJoint(weldJoint); + weldJoint.WeldJointId = SQLHelper.GetNewID(); + weldJoints_add.Add(weldJoint); + //BLL.WeldJointService.AddWeldJoint(weldJoint); } + } + if (weldJoints_add.Count > 0) + { + BLL.WeldJointService.AddBulkWeldJoint(weldJoints_add); + } } - #endregion /// /// 恢复版本 diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.designer.cs index d6a93186..e238e9d9 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.designer.cs @@ -68,6 +68,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected global::FineUIPro.DropDownList DrpType; + /// + /// rbDiaType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbDiaType; + /// /// hdFileName 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx index c3e5d171..caac6cfd 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx @@ -221,10 +221,14 @@ SortField="Size" FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" Width="90px"> - + + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs index 79ed650c..e1375e29 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs @@ -297,7 +297,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { string strSql = @"SELECT WeldJointId,JointAttribute,WeldJointCode,PipelineId,PipelineCode,JointAttribute, IsWelding,IsHotProessStr,Material1Code,Material2Code,WeldTypeCode, - Specification,HeartNo1,HeartNo2,Size,Dia,Thickness,GrooveTypeCode, + Specification,HeartNo1,HeartNo2,Size,Dia,DNDia,Thickness,GrooveTypeCode, WeldingMethodCode,WeldingWireCode,WeldingRodCode,WeldingDate,WeldingDailyCode, BackingWelderCode,CoverWelderCode,MediumCode ,PreTemperature,JointArea,WPQCode,Remark FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL "; diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index a0090aa9..e20c2dae 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -77389,6 +77389,8 @@ namespace Model private string _TwoJointType; + private string _DNDia; + private EntitySet _HJGL_Batch_BatchTrustItem; private EntitySet _HJGL_Batch_PointBatchItem; @@ -77525,6 +77527,8 @@ namespace Model partial void OnMatchableWPQChanged(); partial void OnTwoJointTypeChanging(string value); partial void OnTwoJointTypeChanged(); + partial void OnDNDiaChanging(string value); + partial void OnDNDiaChanged(); #endregion public HJGL_WeldJoint() @@ -78494,6 +78498,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DNDia", DbType="VarChar(50)")] + public string DNDia + { + get + { + return this._DNDia; + } + set + { + if ((this._DNDia != value)) + { + this.OnDNDiaChanging(value); + this.SendPropertyChanging(); + this._DNDia = value; + this.SendPropertyChanged("DNDia"); + this.OnDNDiaChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_Batch_BatchTrustItem_HJGL_WeldJoint", Storage="_HJGL_Batch_BatchTrustItem", ThisKey="WeldJointId", OtherKey="WeldJointId", DeleteRule="NO ACTION")] public EntitySet HJGL_Batch_BatchTrustItem { @@ -213960,6 +213984,8 @@ namespace Model private System.Nullable _Dia; + private string _DNDia; + private System.Nullable _Size; private System.Nullable _Thickness; @@ -214010,6 +214036,8 @@ namespace Model private string _JointAttribute; + private string _TwoJointType; + private string _WeldingDate; private string _BackingWelderCode; @@ -214742,6 +214770,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DNDia", DbType="VarChar(50)")] + public string DNDia + { + get + { + return this._DNDia; + } + set + { + if ((this._DNDia != value)) + { + this._DNDia = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Size", DbType="Decimal(8,3)")] public System.Nullable Size { @@ -215142,6 +215186,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TwoJointType", DbType="NVarChar(100)")] + public string TwoJointType + { + get + { + return this._TwoJointType; + } + set + { + if ((this._TwoJointType != value)) + { + this._TwoJointType = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldingDate", DbType="VarChar(100)")] public string WeldingDate { From 4b842ede06736ba8c36a32b215f50e386e8a44c7 Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Fri, 18 Nov 2022 18:04:38 +0800 Subject: [PATCH 2/2] 2022-11-18-002 --- .../WeldingManage/PipelineListPDMSIn.aspx.cs | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs index 3ea1fcc8..e999f736 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs @@ -778,7 +778,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.UnitId = unitWork.UnitId; } - string col0 = pds[i].A.ToString(); + string col0 = pds[i].A; string pipeLineId = string.Empty; if (string.IsNullOrEmpty(col0)) { @@ -789,10 +789,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.PipelineCode = col0; } - pipeline.SingleNumber = pds[i].B.ToString(); - pipeline.SingleName = pds[i].C.ToString(); + pipeline.SingleNumber = pds[i].B; + pipeline.SingleName = pds[i].C; - string col3 = pds[i].D.ToString(); + string col3 = pds[i].D; if (string.IsNullOrEmpty(col3)) { result += "第" + (i + 1).ToString() + "行," + "介质名称" + "," + "此项为必填项!" + "|"; @@ -810,7 +810,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.MediumName = col3; } } - string col4 = pds[i].E.ToString(); + string col4 = pds[i].E; if (string.IsNullOrEmpty(col4)) { result += "第" + (i + 1).ToString() + "行," + "管道等级" + "," + "此项为必填项!" + "|"; @@ -828,7 +828,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.PipingClassCode = col4; } } - string col5 = pds[i].F.ToString(); + string col5 = pds[i].F; if (!string.IsNullOrEmpty(col5)) { var DetectionRate = getDetectionRate.FirstOrDefault(x => x.DetectionRateValue.ToString() == col5.Replace("%", "") || x.DetectionRateCode == col5); @@ -847,7 +847,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage result += "第" + (i + 1).ToString() + "行," + "探伤比例" + "," + "此项为必填项!" + "|"; } - string col6 = pds[i].G.ToString(); + string col6 = pds[i].G; if (!string.IsNullOrEmpty(col6)) { string[] types = col6.ToString().Split(','); @@ -875,17 +875,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage result += "第" + (i + 1).ToString() + "行," + "探伤类型" + "," + "此项为必填项!" + "|"; } - string col7 = pds[i].H.ToString(); + string col7 = pds[i].H; if (!string.IsNullOrEmpty(col7)) { pipeline.DesignTemperature = col7; } - string col8 = pds[i].I.ToString(); + string col8 = pds[i].I; if (!string.IsNullOrEmpty(col8)) { pipeline.DesignPress = col8; } - string col9 = pds[i].J.ToString(); + string col9 = pds[i].J; if (!string.IsNullOrEmpty(col9)) { var TestMedium = getTestMedium.FirstOrDefault(x => x.MediumName == col9); @@ -899,12 +899,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.TestMediumName = col9; } } - string col10 = pds[i].K.ToString(); + string col10 = pds[i].K; if (!string.IsNullOrEmpty(col10)) { pipeline.TestPressure = col10; } - string col11 = pds[i].L.ToString(); + string col11 = pds[i].L; if (!string.IsNullOrEmpty(col11)) { var PressurePipingClass = getPressurePipingClass.FirstOrDefault(x => x.PressurePipingClassCode == col11); @@ -918,7 +918,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.PressurePipingClassCode = col11; } } - string col12 = pds[i].M.ToString(); + string col12 = pds[i].M; if (!string.IsNullOrEmpty(col12)) { try @@ -931,7 +931,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage result += "第" + (i + 1).ToString() + "行," + "管线长度(m)格式输入有误" + "|"; } } - string col13 = pds[i].N.ToString(); + string col13 = pds[i].N; if (!string.IsNullOrEmpty(col13)) { var LeakMedium = getLeakMedium.FirstOrDefault(x => x.MediumName == col13); @@ -945,12 +945,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.LeakMediumName = col13; } } - string col14 = pds[i].O.ToString(); + string col14 = pds[i].O; if (!string.IsNullOrEmpty(col14)) { pipeline.LeakPressure = col14; } - string col15 = pds[i].P.ToString(); + string col15 = pds[i].P; if (!string.IsNullOrEmpty(col15)) { var PurgeMethod = getPurgeMethod.FirstOrDefault(x => x.PurgeMethodCode == col15); @@ -965,12 +965,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } - string col16 = pds[i].Q.ToString(); + string col16 = pds[i].Q; if (!string.IsNullOrEmpty(col16)) { pipeline.VacuumPressure = col16; } - string col17 = pds[i].R.ToString(); + string col17 = pds[i].R; if (!string.IsNullOrEmpty(col17)) { var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col17); @@ -984,10 +984,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.PipeMaterialCode = col17; } } - pipeline.Remark = pds[i].S.ToString(); + pipeline.Remark = pds[i].S; // 以下是焊口信息 - string col19 = pds[i].T.ToString(); + string col19 = pds[i].T; if (string.IsNullOrEmpty(col19)) { result += "第" + (i + 1).ToString() + "行," + "焊口号" + "," + "此项为必填项!" + "|"; @@ -1006,7 +1006,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.WeldJointCode = col19; } - string col20 = pds[i].U.ToString(); + string col20 = pds[i].U; if (!string.IsNullOrEmpty(col20)) { var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col20); @@ -1025,7 +1025,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage result += "第" + (i + 1).ToString() + "行," + "材质1" + "," + "此项为必填项!" + "|"; } - string col21 = pds[i].V.ToString(); + string col21 = pds[i].V; if (!string.IsNullOrEmpty(col21)) { var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col21); @@ -1044,15 +1044,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage result += "第" + (i + 1).ToString() + "行," + "材质2" + "," + "此项为必填项!" + "|"; } - string col22 = pds[i].W.ToString(); - string col27 = pds[i].AB.ToString().Replace("Φ", ""); + string col22 = pds[i].W; + string col27 = pds[i].AB; if (rbDiaType.SelectedValue == "1") { if (!string.IsNullOrEmpty(col27)) { try { - decimal Dia = Convert.ToDecimal(col27); + decimal Dia = Convert.ToDecimal(col27.Replace("Φ", "")); pipeline.Dia = Dia; //var inch = BLL.Base_DNCompareService.GetSizeByDia(Dia); @@ -1086,7 +1086,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } - string col23 = pds[i].X.ToString(); + string col23 = pds[i].X; if (!string.IsNullOrEmpty(col23)) { try @@ -1104,7 +1104,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage result += "第" + (i + 1).ToString() + "行," + "达因" + "," + "此项为必填项!" + "|"; } - string col24 = pds[i].Y.ToString(); + string col24 = pds[i].Y; if (!string.IsNullOrEmpty(col24)) { try @@ -1141,7 +1141,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } - string col25 = pds[i].Z.ToString(); + string col25 = pds[i].Z; if (!string.IsNullOrEmpty(col25)) { var weldType = getWeldType.FirstOrDefault(x => x.WeldTypeCode == col25); @@ -1198,7 +1198,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { result += "第" + (i + 1).ToString() + "行," + "焊缝类型" + "," + "此项为必填项!" + "|"; } - string col26 = pds[i].AA.ToString(); + string col26 = pds[i].AA; if (!string.IsNullOrEmpty(col26)) { var JointAttribute = BLL.DropListService.HJGL_JointAttribute();