From 42f0783efa7ddaca12344847f6de56ba1eb80f94 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 15 May 2024 16:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SGGLDB_WH_2024-05-15-gaofei.sql | 350 ++++++++++++++++++ .../SitePerson_MonthReportService.cs | 42 +++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 + SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user | 2 +- SGGL/FineUIPro.Web/JDGL/Check/WeekPlan.aspx | 224 +++++++---- .../FineUIPro.Web/JDGL/Check/WeekPlan.aspx.cs | 69 +++- .../JDGL/Check/WeekPlan.aspx.designer.cs | 81 +++- .../JDGL/Check/WeekPlanEdit.aspx.cs | 7 +- .../JDGL/Check/WeekPlanStatisc.aspx | 85 +++++ .../JDGL/Check/WeekPlanStatisc.aspx.cs | 320 ++++++++++++++++ .../Check/WeekPlanStatisc.aspx.designer.cs | 150 ++++++++ SGGL/FineUIPro.Web/Web.config | 4 +- .../FineUIPro.Web/common/mainProject2.aspx.cs | 6 +- SGGL/WebAPI/WebAPI.csproj.user | 2 +- 14 files changed, 1242 insertions(+), 108 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_WH_2024-05-15-gaofei.sql create mode 100644 SGGL/FineUIPro.Web/JDGL/Check/WeekPlanStatisc.aspx create mode 100644 SGGL/FineUIPro.Web/JDGL/Check/WeekPlanStatisc.aspx.cs create mode 100644 SGGL/FineUIPro.Web/JDGL/Check/WeekPlanStatisc.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_WH_2024-05-15-gaofei.sql b/DataBase/版本日志/SGGLDB_WH_2024-05-15-gaofei.sql new file mode 100644 index 00000000..92fdde3f --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2024-05-15-gaofei.sql @@ -0,0 +1,350 @@ + +--ȡǰ˴ +ALTER PROCEDURE [dbo].[Sp_Project_GetToDoItems] + @projectId NVARCHAR(50)=NULL, + @userId NVARCHAR(200)=NULL +AS +/*ȡǰ˴*/ +BEGIN +SELECT HazardRegisterId AS DataId + ,'B6BE5FE0-CB84-47FF-A6C3-5AD9E1CCE079' AS MenuId + ,'ȫѲ' AS MenuName + ,register.RegisterDef AS Content + ,UserId + ,users.UserName + ,register.RegisterDate AS DataTime + ,CONVERT(varchar(100),register.RegisterDate, 23) AS DataTimeStr + ,'../HSSE/HiddenInspection/HiddenRectificationRectify.aspx?HazardRegisterId='+register.HazardRegisterId AS PCUrl +FROM HSSE_Hazard_HazardRegister AS register +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE register.ProjectId=@projectId AND +((register.states = '1' AND (register.ResponsibleMan =@userId OR register.CCManIds LIKE ('%'+@userId+'%') )) +) +UNION ALL + +SELECT HazardRegisterId AS DataId + ,'B6BE5FE0-CB84-47FF-A6C3-5AD9E1CCE079' AS MenuId + ,'ȫѲȷ' AS MenuName + ,register.RegisterDef AS Content + ,UserId + ,users.UserName + ,register.RegisterDate AS DataTime + ,CONVERT(varchar(100),register.RegisterDate, 23) AS DataTimeStr + ,'../HSSE/HiddenInspection/HiddenRectificationConfirm.aspx?HazardRegisterId='+register.HazardRegisterId AS PCUrl +FROM HSSE_Hazard_HazardRegister AS register +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE register.ProjectId=@projectId AND +register.states = '2' AND register.CheckManId =@userId + +UNION ALL +SELECT CheckControlCode AS DataId + ,'B3E99BD9-FDC7-4F15-8C3C-A7821AC9E306' AS MenuId + ,'Ѳ' AS MenuName + ,checkControl.QuestionDef AS Content + ,UserId + ,users.UserName + ,checkControl.CheckDate AS DataTime + ,CONVERT(varchar(100),checkControl.CheckDate, 23) AS DataTimeStr + ,'../CQMS/Check/ChecklistEdit.aspx?ToDo=ToDo&CheckControlCode='+checkControl.CheckControlCode AS PCUrl +FROM Check_CheckControl AS checkControl +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE checkControl.ProjectId=@projectId AND +checkControl.State != '7' AND checkControl.CheckControlCode in (select CheckControlCode from Check_CheckControlApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) + +UNION ALL +SELECT GJSXID AS DataId + ,'0BEA2126-7A48-40EB-8E21-99148E91A22B' AS MenuId + ,'ؼ' AS MenuName + ,GJSX.Detail AS Content + ,users.UserId + ,users.UserName + ,GJSX.CreateDate AS DataTime + ,CONVERT(varchar(100),GJSX.CreateDate, 23) AS DataTimeStr + ,'../PZHGL/GJSX/GJSXListEdit.aspx?ToDo=ToDo&EditType=Edit&ID='+GJSXID AS PCUrl +FROM GJSX +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE GJSX.ProjectId=@projectId AND +GJSX.State != 0 AND (((select count(*) from GJSX_detail detail where detail.Progress_user=@userId and detail.GJSXID=GJSX.GJSXID)=0 +and (select count(*) from GJSX_Process process where process.UserId=@userId and process.GJSXID=GJSX.GJSXID)>0) +or (GJSX.User_Acceptance like '%'+@userId+'%' and (select count(*) from GJSX_detail detail where detail.GJSXID=GJSX.GJSXID)=(select count(*) from GJSX_Process process where process.GJSXID=GJSX.GJSXID)) +) + +UNION ALL +SELECT InspectionEquipmentId AS DataId + ,'6c2c1e5e-1812-4e1c-a683-7125518e28c7' AS MenuId + ,'豸ϱȷ' AS MenuName + ,Equipment.InspectionName AS Content + ,UserId + ,users.UserName + ,Equipment.InspectionDate AS DataTime + ,CONVERT(varchar(100),Equipment.InspectionDate, 23) AS DataTimeStr + ,'../CQMS/Comprehensive/InspectionEquipmentEdit.aspx?ToDo=ToDo&InspectionEquipmentId='+Equipment.InspectionEquipmentId AS PCUrl +FROM Comprehensive_InspectionEquipment AS Equipment +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE Equipment.ProjectId=@projectId and +Equipment.Status!='3' AND Equipment.InspectionEquipmentId in (select InspectionEquipmentId from Comprehensive_InspectionEquipmentApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) +UNION ALL +SELECT InspectionPersonId AS DataId + ,'8ed133de-5899-4687-878a-20b1f5280f18' AS MenuId + ,'Աȷ' AS MenuName + ,Person.PersonName AS Content + ,UserId + ,users.UserName + ,Person.CompileDate AS DataTime + ,CONVERT(varchar(100),Person.CompileDate, 23) AS DataTimeStr + ,'../CQMS/Comprehensive/InspectionPersonEdit.aspx?ToDo=ToDo&InspectionPersonId='+Person.InspectionPersonId AS PCUrl +FROM Comprehensive_InspectionPerson AS Person +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE Person.ProjectId=@projectId and +Person.Status!='3' AND Person.InspectionPersonId in (select InspectionPersonId from Comprehensive_InspectionPersonApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) +UNION ALL +SELECT InspectionMachineId AS DataId + ,'aa55fad1-6c51-43f5-8c99-3c6aaae79118' AS MenuId + ,'߱ȷ' AS MenuName + ,Machine.InspectionMachineName AS Content + ,UserId + ,users.UserName + ,Machine.CompileDate AS DataTime + ,CONVERT(varchar(100),Machine.CompileDate, 23) AS DataTimeStr + ,'../CQMS/Comprehensive/InspectionMachineEdit.aspx?ToDo=ToDo&InspectionMachineId='+Machine.InspectionMachineId AS PCUrl +FROM Comprehensive_InspectionMachine AS Machine +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE Machine.ProjectId=@projectId and +Machine.Status!='3' AND Machine.InspectionMachineId in (select InspectionMachineId from Comprehensive_InspectionMachineApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) +UNION ALL +SELECT ConstructSolutionId AS DataId + ,'91C4BFDB-0A51-4992-99CC-EB4EC185593D' AS MenuId + ,'ʩ' AS MenuName + ,Solution.SolutionName AS Content + ,UserId + ,users.UserName + ,Solution.CompileDate AS DataTime + ,CONVERT(varchar(100),Solution.CompileDate, 23) AS DataTimeStr + ,'../CQMS/Solution/EditConstructSolution.aspx?ToDo=ToDo&ConstructSolutionId='+Solution.ConstructSolutionId AS PCUrl +FROM Solution_CQMSConstructSolution AS Solution +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE Solution.ProjectId=@projectId and +Solution.State!='3' +AND Solution.ConstructSolutionId in +(select top 1 ConstructSolutionId from ( +SELECT Solution_CQMSConstructSolutionApprove.* +FROM Solution_CQMSConstructSolutionApprove, +(SELECT MIN([order]) AS [order],ConstructSolutionId FROM Solution_CQMSConstructSolutionApprove where ApproveType!='S' and ApproveDate is null GROUP BY ConstructSolutionId )b +WHERE Solution_CQMSConstructSolutionApprove.[order] = b.[order] and Solution_CQMSConstructSolutionApprove.ConstructSolutionId = b.ConstructSolutionId + ) approve +where approve.ApproveMan=@userId ) + +UNION ALL +SELECT InspectionId AS DataId + ,'4781f467-35bf-4cf2-aaa4-7960a175eb61' AS MenuId + ,'֪ͨ' AS MenuName + ,InspectionManagement.AcceptanceSite AS Content + ,UserId + ,users.UserName + ,InspectionManagement.CompileDate AS DataTime + ,CONVERT(varchar(100),InspectionManagement.CompileDate, 23) AS DataTimeStr + ,'../CQMS/ProcessControl/InspectionNoticeEdit.aspx?View=View&InspectionId='+InspectionManagement.InspectionId AS PCUrl +FROM ProcessControl_InspectionManagement AS InspectionManagement +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE InspectionManagement.ProjectId=@projectId and +dateadd(day,3,InspectionManagement.CompileDate)>getdate() and InspectionManagement.AcceptanceCheckMan like '%'+@userId+'%' +UNION ALL +SELECT CheckSpecialId AS DataId + ,'1B08048F-93ED-4E84-AE65-DB7917EA2DFB' AS MenuId + ,'ר' AS MenuName + ,CheckItemSet.CheckItemName AS Content + ,UserId + ,users.UserName + ,CheckSpecial.CheckTime AS DataTime + ,CONVERT(varchar(100),CheckSpecial.CheckTime, 23) AS DataTimeStr + ,'../HSSE/Check/CheckSpecialView.aspx?CheckSpecialId='+CheckSpecial.CheckSpecialId AS PCUrl +FROM Check_CheckSpecial AS CheckSpecial +LEFT JOIN Sys_User AS users ON users.UserId =@userId +LEFT JOIN Technique_CheckItemSet AS CheckItemSet ON CheckItemSet.CheckItemSetId =CheckSpecial.CheckItemSetId +WHERE CheckSpecial.ProjectId=@projectId and +dateadd(day,3,CheckSpecial.CheckTime)>getdate() and CheckSpecial.PartInPersonIds like '%'+@userId+'%' +UNION ALL +SELECT CheckColligationId AS DataId + ,'C198EBA8-9E23-4654-92E1-09C61105C522' AS MenuId + ,'ۺϼ' AS MenuName + ,case CheckType when '0' then 'ܼ' when '1' then '¼' else '' end AS Content + ,users.UserId + ,users.UserName + ,CheckColligation.CheckTime AS DataTime + ,CONVERT(varchar(100),CheckColligation.CheckTime, 23) AS DataTimeStr + ,'../HSSE/Check/CheckColligationEdit.aspx?CheckColligationId='+CheckColligation.CheckColligationId AS PCUrl +FROM Check_CheckColligation AS CheckColligation +LEFT JOIN Sys_User AS users ON users.UserId =@userId +LEFT JOIN Sys_FlowOperate AS FlowOperate ON CheckColligation.CheckColligationId=FlowOperate.DataId +LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId +WHERE CheckColligation.ProjectId=@projectId and FlowOperate.IsClosed <> 1 and FlowOperate.OperaterId=@userId +UNION ALL +SELECT PatrolPlanId AS DataId + ,'D256E5C8-DC76-4F4D-BABE-A253418823F4' AS MenuId + ,'Ѳ' AS MenuName + ,HazardListItem.HazardItems AS Content + ,UserId + ,users.UserName + ,PatrolPlan.LimitCheckDate AS DataTime + ,CONVERT(varchar(100),PatrolPlan.LimitCheckDate, 23) AS DataTimeStr + ,'../HSSE/Hazard/RoutingInspectionEdit.aspx?PatrolPlanId='+PatrolPlan.PatrolPlanId AS PCUrl +FROM Hazard_PatrolPlan AS PatrolPlan +LEFT JOIN Sys_User AS users ON users.UserId =@userId +LEFT JOIN Hazard_HazardSelectedItem AS HazardListItem on HazardListItem.HazardSelectedItemId=PatrolPlan.HazardSelectedItemId +WHERE HazardListItem.ProjectId=@projectId and +dateadd(day,-3,PatrolPlan.LimitCheckDate)=22 and (select COUNT(*) from JDGL_QuantityCompletion WHERE ProjectId=@projectId and DATENAME(year,GETDATE())=DATENAME(year,EndDate) and DATENAME(MONTH,GETDATE())=DATENAME(MONTH,EndDate))=0) +or (DATEADD(day,60,(select top 1 EndDate from JDGL_QuantityCompletion WHERE ProjectId=@projectId order by EndDate desc))=22 and +DATENAME(year,GETDATE())=DATENAME(year,MonthPlan.PlanDate) and DATENAME(MONTH,GETDATE())=DATENAME(MONTH,MonthPlan.PlanDate) +UNION ALL +SELECT WeekPlan.WeekPlanId AS DataId + ,'56A54B4B-BBA3-4249-9FFC-3A60DAC79059' AS MenuId + ,'ܽȼƻδ' AS MenuName + ,'' AS Content + ,users.UserId + ,users.UserName + ,GETDATE() AS DataTime + ,CONVERT(varchar(100),GETDATE(), 23) AS DataTimeStr + ,'../JDGL/Check/WeekPlanEdit.aspx?ToDo=ToDo&WeekNo='+ WeekPlan.WeekNo AS PCUrl +FROM JDGL_WeekPlan AS WeekPlan +LEFT JOIN Sys_User AS users ON users.UserId =@userId +LEFT JOIN Project_ProjectUser as pu on pu.UserId=@userId +WHERE WeekPlan.ProjectId=@projectId +and WeekPlan.DutyPerson=@userId and (WeekPlan.IsOK is null or WeekPlan.IsOK=0) and dateadd(day,2,WeekPlan.PlanDate)>getdate() + +ORDER BY DataTime DESC +END + + + + + + + + + + + + + + + +GO + + diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportService.cs index f68c1733..700ef511 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportService.cs @@ -152,6 +152,48 @@ namespace BLL return reports; } + /// + /// 获取出入记录人工时-月报 + /// + /// + public static List getAllMonthReports(string projectId, DateTime? sDate) + { + Model.SGGLDB db = Funs.DB; + List reports = new List(); + var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber + where x.ProjectId == projectId + select x; + if (getAllPersonInOutList.Count() > 0) + { + var getInMonths = (from x in getAllPersonInOutList select new { x.InOutDate.Year, x.InOutDate.Month }).Distinct(); + if (sDate.HasValue) + { + getInMonths = getInMonths.Where(x => x.Year <= sDate.Value.Year && x.Month <= sDate.Value.Month); + } + foreach (var item in getInMonths) + { + DateTime compileDate = Funs.GetNewDateTimeOrNow(item.Year.ToString() + "-" + item.Month.ToString()); + var getNow = getAllPersonInOutList.Where(x => x.InOutDate.Year == compileDate.Year && x.InOutDate.Month == compileDate.Month).Max(x => x.WorkHours); + if (getNow.HasValue) + { + Model.SitePerson_MonthReport reportItem = new Model.SitePerson_MonthReport + { + MonthReportId = SQLHelper.GetNewID(), + ProjectId = projectId, + CompileDate = Funs.GetNewDateTime(item.Year.ToString() + "-" + item.Month.ToString()), + TotalPersonWorkTime = getNow, + }; + DateTime upDate = compileDate.AddMonths(-1); + var getMax = getAllPersonInOutList.Where(x => x.InOutDate.Year == upDate.Year && x.InOutDate.Month == upDate.Month).Max(x => x.WorkHours) ?? 0; + reportItem.DayWorkTime = (getNow ?? 0) - getMax; + reports.Add(reportItem); + } + + } + } + return reports; + } + /// /// 获取出入记录人工时-月报累计 /// diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 9a063def..1e2448d5 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1408,6 +1408,7 @@ + @@ -13962,6 +13963,13 @@ WeekPlanIn.aspx + + WeekPlanStatisc.aspx + ASPXCodeBehind + + + WeekPlanStatisc.aspx + EarnedValueCurve.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user index b8cc84be..b52b49a8 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU true false diff --git a/SGGL/FineUIPro.Web/JDGL/Check/WeekPlan.aspx b/SGGL/FineUIPro.Web/JDGL/Check/WeekPlan.aspx index f1387b45..698eedbc 100644 --- a/SGGL/FineUIPro.Web/JDGL/Check/WeekPlan.aspx +++ b/SGGL/FineUIPro.Web/JDGL/Check/WeekPlan.aspx @@ -12,85 +12,143 @@ + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +