diff --git a/DataBase/版本日志/SGGLDB_WH_V2025-02-17-gf.sql b/DataBase/版本日志/SGGLDB_WH_V2025-02-17-gf.sql new file mode 100644 index 00000000..866f8eb7 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_V2025-02-17-gf.sql @@ -0,0 +1,326 @@ + +--ȡǰ˴ +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)=20 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) + + +ORDER BY DataTime DESC +END + + + + +GO + + diff --git a/DataBase/版本日志/SUBQHSE_V2025-02-12-gf.sql b/DataBase/版本日志/SUBQHSE_V2025-02-12-gf.sql new file mode 100644 index 00000000..665c0071 --- /dev/null +++ b/DataBase/版本日志/SUBQHSE_V2025-02-12-gf.sql @@ -0,0 +1,2 @@ +update Sys_Menu set MenuName='' where MenuId='858E83E9-ADE5-452E-BD65-82D8DFF872C0' +GO diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 99a5c7bf..a86bf87c 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -610,6 +610,8 @@ + + diff --git a/SGGL/BLL/JDGL/WBS/JDGLWBSDetailService.cs b/SGGL/BLL/JDGL/WBS/JDGLWBSDetailService.cs new file mode 100644 index 00000000..ad79333a --- /dev/null +++ b/SGGL/BLL/JDGL/WBS/JDGLWBSDetailService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class JDGLWBSDetailService + { + public static List GetWBSDetailsByWorkPackageId(string workPackageId) + { + return (from x in Funs.DB.JDGL_WBSDetail where x.WorkPackageId == workPackageId select x).ToList(); + } + } +} diff --git a/SGGL/BLL/JDGL/WBS/JDGLWBSService.cs b/SGGL/BLL/JDGL/WBS/JDGLWBSService.cs new file mode 100644 index 00000000..22791380 --- /dev/null +++ b/SGGL/BLL/JDGL/WBS/JDGLWBSService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public static class JDGLWBSService + { + public static List GetWBSsByProjectId(string projectId,string parentId) + { + return (from x in Funs.DB.JDGL_WBS where x.ParentId == parentId && x.ProjectId == projectId orderby x.PathCode select x).ToList(); + } + } +} diff --git a/SGGL/BLL/OpenService/MonitorService.cs b/SGGL/BLL/OpenService/MonitorService.cs index be248aad..1949ea33 100644 --- a/SGGL/BLL/OpenService/MonitorService.cs +++ b/SGGL/BLL/OpenService/MonitorService.cs @@ -2179,7 +2179,7 @@ namespace BLL //////推送订阅消息 GetDataService.SendSubscribeMessage(); GetDataService.CorrectingPersonInOutNumber(null); - + } #region 启动监视器 定时每天执行 获取指定项目管道焊接工程量等信息 @@ -2230,7 +2230,8 @@ namespace BLL } finally { - getPipelineWeldingQuantities.Interval = 1000 * 3600 * 24; + //getPipelineWeldingQuantities.Interval = 1000 * 3600 * 24; + getPipelineWeldingQuantities.Interval = 1000 * 3600 * 12; getPipelineWeldingQuantities.Start(); } } diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index a4dbe12c..a76fce8b 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -19374,7 +19374,7 @@ - + - + @@ -77,7 +77,7 @@ - + diff --git a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs index f2606cd6..9f3cb957 100644 --- a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs @@ -441,7 +441,7 @@ namespace FineUIPro.Web.common /// protected int GetCompletedNum() { - var result = Project_HSSEData_HSSEService.GetCompletedNum(ProjectId); + var result = Project_HSSEData_HSSEService.GetFinishedNum(ProjectId); return result; } @@ -481,7 +481,7 @@ namespace FineUIPro.Web.common /// protected int GetSuperCompletedNum() { - var result = Project_HSSEData_HSSEService.GetSuperCompletedNum(ProjectId); + var result = Project_HSSEData_HSSEService.GetSuperFinishedNum(ProjectId); return result; } diff --git a/SGGL/FineUIPro.Web/common/main_new.aspx.cs b/SGGL/FineUIPro.Web/common/main_new.aspx.cs index a9ec355c..153fd18e 100644 --- a/SGGL/FineUIPro.Web/common/main_new.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main_new.aspx.cs @@ -24,15 +24,16 @@ namespace FineUIPro.Web.common { pids = CurrUser.CompanyProjectId.Split(','); } - else { + else + { //加载所有在建项目的数据 - var pidArray = Funs.DB.Base_Project.Where(x => x.ProjectState == "1").Select(x=>x.ProjectId).ToArray(); - if (pidArray.Length>0) + var pidArray = Funs.DB.Base_Project.Where(x => x.ProjectState == "1").Select(x => x.ProjectId).ToArray(); + if (pidArray.Length > 0) { pids = pidArray; } } - + //未遂事故 var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord @@ -52,21 +53,23 @@ namespace FineUIPro.Web.common { countAqrgsSum = CountAqrgs(); } - else { - countAqrgsSum = CountAqrgs(null,null,pids); + else + { + countAqrgsSum = CountAqrgs(null, null, pids); } - + if (countAqrgsSum > 10000) { countAqrgsSum = countAqrgsSum / Convert.ToDecimal(10000.00); this.divSafeWorkTime.InnerHtml = Math.Round(countAqrgsSum, 2).ToString() + "万"; } - else { + else + { this.divSafeWorkTime.InnerHtml = countAqrgsSum.ToString().Split('.')[0]; } - + //本月安全人工时 //int wHoursMonth = 0; @@ -85,7 +88,7 @@ namespace FineUIPro.Web.common } else { - countMonthAqrgs = CountAqrgs(d1, d2,pids); + countMonthAqrgs = CountAqrgs(d1, d2, pids); } if (countMonthAqrgs > 10000) { @@ -93,7 +96,8 @@ namespace FineUIPro.Web.common this.divSafeWorkTimeMonth.InnerHtml = Math.Round(countMonthAqrgs, 2).ToString() + "万"; } - else { + else + { this.divSafeWorkTimeMonth.InnerHtml = CountAqrgs(d1, d2).ToString().Split('.')[0]; } @@ -113,11 +117,12 @@ namespace FineUIPro.Web.common boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)).ToList().Count; this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString(); } - else { - getTrainRecord = db.EduTrain_TrainRecord.Where(x=>pids.Contains(x.ProjectId)).Sum(x => x.TrainPersonNum) ?? 0; + else + { + getTrainRecord = db.EduTrain_TrainRecord.Where(x => pids.Contains(x.ProjectId)).Sum(x => x.TrainPersonNum) ?? 0; //修改:增加博晟教育中的人数 boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null) - && pids.Contains(x.ProjectId) ).ToList().Count; + && pids.Contains(x.ProjectId)).ToList().Count; this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString(); } @@ -137,7 +142,8 @@ namespace FineUIPro.Web.common select x; this.divSafeManagePersonNum.InnerText = glAllPerson.Count().ToString(); } - else { + else + { //安全管理人员 var allSum = from x in Funs.DB.SitePerson_Person where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now) @@ -174,11 +180,12 @@ namespace FineUIPro.Web.common select x).Count(); divCqmsPxNum.InnerText = CqmsPxNum.ToString(); } - else { + else + { CqmsManageNum = (from x in Funs.DB.SitePerson_Person - join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId - where x.IsUsed == true && y.IsCQMS == true && pids.Contains(x.ProjectId) - select x).Count(); + join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId + where x.IsUsed == true && y.IsCQMS == true && pids.Contains(x.ProjectId) + select x).Count(); this.divCqmsManageNum.InnerText = CqmsManageNum.ToString(); CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson @@ -193,10 +200,11 @@ namespace FineUIPro.Web.common { allProjects = ProjectService.GetAllProjectDropDownList(); } - else { + else + { allProjects = ProjectService.GetAllProjectDropDownList(pids); } - + int acount = allProjects.Count(); int pcount1 = 0; int pcount2 = 0; @@ -205,10 +213,12 @@ namespace FineUIPro.Web.common { pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Count(); var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(','); - if (pids == null) { + if (pids == null) + { pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x).Count(); } - else { + else + { pidzjsg = pids; pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x).Count(); } @@ -279,7 +289,7 @@ namespace FineUIPro.Web.common /// /// /// - protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null,string[] pids =null) + protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null, string[] pids = null) { decimal cout1 = 0; @@ -288,12 +298,13 @@ namespace FineUIPro.Web.common var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber select x; - if (pids != null) { + if (pids != null) + { getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber where pids.Contains(x.ProjectId) select x; } - if (getAllPersonInOutList.Count() > 0) + if (getAllPersonInOutList.Count() > 0) { if (datetime1.HasValue) { @@ -305,7 +316,16 @@ namespace FineUIPro.Web.common } if (getAllPersonInOutList.Count() > 0) { - cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours); + //cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours); + foreach (var pid in pids) + { + var q1 = getAllPersonInOutList.Where(x => x.ProjectId == pid).OrderByDescending(x => x.InOutDate); + var q2 = getAllPersonInOutList.Where(x => x.ProjectId == pid).OrderBy(x => x.InOutDate); + if (q1.Count() > 0) + { + cout1 += (q1.First().WorkHours ?? 0) - (q2.First().WorkHours ?? 0); + } + } } } @@ -318,15 +338,15 @@ namespace FineUIPro.Web.common where y.ProjectState == Const.ProjectState_1 select x; - if (pids!=null) + if (pids != null) { getD1 = from x in Funs.DB.Accident_AccidentHandle join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId - where pids.Contains(x.ProjectId) + where pids.Contains(x.ProjectId) select x; getD2 = from x in Funs.DB.Accident_AccidentReport join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId - where pids.Contains(x.ProjectId) + where pids.Contains(x.ProjectId) select x; } @@ -716,7 +736,8 @@ namespace FineUIPro.Web.common zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString(); } - else { + else + { zlallNumber = (from x in Funs.DB.Check_CheckControl where x.CheckDate <= DateTime.Now && pids.Contains(x.ProjectId) select x).Count().ToString(); @@ -736,7 +757,7 @@ namespace FineUIPro.Web.common zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString(); } - + } #endregion @@ -764,7 +785,8 @@ namespace FineUIPro.Web.common zlgjzgl = zgl.ToString(); zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString(); } - else { + else + { var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement where pids.Contains(x.ProjectId) select x).Count(); @@ -780,7 +802,7 @@ namespace FineUIPro.Web.common zlgjzgl = zgl.ToString(); zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString(); } - + } #endregion @@ -799,7 +821,7 @@ namespace FineUIPro.Web.common double result = 0; Model.SGGLDB db = Funs.DB; var ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" select x; - if (pids!=null) + if (pids != null) { ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && pids.Contains(x.ProjectId) select x; } @@ -886,7 +908,8 @@ namespace FineUIPro.Web.common select x).Count(); gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString(); } - else { + else + { //Check_JointCheck var znum = (from x in Funs.DB.GJSX where pids.Contains(x.ProjectId) @@ -913,7 +936,7 @@ namespace FineUIPro.Web.common select x).Count(); gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString(); } - + } #endregion @@ -928,8 +951,9 @@ namespace FineUIPro.Web.common { getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now); } - else { - getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now,pids); + else + { + getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now, pids); } AllCount = getallin.Count(); if (AllCount > 0) @@ -954,13 +978,14 @@ namespace FineUIPro.Web.common var list = new List(); if (pids == null) { - list= Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList(); + list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList(); } - else { + else + { list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId)).ToList(); } - - + + foreach (var item in list) { ProjectPersonMc += "'" + item.ShortName + "',"; @@ -981,10 +1006,11 @@ namespace FineUIPro.Web.common { list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null) && x.Progress != null).ToList(); } - else { + else + { list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId) && x.Progress != null).ToList(); } - if (list.Count>0) + if (list.Count > 0) { foreach (var item in list) { @@ -994,7 +1020,7 @@ namespace FineUIPro.Web.common ProjectJd = ProjectJd.TrimEnd(','); ProjectMc = ProjectMc.TrimEnd(','); } - + } #endregion @@ -1011,28 +1037,29 @@ namespace FineUIPro.Web.common /// 获取隐患整改闭环项 /// /// - public int GetGeneralClosedNum() + public int GetGeneralClosedNum() { int result = 0; - if (pids==null) + if (pids == null) { result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.States == "3" select x).Count(); } - else { + else + { result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.States == "3" && pids.Contains(x.ProjectId) select x).Count(); } - + return result; } /// /// 获取隐患未整改完成项 /// /// - public int GetGeneralNotClosedNum() + public int GetGeneralNotClosedNum() { int result = 0; if (pids == null) @@ -1041,12 +1068,13 @@ namespace FineUIPro.Web.common where x.States != "3" select x).Count(); } - else { + else + { result = (from x in Funs.DB.HSSE_Hazard_HazardRegister where x.States != "3" && pids.Contains(x.ProjectId) select x).Count(); } - + return result; } #endregion @@ -1192,7 +1220,7 @@ namespace FineUIPro.Web.common /// 获取未遂事件数 /// /// - private int GetNearMissNum() + private int GetNearMissNum() { if (pids == null) { @@ -1202,7 +1230,8 @@ namespace FineUIPro.Web.common select x).Count(); return result; } - else { + else + { var result = (from x in Funs.DB.Accident_AccidentPersonRecord join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime @@ -1210,7 +1239,7 @@ namespace FineUIPro.Web.common select x).Count(); return result; } - + } } } \ No newline at end of file