20251017 焊接统计报表

This commit is contained in:
毕文静 2025-10-17 10:18:24 +08:00
parent 666283b454
commit a1a2e05432
4 changed files with 138 additions and 8 deletions

View File

@ -0,0 +1,99 @@
ALTER PROC [dbo].[sp_rpt_WeldingStatistical]
@AreaNo nVARCHAR(50) = NULL,
@installationId nVARCHAR(50) = NULL,
@startTime datetime = NULL,
@endTime datetime = NULL,
@projectId NVARCHAR(50) = NULL,
@IsStandard NVARCHAR(50) = NULL,
@teamGroup nvarchar(50) = NULL,
@ste_steeltype nvarchar(50) = NULL
AS
/*焊接统计分析表*/
SELECT WorkArea.WorkAreaId,
WorkArea.ProjectId,
WorkArea.WorkAreaCode AS baw_areano,--
Unit.UnitCode AS bsu_unitcode,--
Unit.UnitName AS bsu_unitname, --
Installation.InstallationCode, --
Installation.InstallationName, --
ISNULL(total_jot.total_jot,0) AS total_jot, --
CAST(ISNULL(total_jot.total_din,0) AS DECIMAL(19,2)) AS total_din,--
TeamGroup.TeamGroupId,
TeamGroup.TeamGroupName as TeamGroup,
CAST(ISNULL(finished_total_dia_bq.finished_total_dia_bq ,0) AS DECIMAL(19,2)) AS finished_total_din_bq, --
(CAST(ISNULL(total_jot.total_din,0)-ISNULL(finished_total_jot_bq.finished_total_din_bq ,0) AS DECIMAL(19,2))) as RemainingDain, ---
getdate() as CurrentDate,--
WorkArea.CompletionDate, --
(DATEDIFF(DAY, getdate(), WorkArea.CompletionDate)+1) as RemainingConPeriod,--
CEILING(case when (DATEDIFF(DAY, getdate(), WorkArea.CompletionDate)+1)>0 then
(ISNULL(total_jot.total_din,0)-ISNULL(finished_total_jot_bq.finished_total_din_bq ,0))/(DATEDIFF(DAY, getdate(), WorkArea.CompletionDate)+1)
else '0' end) as AvgDayCompletedDin,--
(getdate()-1) as CurrentCompleted, --
(cast(isnull(finished_current_day_din.finished_current_day_din,0) as decimal(19,2))) as finished_current_day_din --
FROM ProjectData_WorkArea AS WorkArea
LEFT JOIN Base_Unit AS Unit ON WorkArea.UnitId =Unit.UnitId
LEFT JOIN Project_Installation AS Installation ON Installation.InstallationId = WorkArea.InstallationId
LEFT JOIN (SELECT COUNT(*) total_jot ,pw_isoinfo.WorkAreaId ,SUM(JOT_Size) AS total_din
,SUM(JOT_DoneDin) AS finished_total_din
FROM pw_jointinfo
LEFT JOIN pw_isoinfo ON pw_jointinfo.ISO_ID = pw_isoinfo.ISO_ID
LEFT JOIN Base_Material ON Base_Material.MaterialId = pw_jointinfo.MaterialId
WHERE (Base_Material.SteelType =@ste_steeltype or @ste_steeltype is null)
and (pw_isoinfo.Is_Standard=@IsStandard OR @IsStandard IS NULL)
GROUP BY pw_isoinfo.WorkAreaId) AS total_jot ON total_jot.WorkAreaId = WorkArea.WorkAreaId
LEFT JOIN (SELECT pw_isoinfo.WorkAreaId ,SUM(JOT_DoneDin) AS finished_total_din_bq
FROM pw_jointinfo
LEFT JOIN pw_isoinfo ON pw_jointinfo.ISO_ID = pw_isoinfo.ISO_ID
LEFT JOIN BO_WeldReportMain ON BO_WeldReportMain.dreportid = pw_jointinfo.dreportid
LEFT JOIN Base_Material ON Base_Material.MaterialId = pw_jointinfo.MaterialId
WHERE pw_jointinfo.DReportID is not null and (Base_Material.SteelType =@ste_steeltype or @ste_steeltype is null)
and (jot_welddate >= @startTime OR @startTime IS NULL) and (jot_welddate <@endTime OR @endTime IS NULL) AND
(pw_isoinfo.Is_Standard=@IsStandard OR @IsStandard IS NULL)
GROUP BY pw_isoinfo.WorkAreaId) AS finished_total_jot_bq ON finished_total_jot_bq.WorkAreaId = WorkArea.WorkAreaId
--
left join(select distinct ProjectData_TeamGroup.TeamGroupId,ProjectData_TeamGroup.TeamGroupName,PW_IsoInfo.WorkAreaId from PW_JointInfo
left join PW_IsoInfo on PW_IsoInfo.ISO_ID = PW_JointInfo.ISO_ID
LEFT JOIN Base_Material ON Base_Material.MaterialId = pw_jointinfo.MaterialId
left join BS_Welder on BS_Welder.WED_ID = PW_JointInfo.JOT_FloorWelder
left join ProjectData_TeamGroup on ProjectData_TeamGroup.TeamGroupId= BS_Welder.TeamGroupId
where (Base_Material.SteelType =@ste_steeltype or @ste_steeltype is null) and PW_JointInfo.DReportID is not null and BS_Welder.TeamGroupId is not null) as TeamGroup on TeamGroup.WorkAreaId = WorkArea.WorkAreaId
----
LEFT JOIN (SELECT pw_isoinfo.WorkAreaId,BS_Welder.TeamGroupId,SUM(JOT_DoneDin) AS finished_total_dia_bq
FROM pw_jointinfo
LEFT JOIN pw_isoinfo ON pw_jointinfo.ISO_ID = pw_isoinfo.ISO_ID
LEFT JOIN BO_WeldReportMain ON BO_WeldReportMain.dreportid = pw_jointinfo.dreportid
left join BS_Welder on BS_Welder.WED_ID = PW_JointInfo.JOT_FloorWelder
LEFT JOIN Base_Material ON Base_Material.MaterialId = pw_jointinfo.MaterialId
WHERE pw_jointinfo.DReportID is not null and (Base_Material.SteelType =@ste_steeltype or @ste_steeltype is null)
and (jot_welddate >= @startTime OR @startTime IS NULL) and (jot_welddate <@endTime OR @endTime IS NULL) AND
(pw_isoinfo.Is_Standard=@IsStandard OR @IsStandard IS NULL)
GROUP BY pw_isoinfo.WorkAreaId,BS_Welder.TeamGroupId) AS finished_total_dia_bq ON finished_total_dia_bq.WorkAreaId = WorkArea.WorkAreaId and finished_total_dia_bq.TeamGroupId = TeamGroup.TeamGroupId
--
LEFT JOIN (SELECT pw_isoinfo.WorkAreaId,BS_Welder.TeamGroupId ,SUM(JOT_DoneDin) AS finished_current_day_din
FROM pw_jointinfo
LEFT JOIN pw_isoinfo ON pw_jointinfo.ISO_ID = pw_isoinfo.ISO_ID
LEFT JOIN BO_WeldReportMain ON BO_WeldReportMain.dreportid = pw_jointinfo.dreportid
left join BS_Welder on BS_Welder.WED_ID = PW_JointInfo.JOT_FloorWelder
LEFT JOIN Base_Material ON Base_Material.MaterialId = pw_jointinfo.MaterialId
WHERE pw_jointinfo.DReportID is not null and (Base_Material.SteelType =@ste_steeltype or @ste_steeltype is null)
and (CONVERT(varchar(10), jot_welddate, 23) = CONVERT(varchar(10), GETDATE()-1, 23) ) AND
(pw_isoinfo.Is_Standard=@IsStandard OR @IsStandard IS NULL)
GROUP BY pw_isoinfo.WorkAreaId,BS_Welder.TeamGroupId) AS finished_current_day_din ON finished_current_day_din.WorkAreaId = WorkArea.WorkAreaId and finished_current_day_din.TeamGroupId = TeamGroup.TeamGroupId
WHERE
(WorkArea.ProjectId=@projectId OR @projectId IS NULL ) AND
(WorkArea.WorkAreaId=@areano OR @AreaNo IS NULL ) AND
(WorkArea.InstallationId=@installationId OR @installationId IS NULL) AND
(TeamGroup.TeamGroupId=@teamGroup OR @teamGroup IS NULL)
ORDER BY Unit.UnitCode ,Installation.InstallationCode
GO

View File

@ -51,6 +51,13 @@
</f:CheckBoxList> </f:CheckBoxList>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow ColumnWidths="17% 83%">
<Items>
<f:DropDownList ID="drpSteType" runat="server" LabelWidth="80px" Label="钢材类型" EnableEdit="true">
</f:DropDownList>
<f:Label ID="Label1" runat="server"></f:Label>
</Items>
</f:FormRow>
</Rows> </Rows>
</f:Form> </f:Form>
</Items> </Items>

View File

@ -55,6 +55,12 @@ namespace FineUIPro.Web.HJGL.WeldingReport
Funs.FineUIPleaseSelect(this.drpWorkArea); Funs.FineUIPleaseSelect(this.drpWorkArea);
////钢材类型
this.drpSteType.DataTextField = "Text";
this.drpSteType.DataValueField = "Value";
this.drpSteType.DataSource = BLL.DropListService.HJGL_GetSteTypeList();
this.drpSteType.DataBind();
Funs.FineUIPleaseSelect(this.drpSteType);
BLL.TeamGroupService.InitTeamGroupProjectDropDownList(this.drpTeamGroupId, this.CurrUser.LoginProjectId, true); BLL.TeamGroupService.InitTeamGroupProjectDropDownList(this.drpTeamGroupId, this.CurrUser.LoginProjectId, true);
////钢材类型 ////钢材类型
@ -144,14 +150,14 @@ namespace FineUIPro.Web.HJGL.WeldingReport
//{ //{
// listStr.Add(new SqlParameter("@supervisorUnitId", null)); // listStr.Add(new SqlParameter("@supervisorUnitId", null));
//} //}
//if (this.drpSteType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpSteType.SelectedValue)) if (this.drpSteType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpSteType.SelectedValue))
//{ {
// listStr.Add(new SqlParameter("@ste_steeltype", this.drpSteType.SelectedValue)); listStr.Add(new SqlParameter("@ste_steeltype", this.drpSteType.SelectedValue));
//} }
//else else
//{ {
// listStr.Add(new SqlParameter("@ste_steeltype", null)); listStr.Add(new SqlParameter("@ste_steeltype", null));
//} }
if (this.cb_IsStandard.SelectedIndexArray != null && this.cb_IsStandard.SelectedIndexArray.Length == 1) if (this.cb_IsStandard.SelectedIndexArray != null && this.cb_IsStandard.SelectedIndexArray.Length == 1)
{ {
listStr.Add(new SqlParameter("@IsStandard", this.cb_IsStandard.SelectedValueArray[0])); listStr.Add(new SqlParameter("@IsStandard", this.cb_IsStandard.SelectedValueArray[0]));

View File

@ -140,6 +140,24 @@ namespace FineUIPro.Web.HJGL.WeldingReport
/// </remarks> /// </remarks>
protected global::FineUIPro.CheckBoxList cb_IsStandard; protected global::FineUIPro.CheckBoxList cb_IsStandard;
/// <summary>
/// drpSteType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSteType;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary> /// <summary>
/// Region2 控件。 /// Region2 控件。
/// </summary> /// </summary>