This commit is contained in:
2026-11-06 11:12:22 +08:00
parent 002c3b8d04
commit 95104fed88
4 changed files with 120 additions and 13 deletions
@@ -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
@@ -17,10 +17,13 @@
<Items>
<f:Form ID="Form2" ShowHeader="false" ShowBorder="false" runat="server" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="20% 75% 5%">
<f:FormRow ColumnWidths="18% 3% 10% 8% 56% 5%">
<Items>
<f:DatePicker ID="txtDate" runat="server" Label="日期" LabelAlign="Right" AutoPostBack="true" OnTextChanged="txtDate_TextChanged"></f:DatePicker>
<f:Label runat="server"></f:Label>
<f:DatePicker ID="txtStartDate" runat="server" Label="日期" LabelAlign="Right"></f:DatePicker>
<f:Label runat="server" Text="至"></f:Label>
<f:DatePicker ID="txtEndDate" runat="server"></f:DatePicker>
<f:Button ID="BtnAnalyse" Text="统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse_Click"></f:Button>
<f:Label runat="server"></f:Label>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" Icon="TableGo" ToolTip="导出"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
@@ -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<SqlParameter> listStr = new List<SqlParameter>();
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();
}
}
}
@@ -60,13 +60,31 @@ namespace FineUIPro.Web.HJGL.WeldingReport
protected global::FineUIPro.Form Form2;
/// <summary>
/// txtDate 控件。
/// txtStartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtDate;
protected global::FineUIPro.DatePicker txtStartDate;
/// <summary>
/// txtEndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndDate;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// btnOut 控件。