20250909 修改焊接统计分析表

This commit is contained in:
毕文静 2025-09-09 09:38:55 +08:00
parent ced7b82085
commit df49677f90
5 changed files with 123 additions and 7554 deletions

View File

@ -0,0 +1,93 @@
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
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
WHERE (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
WHERE pw_jointinfo.DReportID is not 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 BS_Welder on BS_Welder.WED_ID = PW_JointInfo.JOT_CellWelder
left join ProjectData_TeamGroup on ProjectData_TeamGroup.TeamGroupId= BS_Welder.TeamGroupId
where 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_CellWelder
WHERE pw_jointinfo.DReportID is not 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_CellWelder
WHERE pw_jointinfo.DReportID is not 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

File diff suppressed because it is too large Load Diff

View File

@ -34,15 +34,14 @@
</f:Toolbar>
</Toolbars>
<Rows>
<f:FormRow>
<f:FormRow ColumnWidths="17% 20% 17% 15% 15% 16%">
<Items>
<%--<f:DropDownList ID="drpUnit" runat="server" LabelWidth="80px" Label="单位名称" EnableEdit="true"
AutoPostBack="true" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
</f:DropDownList>--%>
<f:DropDownList ID="drpInstallation" runat="server" LabelWidth="80px" Label="装置" EnableEdit="true"
AutoPostBack="true" OnSelectedIndexChanged="drpInstallation_SelectedIndexChanged">
</f:DropDownList>
<f:DropDownList ID="drpWorkArea" runat="server" LabelWidth="80px" Label="施工区域" EnableEdit="true">
</f:DropDownList>
<f:DropDownList ID="drpTeamGroupId" runat="server" LabelWidth="80px" Label="施工队" EnableEdit="true">
</f:DropDownList>
<f:DatePicker runat="server" Label="开始日期" ID="txtStarTime" LabelWidth="80px"></f:DatePicker>
<f:DatePicker runat="server" Label="结束日期" ID="txtEndTime" LabelWidth="80px"></f:DatePicker>
@ -61,7 +60,7 @@
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="焊接统计分析表"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="baw_areano"
AllowCellEditing="true" ClicksToEdit="2" DataIDField="baw_areano" AllowSorting="true"
AllowCellEditing="true" ClicksToEdit="2" DataIDField="" AllowSorting="true"
SortField="bsu_unitcode,InstallationName,baw_areano" SortDirection="DESC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" EnableSummary="true" SummaryPosition="Flow">
@ -76,7 +75,7 @@
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="260px">
</f:RenderField>--%>
<f:RenderField HeaderText="装置" ColumnID="InstallationName" DataField="InstallationName" SortField="InstallationName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="110px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="工区" ColumnID="baw_areano" DataField="baw_areano" SortField="baw_areano"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="160px">
@ -87,7 +86,7 @@
<f:RenderField HeaderText="总达因" ColumnID="total_din" DataField="total_din" SortField="total_din"
FieldType="String" HeaderTextAlign="Center" TextAlign="Right" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="施工队" ColumnID="TeamGroup" DataField="TeamGroup" SortField="TeamGroup"
<f:RenderField HeaderText="施工队" ColumnID="TeamGroup" DataField="TeamGroup" SortField="TeamGroup"
FieldType="String" HeaderTextAlign="Center" TextAlign="Right" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="本期完成达因" ColumnID="finished_total_din_bq" DataField="finished_total_din_bq" SortField="finished_total_din_bq"

View File

@ -55,6 +55,8 @@ namespace FineUIPro.Web.HJGL.WeldingReport
Funs.FineUIPleaseSelect(this.drpWorkArea);
BLL.TeamGroupService.InitTeamGroupProjectDropDownList(this.drpTeamGroupId, this.CurrUser.LoginProjectId, true);
////钢材类型
//this.drpSteType.DataTextField = "Text";
//this.drpSteType.DataValueField = "Value";
@ -110,6 +112,14 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
listStr.Add(new SqlParameter("@AreaNo", null));
}
if (this.drpTeamGroupId.SelectedValue!=BLL.Const._Null)
{
listStr.Add(new SqlParameter("@teamGroup", this.drpTeamGroupId.SelectedValue));
}
else
{
listStr.Add(new SqlParameter("@teamGroup", null));
}
if (!string.IsNullOrEmpty(this.txtStarTime.Text))
{
listStr.Add(new SqlParameter("@startTime", this.txtStarTime.Text.Trim()));
@ -202,6 +212,8 @@ namespace FineUIPro.Web.HJGL.WeldingReport
double finished_total_din_bq = 0.0f;
double RemainingDain = 0.0f;
double AvgDayCompletedDin = 0.0f;
double finished_current_day_din = 0.0f;
foreach (DataRow row in tb.Rows)
{
total_jot += Convert.ToInt32(row["total_jot"]);
@ -209,6 +221,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
finished_total_din_bq += Convert.ToDouble(row["finished_total_din_bq"]);
RemainingDain += Convert.ToDouble(row["RemainingDain"]);
AvgDayCompletedDin += Convert.ToDouble(row["AvgDayCompletedDin"]);
finished_current_day_din += Convert.ToDouble(row["finished_current_day_din"]);
}
JObject summary = new JObject
@ -219,6 +232,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{ "finished_total_din_bq", finished_total_din_bq.ToString("F2") },
{ "RemainingDain",RemainingDain.ToString("F2") },
{ "AvgDayCompletedDin", AvgDayCompletedDin.ToString("F2") },
{ "finished_current_day_din", finished_current_day_din.ToString("F2") },
};
Grid1.SummaryData = summary;

View File

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