diff --git a/DataBase/版本日志/SGGLDB_V2023-11-22.sql b/DataBase/版本日志/SGGLDB_V2023-11-22.sql new file mode 100644 index 00000000..a031201e --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-11-22.sql @@ -0,0 +1,172 @@ + +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 --WPSId + ,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.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 + + diff --git a/DataBase/版本日志/SGGLDB_V2023-11-23.sql b/DataBase/版本日志/SGGLDB_V2023-11-23.sql new file mode 100644 index 00000000..a2f11d5d --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-11-23.sql @@ -0,0 +1,5 @@ + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('2C66A01D-B53F-46A1-89F0-30ED137C7498','','HJGL/WeldingReport/CheckResult.aspx',100,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1) + GO + INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('C5671119-2DDD-4A64-B7C6-492B96C5AEC7','2C66A01D-B53F-46A1-89F0-30ED137C7498','鿴',1) + GO \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2023-11-24.sql b/DataBase/版本日志/SGGLDB_V2023-11-24.sql new file mode 100644 index 00000000..a26c6117 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-11-24.sql @@ -0,0 +1,93 @@ + +CREATE PROC [dbo].[sp_rpt_CheckResult] + @unitId NVARCHAR(50) = NULL, --λId + @detectionTypeId NVARCHAR(50) = NULL, --̽ + @flowingSection NVARCHAR(50) = NULL, --̽ + @date1 DATETIME = NULL, + @date2 DATETIME = NULL, + @projectId NVARCHAR(50) = NULL + +AS +/**/ + +select ndeItem.NDEItemID,unit.UnitName,jot.WeldJointCode,detectionType.DetectionTypeCode,ndeItem.TotalFilm,ndeItem.PassFilm, +case ndeItem.CheckResult when '1' then 'ϸ' else 'ϸ' end as CheckResult,pipeline.FlowingSection +from HJGL_Batch_NDEItem ndeItem +LEFT JOIN dbo.Base_DetectionType detectionType ON detectionType.DetectionTypeId = ndeItem.DetectionTypeId +LEFT JOIN dbo.HJGL_Batch_BatchTrustItem trustItem ON trustItem.TrustBatchItemId = ndeItem.TrustBatchItemId +LEFT JOIN dbo.HJGL_WeldJoint jot ON jot.WeldJointId = trustItem.WeldJointId +LEFT JOIN dbo.HJGL_Pipeline pipeline ON jot.PipelineId = pipeline.PipelineId +LEFT JOIN dbo.HJGL_WeldingDaily daily ON daily.WeldingDailyId = jot.WeldingDailyId +LEFT JOIN dbo.Base_Unit unit ON unit.UnitId = daily.UnitId +WHERE (ndeItem.DetectionTypeId=@detectionTypeId OR @detectionTypeId IS NULL) +AND (jot.ProjectId=@projectId OR @projectId IS NULL) +AND (daily.UnitId = @unitId OR @unitId IS NULL) +AND (daily.WeldingDate >= @date1 OR @date1 IS NULL) +AND (daily.WeldingDate <= @date2 OR @date2 IS NULL) +AND (pipeline.FlowingSection like '%'+@flowingSection+'%' OR @flowingSection IS NULL) +ORDER BY daily.UnitId,detectionType.DetectionTypeCode,jot.WeldJointCode + + +GO + + + +ALTER VIEW [dbo].[View_HJGL_Batch_PointBatchItem] +AS +/*************ϸ*************/ +SELECT PointBatchItem.PointBatchItemId, +PointBatchItem.PointBatchId, +PointBatch.ProjectId, +PointBatch.UnitId, +PointBatch.DetectionTypeId, +PointBatch.DetectionRateId, +PointBatch.PointBatchCode, +Pipeline.UnitWorkId, +PointBatchItem.WeldJointId, +(CASE PointBatchItem.PointState WHEN '1' THEN '' WHEN '2' THEN '͸' END) AS PointState, +(CASE PointBatchItem.IsBuildTrust WHEN 1 THEN '' ELSE '' END) AS IsBuildTrust, +(CASE WHEN PointBatchItem.IsAudit=1 THEN '' + WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NOT NULL THEN '' + WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NULL THEN '' END) AS PointIsAudit, +PointBatchItem.PointDate,-- +(CASE PointBatchItem.IsWelderFirst WHEN 1 THEN '' ELSE '' END) AS IsWelderFirst, +PointBatchItem.RepairDate,-- +PointBatchItem.RepairRecordId, +PointBatchItem.CutDate,--г +PointBatchItem.PBackingWelderId,--޴׺ +PointBatchItem.PCoverWelderId,--޸溸 +UnitWork.UnitWorkCode,-- +WeldJoint.WeldJointCode,--ں +WeldJoint.BackingWelderId AS WelderId, --ID +BackingWelder.WelderCode AS BackingWelderCode, +CoverWelder.WelderCode AS CoverWelderCode, +WeldType.WeldTypeCode, +WeldJoint.JointAttribute, +WeldJoint.JointArea,-- +WeldJoint.Size,--ʵʴ羶 +WeldingDaily.WeldingDate,-- +WeldJoint.PipelineId, --ID +WeldJoint.Material1Id AS Mat, -- +WeldJoint.Specification, -- +Pipeline.PipelineCode, --ߺ +PipingClass.PipingClassName , --ܵȼ +WeldJoint.BackingWelderId, +WeldJoint.CoverWelderId +FROM dbo.HJGL_Batch_PointBatchItem AS PointBatchItem +LEFT JOIN dbo.HJGL_Batch_PointBatch AS PointBatch ON PointBatch.PointBatchId=PointBatchItem.PointBatchId +LEFT JOIN dbo.HJGL_WeldJoint AS WeldJoint ON WeldJoint.WeldJointId=PointBatchItem.WeldJointId +LEFT JOIN dbo.HJGL_Pipeline AS Pipeline ON Pipeline.PipelineId=WeldJoint.PipelineId +LEFT JOIN dbo.WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId=Pipeline.UnitWorkId +LEFT JOIN dbo.HJGL_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=WeldJoint.WeldingDailyId +LEFT JOIN dbo.Base_PipingClass AS PipingClass ON PipingClass.PipingClassId=Pipeline.PipingClassId +LEFT JOIN SitePerson_Person AS BackingWelder ON BackingWelder.PersonId=WeldJoint.BackingWelderId +LEFT JOIN SitePerson_Person AS CoverWelder ON CoverWelder.PersonId=WeldJoint.CoverWelderId +LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=WeldJoint.WeldTypeId +LEFT JOIN HJGL_Hard_TrustItem HardTrustItem ON HardTrustItem.WeldJointId=PointBatchItem.WeldJointId +where (WeldJoint.IsHotProess!=1 or (WeldJoint.IsHotProess=1 and HardTrustItem.IsPass=1)) +and BackingWelder.ProjectId=Pipeline.ProjectId and CoverWelder.ProjectId=Pipeline.ProjectId + + +GO + + diff --git a/DataBase/版本日志/SGGLDB_V2023-11-25.sql b/DataBase/版本日志/SGGLDB_V2023-11-25.sql new file mode 100644 index 00000000..2c5a219f --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-11-25.sql @@ -0,0 +1,2 @@ +alter table [dbo].[WBS_ControlItemInit] add IsJDItem bit null +GO \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2023-11-27.sql b/DataBase/版本日志/SGGLDB_V2023-11-27.sql new file mode 100644 index 00000000..1e679f87 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-11-27.sql @@ -0,0 +1,61 @@ + +ALTER VIEW [dbo].[View_HJGL_Batch_PointBatchItem] +AS +/*************ϸ*************/ +SELECT PointBatchItem.PointBatchItemId, +PointBatchItem.PointBatchId, +PointBatch.ProjectId, +PointBatch.UnitId, +PointBatch.DetectionTypeId, +PointBatch.DetectionRateId, +PointBatch.PointBatchCode, +Pipeline.UnitWorkId, +PointBatchItem.WeldJointId, +(CASE PointBatchItem.PointState WHEN '1' THEN '' WHEN '2' THEN '͸' END) AS PointState, +(CASE PointBatchItem.IsBuildTrust WHEN 1 THEN '' ELSE '' END) AS IsBuildTrust, +(CASE WHEN PointBatchItem.IsAudit=1 THEN '' + WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NOT NULL THEN '' + WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NULL THEN '' END) AS PointIsAudit, +PointBatchItem.PointDate,-- +(CASE PointBatchItem.IsWelderFirst WHEN 1 THEN '' ELSE '' END) AS IsWelderFirst, +PointBatchItem.RepairDate,-- +PointBatchItem.RepairRecordId, +PointBatchItem.CutDate,--г +PointBatchItem.PBackingWelderId,--޴׺ +PointBatchItem.PCoverWelderId,--޸溸 +UnitWork.UnitWorkCode,-- +WeldJoint.WeldJointCode,--ں +WeldJoint.BackingWelderId AS WelderId, --ID +BackingWelder.WelderCode AS BackingWelderCode, +CoverWelder.WelderCode AS CoverWelderCode, +WeldType.WeldTypeCode, +WeldJoint.JointAttribute, +WeldJoint.JointArea,-- +WeldJoint.Size,--ʵʴ羶 +WeldingDaily.WeldingDate,-- +WeldJoint.PipelineId, --ID +WeldJoint.Material1Id AS Mat, -- +WeldJoint.Specification, -- +Pipeline.PipelineCode, --ߺ +PipingClass.PipingClassName , --ܵȼ +WeldJoint.BackingWelderId, +WeldJoint.CoverWelderId +FROM dbo.HJGL_Batch_PointBatchItem AS PointBatchItem +LEFT JOIN dbo.HJGL_Batch_PointBatch AS PointBatch ON PointBatch.PointBatchId=PointBatchItem.PointBatchId +LEFT JOIN dbo.HJGL_WeldJoint AS WeldJoint ON WeldJoint.WeldJointId=PointBatchItem.WeldJointId +LEFT JOIN dbo.HJGL_Pipeline AS Pipeline ON Pipeline.PipelineId=WeldJoint.PipelineId +LEFT JOIN dbo.WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId=Pipeline.UnitWorkId +LEFT JOIN dbo.HJGL_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=WeldJoint.WeldingDailyId +LEFT JOIN dbo.Base_PipingClass AS PipingClass ON PipingClass.PipingClassId=Pipeline.PipingClassId +LEFT JOIN SitePerson_Person AS BackingWelder ON BackingWelder.PersonId=WeldJoint.BackingWelderId +LEFT JOIN SitePerson_Person AS CoverWelder ON CoverWelder.PersonId=WeldJoint.CoverWelderId +LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=WeldJoint.WeldTypeId +LEFT JOIN HJGL_Hard_TrustItem HardTrustItem ON HardTrustItem.WeldJointId=PointBatchItem.WeldJointId +where (WeldJoint.IsHotProess!=1 or WeldJoint.IsHotProess is null or (WeldJoint.IsHotProess=1 and HardTrustItem.IsPass=1)) +and BackingWelder.ProjectId=Pipeline.ProjectId and CoverWelder.ProjectId=Pipeline.ProjectId + + + +GO + + diff --git a/DataBase/版本日志/SGGLDB_V2023-11-28.sql b/DataBase/版本日志/SGGLDB_V2023-11-28.sql new file mode 100644 index 00000000..d4097938 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-11-28.sql @@ -0,0 +1,22 @@ +alter table WBS_WorkPackage add DrawProjectQuantity decimal(18,2) null +GO + +ALTER VIEW [dbo].[View_WBS] +AS +select '1' as Id,'0' as SupId ,'JZ' as Code, '' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as RealEndDate,null as WBSCode,null as JDWeights,null as Unit,null as PlanProjectQuantity,null as RealProjectQuantity,null as RealStartDate,null as IsMileStone,null as PlanCost,null as PreWorkCode,'' as ShowId,null as DrawProjectQuantity, +ProjectId from dbo.Base_Project +Union +select '2' as Id,'0' as SupId ,'AZ' as Code, 'װ' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as RealEndDate,null as WBSCode,null as JDWeights,null as Unit,null as PlanProjectQuantity,null as RealProjectQuantity,null as RealStartDate,null as IsMileStone,null as PlanCost,null as PreWorkCode,'' as ShowId,null as DrawProjectQuantity, +ProjectId from dbo.Base_Project +Union +select UnitWorkId as Id,ProjectType as SupId ,UnitWorkCode as Code, UnitWorkName as Name,'UnitWork' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode,JDWeights,null as Unit,null as PlanProjectQuantity,null as RealProjectQuantity,RealStartDate,null as IsMileStone,PlanCost,null as PreWorkCode,'' as ShowId,null as DrawProjectQuantity, +ProjectId from dbo.WBS_UnitWork +Union all +select WorkPackageId as id,UnitWorkId as SupId,WorkPackageCode as Code,PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode,JDWeights,Unit,PlanProjectQuantity,RealProjectQuantity,RealStartDate,IsMileStone,PlanCost,PreWorkCode,case when (select COUNT(*) from WBS_WorkPackage a where a.SuperWorkPackageId=w.WorkPackageId and a.IsApprove=1)=0 then WorkPackageId else '' end as ShowId,DrawProjectQuantity, +ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is null +Union all +select WorkPackageId as id,SuperWorkPackageId as SupId,WorkPackageCode as Code, PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode,JDWeights,Unit,PlanProjectQuantity,RealProjectQuantity,RealStartDate,IsMileStone,PlanCost,PreWorkCode,case when (select COUNT(*) from WBS_WorkPackage a where a.SuperWorkPackageId=w.WorkPackageId and a.IsApprove=1)=0 then WorkPackageId else '' end as ShowId,DrawProjectQuantity, +ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is not null + + +GO diff --git a/DataBase/版本日志/SGGLDB_V2023-11-29.sql b/DataBase/版本日志/SGGLDB_V2023-11-29.sql new file mode 100644 index 00000000..91b9c864 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-11-29.sql @@ -0,0 +1,53 @@ + +CREATE TABLE [dbo].[ZHGL_ConstructionLogHJGL]( + [ConstructionLogHJGLId] [nvarchar](50) NOT NULL, + [ConstructionLogId] [nvarchar](50) NULL, + [UnitWorkId] [nvarchar](50) NULL, + [TodayCompleteSize] [decimal](18, 3) NULL, + [TotalCompleteSize] [decimal](18, 3) NULL, + [TotalSize] [decimal](18, 3) NULL, + [TotalRate] [nvarchar](20) NULL, + [TomorrowPlanSize] [decimal](18, 3) NULL, + CONSTRAINT [PK_ZHGL_ConstructionLogHJGL] PRIMARY KEY CLUSTERED +( + [ConstructionLogHJGLId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogHJGL] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ConstructionLogHJGL_ZHGL_ConstructionLog] FOREIGN KEY([ConstructionLogId]) +REFERENCES [dbo].[ZHGL_ConstructionLog] ([ConstructionLogId]) +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogHJGL] CHECK CONSTRAINT [FK_ZHGL_ConstructionLogHJGL_ZHGL_ConstructionLog] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'ConstructionLogHJGLId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'ConstructionLogId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'UnitWorkId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ɴ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'TodayCompleteSize' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɴ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'TotalCompleteSize' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܴ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'TotalSize' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ۼɰٷֱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'TotalRate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ռƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL', @level2type=N'COLUMN',@level2name=N'TomorrowPlanSize' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʩ־ݱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogHJGL' +GO + + diff --git a/DataBase/版本日志/SGGLDB_V2023-09-11.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-11.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-11.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-11.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-12.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-12.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-12.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-12.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-13.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-13.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-13.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-13.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-15.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-15.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-15.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-15.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-21.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-21.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-21.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-21.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-22.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-22.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-22.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-22.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-25.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-25.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-25.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-25.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-27.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-27.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-09-27.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-09-27.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-07.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-07.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-07.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-07.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-17.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-17.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-17.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-17.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-20.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-20.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-20.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-20.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-23.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-23.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-23.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-23.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-24.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-24.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-24.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-24.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-25.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-25.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-25.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-25.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-26.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-26.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-26.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-26.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-27.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-27.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-27.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-27.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-10-30.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-30.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-10-30.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-10-30.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-11-01.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-01.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-11-01.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-01.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-11-08.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-08.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-11-08.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-08.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-11-09.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-09.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-11-09.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-09.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-11-10.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-10.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-11-10.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-10.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-11-14.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-14.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-11-14.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-14.sql diff --git a/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-21.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-21.sql new file mode 100644 index 00000000..6d348252 --- /dev/null +++ b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-11-21.sql @@ -0,0 +1,175 @@ +alter table HJGL_WeldJoint add AuditMan2 nvarchar(50) null +GO +alter table HJGL_WeldJoint add AuditDate2 datetime null +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 --WPSId + ,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 --κ + ,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.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 + + diff --git a/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql b/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql index 20cc9602..a72dea5c 100644 --- a/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql +++ b/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql @@ -543,6 +543,12 @@ GO INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('47A49DB1-4689-421A-A93E-DCBD7C34D917','854C79DF-A1C0-4E3C-BCB4-7D5CD044F72B','鿴',1) GO + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('2C66A01D-B53F-46A1-89F0-30ED137C7498','','HJGL/WeldingReport/CheckResult.aspx',100,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1) + GO + INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('C5671119-2DDD-4A64-B7C6-492B96C5AEC7','2C66A01D-B53F-46A1-89F0-30ED137C7498','鿴',1) + GO + --INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) --VALUES('CF3CB43C-4031-4CFD-905F-154DC1CB881E','ۺϢ','HJGL/WeldingReport/IsoCompreInfo.aspx',80,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1) diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index b8bfa829..0ee1899e 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -644,6 +644,7 @@ + diff --git a/SGGL/BLL/CQMS/WBS/ControlItemInitService.cs b/SGGL/BLL/CQMS/WBS/ControlItemInitService.cs index bbd0b196..f7603317 100644 --- a/SGGL/BLL/CQMS/WBS/ControlItemInitService.cs +++ b/SGGL/BLL/CQMS/WBS/ControlItemInitService.cs @@ -51,6 +51,7 @@ namespace BLL newControlItem.Standard = controlItem.Standard; newControlItem.ClauseNo = controlItem.ClauseNo; newControlItem.CheckAcceptType = controlItem.CheckAcceptType; + newControlItem.IsJDItem = controlItem.IsJDItem; db.WBS_ControlItemInit.InsertOnSubmit(newControlItem); db.SubmitChanges(); @@ -75,6 +76,7 @@ namespace BLL newControlItem.Standard = controlItem.Standard; newControlItem.ClauseNo = controlItem.ClauseNo; newControlItem.CheckAcceptType = controlItem.CheckAcceptType; + newControlItem.IsJDItem = controlItem.IsJDItem; db.SubmitChanges(); } diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageProjectService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageProjectService.cs index 9c252348..2a63d1db 100644 --- a/SGGL/BLL/CQMS/WBS/WorkPackageProjectService.cs +++ b/SGGL/BLL/CQMS/WBS/WorkPackageProjectService.cs @@ -32,7 +32,7 @@ namespace BLL public static void UpdateWorkPackageProject(Model.WBS_WorkPackageProject workPack) { Model.SGGLDB db = Funs.DB; - Model.WBS_WorkPackageProject newPack = db.WBS_WorkPackageProject.First(e => e.WorkPackageCode == workPack.WorkPackageCode); + Model.WBS_WorkPackageProject newPack = db.WBS_WorkPackageProject.First(e => e.WorkPackageCode == workPack.WorkPackageCode && e.ProjectId == workPack.ProjectId); newPack.WorkPackageCode = workPack.WorkPackageCode; newPack.IsChild = workPack.IsChild; newPack.PackageContent = workPack.PackageContent; diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs index fd000c2f..2c6e85c7 100644 --- a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs +++ b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs @@ -40,6 +40,7 @@ namespace BLL newWorkPackage.RealStartDate = WorkPackage.RealStartDate; newWorkPackage.RealEndDate = WorkPackage.RealEndDate; newWorkPackage.Unit = WorkPackage.Unit; + newWorkPackage.DrawProjectQuantity = WorkPackage.DrawProjectQuantity; db.WBS_WorkPackage.InsertOnSubmit(newWorkPackage); db.SubmitChanges(); @@ -76,6 +77,7 @@ namespace BLL newWorkPackage.PlanCost = WorkPackage.PlanCost; newWorkPackage.JDWeights = WorkPackage.JDWeights; newWorkPackage.PreWorkCode = WorkPackage.PreWorkCode; + newWorkPackage.DrawProjectQuantity = WorkPackage.DrawProjectQuantity; db.SubmitChanges(); } @@ -444,7 +446,7 @@ namespace BLL List newList = new List(); if (getWBSs.Count() > 0) { - + var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0"); int a = 1; foreach (var item in projectTypes) @@ -505,6 +507,7 @@ namespace BLL table.Columns.Add(new DataColumn("JDWeights", typeof(String))); table.Columns.Add(new DataColumn("Unit", typeof(String))); table.Columns.Add(new DataColumn("PlanProjectQuantity", typeof(String))); + table.Columns.Add(new DataColumn("DrawProjectQuantity", typeof(String))); table.Columns.Add(new DataColumn("RealProjectQuantity", typeof(String))); table.Columns.Add(new DataColumn("PlanStartDate", typeof(DateTime))); table.Columns.Add(new DataColumn("PlanEndDate", typeof(DateTime))); @@ -551,30 +554,31 @@ namespace BLL row[6] = item.JDWeights; row[7] = item.Unit; row[8] = item.PlanProjectQuantity; - row[9] = item.RealProjectQuantity; + row[9] = item.DrawProjectQuantity; + row[10] = item.RealProjectQuantity; if (item.PlanStartDate != null) { - row[10] = item.PlanStartDate; + row[11] = item.PlanStartDate; } if (item.PlanEndDate != null) { - row[11] = item.PlanEndDate; + row[12] = item.PlanEndDate; } if (item.RealStartDate != null) { - row[12] = item.RealStartDate; + row[13] = item.RealStartDate; } if (item.RealEndDate != null) { - row[13] = item.RealEndDate; + row[14] = item.RealEndDate; } if (item.IsMileStone != null) { - row[14] = item.IsMileStone; + row[15] = item.IsMileStone; } - row[15] = item.PlanCost; - row[16] = item.PreWorkCode; - row[17] = item.Code; + row[16] = item.PlanCost; + row[17] = item.PreWorkCode; + row[18] = item.Code; if (!string.IsNullOrEmpty(item.ShowId)) { var details = getDetails.Where(x => x.WorkPackageId == item.Id).ToList(); @@ -583,11 +587,11 @@ namespace BLL var index = months.FindIndex(x => x.Equals(item1.Months)); if (item1.PlanNum != 0) { - row[18 + index * 2] = decimal.Round(Convert.ToDecimal(item1.PlanNum), 2); + row[19 + index * 2] = decimal.Round(Convert.ToDecimal(item1.PlanNum), 2); } if (item1.ThisNum != 0) { - row[19 + index * 2] = decimal.Round(Convert.ToDecimal(item1.ThisNum), 2); + row[20 + index * 2] = decimal.Round(Convert.ToDecimal(item1.ThisNum), 2); } } } @@ -827,6 +831,45 @@ namespace BLL } } + /// + /// 更新分部分项工程实际完成时间 + /// + /// + public static void UpdateWorkPackageRealEndDate2(string workPackageId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var workPackage = db.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPackageId); + if (workPackage != null) + { + workPackage.RealEndDate = DateTime.Now; + UpdateWorkPackages(db, workPackage, null, null, null, workPackage.RealEndDate); + db.SubmitChanges(); + var unitWork = db.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == workPackage.UnitWorkId); + //获取是否存在其他未完成的分部分项 + var notEndOthenWorkPackage = db.WBS_WorkPackage.FirstOrDefault(x => x.UnitWorkId == unitWork.UnitWorkId && x.IsApprove == true && x.RealEndDate == null); + if (notEndOthenWorkPackage == null) + { + if (workPackage.RealEndDate != null) + { + if (unitWork.RealEndDate == null) + { + unitWork.RealEndDate = workPackage.RealEndDate; + } + else + { + if (unitWork.RealEndDate < workPackage.RealEndDate) + { + unitWork.RealEndDate = workPackage.RealEndDate; + } + } + } + } + } + db.SubmitChanges(); + } + } + #region 根据工作包ID获取wbs节点及父节点字符串 /// /// 根据工作包ID获取wbs节点及父节点字符串 diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 59aced14..1ae05411 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3338,6 +3338,10 @@ namespace BLL /// public const string WBSWorkPackageTemplateUrl = "File\\Excel\\DataIn\\WBS定制导入模板.xls"; /// + /// WBS定制导入模板 + /// + public const string WBSWorkPackageTemplate2Url = "File\\Excel\\DataIn\\WBS定制导入模板(电仪).xls"; + /// /// WBS编码规则 /// public const string WBSCodeTemplateUrl = "File\\Excel\\DataIn\\WBS编码规则.xlsx"; @@ -3447,6 +3451,10 @@ namespace BLL /// 公司平均工效统计模板文件原始虚拟路径 /// public const string CompanyConstructionLogWorkEfficiencyTemplateUrl = "File\\Excel\\ConstructionLog\\公司平均工效统计.xlsx"; + /// + /// 焊口二次设计信息模板文件原始虚拟路径 + /// + public const string JotTwoDesignTemplateUrl = "File\\Excel\\DataOut\\焊口二次设计信息.xlsx"; #endregion #region 初始化上传路径 diff --git a/SGGL/BLL/HJGL/PersonManage/WelderService.cs b/SGGL/BLL/HJGL/PersonManage/WelderService.cs index 937ad266..5d363875 100644 --- a/SGGL/BLL/HJGL/PersonManage/WelderService.cs +++ b/SGGL/BLL/HJGL/PersonManage/WelderService.cs @@ -65,10 +65,10 @@ namespace BLL /// /// /// - public static bool IsExisWelderCode(string welderId, string welderCode) + public static bool IsExisWelderCode(string welderId, string welderCode, string projectId) { bool isExitCode = false; - var q = from x in Funs.DB.SitePerson_Person where x.WelderCode == welderCode && x.PersonId != welderId select x; + var q = from x in Funs.DB.SitePerson_Person where x.WelderCode == welderCode && x.PersonId != welderId && x.ProjectId == projectId select x; if (q.Count() > 0) { isExitCode = true; diff --git a/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs b/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs index c0be47d9..db4ebadd 100644 --- a/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs +++ b/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs @@ -100,31 +100,31 @@ namespace BLL { var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId); - if (newWeldJoint != null ) + if (newWeldJoint != null) { var isTrust = from x in Funs.DB.HJGL_Batch_BatchTrustItem where x.WeldJointId == weldJointId select x; ; if (!isTrust.Any()) - { - var pointBatchItems = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.WeldJointId == weldJointId select x; - string pointBatchId = pointBatchItems.FirstOrDefault()?.PointBatchId; + { + var pointBatchItems = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.WeldJointId == weldJointId select x; + string pointBatchId = pointBatchItems.FirstOrDefault()?.PointBatchId; - // 删除焊口所在批明细信息 - BLL.PointBatchDetailService.DeleteBatchDetail(weldJointId); + // 删除焊口所在批明细信息 + BLL.PointBatchDetailService.DeleteBatchDetail(weldJointId); + + // 删除批信息 + var batch = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.PointBatchId == pointBatchId select x; + if (!string.IsNullOrEmpty(pointBatchId) && !batch.Any()) + { + DeleteBatch(pointBatchId); + } + //BLL.Batch_NDEItemService.DeleteAllNDEInfoToWeldJoint(item.WeldJointId); - // 删除批信息 - var batch = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.PointBatchId == pointBatchId select x; - if (!string .IsNullOrEmpty(pointBatchId) && !batch.Any()) - { - DeleteBatch(pointBatchId); - } - //BLL.Batch_NDEItemService.DeleteAllNDEInfoToWeldJoint(item.WeldJointId); - } else { - // errlog += "焊口【" + newWeldJoint.WeldJointCode + "】已进委托单了,不能删除。"; + // errlog += "焊口【" + newWeldJoint.WeldJointCode + "】已进委托单了,不能删除。"; } } } @@ -138,7 +138,7 @@ namespace BLL var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId); var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId); var project = BLL.ProjectService.GetProjectByProjectId(pipeline.ProjectId); - var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(pipeline.UnitWorkId); + var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(pipeline.UnitWorkId); var WeldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(newWeldJoint.WeldingDailyId); var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(pipeline.DetectionType); var ndtr = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipeline.DetectionRateId); @@ -236,8 +236,33 @@ namespace BLL batch.PointBatchId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_PointBatch)); batchId = batch.PointBatchId; string perfix = project.ProjectCode + "-" + unitWork.UnitWorkCode + "-GD-DK-" + ndt.DetectionTypeCode + "-" + ndtr.DetectionRateValue.ToString() + "%-"; - batch.PointBatchCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode4ByProjectId", "dbo.HJGL_Batch_PointBatch", "PointBatchCode", project.ProjectId, perfix); - + //batch.PointBatchCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode4ByProjectId", "dbo.HJGL_Batch_PointBatch", "PointBatchCode", project.ProjectId, perfix); + var maxBatch = (from x in Funs.DB.HJGL_Batch_PointBatch where x.ProjectId == project.ProjectId && x.PointBatchCode.Contains(perfix) select x).FirstOrDefault(); + if (maxBatch == null) + { + batch.PointBatchCode = perfix + "0001"; + } + else + { + int code = Funs.GetNewIntOrZero(maxBatch.PointBatchCode.Substring(maxBatch.PointBatchCode.Length - 4)); + code = code + 1; + if (code < 10) + { + batch.PointBatchCode = perfix + "000" + code.ToString(); + } + else if (code >= 10 && code < 100) + { + batch.PointBatchCode = perfix + "00" + code.ToString(); + } + else if (code >= 100 && code < 1000) + { + batch.PointBatchCode = perfix + "0" + code.ToString(); + } + else + { + batch.PointBatchCode = perfix + code.ToString(); + } + } batch.ProjectId = project.ProjectId; batch.UnitWorkId = pipeline.UnitWorkId; batch.BatchCondition = batchCondition; diff --git a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs index 0172d0a1..e1471476 100644 --- a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs +++ b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs @@ -1,5 +1,5 @@ using FineUIPro; - + using System; using System.Collections; using System.Collections.Generic; @@ -75,7 +75,7 @@ namespace BLL IQueryable q1 = (from x in db.HJGL_PackagingManage join y in db.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId join z in db.HJGL_Pipeline on y.PipelineId equals z.PipelineId - select x + select x ); if (!string.IsNullOrEmpty(name)) { @@ -121,7 +121,7 @@ namespace BLL } return PlanStartDate; } - public static List GetPackagingManageList(string projectId,string PackagingCode) + public static List GetPackagingManageList(string projectId, string PackagingCode) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { @@ -131,7 +131,7 @@ namespace BLL join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt from t in tt.DefaultIfEmpty() where x.ProjectId == projectId - &&(string.IsNullOrEmpty(PackagingCode)|| x.PackagingCode.Contains(PackagingCode) ) + && (string.IsNullOrEmpty(PackagingCode) || x.PackagingCode.Contains(PackagingCode)) select new PackagingManageItem { PackagingManageId = x.PackagingManageId, @@ -142,7 +142,7 @@ namespace BLL StackingPosition = x.StackingPosition, State = x.State, ReceiveMan = t.PersonName, - ReceiveDate = string.Format("{0:g}", x.ReceiveDate), + ReceiveDate = x.ReceiveDate.HasValue ? string.Format("{0:g}", x.ReceiveDate) : "", PlanStartDate = GetMinPlanStartDate(x.PackagingManageId), }).Distinct(); @@ -156,8 +156,8 @@ namespace BLL /// public static void PutOutOrder(string PackagingManageId) { - var model= GetHJGL_PackagingManageById(PackagingManageId); - if (model.State==state_0) + var model = GetHJGL_PackagingManageById(PackagingManageId); + if (model.State == state_0) { model.State = state_1; UpdateHJGL_PackagingManage(model); @@ -173,7 +173,7 @@ namespace BLL { DataTable tb = new DataTable(); var model = GetHJGL_PackagingManageById(PackagingManageId); - if (!string .IsNullOrEmpty(model.PipelineComponentId)) + if (!string.IsNullOrEmpty(model.PipelineComponentId)) { var PipelineComponentIds = model.PipelineComponentId.Split(','); string strSql = @"select com.PipelineComponentId, com.PipelineComponentCode,pipe.PlanStartDate,unitwork.UnitWorkName,'1' as num ,'个' as CU @@ -185,7 +185,7 @@ namespace BLL strSql += string.Format("where com.PipelineComponentId in ( {0}) ", "'" + string.Join("','", PipelineComponentIds) + "'"); SqlParameter[] parameter = listStr.ToArray(); tb = SQLHelper.GetDataTableRunText(strSql, parameter); - } + } return tb; } @@ -195,7 +195,7 @@ namespace BLL /// /// /// - public static List GetPackagingCode(string projectid) + public static List GetPackagingCode(string projectid) { Model.SGGLDB db = Funs.DB; var q = (from x in db.HJGL_PackagingManage @@ -244,8 +244,8 @@ namespace BLL table.ContactName = newtable.ContactName; table.ContactPhone = newtable.ContactPhone; table.Remark = newtable.Remark; - table.ReceiveMan=newtable.ReceiveMan; - table.ReceiveDate=newtable.ReceiveDate; + table.ReceiveMan = newtable.ReceiveMan; + table.ReceiveDate = newtable.ReceiveDate; db.SubmitChanges(); } diff --git a/SGGL/BLL/HJGL/WPQ/WPQListService.cs b/SGGL/BLL/HJGL/WPQ/WPQListService.cs index 3ff5c33f..c9d1f40d 100644 --- a/SGGL/BLL/HJGL/WPQ/WPQListService.cs +++ b/SGGL/BLL/HJGL/WPQ/WPQListService.cs @@ -202,7 +202,10 @@ namespace BLL var mat1 = BLL.Base_MaterialService.GetMaterialByMaterialId(material1); var mat2 = BLL.Base_MaterialService.GetMaterialByMaterialId(material2); - + if (mat1.MaterialCode == "No matl" || mat2.MaterialCode == "No matl") //材质1或材质2有一种为无材质,则匹配不了wpq + { + return null; + } int m1 = SNClass(mat1.MaterialClass); int m2 = SNClass(mat2.MaterialClass); diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs index 0545d184..761cef9c 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs @@ -20,24 +20,24 @@ namespace BLL /// /// 工厂预制 /// - public const string PipeArea_SHOP="1"; + public const string PipeArea_SHOP = "1"; /// /// 现场安装 /// - public const string PipeArea_FIELD = "2"; + public const string PipeArea_FIELD = "2"; public const int pageSize = 20; public static List hJGL_Pipelines { - - get; - set; - + + get; + set; + } /// /// 实际日期类型 /// - public enum ActDateType + public enum ActDateType { /// /// 实际开始日期(预制) @@ -46,16 +46,16 @@ namespace BLL /// /// 实际完成日期(预制) /// - ActDateEnd_Shop , + ActDateEnd_Shop, /// /// 实际开始日期(安装) /// - ActDateStart_FIELD , + ActDateStart_FIELD, /// /// 实际完成日期(安装) /// - ActDateEnd_FIELD , - } + ActDateEnd_FIELD, + } /// /// 管线划分 /// @@ -67,7 +67,7 @@ namespace BLL list[1] = new ListItem("现场安装", PipeArea_FIELD); return list; } - public static void RestPipelineAndJoints(string projectid ) + public static void RestPipelineAndJoints(string projectid) { PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(projectid); WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(projectid); @@ -92,7 +92,7 @@ namespace BLL var PlanEndDate = mdoel.PlanEndDate; var ActStartDate = new DateTime?(); var ActEndDate = new DateTime?(); - if (!string .IsNullOrEmpty(GetDateByPipelineId(pipelineId, ActDateType.ActDateStart_FIELD))) + if (!string.IsNullOrEmpty(GetDateByPipelineId(pipelineId, ActDateType.ActDateStart_FIELD))) { ActStartDate = Convert.ToDateTime(GetDateByPipelineId(pipelineId, ActDateType.ActDateStart_FIELD)); } @@ -100,22 +100,22 @@ namespace BLL { ActEndDate = Convert.ToDateTime(GetDateByPipelineId(pipelineId, ActDateType.ActDateEnd_FIELD)); } - if (PlanStartDate==null|| PlanEndDate==null) + if (PlanStartDate == null || PlanEndDate == null) { mdoel.State = 0; UpdatePipeline(mdoel); return; } - if (ActStartDate==null&&DateTime.Compare(DateTime.Now,PlanStartDate.Value)<0) + if (ActStartDate == null && DateTime.Compare(DateTime.Now, PlanStartDate.Value) < 0) { mdoel.State = 0; } - else if(ActStartDate == null && DateTime.Compare(DateTime.Now, PlanStartDate.Value) > 0) + else if (ActStartDate == null && DateTime.Compare(DateTime.Now, PlanStartDate.Value) > 0) { mdoel.State = 1; } - else if (ActStartDate!=null && DateTime.Compare(ActStartDate.Value, PlanStartDate.Value)<0 && ActEndDate==null) + else if (ActStartDate != null && DateTime.Compare(ActStartDate.Value, PlanStartDate.Value) < 0 && ActEndDate == null) { mdoel.State = 2; } @@ -138,7 +138,7 @@ namespace BLL /// public static string GetDateByPipelineId(object pipelineId, ActDateType actDateType) { - string result =""; + string result = ""; string _pipelineId = pipelineId.ToString(); string ActDateStart_Shop = ""; string ActDateEnd_Shop = ""; @@ -149,15 +149,16 @@ namespace BLL var joints = BLL.WeldJointService.GetWeldJointsByPipelineId(_pipelineId); int joint_Shop_count = joints.Where(x => x.JointAttribute == "预制口").Count(); int joint_Field_count = joints.Where(x => x.JointAttribute == "安装口").Count(); - var TaskJoints = (from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == pipemodel.ProjectId && x.PipelineCode == pipemodel.PipelineCode && x.WeldingDailyId!=null - select x).ToList(); + var TaskJoints = (from x in Funs.DB.View_HJGL_WeldingTask + where x.ProjectId == pipemodel.ProjectId && x.PipelineCode == pipemodel.PipelineCode && x.WeldingDailyId != null + select x).ToList(); var TaskJoints_Shop = TaskJoints.Where(x => x.JointAttribute == "预制口").ToList(); - var TaskJoints_Field= TaskJoints.Where(x => x.JointAttribute == "安装口").ToList(); - if (TaskJoints_Shop.Count>0) + var TaskJoints_Field = TaskJoints.Where(x => x.JointAttribute == "安装口").ToList(); + if (TaskJoints_Shop.Count > 0) { ActDateStart_Shop = TaskJoints_Shop.OrderBy(x => x.TaskDate).First().TaskDate.Value.ToShortDateString(); } - if (joint_Shop_count== TaskJoints_Shop.Count&& joint_Shop_count>0) + if (joint_Shop_count == TaskJoints_Shop.Count && joint_Shop_count > 0) { ActDateEnd_Shop = TaskJoints_Shop.OrderByDescending(x => x.TaskDate).First().TaskDate.Value.Date.ToShortDateString(); } @@ -194,14 +195,14 @@ namespace BLL /// public static void UpdataDateByWeldJointId(string WeldJointId) { - - DateTime ? ActDateStart_FIELD = new DateTime(); - DateTime ? ActDateEnd_FIELD = new DateTime(); + + DateTime? ActDateStart_FIELD = new DateTime(); + DateTime? ActDateEnd_FIELD = new DateTime(); string JointAttribute = ""; - var model_joint=BLL.WeldJointService.GetWeldJointByWeldJointId(WeldJointId); - if (model_joint!=null) + var model_joint = BLL.WeldJointService.GetWeldJointByWeldJointId(WeldJointId); + if (model_joint != null) { JointAttribute = model_joint.JointAttribute; var model_pipeline = GetPipelineByPipelineId(model_joint.PipelineId); @@ -211,7 +212,7 @@ namespace BLL select x).ToList(); switch (JointAttribute) { - + case "安装口": int joint_Field_count = joints.Where(x => x.JointAttribute == "安装口").Count(); var TaskJoints_Field = TaskJoints.Where(x => x.JointAttribute == "安装口").ToList(); @@ -231,8 +232,8 @@ namespace BLL break; } - } - + } + } /// /// 根据管线code获取管线信息 @@ -251,8 +252,8 @@ namespace BLL public static List GetHJGL_PipelineList(HJGL_Pipeline model) { var db = Funs.DB; - var pipelineList =( from x in Funs.DB.HJGL_Pipeline - where + var pipelineList = (from x in Funs.DB.HJGL_Pipeline + where (string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId)) && (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId)) && (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode)) @@ -260,15 +261,15 @@ namespace BLL && (string.IsNullOrEmpty(model.DesignPress) || x.DesignPress.Contains(model.DesignPress)) /* && (string.IsNullOrEmpty(model.MaterialCode) || x.MaterialCode.Contains(model.MaterialCode))*/ select x).ToList(); - if (model.IsFinished!=null) + if (model.IsFinished != null) { - if (model.IsFinished==true) + if (model.IsFinished == true) { - pipelineList= pipelineList.Where(x => x.IsFinished == true).ToList(); + pipelineList = pipelineList.Where(x => x.IsFinished == true).ToList(); } else { - pipelineList = pipelineList.Where(x => x.IsFinished == false||x.IsFinished==null).ToList(); + pipelineList = pipelineList.Where(x => x.IsFinished == false || x.IsFinished == null).ToList(); } @@ -338,16 +339,17 @@ namespace BLL /// /// /// - public static List GetNoComPipelinesByUnitWordId(string unitworkId) + public static List GetNoComPipelinesByUnitWordId(string unitworkId) { var q = (from x in Funs.DB.View_HJGL_WeldJoint - where x.UnitWorkId == unitworkId - select new { - PipelineId=x.PipelineId, - WeldingDate=x.WeldingDate, - PipelineCode=x.PipelineCode + where x.UnitWorkId == unitworkId + select new + { + PipelineId = x.PipelineId, + WeldingDate = x.WeldingDate, + PipelineCode = x.PipelineCode }).Distinct(); - if (q.Count()==0) + if (q.Count() == 0) { return new List(); } @@ -359,10 +361,10 @@ namespace BLL Count = (from x2 in g where x2.WeldingDate != null && x2.WeldingDate != "" select x2).Count(), }; var NowComPipelineCode = (from x in q - join y in noCompipeline on x.PipelineId equals y.PipelineId - where y.Count == 0 - select x.PipelineCode - ).Distinct(). ToList(); + join y in noCompipeline on x.PipelineId equals y.PipelineId + where y.Count == 0 + select x.PipelineCode + ).Distinct().ToList(); return NowComPipelineCode; } /// @@ -370,7 +372,7 @@ namespace BLL /// /// /// - public static void DownPipeArea_SHOPFile(string projectid,string unitworkid) + public static void DownPipeArea_SHOPFile(string projectid, string unitworkid) { string templatePath = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut_SHOP.xlsx"; string path = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut_SHOP.xlsx"; @@ -442,7 +444,7 @@ namespace BLL ["Data"] = tb, }; MiniExcel.SaveAsByTemplate(path, templatePath, value); - HJGL_DataImportService.DownFile(path.Replace(Funs.RootPath,"") , "焊接施工计划(预制).xlsx"); + HJGL_DataImportService.DownFile(path.Replace(Funs.RootPath, ""), "焊接施工计划(预制).xlsx"); File.Delete(path); } /// @@ -451,7 +453,7 @@ namespace BLL /// /// public static void DownPipeArea_FIELDFile(string projectid, string unitworkid) - { + { string templatePath = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut2.xlsx"; string path = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut2.xlsx"; path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx"); @@ -555,10 +557,10 @@ namespace BLL q = Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.UnitWorkId == unitWorkId); return q; } - /// - /// 添加管线信息 - /// - /// + /// + /// 添加管线信息 + /// + /// public static void AddPipeline(Model.HJGL_Pipeline pipeline) { Model.SGGLDB db = Funs.DB; @@ -589,7 +591,7 @@ namespace BLL newPipeline.PCtype = pipeline.PCtype; newPipeline.MaterialId = pipeline.MaterialId; newPipeline.State = pipeline.State; - newPipeline.FlowingSection=pipeline.FlowingSection; + newPipeline.FlowingSection = pipeline.FlowingSection; db.HJGL_Pipeline.InsertOnSubmit(newPipeline); db.SubmitChanges(); } @@ -755,7 +757,7 @@ namespace BLL } } - public static void BindTreeNodes(FineUIPro.TreeNode node,string pipecode,string ProjectId,int pageSize) + public static void BindTreeNodes(FineUIPro.TreeNode node, string pipecode, string ProjectId, int pageSize) { var pipeline = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID @@ -798,7 +800,7 @@ namespace BLL /// /// /// - public static void BindTreeNodes(FineUIPro.TreeNode node, string pipecode,string MaterialCode, string ProjectId, int pageSize) + public static void BindTreeNodes(FineUIPro.TreeNode node, string pipecode, string MaterialCode, string ProjectId, int pageSize) { //var pipeline = (from x in Funs.DB.HJGL_Pipeline // where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID @@ -806,8 +808,8 @@ namespace BLL // orderby x.PipelineCode // select x).ToList(); var pipeline = (from x in Funs.DB.HJGL_Pipeline - join y in Funs.DB.HJGL_PipeLineMat.Where(m => m.MaterialCode.Contains(MaterialCode)) on x.PipelineId equals y.PipelineId - where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(pipecode) + join y in Funs.DB.HJGL_PipeLineMat.Where(m => m.MaterialCode.Contains(MaterialCode)) on x.PipelineId equals y.PipelineId + where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(pipecode) select x).Distinct().ToList(); var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId select x).ToList(); int pageindex = int.Parse(node.CommandName.Split('|')[0]); @@ -837,23 +839,29 @@ namespace BLL } } } - public static void BindTreeNodes(FineUIPro.TreeNode node,bool isExitWPQId, string pipecode, string ProjectId, int pageSize) + public static void BindTreeNodes(FineUIPro.TreeNode node, bool isExitWPQId, string pipecode, string ProjectId, int pageSize, string pipeArea) { + string pipeAreasql = string.Empty; + if (pipeArea != BLL.Const._Null) + { + pipeAreasql += " AND PipeArea='" + pipeArea + "'"; + } if (isExitWPQId) { - string strSql = "SELECT distinct PipelineId, PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL"; + string strSql = "SELECT distinct PipelineId, PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL" + pipeAreasql; List listStr = new List(); listStr.Add(new SqlParameter("@UnitWorkId", node.NodeID)); - if (!string .IsNullOrEmpty(pipecode)) + if (!string.IsNullOrEmpty(pipecode)) { strSql += " and PipelineCode=@PipelineCode "; - listStr.Add(new SqlParameter("@PipelineCode", ""+ pipecode + "")); + listStr.Add(new SqlParameter("@PipelineCode", "" + pipecode + "")); } + strSql += " order by PipelineCode"; SqlParameter[] parameter = listStr.ToArray(); System.Data.DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter); var pipeline = Funs.TableToEntity(dt); - + var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId select x).ToList(); int pageindex = int.Parse(node.CommandName.Split('|')[0]); int pageCount = int.Parse(node.CommandName.Split('|')[1]); @@ -890,6 +898,10 @@ namespace BLL && x.PipelineCode.Contains(pipecode) orderby x.PipelineCode select x).ToList(); + if (pipeArea != BLL.Const._Null) + { + pipeline = pipeline.Where(x => x.PipeArea == pipeArea).ToList(); + } var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId select x).ToList(); int pageindex = int.Parse(node.CommandName.Split('|')[0]); int pageCount = int.Parse(node.CommandName.Split('|')[1]); diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs index cfd95d31..03a74df0 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs @@ -9,7 +9,7 @@ namespace BLL { public static class WeldJointService { - public static List hJGL_WeldJoints + public static List hJGL_WeldJoints { get; @@ -66,14 +66,14 @@ namespace BLL } public static List GetWeldJointsByPipelineId(string PipelineId) { - var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId select x).ToList(); + var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId select x).ToList(); return q; } public static Model.HJGL_WeldJoint GetWeldJointsByWeldJointCode(string PipelineId, string WeldJointCode) - { - var q=(from x in Funs.DB.HJGL_WeldJoint where x.PipelineId==PipelineId && x.WeldJointCode==WeldJointCode select x ).FirstOrDefault(); - + { + var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId && x.WeldJointCode == WeldJointCode select x).FirstOrDefault(); + return q; } @@ -87,7 +87,6 @@ namespace BLL Model.SGGLDB db = Funs.DB; Model.HJGL_WeldJoint newWeldJoint = new Model.HJGL_WeldJoint { - WeldJointId = SQLHelper.GetNewID(typeof(Model.HJGL_WeldJoint)), ProjectId = weldJoint.ProjectId, PipelineId = weldJoint.PipelineId, PipelineCode = weldJoint.PipelineCode, @@ -97,7 +96,7 @@ namespace BLL Material2Id = weldJoint.Material2Id, Thickness = weldJoint.Thickness, Dia = weldJoint.Dia, - DNDia=weldJoint.DNDia, + DNDia = weldJoint.DNDia, Size = weldJoint.Size, DetectionTypeId = weldJoint.DetectionTypeId, JointArea = weldJoint.JointArea, @@ -120,18 +119,27 @@ namespace BLL Remark = weldJoint.Remark, IsTwoJoint = weldJoint.IsTwoJoint, SubmitMan = weldJoint.SubmitMan, - TwoJointType=weldJoint.TwoJointType + TwoJointType = weldJoint.TwoJointType }; - + if (!string.IsNullOrEmpty(weldJoint.WeldJointId)) + { + newWeldJoint.WeldJointId = weldJoint.WeldJointId; + } + else + { + newWeldJoint.WeldJointId = SQLHelper.GetNewID(typeof(Model.HJGL_WeldJoint)); + } db.HJGL_WeldJoint.InsertOnSubmit(newWeldJoint); db.SubmitChanges(); } public static void AddBulkWeldJoint(List weldJoints) { - Model.SGGLDB db = Funs.DB; - db.HJGL_WeldJoint.InsertAllOnSubmit(weldJoints); - db.SubmitChanges(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + db.HJGL_WeldJoint.InsertAllOnSubmit(weldJoints); + db.SubmitChanges(); + } } /// @@ -246,6 +254,24 @@ namespace BLL } } + /// + /// 二次焊口施工经理审核 + /// + /// + /// + /// + public static void UpdateJointAudit2(string jointId, string auditMan, DateTime? auditDate) + { + Model.SGGLDB db = Funs.DB; + Model.HJGL_WeldJoint newWeldJoint = db.HJGL_WeldJoint.FirstOrDefault(e => e.WeldJointId == jointId); + if (newWeldJoint != null) + { + newWeldJoint.AuditMan2 = auditMan; + newWeldJoint.AuditDate2 = auditDate; + db.SubmitChanges(); + } + } + /// /// 根据主键删除焊口信息 /// @@ -267,7 +293,7 @@ namespace BLL public static void DeleteWeldJointByPipelineId(string pipelineId) { Model.SGGLDB db = Funs.DB; - var weldline = db.HJGL_WeldJoint.Where(e => e.PipelineId == pipelineId); + var weldline = db.HJGL_WeldJoint.Where(e => e.PipelineId == pipelineId); if (weldline != null) { db.HJGL_WeldJoint.DeleteAllOnSubmit(weldline); @@ -279,7 +305,7 @@ namespace BLL /// 根据unitworkid删除焊口 /// /// - public static void DeleteWeldJointByUnitWorkId(string unitworkId) + public static void DeleteWeldJointByUnitWorkId(string unitworkId) { var oldPipeline = BLL.PipelineService.GetPipelinesByUnitWordId(unitworkId); if (oldPipeline != null) @@ -335,14 +361,14 @@ namespace BLL { Model.SGGLDB db = Funs.DB; var q = (from x in db.HJGL_WeldJoint - join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId into tt - from g in tt.DefaultIfEmpty() - where g.UnitWorkId == UnitWorkId + join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId into tt + from g in tt.DefaultIfEmpty() + where g.UnitWorkId == UnitWorkId select x).ToList(); return q; } - public static List GetWeldJointByProjectid(string ProjectId) + public static List GetWeldJointByProjectid(string ProjectId) { Model.SGGLDB db = Funs.DB; @@ -350,7 +376,7 @@ namespace BLL where x.ProjectId == ProjectId select x).ToList(); return q; - } + } /// /// 根据焊口Id获取插入焊口数 @@ -427,13 +453,14 @@ namespace BLL public static List GetViewWeldJointsBymodel(Model.View_HJGL_WeldJoint model) { var q = (from x in Funs.DB.View_HJGL_WeldJoint - where + where (string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId)) && (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId)) && (string.IsNullOrEmpty(model.PipelineId) || x.PipelineId.Contains(model.PipelineId)) && (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode)) && (string.IsNullOrEmpty(model.WeldJointCode) || x.WeldJointCode.Contains(model.WeldJointCode)) - orderby x.WeldJointCode select x).AsParallel().ToList(); + orderby x.WeldJointCode + select x).AsParallel().ToList(); return q; } /// diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs index 8949031b..24e91bfd 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs @@ -322,6 +322,14 @@ namespace BLL updateWeldJoint.BackingWelderId = null; BLL.WeldJointService.UpdateWeldJoint(updateWeldJoint); + var weldTask = BLL.WeldTaskService.GetWeldTaskByWeldJointId(weldJointId); + if (weldTask != null) + { + weldTask.CoverWelderId = null; + weldTask.BackingWelderId = null; + BLL.WeldTaskService.UpdateWeldTask(weldTask); + } + var pointBatchItems = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.WeldJointId == weldJointId select x; string pointBatchId = pointBatchItems.FirstOrDefault().PointBatchId; diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogHJGLService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogHJGLService.cs new file mode 100644 index 00000000..65e9c06e --- /dev/null +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogHJGLService.cs @@ -0,0 +1,69 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + public class ConstructionLogHJGLService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 获取施工日志焊接数据明细列表 + /// + /// + /// + /// + public static List getListData(string ConstructionLogId) + { + return (from x in db.ZHGL_ConstructionLogHJGL + where x.ConstructionLogId == ConstructionLogId + select x).ToList(); + } + + /// + /// 增加施工日志焊接数据明细 + /// + /// 施工日志焊接数据明细实体 + public static void AddConstructionLogHJGL(Model.ZHGL_ConstructionLogHJGL constructionLogHJGL) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ConstructionLogHJGL newConstructionLogHJGL = new Model.ZHGL_ConstructionLogHJGL(); + newConstructionLogHJGL.ConstructionLogHJGLId = constructionLogHJGL.ConstructionLogHJGLId; + newConstructionLogHJGL.ConstructionLogId = constructionLogHJGL.ConstructionLogId; + newConstructionLogHJGL.UnitWorkId = constructionLogHJGL.UnitWorkId; + newConstructionLogHJGL.TodayCompleteSize = constructionLogHJGL.TodayCompleteSize; + newConstructionLogHJGL.TotalCompleteSize = constructionLogHJGL.TotalCompleteSize; + newConstructionLogHJGL.TotalSize = constructionLogHJGL.TotalSize; + newConstructionLogHJGL.TotalRate = constructionLogHJGL.TotalRate; + newConstructionLogHJGL.TomorrowPlanSize = constructionLogHJGL.TomorrowPlanSize; + + db.ZHGL_ConstructionLogHJGL.InsertOnSubmit(newConstructionLogHJGL); + db.SubmitChanges(); + } + + /// + /// 根据月报id删除对应的所有施工日志焊接数据明细 + /// + /// 施工日志焊接数据明细编号 + public static void DeleteConstructionLogHJGLsByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in db.ZHGL_ConstructionLogHJGL where x.ConstructionLogId == ConstructionLogId select x).ToList(); + if (q.Count() > 0) + { + db.ZHGL_ConstructionLogHJGL.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + + /// + /// 根据月报id获取对应的所有施工日志焊接数据明细 + /// + /// 施工日志焊接数据明细编号 + public static List GetConstructionLogHJGLsByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + return (from x in db.ZHGL_ConstructionLogHJGL where x.ConstructionLogId == ConstructionLogId orderby x.UnitWorkId select x).ToList(); + } + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Check/EditSpotCheck.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Check/EditSpotCheck.aspx.cs index d999a89d..a3abb8b3 100644 --- a/SGGL/FineUIPro.Web/CQMS/Check/EditSpotCheck.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Check/EditSpotCheck.aspx.cs @@ -967,6 +967,12 @@ namespace FineUIPro.Web.CQMS.Check foreach (var item in list) { Model.WBS_ControlItemAndCycle c = BLL.ControlItemAndCycleService.GetControlItemAndCycleById(item.ControlItemAndCycleId); + Model.WBS_ControlItemInit cInit = BLL.ControlItemInitService.GetControlItemInitByCode(c.InitControlItemCode); + bool isJDItem = false; + if (cInit != null && cInit.IsJDItem.HasValue) + { + isJDItem = cInit.IsJDItem.Value; + } if (c != null) { if (!string.IsNullOrEmpty(c.HGForms) || !string.IsNullOrEmpty(c.SHForms)) @@ -980,7 +986,18 @@ namespace FineUIPro.Web.CQMS.Check { c.RealEndDate = DateTime.Now; BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c); - BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + if (isJDItem) //进度完成项 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate2(c.WorkPackageId); + } + else //非进度完成项 + { + Model.WBS_WorkPackage workPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(c.WorkPackageId); + if (workPackage.RealEndDate == null) //分部分项还未生成实际完成时间 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + } + } } else //检查多次 { @@ -989,7 +1006,18 @@ namespace FineUIPro.Web.CQMS.Check { c.RealEndDate = DateTime.Now; BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c); - BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + if (isJDItem) //进度完成项 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate2(c.WorkPackageId); + } + else //非进度完成项 + { + Model.WBS_WorkPackage workPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(c.WorkPackageId); + if (workPackage.RealEndDate == null) //分部分项还未生成实际完成时间 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + } + } } } } diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx index ab645096..19e89f0d 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx @@ -39,6 +39,15 @@ EmptyText="输入查询条件" Width="190px" LabelWidth="80px" LabelAlign="Right"> + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs index 2a96a30e..f7260c40 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs @@ -191,11 +191,15 @@ namespace FineUIPro.Web.CQMS.PersonManage rootNode.Text = item.UnitName; rootNode.EnableClickEvent = true; this.tvControlItem.Nodes.Add(rootNode); - var getWelders = (from x in Funs.DB.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkPostId == Const.WorkPost_Welder && x.States == Const.ProjectPersonStates_1 && x.UnitId == item.UnitId select x).ToList(); + var getWelders = (from x in Funs.DB.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkPostId == Const.WorkPost_Welder && x.UnitId == item.UnitId select x).ToList(); if (!string.IsNullOrEmpty(txtQueryWelderCode.Text.Trim())) { getWelders = getWelders.Where(x => x.WelderCode.Contains(txtQueryWelderCode.Text.Trim())).ToList(); } + if (!string.IsNullOrEmpty(txtName.Text.Trim())) + { + getWelders = getWelders.Where(x => x.PersonName.Contains(txtName.Text.Trim())).ToList(); + } foreach (var sitem in getWelders) { TreeNode tn = new TreeNode(); diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs index 10b5cf05..3d1b574b 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs @@ -7,13 +7,11 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.CQMS.PersonManage -{ - - - public partial class WelderManage - { - +namespace FineUIPro.Web.CQMS.PersonManage { + + + public partial class WelderManage { + /// /// form1 控件。 /// @@ -22,7 +20,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -31,7 +29,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -40,7 +38,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelLeftRegion 控件。 /// @@ -49,7 +47,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelLeftRegion; - + /// /// Toolbar3 控件。 /// @@ -58,7 +56,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar3; - + /// /// txtQueryWelderCode 控件。 /// @@ -67,7 +65,25 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtQueryWelderCode; - + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// txtName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtName; + /// /// btnQuery 控件。 /// @@ -76,7 +92,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnQuery; - + /// /// tvControlItem 控件。 /// @@ -85,7 +101,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tree tvControlItem; - + /// /// panelCenterRegion 控件。 /// @@ -94,7 +110,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelCenterRegion; - + /// /// Toolbar1 控件。 /// @@ -103,7 +119,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// ToolbarFill2 控件。 /// @@ -112,7 +128,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill2; - + /// /// btnEdit 控件。 /// @@ -121,7 +137,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnEdit; - + /// /// btnDelete 控件。 /// @@ -130,7 +146,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnDelete; - + /// /// SimpleForm1 控件。 /// @@ -139,7 +155,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// drpUnitId 控件。 /// @@ -148,7 +164,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label drpUnitId; - + /// /// txtWelderName 控件。 /// @@ -157,7 +173,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWelderName; - + /// /// txtWelderCode 控件。 /// @@ -166,7 +182,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWelderCode; - + /// /// rblSex 控件。 /// @@ -175,7 +191,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label rblSex; - + /// /// txtBirthday 控件。 /// @@ -184,7 +200,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtBirthday; - + /// /// txtCertificateCode 控件。 /// @@ -193,7 +209,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtCertificateCode; - + /// /// txtWelderLevel 控件。 /// @@ -202,7 +218,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWelderLevel; - + /// /// cbIsOnDuty 控件。 /// @@ -211,7 +227,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.CheckBox cbIsOnDuty; - + /// /// txtCertificateLimitTime 控件。 /// @@ -220,7 +236,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtCertificateLimitTime; - + /// /// Grid1 控件。 /// @@ -229,7 +245,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -238,7 +254,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// txtQualificationItem 控件。 /// @@ -247,7 +263,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtQualificationItem; - + /// /// ToolbarFill1 控件。 /// @@ -256,7 +272,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnNew 控件。 /// @@ -265,7 +281,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// ToolbarSeparator1 控件。 /// @@ -274,7 +290,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -283,7 +299,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -292,7 +308,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -301,7 +317,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Menu1 控件。 /// @@ -310,7 +326,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuAudit 控件。 /// @@ -319,7 +335,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuAudit; - + /// /// btnMenuEdit 控件。 /// @@ -328,7 +344,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + /// /// btnMenuDelete 控件。 /// @@ -337,7 +353,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuDelete; - + /// /// btnView 控件。 /// @@ -346,7 +362,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnView; - + /// /// Menu2 控件。 /// @@ -355,7 +371,7 @@ namespace FineUIPro.Web.CQMS.PersonManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu2; - + /// /// btnMenuTreeAudit 控件。 /// diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.cs index f54529fa..e72eadea 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.cs @@ -139,7 +139,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { string PersonId = Request.Params["PersonId"]; var q = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.WelderCode == this.txtWelderCode.Text.Trim() - && (x.PersonId != PersonId || (PersonId == null && PersonId != null))); + && (x.PersonId != PersonId || (PersonId == null && PersonId != null)) && x.ProjectId == this.CurrUser.LoginProjectId); if (q != null) { Alert.ShowInTop("焊工号已经存在!", MessageBoxIcon.Warning); @@ -170,7 +170,18 @@ namespace FineUIPro.Web.CQMS.PersonManage //newWelder.Sex = this.rblSex.SelectedValue; //newWelder.Birthday = Funs.GetNewDateTime(this.txtBirthday.Text.Trim()); newWelder.IdentityCard = this.txtIdentityCard.Text.Trim(); - newWelder.CertificateCode = this.txtCertificateCode.Text.Trim(); + if (!string.IsNullOrEmpty(this.txtCertificateCode.Text.Trim())) + { + newWelder.CertificateCode = this.txtCertificateCode.Text.Trim(); + } + else + { + var welder = BLL.SitePerson_PersonService.GetSitePersonByProjectIdPersonId(this.CurrUser.LoginProjectId, PersonId); + if (welder != null) + { + newWelder.CertificateCode = welder.IdentityCard; + } + } //newWelder.CertificateLimitTime = Funs.GetNewDateTime(this.txtCertificateLimitTime.Text.Trim()); newWelder.WelderLevel = this.txtWelderLevel.Text.Trim(); //if (this.cbIsOnDuty.Checked) @@ -184,10 +195,10 @@ namespace FineUIPro.Web.CQMS.PersonManage newWelder.Remark = this.txtRemark.Text.Trim(); //newWelder.PhotoUrl = this.PhotoAttachUrl; newWelder.Isprint = "0"; - // newWelder.IsUsed = true; + // newWelder.IsUsed = true; if (!string.IsNullOrEmpty(PersonId)) { - if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text)) + if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text, this.CurrUser.LoginProjectId)) { newWelder.PersonId = PersonId; BLL.WelderService.UpdateWelder(newWelder); @@ -201,7 +212,7 @@ namespace FineUIPro.Web.CQMS.PersonManage else { PersonId = SQLHelper.GetNewID(typeof(Model.SitePerson_Person)); - if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text)) + if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text, this.CurrUser.LoginProjectId)) { newWelder.PersonId = PersonId; // BLL.WelderService.AddWelder(newWelder); diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx index 2c8dd5ea..668efa6b 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx @@ -77,6 +77,11 @@ + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.cs index d81af6f6..d1e2ae7e 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.cs @@ -102,6 +102,10 @@ namespace FineUIPro.Web.CQMS.WBS this.txtSHForms.Text = controlItem.SHForms; this.txtStandard.Text = controlItem.Standard; this.txtClauseNo.Text = controlItem.ClauseNo; + if (controlItem.IsJDItem == true) + { + this.cbIsJDItem.Checked = true; + } } } } @@ -130,6 +134,7 @@ namespace FineUIPro.Web.CQMS.WBS newControlItem.SHForms = this.txtSHForms.Text.Trim(); newControlItem.Standard = this.txtStandard.Text.Trim(); newControlItem.ClauseNo = this.txtClauseNo.Text.Trim(); + newControlItem.IsJDItem = this.cbIsJDItem.Checked; if (Request.Params["type"] == "add") { BLL.ControlItemInitService.AddControlItemInit(newControlItem); diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.designer.cs index 52473a32..e21574dd 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitEdit.aspx.designer.cs @@ -147,6 +147,15 @@ namespace FineUIPro.Web.CQMS.WBS { /// protected global::FineUIPro.TextBox txtClauseNo; + /// + /// cbIsJDItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox cbIsJDItem; + /// /// Toolbar1 控件。 /// diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx index 05076cf0..488f2215 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx @@ -88,6 +88,7 @@ + diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx.cs index 4bad54d8..b2a3a6e2 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemInitSet.aspx.cs @@ -455,7 +455,7 @@ namespace FineUIPro.Web.CQMS.WBS /// private void BindGrid() { - string strSql = @"SELECT ControlItemCode,WorkPackageCode,ControlItemContent,ControlPoint,ControlItemDef,Weights,HGForms,SHForms,Standard,ClauseNo" + string strSql = @"SELECT ControlItemCode,WorkPackageCode,ControlItemContent,ControlPoint,ControlItemDef,Weights,HGForms,SHForms,Standard,ClauseNo,IsJDItem" + @" FROM WBS_ControlItemInit "; List listStr = new List(); strSql += " where WorkPackageCode = @WorkPackageCode"; diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/WorkPackageSet2.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/WorkPackageSet2.aspx index 9a9ee096..843cbead 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/WorkPackageSet2.aspx +++ b/SGGL/FineUIPro.Web/CQMS/WBS/WorkPackageSet2.aspx @@ -41,6 +41,7 @@ + @@ -115,7 +116,7 @@ diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs index 7486a93c..54592b9b 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs @@ -17,7 +17,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage public partial class WeldJointList : PageBase { public int pageSize = PipelineService.pageSize; - public static List WeldJointlist = new List(); + public static List WeldJointlist = new List(); /// /// 预制口总达因 /// @@ -40,7 +40,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (!IsPostBack) { - // WeldJointlist = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId); + // WeldJointlist = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId); this.InitTreeMenu();//加载树 //显示列 //Model.Sys_UserShowColumns c = BLL.UserShowColumnsService.GetColumnsByUserId(this.CurrUser.PersonId, "Joint"); @@ -111,8 +111,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage //} //else //{ - unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); - unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); + unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); + unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); //} if (unitWork1.Count() > 0) @@ -143,8 +143,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId - && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) + int a = (from x in Funs.DB.HJGL_Pipeline + where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId +&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) select x).Count(); var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); TreeNode tn2 = new TreeNode(); @@ -157,7 +158,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn2.ToolTip = "施工单位:" + unitNamesUnitIds; tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn2.EnableExpandEvent = true; - tn2.EnableClickEvent= true; + tn2.EnableClickEvent = true; rootNode2.Nodes.Add(tn2); if (a > 0) { @@ -175,7 +176,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage #region private void BindNodes(TreeNode node) { - BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId,pageSize); + BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize); } #endregion @@ -188,7 +189,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } //e.Node.Nodes.Clear(); - + //if (e.Node.CommandName == "单位工程") //{ // var pipeline = (from x in Funs.DB.HJGL_Pipeline @@ -196,7 +197,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage // orderby x.PipelineCode // select x).ToList(); // var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); - + // // var WeldJointlist = (from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId == e.Node.NodeID && x.IsTwoJoint == null select x).ToList(); // foreach (var item in pipeline) @@ -210,7 +211,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage // e.Node.Nodes.Add(newNode); // } - + //} } @@ -266,7 +267,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage this.lbFiledSum.Text = FieldSum; } } - + } #endregion @@ -411,29 +412,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage #endregion #region 预制率计算 - private string GetRateByUnitWork(string unitworkid) + private string GetRateByUnitWork(string unitworkid) { var db = Funs.DB; - var q=from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x ; + var q = from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x; string rate = ""; ShopSumSize = "0"; FieldSumSize = "0"; - if (q!=null&&q.Count()>0) + if (q != null && q.Count() > 0) { var proSum = (from x in q - where x.JointAttribute == "预制口" + where x.JointAttribute == "预制口" group x by x.UnitWorkId into g select new { SizeSum = g.Sum(x => x.Size) }).FirstOrDefault()?.SizeSum; var FieldSum = (from x in q - where x.JointAttribute == "安装口" - group x by x.UnitWorkId into g - select new - { - SizeSum = g.Sum(x => x.Size) - }).FirstOrDefault()?.SizeSum; + where x.JointAttribute == "安装口" + group x by x.UnitWorkId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault()?.SizeSum; var AllSum = (from x in q group x by x.UnitWorkId into g select new @@ -442,14 +443,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage }).FirstOrDefault()?.SizeSum; proSum = (proSum != null) ? proSum : 0; FieldSum = (FieldSum != null) ? FieldSum : 0; - ShopSumSize = proSum.ToString() ; - FieldSumSize = FieldSum.ToString() ; - if (AllSum>0) + ShopSumSize = proSum.ToString(); + FieldSumSize = FieldSum.ToString(); + if (AllSum > 0) { var a = (decimal)100 * proSum / AllSum; - rate = Math.Round((decimal)a, 1).ToString()+"%"; + rate = Math.Round((decimal)a, 1).ToString() + "%"; } - + return rate; } return "0%"; @@ -496,28 +497,28 @@ namespace FineUIPro.Web.HJGL.WeldingManage var q = from x in db.View_HJGL_WeldJoint where x.PipelineId == pipelineid select x; if (q != null && q.Count() > 0) { - var proSumModel= (from x in q - where x.JointAttribute == "预制口" - group x by x.PipelineId into g - select new - { - SizeSum = g.Sum(x => x.Size) - }).FirstOrDefault(); - var proSum= (proSumModel !=null) ? proSumModel.SizeSum : 0; + var proSumModel = (from x in q + where x.JointAttribute == "预制口" + group x by x.PipelineId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault(); + var proSum = (proSumModel != null) ? proSumModel.SizeSum : 0; var FieldSumModel = (from x in q - where x.JointAttribute == "安装口" - group x by x.PipelineId into g - select new - { - SizeSum = g.Sum(x => x.Size) - }).FirstOrDefault(); - var FieldSum= (FieldSumModel != null) ? FieldSumModel.SizeSum : 0; + where x.JointAttribute == "安装口" + group x by x.PipelineId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault(); + var FieldSum = (FieldSumModel != null) ? FieldSumModel.SizeSum : 0; var AllSumModel = (from x in q - group x by x.PipelineId into g - select new - { - SizeSum = g.Sum(x => x.Size) - }).FirstOrDefault(); + group x by x.PipelineId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault(); var AllSum = (AllSumModel != null) ? AllSumModel.SizeSum : 0; proSum = (proSum != null) ? proSum : 0; @@ -529,7 +530,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage var a = (decimal)100 * proSum / AllSum; rate = Math.Round((decimal)a, 1).ToString() + "%"; } - + return rate; } return "0%"; @@ -549,13 +550,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage var q = from x in db.View_HJGL_WeldJoint where x.PipelineId == pipelineid select x; if (q != null && q.Count() > 0) { - shopNum = (from x in q - where x.JointAttribute == "预制口" select x - ).Count(); - fieldNum = (from x in q - where x.JointAttribute == "安装口" - select x - ).Count(); + shopNum = (from x in q + where x.JointAttribute == "预制口" + select x + ).Count(); + fieldNum = (from x in q + where x.JointAttribute == "安装口" + select x + ).Count(); ShopSum = shopNum.ToString(); FieldSum = fieldNum.ToString(); AllNum = shopNum + fieldNum; @@ -765,6 +767,38 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } + protected void btnMenuPipeLineAllDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete)) + { + if (this.tvControlItem.SelectedNode.CommandName != "管线") + { + Alert.ShowInTop("请选择一条管线!", MessageBoxIcon.Warning); + return; + } + string pipelineId = this.tvControlItem.SelectedNodeID; + var weldJoints = from x in Funs.DB.HJGL_WeldJoint + where x.PipelineId == pipelineId && x.WeldingDailyId != null + select x; + if (weldJoints.Count() > 0) + { + Alert.ShowInTop("存在已焊接的焊口,无法删除管线!", MessageBoxIcon.Warning); + return; + } + BLL.WeldJointService.DeleteWeldJointByPipelineId(pipelineId); + BLL.PipelineService.DeletePipeline(pipelineId); + //BLL.Sys_LogService.AddLog(BLL.Const.System_6, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_PipelineMenuId, Const.BtnDelete, rowID); + ShowNotify("删除成功!", MessageBoxIcon.Success); + + + this.InitTreeMenu(); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + protected void btnDelMat_Click(object sender, EventArgs e) { if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete)) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs index 85574aad..7ba41839 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs @@ -7,13 +7,11 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HJGL.WeldingManage -{ - - - public partial class WeldJointList - { - +namespace FineUIPro.Web.HJGL.WeldingManage { + + + public partial class WeldJointList { + /// /// form1 控件。 /// @@ -22,7 +20,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -31,7 +29,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -40,7 +38,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelLeftRegion 控件。 /// @@ -49,7 +47,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelLeftRegion; - + /// /// Toolbar1 控件。 /// @@ -58,7 +56,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// tvPipeCode 控件。 /// @@ -67,7 +65,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox tvPipeCode; - + /// /// hdUnitWorkId 控件。 /// @@ -76,7 +74,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdUnitWorkId; - + /// /// btnTreeFind 控件。 /// @@ -85,7 +83,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnTreeFind; - + /// /// tvControlItem 控件。 /// @@ -94,7 +92,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tree tvControlItem; - + /// /// Panel2 控件。 /// @@ -103,7 +101,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel2; - + /// /// panelCenterRegion 控件。 /// @@ -112,7 +110,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelCenterRegion; - + /// /// Toolbar3 控件。 /// @@ -121,7 +119,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar3; - + /// /// txtWeldJointCode 控件。 /// @@ -130,7 +128,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtWeldJointCode; - + /// /// txtMaterialCode 控件。 /// @@ -139,7 +137,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtMaterialCode; - + /// /// ToolbarFill1 控件。 /// @@ -148,7 +146,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnNew 控件。 /// @@ -157,7 +155,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// btnPrint 控件。 /// @@ -166,7 +164,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnPrint; - + /// /// btnImport 控件。 /// @@ -175,7 +173,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnImport; - + /// /// btnUpdateImport 控件。 /// @@ -184,7 +182,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnUpdateImport; - + /// /// btnPDMSImport 控件。 /// @@ -193,7 +191,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnPDMSImport; - + /// /// btnMatImport 控件。 /// @@ -202,7 +200,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnMatImport; - + /// /// Toolbar2 控件。 /// @@ -211,7 +209,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// lbSinglePreRate 控件。 /// @@ -220,7 +218,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbSinglePreRate; - + /// /// lbShopSize 控件。 /// @@ -229,7 +227,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbShopSize; - + /// /// lbFiledSize 控件。 /// @@ -238,7 +236,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbFiledSize; - + /// /// Label2 控件。 /// @@ -247,7 +245,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label Label2; - + /// /// lbSinglePreRateByWeldJoint 控件。 /// @@ -256,7 +254,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbSinglePreRateByWeldJoint; - + /// /// lbShopSum 控件。 /// @@ -265,7 +263,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbShopSum; - + /// /// lbFiledSum 控件。 /// @@ -274,7 +272,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbFiledSum; - + /// /// Grid1 控件。 /// @@ -283,7 +281,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Label1 控件。 /// @@ -292,7 +290,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label1; - + /// /// panelBottomRegion 控件。 /// @@ -301,7 +299,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelBottomRegion; - + /// /// TabStrip1 控件。 /// @@ -310,7 +308,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TabStrip TabStrip1; - + /// /// TabJoint 控件。 /// @@ -319,7 +317,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tab TabJoint; - + /// /// Grid3 控件。 /// @@ -328,7 +326,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid3; - + /// /// TabPipeMat 控件。 /// @@ -337,7 +335,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tab TabPipeMat; - + /// /// Grid2 控件。 /// @@ -346,7 +344,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid2; - + /// /// Window1 控件。 /// @@ -355,7 +353,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Window2 控件。 /// @@ -364,7 +362,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window2; - + /// /// Window3 控件。 /// @@ -373,7 +371,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window3; - + /// /// Window4 控件。 /// @@ -382,7 +380,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window4; - + /// /// Window5 控件。 /// @@ -391,7 +389,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window5; - + /// /// Menu1 控件。 /// @@ -400,7 +398,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuPipeLineEdit 控件。 /// @@ -409,7 +407,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuPipeLineEdit; - + /// /// btnMenuPipeLineDelete 控件。 /// @@ -418,7 +416,25 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuPipeLineDelete; - + + /// + /// Menu4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu4; + + /// + /// btnMenuPipeLineAllDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuPipeLineAllDelete; + /// /// Menu2 控件。 /// @@ -427,7 +443,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu2; - + /// /// btnDelMat 控件。 /// @@ -436,7 +452,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnDelMat; - + /// /// Menu3 控件。 /// @@ -445,7 +461,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu3; - + /// /// btnMenuEdit 控件。 /// @@ -454,7 +470,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + /// /// btnMenuInsert 控件。 /// @@ -463,7 +479,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuInsert; - + /// /// btnView 控件。 /// @@ -472,7 +488,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnView; - + /// /// btnMenuDelete 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx index d5b6d26e..e6b9af9d 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx @@ -11,6 +11,16 @@
+ + + + + + + + + @@ -139,6 +149,10 @@ + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.cs index beb00aa8..aa9b5c05 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.cs @@ -160,5 +160,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } + + protected void btnAttachUrl_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/WeldJoint&menuId={1}&type=-1", Request.Params["WeldJointId"], BLL.Const.HJGL_WeldJointMenuId))); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.designer.cs index e1b7b5f5..0c2ce3e5 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointView.aspx.designer.cs @@ -30,6 +30,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// protected global::FineUIPro.PageManager PageManager1; + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachUrl; + /// /// GroupPanel3 控件。 /// @@ -281,5 +299,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox hdGrooveType; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; } } diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs index cd36c6bd..9c6bbf37 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs @@ -439,7 +439,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } BLL.WeldingDailyService.DeleteWeldingDaily(weldingDailyId); - //BLL.Sys_LogService.AddLog(BLL.Const.System_6, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldReportMenuId, Const.BtnDelete, weldingDailyId); + BLL.LogService.AddLog(this.CurrUser.PersonId, "删除焊接日报"); ShowNotify("删除成功!", MessageBoxIcon.Success); this.InitTreeMenu(); this.BindGrid(); diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx index 905b5a2e..5285e86a 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx @@ -153,6 +153,13 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -427,6 +477,16 @@ function reloadGrid() { __doPostBack(null, 'reloadGrid'); } + + function onGridAfterEdit(event, value, params) { + var me = this, columnId = params.columnId, rowId = params.rowId; + updateSummary(); + } + + function updateSummary() { + // 回发到后台更新 + __doPostBack('', 'UPDATE_SUMMARY'); + } diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs index da9630c4..0c6bd3b8 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs @@ -131,9 +131,78 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now); this.InitTreeMenu(); } + else + { + if (GetRequestEventArgument() == "UPDATE_SUMMARY") + { + // 页面要求重新计算合计行的值 + OutputSummaryData(); + } + } } #endregion + private void OutputSummaryData() + { + List list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ','); + int[] sum1 = new int[list.Count]; + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + for (int i = 0; i < list.Count; i++) + { + sum1[i] += Funs.GetNewIntOrZero(values.Value("Num" + i.ToString())); + } + } + JObject summary1 = new JObject(); + summary1.Add("UnitWorkName", "合计"); + for (int i = 0; i < list.Count; i++) + { + summary1.Add("Num" + i.ToString(), sum1[i]); + } + Grid1.SummaryData = summary1; + + List list2 = Funs.GetStrListByStr(this.hdMachineId.Text, ','); + int[] sum2 = new int[list2.Count]; + foreach (JObject mergedRow in Grid2.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + for (int i = 0; i < list2.Count; i++) + { + sum2[i] += Funs.GetNewIntOrZero(values.Value("Num" + i.ToString())); + } + } + JObject summary2 = new JObject(); + summary2.Add("UnitWorkName", "合计"); + for (int i = 0; i < list2.Count; i++) + { + summary2.Add("Num" + i.ToString(), sum2[i]); + } + Grid2.SummaryData = summary2; + decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0; + foreach (JObject mergedRow in Grid6.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + sumTodayCompleteSize += Funs.GetNewDecimalOrZero(values.Value("TodayCompleteSize")); + sumTotalCompleteSize += Funs.GetNewDecimalOrZero(values.Value("TotalCompleteSize")); + sumTotalSize += Funs.GetNewDecimalOrZero(values.Value("TotalSize")); + sumTomorrowPlanSize += Funs.GetNewDecimalOrZero(values.Value("TomorrowPlanSize")); + } + string sumRate = "/"; + if (sumTotalSize > 0) + { + sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%"; + } + JObject summary3 = new JObject(); + summary3.Add("UnitWorkName", "合计"); + summary3.Add("TodayCompleteSize", sumTodayCompleteSize); + summary3.Add("TotalCompleteSize", sumTotalCompleteSize); + summary3.Add("TotalSize", sumTotalSize); + summary3.Add("TotalRate", sumRate); + summary3.Add("TomorrowPlanSize", sumTomorrowPlanSize); + Grid6.SummaryData = summary3; + } + #region 加载树装置-单位-工作区 /// /// 加载树 @@ -516,7 +585,19 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.Grid5.DataSource = records; this.Grid5.DataBind(); } + var hjgls = BLL.ConstructionLogHJGLService.GetConstructionLogHJGLsByConstructionLogId(ConstructionLogId); + if (hjgls.Count > 0) + { + this.Grid6.DataSource = hjgls; + this.Grid6.DataBind(); + } + else + { + this.Grid6.DataSource = null; + this.Grid6.DataBind(); + } ChangeText(); + OutputSummaryData(); } } @@ -619,6 +700,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.Grid5.DataBind(); drpUnitWork_SelectedIndexChanged(null, null); ChangeText(); + OutputSummaryData(); } private void TextEmpty() @@ -652,6 +734,8 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.Grid4.DataBind(); this.Grid5.DataSource = null; this.Grid5.DataBind(); + this.Grid6.DataSource = null; + this.Grid6.DataBind(); } #endregion @@ -1036,6 +1120,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject sheet.AddMergedRegion(new CellRangeAddress(8, 8, 0, 1 + list.Count)); int rowCount = 10; List unitWorklist = Funs.GetStrListByStr(log.UnitWorks, ','); + int[] sum1 = new int[list.Count]; for (int i = 0; i < unitWorklist.Count; i++) { row1 = sheet.GetRow(rowCount + i); @@ -1053,10 +1138,25 @@ namespace FineUIPro.Web.PZHGL.InformationProject if (person != null && person.Num != null) { cell3.SetCellValue(person.Num.ToString()); + sum1[j] += Funs.GetNewIntOrZero(person.Num.ToString()); } } } rowCount += unitWorklist.Count; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + for (int i = 0; i < sum1.Length; i++) + { + cell3 = row1.CreateCell(i + 2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sum1[i].ToString()); + } + rowCount++; int rowMachineTitle = rowCount; row1 = sheet.GetRow(rowCount); cell3 = row1.CreateCell(0); @@ -1082,6 +1182,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject cell3.CellStyle = cellStyle0; sheet.AddMergedRegion(new CellRangeAddress(rowMachineTitle, rowMachineTitle, 0, 1 + list2.Count)); rowCount++; + int[] sum2 = new int[list2.Count]; for (int i = 0; i < unitWorklist.Count; i++) { row1 = sheet.GetRow(rowCount + i); @@ -1099,12 +1200,126 @@ namespace FineUIPro.Web.PZHGL.InformationProject if (machine != null && machine.Num != null) { cell3.SetCellValue(machine.Num.ToString()); + sum2[j] += Funs.GetNewIntOrZero(machine.Num.ToString()); } } } rowCount += unitWorklist.Count; row1 = sheet.GetRow(rowCount); cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + for (int i = 0; i < sum2.Length; i++) + { + cell3 = row1.CreateCell(i + 2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sum2[i].ToString()); + } + rowCount++; + int rowHJGLTitle = rowCount; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle3; + cell3.SetCellValue("焊接数据"); + rowCount++; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("序号"); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("单位工程"); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("今日完成(DIN)"); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("累计完成(DIN)"); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("总量(DIN)"); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("累计完成百分比"); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("明日计划(DIN)"); + row1 = sheet.GetRow(rowHJGLTitle); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + sheet.AddMergedRegion(new CellRangeAddress(rowHJGLTitle, rowHJGLTitle, 0, 6)); + rowCount++; + var hjgls = (from x in db.ZHGL_ConstructionLogHJGL + where x.ConstructionLogId == constructionLogId + orderby x.UnitWorkId + select x).ToList(); + if (hjgls.Count > 0) + { + decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0; + for (int i = 0; i < hjgls.Count; i++) + { + row1 = sheet.GetRow(rowCount + i); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue((i + 1).ToString()); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(hjgls[i].UnitWorkId)); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TodayCompleteSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalCompleteSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalRate); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TomorrowPlanSize.Value.ToString("0.###")); + sumTodayCompleteSize += hjgls[i].TodayCompleteSize.Value; + sumTotalCompleteSize += hjgls[i].TotalCompleteSize.Value; + sumTotalSize += hjgls[i].TotalSize.Value; + sumTomorrowPlanSize += hjgls[i].TomorrowPlanSize.Value; + } + rowCount += hjgls.Count; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTodayCompleteSize.ToString("0.###")); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTotalCompleteSize.ToString("0.###")); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTotalSize.ToString("0.###")); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + string sumRate = "/"; + if (sumTotalSize > 0) + { + sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%"; + } + cell3.SetCellValue(sumRate); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTomorrowPlanSize.ToString("0.###")); + rowCount++; + } + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); cell3.CellStyle = cellStyle3; cell3.SetCellValue("专业管理"); cell3 = row1.CreateCell(2); @@ -1884,6 +2099,22 @@ namespace FineUIPro.Web.PZHGL.InformationProject newItem.Remark = values.Value("Remark"); ConstructionLogRecordService.AddConstructionLogRecord(newItem); } + BLL.ConstructionLogHJGLService.DeleteConstructionLogHJGLsByConstructionLogId(this.ConstructionLogId); + foreach (JObject mergedRow in Grid6.GetMergedData()) //需要协调解决的问题 + { + Model.ZHGL_ConstructionLogHJGL newItem = new Model.ZHGL_ConstructionLogHJGL(); + int i = mergedRow.Value("index"); + JObject values = mergedRow.Value("values"); + newItem.ConstructionLogHJGLId = SQLHelper.GetNewID(); + newItem.ConstructionLogId = this.ConstructionLogId; + newItem.UnitWorkId = values.Value("UnitWorkId"); + newItem.TodayCompleteSize = Funs.GetNewDecimalOrZero(values.Value("TodayCompleteSize")); + newItem.TotalCompleteSize = Funs.GetNewDecimalOrZero(values.Value("TotalCompleteSize")); + newItem.TotalSize = Funs.GetNewDecimalOrZero(values.Value("TotalSize")); + newItem.TotalRate = values.Value("TotalRate"); + newItem.TomorrowPlanSize = Funs.GetNewDecimalOrZero(values.Value("TomorrowPlanSize")); + ConstructionLogHJGLService.AddConstructionLogHJGL(newItem); + } ShowNotify("保存成功!", MessageBoxIcon.Success); InitTreeMenu(); } @@ -1939,6 +2170,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject BLL.ConstructionLogWorkEfficiencyService.DeleteConstructionLogWorkEfficiencysByConstructionLogId(ConstructionLogId); BLL.ConstructionLogPersonService.DeleteConstructionLogPersonsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogMachineService.DeleteConstructionLogMachinesByConstructionLogId(ConstructionLogId); + BLL.ConstructionLogHJGLService.DeleteConstructionLogHJGLsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogManagementService.DeleteConstructionLogManagementsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogProblemService.DeleteConstructionLogProblemsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogRecordService.DeleteConstructionLogRecordsByConstructionLogId(ConstructionLogId); @@ -2016,6 +2248,8 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.Grid3.DataBind(); this.Grid4.DataSource = null; this.Grid4.DataBind(); + this.Grid6.DataSource = null; + this.Grid6.DataBind(); } else { @@ -2045,6 +2279,47 @@ namespace FineUIPro.Web.PZHGL.InformationProject } this.Grid2.DataSource = machines; this.Grid2.DataBind(); + DateTime today = DateTime.Now.Date; + if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim())) + { + today = Convert.ToDateTime(this.txtCompileDate.Text.Trim()).Date; + } + Model.SGGLDB db = Funs.DB; + var allWeldJoints = from x in db.View_HJGL_WeldJoint + where x.ProjectId == this.CurrUser.LoginProjectId + select new + { + x.UnitWorkId, + x.WeldJointId, + Size = x.Size ?? 0, + x.WeldingDateD, + }; + List hjgls = new List(); + foreach (var item in this.drpUnitWork.SelectedValueArray) + { + if (item != BLL.Const._Null) + { + Model.ZHGL_ConstructionLogHJGL hjgl = new Model.ZHGL_ConstructionLogHJGL(); + hjgl.ConstructionLogHJGLId = SQLHelper.GetNewID(); + hjgl.UnitWorkId = item; + hjgl.TodayCompleteSize = allWeldJoints.Where(x => x.UnitWorkId == item && x.WeldingDateD == today).ToList().Sum(x => x.Size); + decimal totalCompleteSize = allWeldJoints.Where(x => x.UnitWorkId == item && x.WeldingDateD <= today).ToList().Sum(x => x.Size); + hjgl.TotalCompleteSize = totalCompleteSize; + decimal totalSize = allWeldJoints.Where(x => x.UnitWorkId == item).ToList().Sum(x => x.Size); + hjgl.TotalSize = totalSize; + if (totalSize > 0) + { + hjgl.TotalRate = decimal.Round(totalCompleteSize / totalSize * 100, 2) + "%"; + } + else + { + hjgl.TotalRate = "/"; + } + hjgls.Add(hjgl); + } + } + this.Grid6.DataSource = hjgls; + this.Grid6.DataBind(); List managements = new List(); foreach (var item in this.drpUnitWork.SelectedValueArray) { diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.designer.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.designer.cs index b223ac56..950849bc 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.designer.cs @@ -309,6 +309,33 @@ namespace FineUIPro.Web.PZHGL.InformationProject { /// protected global::System.Web.UI.WebControls.Label Label2; + /// + /// Grid6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid6; + + /// + /// Label5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label5; + + /// + /// nbTomorrowPlanSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox nbTomorrowPlanSize; + /// /// Grid3 控件。 /// diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx index 864e788e..44d7be9c 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx @@ -96,7 +96,7 @@ @@ -116,7 +116,7 @@ @@ -132,6 +132,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ','); + int[] sum1 = new int[list.Count]; + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + for (int i = 0; i < list.Count; i++) + { + sum1[i] += Funs.GetNewIntOrZero(values.Value("Num" + i.ToString())); + } + } + JObject summary1 = new JObject(); + summary1.Add("UnitWorkName", "合计"); + for (int i = 0; i < list.Count; i++) + { + summary1.Add("Num" + i.ToString(), sum1[i]); + } + Grid1.SummaryData = summary1; + + List list2 = Funs.GetStrListByStr(this.hdMachineId.Text, ','); + int[] sum2 = new int[list2.Count]; + foreach (JObject mergedRow in Grid2.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + for (int i = 0; i < list2.Count; i++) + { + sum2[i] += Funs.GetNewIntOrZero(values.Value("Num" + i.ToString())); + } + } + JObject summary2 = new JObject(); + summary2.Add("UnitWorkName", "合计"); + for (int i = 0; i < list2.Count; i++) + { + summary2.Add("Num" + i.ToString(), sum2[i]); + } + Grid2.SummaryData = summary2; + decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0; + foreach (JObject mergedRow in Grid6.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + sumTodayCompleteSize += Funs.GetNewDecimalOrZero(values.Value("TodayCompleteSize")); + sumTotalCompleteSize += Funs.GetNewDecimalOrZero(values.Value("TotalCompleteSize")); + sumTotalSize += Funs.GetNewDecimalOrZero(values.Value("TotalSize")); + sumTomorrowPlanSize += Funs.GetNewDecimalOrZero(values.Value("TomorrowPlanSize")); + } + string sumRate = "/"; + if (sumTotalSize > 0) + { + sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%"; + } + JObject summary3 = new JObject(); + summary3.Add("UnitWorkName", "合计"); + summary3.Add("TodayCompleteSize", sumTodayCompleteSize); + summary3.Add("TotalCompleteSize", sumTotalCompleteSize); + summary3.Add("TotalSize", sumTotalSize); + summary3.Add("TotalRate", sumRate); + summary3.Add("TomorrowPlanSize", sumTomorrowPlanSize); + Grid6.SummaryData = summary3; + } + #region 加载 /// /// 加载页面 @@ -546,6 +607,18 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.Grid5.DataSource = records; this.Grid5.DataBind(); } + var hjgls = BLL.ConstructionLogHJGLService.GetConstructionLogHJGLsByConstructionLogId(ConstructionLogId); + if (hjgls.Count > 0) + { + this.Grid6.DataSource = hjgls; + this.Grid6.DataBind(); + } + else + { + this.Grid6.DataSource = null; + this.Grid6.DataBind(); + } + OutputSummaryData(); } } @@ -1059,6 +1132,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject sheet.AddMergedRegion(new CellRangeAddress(8, 8, 0, 1 + list.Count)); int rowCount = 10; List unitWorklist = Funs.GetStrListByStr(log.UnitWorks, ','); + int[] sum1 = new int[list.Count]; for (int i = 0; i < unitWorklist.Count; i++) { row1 = sheet.GetRow(rowCount + i); @@ -1076,10 +1150,25 @@ namespace FineUIPro.Web.PZHGL.InformationProject if (person != null && person.Num != null) { cell3.SetCellValue(person.Num.ToString()); + sum1[j] += Funs.GetNewIntOrZero(person.Num.ToString()); } } } rowCount += unitWorklist.Count; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + for (int i = 0; i < sum1.Length; i++) + { + cell3 = row1.CreateCell(i + 2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sum1[i].ToString()); + } + rowCount++; int rowMachineTitle = rowCount; row1 = sheet.GetRow(rowCount); cell3 = row1.CreateCell(0); @@ -1105,6 +1194,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject cell3.CellStyle = cellStyle0; sheet.AddMergedRegion(new CellRangeAddress(rowMachineTitle, rowMachineTitle, 0, 1 + list2.Count)); rowCount++; + int[] sum2 = new int[list2.Count]; for (int i = 0; i < unitWorklist.Count; i++) { row1 = sheet.GetRow(rowCount + i); @@ -1122,12 +1212,126 @@ namespace FineUIPro.Web.PZHGL.InformationProject if (machine != null && machine.Num != null) { cell3.SetCellValue(machine.Num.ToString()); + sum2[j] += Funs.GetNewIntOrZero(machine.Num.ToString()); } } } rowCount += unitWorklist.Count; row1 = sheet.GetRow(rowCount); cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + for (int i = 0; i < sum2.Length; i++) + { + cell3 = row1.CreateCell(i + 2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sum2[i].ToString()); + } + rowCount++; + int rowHJGLTitle = rowCount; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle3; + cell3.SetCellValue("焊接数据"); + rowCount++; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("序号"); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("单位工程"); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("今日完成(DIN)"); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("累计完成(DIN)"); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("总量(DIN)"); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("累计完成百分比"); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("明日计划(DIN)"); + row1 = sheet.GetRow(rowHJGLTitle); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + sheet.AddMergedRegion(new CellRangeAddress(rowHJGLTitle, rowHJGLTitle, 0, 6)); + rowCount++; + var hjgls = (from x in db.ZHGL_ConstructionLogHJGL + where x.ConstructionLogId == constructionLogId + orderby x.UnitWorkId + select x).ToList(); + if (hjgls.Count > 0) + { + decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0; + for (int i = 0; i < hjgls.Count; i++) + { + row1 = sheet.GetRow(rowCount + i); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue((i + 1).ToString()); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(hjgls[i].UnitWorkId)); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TodayCompleteSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalCompleteSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalRate); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TomorrowPlanSize.Value.ToString("0.###")); + sumTodayCompleteSize += hjgls[i].TodayCompleteSize.Value; + sumTotalCompleteSize += hjgls[i].TotalCompleteSize.Value; + sumTotalSize += hjgls[i].TotalSize.Value; + sumTomorrowPlanSize += hjgls[i].TomorrowPlanSize.Value; + } + rowCount += hjgls.Count; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTodayCompleteSize.ToString("0.###")); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTotalCompleteSize.ToString("0.###")); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTotalSize.ToString("0.###")); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + string sumRate = "/"; + if (sumTotalSize > 0) + { + sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%"; + } + cell3.SetCellValue(sumRate); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTomorrowPlanSize.ToString("0.###")); + rowCount++; + } + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); cell3.CellStyle = cellStyle3; cell3.SetCellValue("专业管理"); cell3 = row1.CreateCell(2); @@ -1953,6 +2157,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject { BLL.ConstructionLogPersonService.DeleteConstructionLogPersonsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogMachineService.DeleteConstructionLogMachinesByConstructionLogId(ConstructionLogId); + BLL.ConstructionLogHJGLService.DeleteConstructionLogHJGLsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogManagementService.DeleteConstructionLogManagementsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogProblemService.DeleteConstructionLogProblemsByConstructionLogId(ConstructionLogId); BLL.ConstructionLogRecordService.DeleteConstructionLogRecordsByConstructionLogId(ConstructionLogId); diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.designer.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.designer.cs index 4469893b..9ecbdb5d 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.designer.cs @@ -282,6 +282,24 @@ namespace FineUIPro.Web.PZHGL.InformationProject { /// protected global::System.Web.UI.WebControls.Label Label2; + /// + /// Grid6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid6; + + /// + /// Label5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label5; + /// /// Grid3 控件。 /// diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx index 92428c7a..148622aa 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx @@ -102,7 +102,7 @@ @@ -122,7 +122,7 @@ @@ -138,6 +138,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + list = Funs.GetStrListByStr(this.hdWorkPostId.Text, ','); + int[] sum1 = new int[list.Count]; + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + for (int i = 0; i < list.Count; i++) + { + sum1[i] += Funs.GetNewIntOrZero(values.Value("Num" + i.ToString())); + } + } + JObject summary1 = new JObject(); + summary1.Add("UnitWorkName", "合计"); + for (int i = 0; i < list.Count; i++) + { + summary1.Add("Num" + i.ToString(), sum1[i]); + } + Grid1.SummaryData = summary1; + + List list2 = Funs.GetStrListByStr(this.hdMachineId.Text, ','); + int[] sum2 = new int[list2.Count]; + foreach (JObject mergedRow in Grid2.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + for (int i = 0; i < list2.Count; i++) + { + sum2[i] += Funs.GetNewIntOrZero(values.Value("Num" + i.ToString())); + } + } + JObject summary2 = new JObject(); + summary2.Add("UnitWorkName", "合计"); + for (int i = 0; i < list2.Count; i++) + { + summary2.Add("Num" + i.ToString(), sum2[i]); + } + Grid2.SummaryData = summary2; + decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0; + foreach (JObject mergedRow in Grid6.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + sumTodayCompleteSize += Funs.GetNewDecimalOrZero(values.Value("TodayCompleteSize")); + sumTotalCompleteSize += Funs.GetNewDecimalOrZero(values.Value("TotalCompleteSize")); + sumTotalSize += Funs.GetNewDecimalOrZero(values.Value("TotalSize")); + sumTomorrowPlanSize += Funs.GetNewDecimalOrZero(values.Value("TomorrowPlanSize")); + } + string sumRate = "/"; + if (sumTotalSize > 0) + { + sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%"; + } + JObject summary3 = new JObject(); + summary3.Add("UnitWorkName", "合计"); + summary3.Add("TodayCompleteSize", sumTodayCompleteSize); + summary3.Add("TotalCompleteSize", sumTotalCompleteSize); + summary3.Add("TotalSize", sumTotalSize); + summary3.Add("TotalRate", sumRate); + summary3.Add("TomorrowPlanSize", sumTomorrowPlanSize); + Grid6.SummaryData = summary3; + } + #region 加载 /// /// 加载页面 @@ -364,6 +425,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.GridCQMSTomorrowPlan.DataBind(); } ChangeText(); + OutputSummaryData(); } } @@ -509,6 +571,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.Grid5.DataBind(); drpUnitWork_SelectedIndexChanged(null, null); ChangeText(); + OutputSummaryData(); } private void TextEmpty() @@ -822,6 +885,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject cell3.CellStyle = cellStyle0; sheet.AddMergedRegion(new CellRangeAddress(8, 8, 0, 1 + list.Count)); int rowCount = 10; + int[] sum1 = new int[list.Count]; List unitWorklist = Funs.GetStrListByStr(log.UnitWorks, ','); for (int i = 0; i < unitWorklist.Count; i++) { @@ -839,9 +903,24 @@ namespace FineUIPro.Web.PZHGL.InformationProject int num = 0; num = persons.Where(x => x.UnitWorkId == unitWorklist[i] && x.WorkPostId == list[j]).ToList().Sum(x => x.Num ?? 0); cell3.SetCellValue(num.ToString()); + sum1[j] += Funs.GetNewIntOrZero(num.ToString()); } } rowCount += unitWorklist.Count; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + for (int i = 0; i < sum1.Length; i++) + { + cell3 = row1.CreateCell(i + 2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sum1[i].ToString()); + } + rowCount++; int rowMachineTitle = rowCount; row1 = sheet.GetRow(rowCount); cell3 = row1.CreateCell(0); @@ -867,6 +946,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject cell3.CellStyle = cellStyle0; sheet.AddMergedRegion(new CellRangeAddress(rowMachineTitle, rowMachineTitle, 0, 1 + list2.Count)); rowCount++; + int[] sum2 = new int[list2.Count]; for (int i = 0; i < unitWorklist.Count; i++) { row1 = sheet.GetRow(rowCount + i); @@ -883,11 +963,125 @@ namespace FineUIPro.Web.PZHGL.InformationProject int num = 0; num = machines.Where(x => x.UnitWorkId == unitWorklist[i] && x.MachineId == list2[j]).ToList().Sum(x => x.Num ?? 0); cell3.SetCellValue(num.ToString()); + sum2[j] += Funs.GetNewIntOrZero(num.ToString()); } } rowCount += unitWorklist.Count; row1 = sheet.GetRow(rowCount); cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + for (int i = 0; i < sum2.Length; i++) + { + cell3 = row1.CreateCell(i + 2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sum2[i].ToString()); + } + rowCount++; + int rowHJGLTitle = rowCount; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle3; + cell3.SetCellValue("焊接数据"); + rowCount++; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("序号"); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("单位工程"); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("今日完成(DIN)"); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("累计完成(DIN)"); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("总量(DIN)"); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("累计完成百分比"); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("明日计划(DIN)"); + row1 = sheet.GetRow(rowHJGLTitle); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + sheet.AddMergedRegion(new CellRangeAddress(rowHJGLTitle, rowHJGLTitle, 0, 6)); + rowCount++; + var hjgls = (from x in db.ZHGL_ConstructionLogHJGL + where personLogIds.Contains(x.ConstructionLogId) + orderby x.UnitWorkId + select x).ToList(); + if (hjgls.Count > 0) + { + decimal sumTodayCompleteSize = 0, sumTotalCompleteSize = 0, sumTotalSize = 0, sumTomorrowPlanSize = 0; + for (int i = 0; i < hjgls.Count; i++) + { + row1 = sheet.GetRow(rowCount + i); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue((i + 1).ToString()); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(BLL.UnitWorkService.GetUnitWorkName(hjgls[i].UnitWorkId)); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TodayCompleteSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalCompleteSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalSize.Value.ToString("0.###")); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TotalRate); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(hjgls[i].TomorrowPlanSize.Value.ToString("0.###")); + sumTodayCompleteSize += hjgls[i].TodayCompleteSize.Value; + sumTotalCompleteSize += hjgls[i].TotalCompleteSize.Value; + sumTotalSize += hjgls[i].TotalSize.Value; + sumTomorrowPlanSize += hjgls[i].TomorrowPlanSize.Value; + } + rowCount += hjgls.Count; + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(""); + cell3 = row1.CreateCell(1); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue("合计"); + cell3 = row1.CreateCell(2); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTodayCompleteSize.ToString("0.###")); + cell3 = row1.CreateCell(3); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTotalCompleteSize.ToString("0.###")); + cell3 = row1.CreateCell(4); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTotalSize.ToString("0.###")); + cell3 = row1.CreateCell(5); + cell3.CellStyle = cellStyle0; + string sumRate = "/"; + if (sumTotalSize > 0) + { + sumRate = decimal.Round(sumTotalCompleteSize / sumTotalSize * 100, 2) + "%"; + } + cell3.SetCellValue(sumRate); + cell3 = row1.CreateCell(6); + cell3.CellStyle = cellStyle0; + cell3.SetCellValue(sumTomorrowPlanSize.ToString("0.###")); + rowCount++; + } + row1 = sheet.GetRow(rowCount); + cell3 = row1.CreateCell(0); cell3.CellStyle = cellStyle3; cell3.SetCellValue("专业管理"); cell3 = row1.CreateCell(2); @@ -1948,6 +2142,9 @@ namespace FineUIPro.Web.PZHGL.InformationProject var allRecords = from x in db.ZHGL_ConstructionLogRecord where personLogIds.Contains(x.ConstructionLogId) select x; + var allHJGLs = from x in db.ZHGL_ConstructionLogHJGL + where personLogIds.Contains(x.ConstructionLogId) + select x; List personItems = new List(); List workPostList = Funs.GetStrListByStr(this.hdWorkPostId.Text, ','); workPostList.Distinct(); @@ -2171,6 +2368,8 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.Grid4.DataBind(); this.Grid5.DataSource = allRecords; this.Grid5.DataBind(); + this.Grid6.DataSource = allHJGLs; + this.Grid6.DataBind(); } } diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.designer.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.designer.cs index 6c7e24bb..368124a0 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.designer.cs @@ -300,6 +300,24 @@ namespace FineUIPro.Web.PZHGL.InformationProject { /// protected global::System.Web.UI.WebControls.Label Label2; + /// + /// Grid6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid6; + + /// + /// Label12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label12; + /// /// Grid3 控件。 /// diff --git a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml index 65eed927..89357168 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml @@ -60,6 +60,7 @@ + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml index c0fc81f0..95eeab91 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml @@ -7,6 +7,8 @@ + + @@ -14,7 +16,10 @@ - + + + + diff --git a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml index eb672a76..31955789 100644 --- a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml @@ -17,19 +17,20 @@ - - - - - - - - - + + + + + + + + + + - + diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 03eb9188..91287096 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -53,7 +53,12 @@ - + + + + + + diff --git a/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx b/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx new file mode 100644 index 00000000..e3f3a568 --- /dev/null +++ b/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx @@ -0,0 +1,174 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mainMenu_HJGL3.aspx.cs" Inherits="FineUIPro.Web.common.mainMenu_HJGL3" %> + + + + + + 焊接进度统计 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx.cs b/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx.cs new file mode 100644 index 00000000..ca5e2f58 --- /dev/null +++ b/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx.cs @@ -0,0 +1,334 @@ +using BLL; +using MiniExcelLibs; +using Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; + +namespace FineUIPro.Web.common +{ + public partial class mainMenu_HJGL3 : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.InitTreeMenu();//加载树 + BindGrid1(); + } + } + + #region 加载树装置-单位-工作区 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + TreeNode rootNode1 = new TreeNode(); + rootNode1.NodeID = "1"; + rootNode1.Text = "建筑工程"; + rootNode1.CommandName = "建筑工程"; + rootNode1.Selectable = false; + this.tvControlItem.Nodes.Add(rootNode1); + + TreeNode rootNode2 = new TreeNode(); + rootNode2.NodeID = "2"; + rootNode2.Text = "安装工程"; + rootNode2.CommandName = "安装工程"; + rootNode2.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode2); + + var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + // 获取当前用户所在单位 + var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId); + + var unitWorkList = (from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null + select x).ToList(); + + List unitWork1 = null; + List unitWork2 = null; + + //// 当前为施工单位,只能操作本单位的数据 + //if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2) + //{ + // unitWork1 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1" + // select x).ToList(); + // unitWork2 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2" + // select x).ToList(); + //} + //else + //{ + unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); + unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); + //} + + if (unitWork1.Count() > 0) + { + foreach (var q in unitWork1) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn1 = new TreeNode(); + tn1.NodeID = q.UnitWorkId; + tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn1.ToolTip = "施工单位:" + unitNamesUnitIds; + tn1.EnableClickEvent = true; + rootNode1.Nodes.Add(tn1); + } + } + if (unitWork2.Count() > 0) + { + foreach (var q in unitWork2) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn2 = new TreeNode(); + tn2.NodeID = q.UnitWorkId; + tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn2.ToolTip = "施工单位:" + unitNamesUnitIds; + tn2.EnableClickEvent = true; + rootNode2.Nodes.Add(tn2); + } + } + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID.Length > 1) + { + this.BindGrid2(this.tvControlItem.SelectedNodeID); + } + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + private void BindGrid1() + { + string strSql = @"select ProjectId,TotalDin,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0 + ELSE 100.0 * ISNULL(FinishSize,0)/(1.0 * TotalDin) END) AS DECIMAL(8,2))))+'%' + AS Rate from + (select ProjectId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint WHERE ProjectId=b.ProjectId) AS DECIMAL(12,3)) AS TotalDin, + CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot WHERE ProjectId=b.ProjectId AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(12,3)) AS FinishSize + from Base_Project b) v where ProjectId=@ProjectId "; + + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", (CurrUser != null) ? CurrUser.LoginProjectId : "")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[0].ToString()); + decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[1].ToString()); + decimal notCompleteDin = totalDin - finishSize; + this.lbNotCompleteDinTotal.Text = notCompleteDin.ToString(); + } + + /// + /// 数据绑定 + /// + private void BindGrid2(string unitWorkId) + { + string strSql = @"select '工厂预制' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0 + ELSE 100.0 * ISNULL(FinishSize,0)/(1.0 * TotalDin) END) AS DECIMAL(8,2))))+'%' + AS Rate from + (select UnitWorkId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1') AS DECIMAL(12,3)) AS TotalDin, + CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='1' AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(12,3)) AS FinishSize + from WBS_UnitWork b) v where UnitWorkId=@UnitWorkId +union +select '现场安装' as PipeArea,UnitWorkId,TotalDin,FinishSize,CONVERT(NVARCHAR(10),(CAST((CASE ISNULL(TotalDin,0) WHEN 0 THEN 0 + ELSE 100.0 * ISNULL(FinishSize,0)/(1.0 * TotalDin) END) AS DECIMAL(8,2))))+'%' + AS Rate from + (select UnitWorkId,CAST((SELECT ISNULL(SUM(ISNULL(Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='2') AS DECIMAL(12,3)) AS TotalDin, + CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot left join dbo.HJGL_Pipeline pipeline on jot.PipelineId=pipeline.PipelineId WHERE pipeline.UnitWorkId=b.UnitWorkId and PipeArea='2' AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(12,3)) AS FinishSize + from WBS_UnitWork b) v where UnitWorkId=@UnitWorkId"; + + List listStr = new List(); + listStr.Add(new SqlParameter("@UnitWorkId", unitWorkId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid2.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid2.FilteredData, tb); + var table = GetPagedDataTable(Grid2, tb); + Grid2.DataSource = table; + Grid2.DataBind(); + decimal totalDin1 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[1].ToString()); + decimal finishSize1 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[2].ToString()); + decimal notCompleteDin1 = totalDin1 - finishSize1; + this.lbNotCompleteDin1.Text = notCompleteDin1.ToString(); + decimal totalDin2 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[1].ToString()); + decimal finishSize2 = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[2].ToString()); + decimal notCompleteDin2 = totalDin2 - finishSize2; + this.lbNotCompleteDin2.Text = notCompleteDin2.ToString(); + } + #endregion + + /// + /// 查询 + /// + /// + /// + protected void btnQuery1_Click(object sender, EventArgs e) + { + if (this.tvControlItem.SelectedNodeID.Length > 1) + { + if (string.IsNullOrEmpty(this.txtLeaveDay1.Text.Trim())) + { + ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(this.txtWorkEfficiency1.Text.Trim())) + { + ShowNotify("请输入日工效!", MessageBoxIcon.Warning); + return; + } + decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[1].ToString()); + decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid2.Rows[0].Values[2].ToString()); + decimal notCompleteDin = totalDin - finishSize; + this.lbNotCompleteDin1.Text = notCompleteDin.ToString(); + decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDay1.Text.Trim()); + decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiency1.Text.Trim()); + if (notCompleteDin > 0) + { + if (leaveDay == 0) + { + ShowNotify("剩余工期(天)为0!", MessageBoxIcon.Warning); + return; + } + if (workEfficiency == 0) + { + ShowNotify("日工效为0!", MessageBoxIcon.Warning); + return; + } + this.lbNeedWelderNum1.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString(); + } + else + { + ShowNotify("工厂预制未完成达因为0!", MessageBoxIcon.Warning); + return; + } + } + else + { + ShowNotify("请选择单位工程", MessageBoxIcon.Warning); + return; + } + } + + /// + /// 查询 + /// + /// + /// + protected void btnQuery2_Click(object sender, EventArgs e) + { + if (this.tvControlItem.SelectedNodeID.Length > 1) + { + if (string.IsNullOrEmpty(this.txtLeaveDay1.Text.Trim())) + { + ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(this.txtWorkEfficiency1.Text.Trim())) + { + ShowNotify("请输入日工效!", MessageBoxIcon.Warning); + return; + } + decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[1].ToString()); + decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid2.Rows[1].Values[2].ToString()); + decimal notCompleteDin = totalDin - finishSize; + this.lbNotCompleteDin2.Text = notCompleteDin.ToString(); + decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDay2.Text.Trim()); + decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiency2.Text.Trim()); + if (notCompleteDin > 0) + { + if (leaveDay == 0) + { + ShowNotify("剩余工期(天)为0!", MessageBoxIcon.Warning); + return; + } + if (workEfficiency == 0) + { + ShowNotify("日工效为0!", MessageBoxIcon.Warning); + return; + } + this.lbNeedWelderNum2.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString(); + } + else + { + ShowNotify("现场安装未完成达因为0!", MessageBoxIcon.Warning); + return; + } + } + else + { + ShowNotify("请选择单位工程", MessageBoxIcon.Warning); + return; + } + } + + /// + /// 查询 + /// + /// + /// + protected void btnQueryTotal_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.txtLeaveDayTotal.Text.Trim())) + { + ShowNotify("请输入剩余工期(天)!", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(this.txtWorkEfficiencyTotal.Text.Trim())) + { + ShowNotify("请输入日工效!", MessageBoxIcon.Warning); + return; + } + decimal totalDin = Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[0].ToString()); + decimal finishSize = Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[1].ToString()); + decimal notCompleteDin = totalDin - finishSize; + decimal leaveDay = Funs.GetNewDecimalOrZero(this.txtLeaveDayTotal.Text.Trim()); + decimal workEfficiency = Funs.GetNewDecimalOrZero(this.txtWorkEfficiencyTotal.Text.Trim()); + if (notCompleteDin > 0) + { + if (leaveDay == 0) + { + ShowNotify("剩余工期(天)为0!", MessageBoxIcon.Warning); + return; + } + if (workEfficiency == 0) + { + ShowNotify("日工效为0!", MessageBoxIcon.Warning); + return; + } + this.lbNeedWelderNumTotal.Text = Convert.ToInt32(Math.Ceiling(notCompleteDin / leaveDay / workEfficiency)).ToString(); + } + else + { + ShowNotify("未完成达因为0!", MessageBoxIcon.Warning); + return; + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx.designer.cs b/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx.designer.cs new file mode 100644 index 00000000..899587dc --- /dev/null +++ b/SGGL/FineUIPro.Web/common/mainMenu_HJGL3.aspx.designer.cs @@ -0,0 +1,285 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.common { + + + public partial class mainMenu_HJGL3 { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panel6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panel6; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panel3; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// panel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panel5; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// lbNotCompleteDinTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbNotCompleteDinTotal; + + /// + /// txtLeaveDayTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtLeaveDayTotal; + + /// + /// txtWorkEfficiencyTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtWorkEfficiencyTotal; + + /// + /// lbNeedWelderNumTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbNeedWelderNumTotal; + + /// + /// btnQueryTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQueryTotal; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panel4; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// lbNotCompleteDin1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbNotCompleteDin1; + + /// + /// txtLeaveDay1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtLeaveDay1; + + /// + /// txtWorkEfficiency1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtWorkEfficiency1; + + /// + /// lbNeedWelderNum1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbNeedWelderNum1; + + /// + /// btnQuery1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery1; + + /// + /// lbNotCompleteDin2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbNotCompleteDin2; + + /// + /// txtLeaveDay2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtLeaveDay2; + + /// + /// txtWorkEfficiency2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtWorkEfficiency2; + + /// + /// lbNeedWelderNum2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbNeedWelderNum2; + + /// + /// btnQuery2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery2; + } +} diff --git a/SGGL/FineUIPro.Web/indexProject.aspx.cs b/SGGL/FineUIPro.Web/indexProject.aspx.cs index 480dbe5c..93643687 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx.cs +++ b/SGGL/FineUIPro.Web/indexProject.aspx.cs @@ -618,7 +618,7 @@ namespace FineUIPro.Web } else if (type == Const.Menu_HJGL) { - this.Tab1.IFrameUrl = "~/common/mainMenu_HJGL_AVEVA.aspx"; + this.Tab1.IFrameUrl = "~/common/mainMenu_HJGL3.aspx"; } else if (type == Const.Menu_PZHGL) { diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 7d4e7dde..6d6f8e78 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -1715,6 +1715,9 @@ namespace Model partial void InsertZHGL_ConstructionLog(ZHGL_ConstructionLog instance); partial void UpdateZHGL_ConstructionLog(ZHGL_ConstructionLog instance); partial void DeleteZHGL_ConstructionLog(ZHGL_ConstructionLog instance); + partial void InsertZHGL_ConstructionLogHJGL(ZHGL_ConstructionLogHJGL instance); + partial void UpdateZHGL_ConstructionLogHJGL(ZHGL_ConstructionLogHJGL instance); + partial void DeleteZHGL_ConstructionLogHJGL(ZHGL_ConstructionLogHJGL instance); partial void InsertZHGL_ConstructionLogMachine(ZHGL_ConstructionLogMachine instance); partial void UpdateZHGL_ConstructionLogMachine(ZHGL_ConstructionLogMachine instance); partial void DeleteZHGL_ConstructionLogMachine(ZHGL_ConstructionLogMachine instance); @@ -7081,6 +7084,14 @@ namespace Model } } + public System.Data.Linq.Table ZHGL_ConstructionLogHJGL + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table ZHGL_ConstructionLogMachine { get @@ -39527,10 +39538,10 @@ namespace Model private string _SaveHandleMan; - private string _WorkPackageName; - private string _WorkPackageId; + private string _WorkPackageName; + private EntityRef _Base_Project; private EntityRef _Person_Persons; @@ -39587,10 +39598,10 @@ namespace Model partial void OnProposeUnitIdChanged(); partial void OnSaveHandleManChanging(string value); partial void OnSaveHandleManChanged(); - partial void OnWorkPackageNameChanging(string value); - partial void OnWorkPackageNameChanged(); partial void OnWorkPackageIdChanging(string value); partial void OnWorkPackageIdChanged(); + partial void OnWorkPackageNameChanging(string value); + partial void OnWorkPackageNameChanged(); #endregion public Check_CheckControl() @@ -40069,26 +40080,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageName", DbType="NVarChar(2000)")] - public string WorkPackageName - { - get - { - return this._WorkPackageName; - } - set - { - if ((this._WorkPackageName != value)) - { - this.OnWorkPackageNameChanging(value); - this.SendPropertyChanging(); - this._WorkPackageName = value; - this.SendPropertyChanged("WorkPackageName"); - this.OnWorkPackageNameChanged(); - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageId", DbType="NVarChar(2000)")] public string WorkPackageId { @@ -40109,6 +40100,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageName", DbType="NVarChar(2000)")] + public string WorkPackageName + { + get + { + return this._WorkPackageName; + } + set + { + if ((this._WorkPackageName != value)) + { + this.OnWorkPackageNameChanging(value); + this.SendPropertyChanging(); + this._WorkPackageName = value; + this.SendPropertyChanged("WorkPackageName"); + this.OnWorkPackageNameChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_CheckControl_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -97548,6 +97559,10 @@ namespace Model private string _DNDia; + private string _AuditMan2; + + private System.Nullable _AuditDate2; + private EntitySet _HJGL_Batch_BatchTrustItem; private EntitySet _HJGL_Batch_PointBatchItem; @@ -97686,6 +97701,10 @@ namespace Model partial void OnTwoJointTypeChanged(); partial void OnDNDiaChanging(string value); partial void OnDNDiaChanged(); + partial void OnAuditMan2Changing(string value); + partial void OnAuditMan2Changed(); + partial void OnAuditDate2Changing(System.Nullable value); + partial void OnAuditDate2Changed(); #endregion public HJGL_WeldJoint() @@ -98675,6 +98694,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuditMan2", DbType="NVarChar(50)")] + public string AuditMan2 + { + get + { + return this._AuditMan2; + } + set + { + if ((this._AuditMan2 != value)) + { + this.OnAuditMan2Changing(value); + this.SendPropertyChanging(); + this._AuditMan2 = value; + this.SendPropertyChanged("AuditMan2"); + this.OnAuditMan2Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuditDate2", DbType="DateTime")] + public System.Nullable AuditDate2 + { + get + { + return this._AuditDate2; + } + set + { + if ((this._AuditDate2 != value)) + { + this.OnAuditDate2Changing(value); + this.SendPropertyChanging(); + this._AuditDate2 = value; + this.SendPropertyChanged("AuditDate2"); + this.OnAuditDate2Changed(); + } + } + } + [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 { @@ -100759,10 +100818,10 @@ namespace Model private string _HazardValue; - private string _WorkPackageName; - private string _WorkPackageId; + private string _WorkPackageName; + private EntityRef _Base_Unit; private EntityRef _HSSE_Hazard_HazardRegisterTypes; @@ -100863,10 +100922,10 @@ namespace Model partial void OnRegisterTypes4IdChanged(); partial void OnHazardValueChanging(string value); partial void OnHazardValueChanged(); - partial void OnWorkPackageNameChanging(string value); - partial void OnWorkPackageNameChanged(); partial void OnWorkPackageIdChanging(string value); partial void OnWorkPackageIdChanged(); + partial void OnWorkPackageNameChanging(string value); + partial void OnWorkPackageNameChanged(); #endregion public HSSE_Hazard_HazardRegister() @@ -101804,26 +101863,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageName", DbType="NVarChar(2000)")] - public string WorkPackageName - { - get - { - return this._WorkPackageName; - } - set - { - if ((this._WorkPackageName != value)) - { - this.OnWorkPackageNameChanging(value); - this.SendPropertyChanging(); - this._WorkPackageName = value; - this.SendPropertyChanged("WorkPackageName"); - this.OnWorkPackageNameChanged(); - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageId", DbType="NVarChar(2000)")] public string WorkPackageId { @@ -101844,6 +101883,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageName", DbType="NVarChar(2000)")] + public string WorkPackageName + { + get + { + return this._WorkPackageName; + } + set + { + if ((this._WorkPackageName != value)) + { + this.OnWorkPackageNameChanging(value); + this.SendPropertyChanging(); + this._WorkPackageName = value; + this.SendPropertyChanged("WorkPackageName"); + this.OnWorkPackageNameChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HSSE_Hazard_HazardRegister_Base_Unit", Storage="_Base_Unit", ThisKey="ResponsibleUnit", OtherKey="UnitId", IsForeignKey=true)] public Base_Unit Base_Unit { @@ -182212,7 +182271,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDescription", DbType="VarChar(255)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDescription", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)] public string ProjectDescription { get @@ -182332,7 +182391,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalculationRule", DbType="VarChar(255)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalculationRule", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)] public string CalculationRule { get @@ -182392,7 +182451,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionSubcontractor", DbType="VarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionSubcontractor", DbType="VarChar(100)")] public string ConstructionSubcontractor { get @@ -269024,6 +269083,8 @@ namespace Model private string _DetectionTypeId; + private string _DetectionRateId; + private string _PointBatchCode; private string _UnitWorkId; @@ -269168,6 +269229,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DetectionRateId", DbType="NVarChar(50)")] + public string DetectionRateId + { + get + { + return this._DetectionRateId; + } + set + { + if ((this._DetectionRateId != value)) + { + this._DetectionRateId = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PointBatchCode", DbType="NVarChar(100)")] public string PointBatchCode { @@ -273580,6 +273657,8 @@ namespace Model private string _TwoJointType; + private string _PipeArea; + private System.Nullable _WeldingDateD; private string _WeldingDate; @@ -273630,8 +273709,12 @@ namespace Model private string _AuditMan; + private string _AuditMan2; + private System.Nullable _AuditDate; + private System.Nullable _AuditDate2; + private string _WeldingLocationCode; private string _IsWelding; @@ -274762,6 +274845,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipeArea", DbType="NChar(1)")] + public string PipeArea + { + get + { + return this._PipeArea; + } + set + { + if ((this._PipeArea != value)) + { + this._PipeArea = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldingDateD", DbType="DateTime")] public System.Nullable WeldingDateD { @@ -275162,6 +275261,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuditMan2", DbType="NVarChar(50)")] + public string AuditMan2 + { + get + { + return this._AuditMan2; + } + set + { + if ((this._AuditMan2 != value)) + { + this._AuditMan2 = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuditDate", DbType="DateTime")] public System.Nullable AuditDate { @@ -275178,6 +275293,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AuditDate2", DbType="DateTime")] + public System.Nullable AuditDate2 + { + get + { + return this._AuditDate2; + } + set + { + if ((this._AuditDate2 != value)) + { + this._AuditDate2 = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldingLocationCode", DbType="NVarChar(50)")] public string WeldingLocationCode { @@ -293035,6 +293166,8 @@ namespace Model private string _ShowId; + private System.Nullable _DrawProjectQuantity; + private string _ProjectId; public View_WBS() @@ -293089,7 +293222,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(200)")] public string Name { get @@ -293329,6 +293462,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawProjectQuantity", DbType="Decimal(18,2)")] + public System.Nullable DrawProjectQuantity + { + get + { + return this._DrawProjectQuantity; + } + set + { + if ((this._DrawProjectQuantity != value)) + { + this._DrawProjectQuantity = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] public string ProjectId { @@ -293650,7 +293799,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] public string PackageContent { get @@ -293841,7 +293990,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] public string PackageContent { get @@ -296594,6 +296743,8 @@ namespace Model private string _CheckAcceptType; + private System.Nullable _IsJDItem; + private EntityRef _WBS_WorkPackageInit; #region 可扩展性方法定义 @@ -296622,6 +296773,8 @@ namespace Model partial void OnClauseNoChanged(); partial void OnCheckAcceptTypeChanging(string value); partial void OnCheckAcceptTypeChanged(); + partial void OnIsJDItemChanging(System.Nullable value); + partial void OnIsJDItemChanged(); #endregion public WBS_ControlItemInit() @@ -296854,6 +297007,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsJDItem", DbType="Bit")] + public System.Nullable IsJDItem + { + get + { + return this._IsJDItem; + } + set + { + if ((this._IsJDItem != value)) + { + this.OnIsJDItemChanging(value); + this.SendPropertyChanging(); + this._IsJDItem = value; + this.SendPropertyChanged("IsJDItem"); + this.OnIsJDItemChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_ControlItemInit_WBS_WorkPackageInit", Storage="_WBS_WorkPackageInit", ThisKey="WorkPackageCode", OtherKey="WorkPackageCode", IsForeignKey=true)] public WBS_WorkPackageInit WBS_WorkPackageInit { @@ -298934,6 +299107,8 @@ namespace Model private string _WBSCode; + private System.Nullable _DrawProjectQuantity; + private EntitySet _WBS_ControlItemAndCycle; private EntityRef _WBS_UnitWork; @@ -299006,6 +299181,8 @@ namespace Model partial void OnPreWorkCodeChanged(); partial void OnWBSCodeChanging(string value); partial void OnWBSCodeChanged(); + partial void OnDrawProjectQuantityChanging(System.Nullable value); + partial void OnDrawProjectQuantityChanged(); #endregion public WBS_WorkPackage() @@ -299100,7 +299277,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] public string PackageContent { get @@ -299640,6 +299817,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawProjectQuantity", DbType="Decimal(18,2)")] + public System.Nullable DrawProjectQuantity + { + get + { + return this._DrawProjectQuantity; + } + set + { + if ((this._DrawProjectQuantity != value)) + { + this.OnDrawProjectQuantityChanging(value); + this.SendPropertyChanging(); + this._DrawProjectQuantity = value; + this.SendPropertyChanged("DrawProjectQuantity"); + this.OnDrawProjectQuantityChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_ControlItemAndCycle_WBS_ControlItemAndCycle", Storage="_WBS_ControlItemAndCycle", ThisKey="WorkPackageId", OtherKey="WorkPackageId", DeleteRule="NO ACTION")] public EntitySet WBS_ControlItemAndCycle { @@ -304391,6 +304588,8 @@ namespace Model private EntityRef _Base_Project; + private EntitySet _ZHGL_ConstructionLogHJGL; + private EntitySet _ZHGL_ConstructionLogMachine; private EntitySet _ZHGL_ConstructionLogManagement; @@ -304454,6 +304653,7 @@ namespace Model public ZHGL_ConstructionLog() { this._Base_Project = default(EntityRef); + this._ZHGL_ConstructionLogHJGL = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogHJGL), new Action(this.detach_ZHGL_ConstructionLogHJGL)); this._ZHGL_ConstructionLogMachine = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogMachine), new Action(this.detach_ZHGL_ConstructionLogMachine)); this._ZHGL_ConstructionLogManagement = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogManagement), new Action(this.detach_ZHGL_ConstructionLogManagement)); this._ZHGL_ConstructionLogPerson = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogPerson), new Action(this.detach_ZHGL_ConstructionLogPerson)); @@ -304940,6 +305140,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogHJGL_ZHGL_ConstructionLog", Storage="_ZHGL_ConstructionLogHJGL", ThisKey="ConstructionLogId", OtherKey="ConstructionLogId", DeleteRule="NO ACTION")] + public EntitySet ZHGL_ConstructionLogHJGL + { + get + { + return this._ZHGL_ConstructionLogHJGL; + } + set + { + this._ZHGL_ConstructionLogHJGL.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogMachine_ZHGL_ConstructionLog", Storage="_ZHGL_ConstructionLogMachine", ThisKey="ConstructionLogId", OtherKey="ConstructionLogId", DeleteRule="NO ACTION")] public EntitySet ZHGL_ConstructionLogMachine { @@ -305025,6 +305238,18 @@ namespace Model } } + private void attach_ZHGL_ConstructionLogHJGL(ZHGL_ConstructionLogHJGL entity) + { + this.SendPropertyChanging(); + entity.ZHGL_ConstructionLog = this; + } + + private void detach_ZHGL_ConstructionLogHJGL(ZHGL_ConstructionLogHJGL entity) + { + this.SendPropertyChanging(); + entity.ZHGL_ConstructionLog = null; + } + private void attach_ZHGL_ConstructionLogMachine(ZHGL_ConstructionLogMachine entity) { this.SendPropertyChanging(); @@ -305086,6 +305311,277 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ZHGL_ConstructionLogHJGL")] + public partial class ZHGL_ConstructionLogHJGL : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ConstructionLogHJGLId; + + private string _ConstructionLogId; + + private string _UnitWorkId; + + private System.Nullable _TodayCompleteSize; + + private System.Nullable _TotalCompleteSize; + + private System.Nullable _TotalSize; + + private string _TotalRate; + + private System.Nullable _TomorrowPlanSize; + + private EntityRef _ZHGL_ConstructionLog; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnConstructionLogHJGLIdChanging(string value); + partial void OnConstructionLogHJGLIdChanged(); + partial void OnConstructionLogIdChanging(string value); + partial void OnConstructionLogIdChanged(); + partial void OnUnitWorkIdChanging(string value); + partial void OnUnitWorkIdChanged(); + partial void OnTodayCompleteSizeChanging(System.Nullable value); + partial void OnTodayCompleteSizeChanged(); + partial void OnTotalCompleteSizeChanging(System.Nullable value); + partial void OnTotalCompleteSizeChanged(); + partial void OnTotalSizeChanging(System.Nullable value); + partial void OnTotalSizeChanged(); + partial void OnTotalRateChanging(string value); + partial void OnTotalRateChanged(); + partial void OnTomorrowPlanSizeChanging(System.Nullable value); + partial void OnTomorrowPlanSizeChanged(); + #endregion + + public ZHGL_ConstructionLogHJGL() + { + this._ZHGL_ConstructionLog = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionLogHJGLId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ConstructionLogHJGLId + { + get + { + return this._ConstructionLogHJGLId; + } + set + { + if ((this._ConstructionLogHJGLId != value)) + { + this.OnConstructionLogHJGLIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionLogHJGLId = value; + this.SendPropertyChanged("ConstructionLogHJGLId"); + this.OnConstructionLogHJGLIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionLogId", DbType="NVarChar(50)")] + public string ConstructionLogId + { + get + { + return this._ConstructionLogId; + } + set + { + if ((this._ConstructionLogId != value)) + { + if (this._ZHGL_ConstructionLog.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnConstructionLogIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionLogId = value; + this.SendPropertyChanged("ConstructionLogId"); + this.OnConstructionLogIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorkId", DbType="NVarChar(50)")] + public string UnitWorkId + { + get + { + return this._UnitWorkId; + } + set + { + if ((this._UnitWorkId != value)) + { + this.OnUnitWorkIdChanging(value); + this.SendPropertyChanging(); + this._UnitWorkId = value; + this.SendPropertyChanged("UnitWorkId"); + this.OnUnitWorkIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TodayCompleteSize", DbType="Decimal(18,3)")] + public System.Nullable TodayCompleteSize + { + get + { + return this._TodayCompleteSize; + } + set + { + if ((this._TodayCompleteSize != value)) + { + this.OnTodayCompleteSizeChanging(value); + this.SendPropertyChanging(); + this._TodayCompleteSize = value; + this.SendPropertyChanged("TodayCompleteSize"); + this.OnTodayCompleteSizeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalCompleteSize", DbType="Decimal(18,3)")] + public System.Nullable TotalCompleteSize + { + get + { + return this._TotalCompleteSize; + } + set + { + if ((this._TotalCompleteSize != value)) + { + this.OnTotalCompleteSizeChanging(value); + this.SendPropertyChanging(); + this._TotalCompleteSize = value; + this.SendPropertyChanged("TotalCompleteSize"); + this.OnTotalCompleteSizeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalSize", DbType="Decimal(18,3)")] + public System.Nullable TotalSize + { + get + { + return this._TotalSize; + } + set + { + if ((this._TotalSize != value)) + { + this.OnTotalSizeChanging(value); + this.SendPropertyChanging(); + this._TotalSize = value; + this.SendPropertyChanged("TotalSize"); + this.OnTotalSizeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalRate", DbType="NVarChar(20)")] + public string TotalRate + { + get + { + return this._TotalRate; + } + set + { + if ((this._TotalRate != value)) + { + this.OnTotalRateChanging(value); + this.SendPropertyChanging(); + this._TotalRate = value; + this.SendPropertyChanged("TotalRate"); + this.OnTotalRateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TomorrowPlanSize", DbType="Decimal(18,3)")] + public System.Nullable TomorrowPlanSize + { + get + { + return this._TomorrowPlanSize; + } + set + { + if ((this._TomorrowPlanSize != value)) + { + this.OnTomorrowPlanSizeChanging(value); + this.SendPropertyChanging(); + this._TomorrowPlanSize = value; + this.SendPropertyChanged("TomorrowPlanSize"); + this.OnTomorrowPlanSizeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogHJGL_ZHGL_ConstructionLog", Storage="_ZHGL_ConstructionLog", ThisKey="ConstructionLogId", OtherKey="ConstructionLogId", IsForeignKey=true)] + public ZHGL_ConstructionLog ZHGL_ConstructionLog + { + get + { + return this._ZHGL_ConstructionLog.Entity; + } + set + { + ZHGL_ConstructionLog previousValue = this._ZHGL_ConstructionLog.Entity; + if (((previousValue != value) + || (this._ZHGL_ConstructionLog.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._ZHGL_ConstructionLog.Entity = null; + previousValue.ZHGL_ConstructionLogHJGL.Remove(this); + } + this._ZHGL_ConstructionLog.Entity = value; + if ((value != null)) + { + value.ZHGL_ConstructionLogHJGL.Add(this); + this._ConstructionLogId = value.ConstructionLogId; + } + else + { + this._ConstructionLogId = default(string); + } + this.SendPropertyChanged("ZHGL_ConstructionLog"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ZHGL_ConstructionLogMachine")] public partial class ZHGL_ConstructionLogMachine : INotifyPropertyChanging, INotifyPropertyChanged { diff --git a/SGGL/WebAPI/Controllers/CQMS/SpotCheckController.cs b/SGGL/WebAPI/Controllers/CQMS/SpotCheckController.cs index 4df65c82..534e786b 100644 --- a/SGGL/WebAPI/Controllers/CQMS/SpotCheckController.cs +++ b/SGGL/WebAPI/Controllers/CQMS/SpotCheckController.cs @@ -327,6 +327,12 @@ namespace Mvc.Controllers //更新明细记录 //判断明细是否需要上传资料 Model.WBS_ControlItemAndCycle c = BLL.ControlItemAndCycleService.GetControlItemAndCycleByIdForApi(item.ControlItemAndCycleId); + Model.WBS_ControlItemInit cInit = BLL.ControlItemInitService.GetControlItemInitByCode(c.InitControlItemCode); + bool isJDItem = false; + if (cInit != null && cInit.IsJDItem.HasValue) + { + isJDItem = cInit.IsJDItem.Value; + } if (c != null) { if (string.IsNullOrEmpty(c.HGForms) && string.IsNullOrEmpty(c.SHForms)) @@ -345,7 +351,18 @@ namespace Mvc.Controllers { c.RealEndDate = DateTime.Now; BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c); - BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + if (isJDItem) //进度完成项 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate2(c.WorkPackageId); + } + else //非进度完成项 + { + Model.WBS_WorkPackage workPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(c.WorkPackageId); + if (workPackage.RealEndDate == null) //分部分项还未生成实际完成时间 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + } + } } else //检查多次 { @@ -354,7 +371,18 @@ namespace Mvc.Controllers { c.RealEndDate = DateTime.Now; BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c); - BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + if (isJDItem) //进度完成项 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate2(c.WorkPackageId); + } + else //非进度完成项 + { + Model.WBS_WorkPackage workPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(c.WorkPackageId); + if (workPackage.RealEndDate == null) //分部分项还未生成实际完成时间 + { + BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId); + } + } } } }