From 95104fed887d7ac93145cde26ddc8fc4f773da7b Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Fri, 6 Nov 2026 11:12:22 +0800 Subject: [PATCH] 20261106 --- .../版本日志/HJGLDB_DS_2026-11-06_bwj.sql | 81 +++++++++++++++++++ .../WeldingReport/WeldingWorkEfficiency.aspx | 9 ++- .../WeldingWorkEfficiency.aspx.cs | 21 +++-- .../WeldingWorkEfficiency.aspx.designer.cs | 22 ++++- 4 files changed, 120 insertions(+), 13 deletions(-) create mode 100644 DataBase/版本日志/HJGLDB_DS_2026-11-06_bwj.sql diff --git a/DataBase/版本日志/HJGLDB_DS_2026-11-06_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-11-06_bwj.sql new file mode 100644 index 0000000..de4fa52 --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-11-06_bwj.sql @@ -0,0 +1,81 @@ + +/*******º¸½Ó×÷Òµ¹¤Ð§*******/ +ALTER PROCEDURE [dbo].[HJGL_rpt_UnitWeldPerformance] +( + @startDate DateTime, + @endDate DateTime +) +AS +SELECT + NEWID() AS Id, + '' as ProjectCode, + total.WED_Unit, + un.UnitCode,-- µ¥Î»´úÂë + un.UnitName,--µ¥Î»Ãû³Æ + -------------±¾ÆÚstart + CAST(@startDate AS date) as ReportDate, --ͳ¼ÆÈÕÆÚ + ISNULL(MRPerson.MRPersonNum,0) AS MRPersonNum, --ά±£ÔÚ¸ÚÈËÊý + ISNULL(TTPerson.TTPersonNum,0) AS TTPersonNum, --¼¼¸ÄÔÚ¸ÚÈËÊý + ISNULL(WeldJoint.totalSize,0) AS TotalSize, --µ±ÈÕº¸½ÓÁ¿ + ISNULL(WorkProject.WorkProjectNum,0) AS WorkProjectNum --ά±£¹¤×÷ÏîÊý +FROM + --×Ü´ïÒòÖµ --×ܺ¸¿Ú + (SELECT SUM(joint.JOT_Size) AS totalSize,COUNT(*) AS totalJoint + ,joint.WED_Unit + FROM View_JointWelder joint + LEFT JOIN HJGL_BO_WeldReportMain report ON joint.DReportID = report.DReportID + WHERE joint.DReportID IS NOT NULL and report.JOT_WeldDate >= '2026-01-01' + GROUP BY joint.WED_Unit) AS total + + +--ά±£ÔÚ¸ÚÈËÊý£¬Óм¸¸öÈËÁìÓÃÁ˺¸²Ä¾ÍÊǼ¸¸öÈË + LEFT JOIN (SELECT COUNT(distinct usingMat.UsingMan) AS MRPersonNum, + UsingPlan.UsingUnit + FROM dbo.HJGL_BS_Welder welder + left join dbo.Weld_UsingMat usingMat on usingMat.UsingMan=welder.WED_ID + left join dbo.Weld_UsingPlan AS UsingPlan ON UsingPlan.UsingPlanId = UsingMat.UsingPlanId + WHERE usingMat.UsingDate> DATEADD(day, -1, CAST(@startDate AS date)) and usingMat.UsingDate<=CAST(@endDate AS date) + and welder.IsSelfCreate=1 + GROUP BY UsingPlan.UsingUnit) AS MRPerson + ON MRPerson.UsingUnit = total.WED_Unit + +--¼¼¸ÄÔÚ¸ÚÈËÊý£¬µ±º¸²ÄÁìÓÃʱѡÔñÁ˹ܵÀº¸½ÓµÄÈËÊý + LEFT JOIN (SELECT COUNT(distinct usingMat.UsingMan) AS TTPersonNum, + UsingPlan.UsingUnit + FROM dbo.HJGL_BS_Welder welder + left join dbo.Weld_UsingMat usingMat on usingMat.UsingMan=welder.WED_ID + left join dbo.Weld_UsingPlan usingPlan on usingPlan.UsingPlanId=usingMat.UsingPlanId + WHERE usingMat.UsingDate> DATEADD(day, -1, CAST(@startDate AS date)) and usingMat.UsingDate<=CAST(@endDate AS date) and usingPlan.IsSteelStru=0 + and welder.IsSelfCreate=1 + GROUP BY UsingPlan.UsingUnit) AS TTPerson + ON TTPerson.UsingUnit = total.WED_Unit + --µ±ÈÕº¸½ÓÁ¿£¬Ö»Í³¼Æ×Ô½¨º¸¹¤µÄ×ܹ¤×÷Á¿ + LEFT JOIN (SELECT SUM(WeldJointT.JOT_Size) AS TotalSize + ,WeldJointT.BSU_ID from + (SELECT distinct joint.JOT_ID,joint.JOT_Size + ,report.BSU_ID + FROM View_JointWelder joint + LEFT JOIN HJGL_PW_JointInfo jot on jot.JOT_ID=joint.JOT_ID + LEFT JOIN HJGL_PW_IsoInfo iso on iso.ISO_ID=jot.ISO_ID + LEFT JOIN HJGL_BO_WeldReportMain report ON joint.DReportID = report.DReportID + LEFT JOIN HJGL_BS_Welder wed on wed.WED_ID=joint.Welder + WHERE joint.DReportID IS NOT NULL and report.JOT_WeldDate> DATEADD(day, -1, CAST(@startDate AS date)) and report.JOT_WeldDate<=CAST(@endDate AS date) + and wed.IsSelfCreate=1) AS WeldJointT + GROUP BY WeldJointT.BSU_ID) WeldJoint + ON WeldJoint.BSU_ID = total.WED_Unit + --ά±£¹¤×÷ÏîÊý£¬×Ô½¨º¸¹¤ÁìÓõÄÏîÄ¿ÊýÁ¿ + LEFT JOIN (SELECT COUNT(distinct usingMat.ProjectId) AS WorkProjectNum, + usingPlan.UsingUnit + FROM dbo.HJGL_BS_Welder welder + left join dbo.Weld_UsingMat usingMat on usingMat.UsingMan=welder.WED_ID + left join dbo.Weld_UsingPlan usingPlan on usingPlan.UsingPlanId=usingMat.UsingPlanId + WHERE usingMat.UsingDate> DATEADD(day, -1, CAST(@startDate AS date)) and usingMat.UsingDate<=CAST(@endDate AS date) + and welder.IsSelfCreate=1 + GROUP BY usingPlan.UsingUnit) AS WorkProject + ON WorkProject.UsingUnit = total.WED_Unit +LEFT JOIN dbo.Base_Unit un ON un.UnitId=total.WED_Unit + + +GO + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx index 67a5650..1124a3b 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx @@ -17,10 +17,13 @@ - + - - + + + + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.cs index 4262c55..c2f2765 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.cs @@ -21,7 +21,8 @@ namespace FineUIPro.Web.HJGL.WeldingReport { if (!IsPostBack) { - this.txtDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(-1)); + this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); BindGrid(); } } @@ -38,13 +39,21 @@ namespace FineUIPro.Web.HJGL.WeldingReport //Grid1.DataSource = list; List listStr = new List(); - if (!string.IsNullOrEmpty(this.txtDate.Text)) + if (!string.IsNullOrEmpty(this.txtStartDate.Text)) { - listStr.Add(new SqlParameter("@reportDate", this.txtDate.Text.Trim())); + listStr.Add(new SqlParameter("@startDate", this.txtStartDate.Text.Trim())); } else { - listStr.Add(new SqlParameter("@reportDate", null)); + listStr.Add(new SqlParameter("@startDate", null)); + } + if (!string.IsNullOrEmpty(this.txtEndDate.Text)) + { + listStr.Add(new SqlParameter("@endDate", this.txtEndDate.Text.Trim())); + } + else + { + listStr.Add(new SqlParameter("@endDate", null)); } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_UnitWeldPerformance", parameter); @@ -145,9 +154,5 @@ namespace FineUIPro.Web.HJGL.WeldingReport } #endregion - protected void txtDate_TextChanged(object sender, EventArgs e) - { - BindGrid(); - } } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.designer.cs index 43b80c9..55cf207 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WeldingWorkEfficiency.aspx.designer.cs @@ -60,13 +60,31 @@ namespace FineUIPro.Web.HJGL.WeldingReport protected global::FineUIPro.Form Form2; /// - /// txtDate 控件。 + /// txtStartDate 控件。 /// /// /// 自动生æˆ�的字段。 /// è‹¥è¦�进行修改,请将字段声明从设计器文件移到代ç �éš�è—�文件。 /// - protected global::FineUIPro.DatePicker txtDate; + protected global::FineUIPro.DatePicker txtStartDate; + + /// + /// txtEndDate 控件。 + /// + /// + /// 自动生æˆ�的字段。 + /// è‹¥è¦�进行修改,请将字段声明从设计器文件移到代ç �éš�è—�文件。 + /// + protected global::FineUIPro.DatePicker txtEndDate; + + /// + /// BtnAnalyse 控件。 + /// + /// + /// 自动生æˆ�的字段。 + /// è‹¥è¦�进行修改,请将字段声明从设计器文件移到代ç �éš�è—�文件。 + /// + protected global::FineUIPro.Button BtnAnalyse; /// /// btnOut 控件。