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 @@ 排产计划 - @@ -44,120 +43,202 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - <%-- - --%> - - - - - - - - - - - - - - - <%-- - - --%> - - - - - - - - - - - - - <%-- - - --%> - - - - - - - - <%-- - - --%> - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -202,7 +283,7 @@ } function onGridDataLoad(event) { - this.mergeColumns(['FlowNum', 'Material', 'TotalDyne','TotalPriority','PriorityTotalDyne', 'TotalCompletedRate']); + this.mergeColumns(['FlowNum', 'Material', 'TotalDyne', 'TotalPriority', 'PriorityTotalDyne', 'TotalCompletedRate']); } //自动计算天数、平均每天工作量 @@ -230,8 +311,8 @@ } me.updateCellValue(rowId, 'Days', daysDifference + 1);//天数 - me.updateCellValue(rowId, 'AvgDailyWorkload', avgDailyWorkload);//平均每天工作量 - me.updateCellValue(rowId, 'NextDayCompleteDyne', nextDayCompleteDyne);//次日应完成量 + me.updateCellValue(rowId, 'AvgDailyWorkload', avgDailyWorkload.toFixed(2));//平均每天工作量 + me.updateCellValue(rowId, 'NextDayCompleteDyne', nextDayCompleteDyne.toFixed(2));//次日应完成量 } } diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs index 0568314b..16e38325 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.cs @@ -23,14 +23,23 @@ namespace FineUIPro.Web.HJGL.PreDesign { public int pageSize = 20; public static DataTable GridDataTable = new DataTable(); + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); this.InitTreeMenu();//加载树 + BindGrid2();//绑定看板数据 } } + #endregion #region 加载树装置-单位-工作区 /// @@ -185,6 +194,13 @@ namespace FineUIPro.Web.HJGL.PreDesign } #endregion + + #region 树节点展开事件 + /// + /// 树节点展开事件 + /// + /// + /// protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { if (e.Node.Nodes[0].NodeID == "加载流水段...") @@ -194,6 +210,8 @@ namespace FineUIPro.Web.HJGL.PreDesign } } + #endregion + #region 点击TreeView /// /// 点击TreeView @@ -202,16 +220,6 @@ namespace FineUIPro.Web.HJGL.PreDesign /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { - //if (e.CommandName == "流水段") - //{ - // Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByFlowingSection(this.tvControlItem.SelectedNode.Text); - // this.hdUnitWorkId.Text = string.Empty; - // if (pipeline != null) - // { - // this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; - // SaveProductionSchedulingPlan(); - // } - //} this.BindGrid(); } @@ -912,5 +920,30 @@ namespace FineUIPro.Web.HJGL.PreDesign } } #endregion + + #region 生产看板 + protected void ddlPageSize2_SelectedIndexChanged(object sender, EventArgs e) + { + this.BindGrid2(); + } + + /// + /// 绑定数据 + /// + private void BindGrid2() + { + + List listStr = new List(); + + listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId)); + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunProc("Sp_HJGL_ProductionPlanStatistics", parameter); + this.Grid2.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid2, tb); + Grid2.DataSource = table; + Grid2.DataBind(); + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs index 04728f3a..3c5b40fb 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/ProductionSchedulingPlan.aspx.designer.cs @@ -93,6 +93,60 @@ namespace FineUIPro.Web.HJGL.PreDesign { /// protected global::FineUIPro.Panel panelCenterRegion; + /// + /// panelCenterTop 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterTop; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// ToolbarSeparator2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator2; + + /// + /// ToolbarText2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText2; + + /// + /// ddlPageSize2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize2; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + /// /// Toolbar3 控件。 /// @@ -129,15 +183,6 @@ namespace FineUIPro.Web.HJGL.PreDesign { /// protected global::FineUIPro.Button btnOut; - /// - /// Grid1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Grid Grid1; - /// /// txtTotalPriority 控件。 ///