diff --git a/DataBase/版本日志/SGGLDB_V2025-09-26-001-bwj.sql b/DataBase/版本日志/SGGLDB_V2025-09-26-001-bwj.sql new file mode 100644 index 00000000..086c3d85 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-09-26-001-bwj.sql @@ -0,0 +1,67 @@ +CREATE PROCEDURE [dbo].[Sp_HJGL_ProductionPlanStatistics] + @projectId nvarchar(50)=null +AS +select distinct unitWork.UnitWorkId, +unitWork.UnitWorkCode, +unitWork.UnitWorkName, +unitWork.ProjectId, +pipeline.FlowingSection, +isnull(total.TotalDia,0) as TotalDia,--Ԥܴ +p.PlanStartDate,--ƻʼ +p.PlanEndDate,--ƻ +p.Days as TotalDays,-- +(case when p.PlanEndDate>= getdate() then (p.Days-(DATEDIFF(day,p.PlanStartDate,GETDATE()))) else '' end) as RemainingDays,--ʣ +(case when p.Days>0 then cast(isnull(total.TotalDia,0)/p.Days as decimal(18,2)) else 0 end) as AvgDayCompleteDia, --ƽÿӦɹ +ISNULL(currentDay.CurrentDayCompletedDia,0) as CurrentDayCompletedDia, --ɹ +cast(case when (case when p.PlanEndDate>= getdate() then (p.Days-(DATEDIFF(day,p.PlanStartDate,GETDATE()))) else 0 end)>0 then +(isnull(total.TotalDia,0)-isnull(totalCompleted.totalCompletedDia,0))/ (case when p.PlanEndDate>= getdate() then (p.Days-(DATEDIFF(day,p.PlanStartDate,GETDATE()))) else 0 end) else 0 end as decimal(18,2)) as NextDayComplete, --Ӧ +isnull(totalCompleted.totalCompletedDia,0) as totalCompletedDia, --ۼ +cast(cast((case when isnull(total.TotalDia,0)>0 then +(isnull(totalCompleted.totalCompletedDia,0) / isnull(total.TotalDia,0)*100) else 0 end) as decimal(18,2)) as varchar(10))+'%' as CompletedRate, --ɰٷֱ +welder.WelderCount, --ǰ +warningWelder.WarningWelderCount --Ԥ +FROM WBS_UnitWork AS unitWork +LEFT JOIN (select FlowingSection,UnitWorkId from HJGL_Pipeline where PipeArea='1' and FlowingSection is not null and FlowingSection!='') as pipeline on pipeline.UnitWorkId = unitWork.UnitWorkId +left join HJGL_ProductionSchedulingPlan p on p.PipelineId = unitWork.UnitWorkId and p.FlowNum = pipeline.FlowingSection +--Ԥܴ +left join (select sum(Size) as TotalDia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint + left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId + where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' + group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as total on total.UnitWorkId = unitWork.UnitWorkId and total.FlowingSection = pipeline.FlowingSection +--ɹ +left join (select sum(Size) as CurrentDayCompletedDia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint + left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId + left join HJGL_WeldingDaily on HJGL_WeldingDaily.WeldingDailyId = HJGL_WeldJoint.WeldingDailyId + where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' + and HJGL_WeldJoint.WeldingDailyId is not null + and YEAR(HJGL_WeldingDaily.WeldingDate)=YEAR(GETDATE()) + and MONTH(HJGL_WeldingDaily.WeldingDate)=MONTH(GETDATE()) + and DAY(HJGL_WeldingDaily.WeldingDate)=DAY(GETDATE()) + group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as currentDay on currentDay.UnitWorkId = unitWork.UnitWorkId and currentDay.FlowingSection = pipeline.FlowingSection + +--ۼ +left join (select sum(Size) as totalCompletedDia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint + left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId + where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' + and HJGL_WeldJoint.WeldingDailyId is not null + group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as totalCompleted on totalCompleted.UnitWorkId = unitWork.UnitWorkId and totalCompleted.FlowingSection = pipeline.FlowingSection + +--ǰ +left join (select count(*) as WelderCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from Person_Persons + left join HJGL_WeldJoint on HJGL_WeldJoint.BackingWelderId = Person_Persons.PersonId + left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId + where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' + and HJGL_WeldJoint.WeldingDailyId is not null + group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as welder on welder.UnitWorkId = unitWork.UnitWorkId and welder.FlowingSection = pipeline.FlowingSection + +--Ԥ +left join (select count(*) as WarningWelderCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from Person_Persons + left join HJGL_WeldJoint on HJGL_WeldJoint.BackingWelderId = Person_Persons.PersonId + left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId + where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='Ԥƿ' + and HJGL_WeldJoint.WeldingDailyId is not null + and PersonId in (select WelderId from Welder_WelderQualify where LimitDate < GETDATE()) + group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as warningWelder on warningWelder.UnitWorkId = unitWork.UnitWorkId and warningWelder.FlowingSection = pipeline.FlowingSection + +where unitWork.ProjectId = @projectId +and pipeline.FlowingSection is not null \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx index 0a4d300e..e3e4104b 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx and b/SGGL/FineUIPro.Web/File/Excel/DataOut/排产计划导出模板.xlsx differ diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx index fcbc9628..f9be7eae 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx @@ -7,11 +7,10 @@