提交代码

This commit is contained in:
高飞 2023-12-01 16:24:41 +08:00
parent 32c14198db
commit b696a63438
6 changed files with 287 additions and 4 deletions

View File

@ -32,6 +32,247 @@ LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId=jot.WeldingRod
WHERE pre.PreWeldingDailyId IS NULL
and jot.WeldJointId not in (select WeldJointId from HJGL_WeldJoint where IsTwoJoint = 1 and (AuditDate is null or AuditDate=''))
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 --51020
,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 --
,pipe.FlowingSection as FlowingSection --
,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] --1Id
,com1.ComponentsCode AS ComponentsCode1 --1
,jot.[Components2Id] --2Id
,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 --
,pipe.PipeArea --/
,daily.WeldingDate as WeldingDateD
,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.AuditMan2
,jot.AuditDate
,jot.AuditDate2
,WeldingLocation.WeldingLocationCode
,CASE WHEN jot.WeldingDailyId IS NULL THEN '' ELSE '' END AS IsWelding
,CASE WHEN jot.WeldingDailyId IS NULL THEN '未完成' ELSE '已完成' END AS IsWeldOK
,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 and BackingWelder.ProjectId=jot.ProjectId
LEFT JOIN SitePerson_Person AS CoverWelder ON CoverWelder.PersonId=jot.CoverWelderId and CoverWelder.ProjectId=jot.ProjectId
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
GO
ALTER VIEW [dbo].[View_HJGL_Pipeline]
AS
/*************管线视图*****************/
SELECT pipeline.PipelineId,
pipeline.ProjectId,
pipeline.UnitId,
pipeline.UnitWorkId,
pipeline.PipelineCode,
pipeline.SingleName,
pipeline.SingleNumber,
pipeline.PipingClassId,
pipeline.MediumId,
pipingClass.PipingClassCode,
pipeline.DetectionRateId,
rate.DetectionRateCode,
pipeline.DetectionType,
pipeline.TestPressure,
pipeline.TestMedium,
pipeline.PressurePipingClassId,
pc.PressurePipingClassCode,
pipeline.PipeLenth,
pipeline.DesignPress,
pipeline.DesignTemperature,
pipeline.Remark,
pipeline.LeakPressure,
pipeline.LeakMedium,
pipeline.VacuumPressure,
pipeline.PCMedium ,
pipeline.PCtype,
pipeline.MaterialId,
pipeline.PipeArea,
pipeline.FlowingSection,
mat.MaterialCode,
lea.MediumName AS LeakMediumName,
pur.PurgeMethodName AS PCMediumName,
CAST((SELECT SUM(ISNULL(Size,0)) FROM dbo.HJGL_WeldJoint WHERE PipelineId=pipeline.PipelineId) AS DECIMAL(8,3)) AS TotalDin,
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot WHERE jot.PipelineId=pipeline.PipelineId AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(8,3)) AS FinishSize,
(SELECT COUNT(WeldJointId) FROM dbo.HJGL_WeldJoint WHERE PipelineId=pipeline.PipelineId and IsTwoJoint is null) AS JointCount,
(SELECT COUNT(WeldJointId) FROM dbo.HJGL_WeldJoint WHERE PipelineId=pipeline.PipelineId and IsTwoJoint is null and WeldingDailyId IS NOT NULL) AS FinishJointCount,
unit.UnitName,
workArea.UnitWorkCode,
medium.MediumCode,
medium.MediumName AS MediumName,
testMedium.MediumCode AS TestMediumCode,
pipeline.ActEndDate AS FinishedDate,
pipeline.IsFinished
FROM dbo.HJGL_Pipeline AS pipeline
LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=pipeline.PipingClassId
LEFT JOIN dbo.Base_Unit AS unit ON unit.UnitId=pipeline.UnitId
LEFT JOIN WBS_UnitWork AS workArea ON workArea.UnitWorkId=pipeline.UnitWorkId
LEFT JOIN Base_Medium AS medium ON medium.MediumId=pipeline.MediumId
LEFT JOIN dbo.Base_TestMedium AS testMedium ON testMedium.TestMediumId=pipeline.TestMedium
LEFT JOIN dbo.Base_DetectionRate rate ON rate.DetectionRateId = pipeline.DetectionRateId
LEFT JOIN dbo.Base_PressurePipingClass pc ON pc.PressurePipingClassId = pipeline.PressurePipingClassId
LEFT JOIN dbo.Base_TestMedium AS lea ON lea.TestMediumId=pipeline.LeakMedium
LEFT JOIN dbo.Base_PurgeMethod AS pur ON pur.PurgeMethodId=pipeline.PCMedium
LEFT JOIN dbo.Base_Material AS mat ON mat.MaterialId=pipeline.MaterialId
GO

View File

@ -108,8 +108,8 @@
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="完成状态" ColumnID="UnitWorkCode1" DataField="UnitWorkCode1"
SortField="UnitWorkCode" FieldType="String" HeaderTextAlign="Center" Width="100px">
<f:RenderField HeaderText="完成状态" ColumnID="IsWeldOK" DataField="IsWeldOK"
SortField="IsWeldOK" FieldType="String" HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="单位名称" ColumnID="UnitName" DataField="UnitName"
SortField="UnitName" FieldType="String" HeaderTextAlign="Center" Width="180px">

View File

@ -492,6 +492,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
select new
{
= x.WeldJointCode,
= x.IsWeldOK,
= x.UnitName,
= x.FlowingSection,
1 = x.Material1Code,

View File

@ -119,6 +119,10 @@
DataField="FinishSize" SortField="FinishSize" FieldType="Double" HeaderTextAlign="Center"
TextAlign="Left" Width="90px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="完成焊口" ColumnID="FinishJointCount"
DataField="FinishJointCount" SortField="FinishJointCount" FieldType="Int" HeaderTextAlign="Center"
TextAlign="Left" Width="90px" Locked="true">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="TotalDin" DataField="TotalDin" FieldType="Double"
HeaderText="总达因数" HeaderTextAlign="Center" TextAlign="Right">
</f:RenderField>

View File

@ -314,6 +314,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
= x.IsFinished,
=x.FinishedDate,
=x.FinishSize,
=x.FinishJointCount,
=x.TotalDin,
=x.JointCount,
=x.UnitName,

View File

@ -272185,6 +272185,8 @@ namespace Model
private System.Nullable<int> _JointCount;
private System.Nullable<int> _FinishJointCount;
private string _UnitName;
private string _UnitWorkCode;
@ -272763,6 +272765,22 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FinishJointCount", DbType="Int")]
public System.Nullable<int> FinishJointCount
{
get
{
return this._FinishJointCount;
}
set
{
if ((this._FinishJointCount != value))
{
this._FinishJointCount = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitName", DbType="NVarChar(200)")]
public string UnitName
{
@ -273719,6 +273737,8 @@ namespace Model
private string _IsWelding;
private string _IsWeldOK;
private string _IsHotProessStr;
private string _BackingWelderName;
@ -275341,6 +275361,22 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsWeldOK", DbType="VarChar(6) NOT NULL", CanBeNull=false)]
public string IsWeldOK
{
get
{
return this._IsWeldOK;
}
set
{
if ((this._IsWeldOK != value))
{
this._IsWeldOK = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsHotProessStr", DbType="VarChar(2) NOT NULL", CanBeNull=false)]
public string IsHotProessStr
{