diff --git a/CreateModel.bat b/CreateModel.bat index f5e367c..f3db9c1 100644 --- a/CreateModel.bat +++ b/CreateModel.bat @@ -27,7 +27,7 @@ REM -------------- @echo. @call "%VS100COMNTOOLS%"vsvars32.bat -SqlMetal /views /server:.\SQL2012 /database:SGGLDB_TCC /code:%Model_ROOT%\Model.cs /namespace:Model +SqlMetal /views /server:.\SQL2022 /database:SGGLDB_HBAZ /code:%Model_ROOT%\Model.cs /namespace:Model @ECHO 完成 pause diff --git a/DataBase/鐗堟湰鏃ュ織/SGGLDB_V2025-09-08-001-bwj.sql b/DataBase/鐗堟湰鏃ュ織/SGGLDB_V2025-09-08-001-bwj.sql new file mode 100644 index 0000000..c0fc5d7 --- /dev/null +++ b/DataBase/鐗堟湰鏃ュ織/SGGLDB_V2025-09-08-001-bwj.sql @@ -0,0 +1,84 @@ + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('0F3ECADA-F108-4C24-979C-67CA49E3726B','焊接统计分析表','HJGL/WeldingReport/WeldingStatistical.aspx',5,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1) +go + +alter table ProjectData_WorkArea add CompletionDate datetime +go + + +CREATE 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 + +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,--总达因 + + --施工工队 按焊工代号汇集数量,按施工队再次自动汇总 + (select top 1 ProjectData_TeamGroup.TeamGroupName 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_IsoInfo.WorkAreaId = WorkArea.WorkAreaId and PW_JointInfo.DReportID is not null and BS_Welder.TeamGroupId is not null) as TeamGroup, + + CAST(ISNULL(finished_total_jot_bq.finished_total_din_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 COUNT(*) finished_total_jot_bq ,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 pw_isoinfo.WorkAreaId ,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 + 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) AS finished_current_day_din ON finished_current_day_din.WorkAreaId = WorkArea.WorkAreaId +WHERE + (WorkArea.ProjectId=@projectId OR @projectId IS NULL ) AND + (WorkArea.WorkAreaId=@areano OR @AreaNo IS NULL ) AND + (WorkArea.InstallationId=@installationId OR @installationId IS NULL) +ORDER BY Unit.UnitCode ,Installation.InstallationCode + +GO + + + + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 094b0d1..d7a88e2 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -6177,6 +6177,10 @@ namespace BLL #region 鐒婃帴鎶ヨ〃 /// + /// 鐒婃帴缁熻鍒嗘瀽琛 + /// + public const string WeldingStatisticalMenuId = "0F3ECADA-F108-4C24-979C-67CA49E3726B"; + /// /// 鍗曚綅宸ュ尯杩涘害鍒嗘瀽 /// public const string UnitAreaAnalyzeMenuId = "66A76F90-96A7-4C1F-B8D9-125DDEACEF52"; diff --git a/SGGL/BLL/ProjectData/WorkAreaService.cs b/SGGL/BLL/ProjectData/WorkAreaService.cs index 53df7d6..761ca0d 100644 --- a/SGGL/BLL/ProjectData/WorkAreaService.cs +++ b/SGGL/BLL/ProjectData/WorkAreaService.cs @@ -39,6 +39,7 @@ namespace BLL WorkAreaCode = WorkArea.WorkAreaCode, WorkAreaName = WorkArea.WorkAreaName, Remark = WorkArea.Remark, + CompletionDate=WorkArea.CompletionDate, }; db.ProjectData_WorkArea.InsertOnSubmit(newWorkArea); @@ -61,6 +62,7 @@ namespace BLL newWorkArea.WorkAreaName = WorkArea.WorkAreaName; newWorkArea.InstallationId = WorkArea.InstallationId; newWorkArea.SupervisorUnitId = WorkArea.SupervisorUnitId; + newWorkArea.CompletionDate = WorkArea.CompletionDate; db.SubmitChanges(); } } diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 84192b7..65ac010 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1746,6 +1746,7 @@ + @@ -11839,6 +11840,13 @@ WelderPerformance.aspx + + WeldingStatistical.aspx + ASPXCodeBehind + + + WeldingStatistical.aspx + AccidentHandle.aspx ASPXCodeBehind @@ -19738,6 +19746,7 @@ +