diff --git a/DataBase/版本日志/SGGLDB_V2023-09-21.sql b/DataBase/版本日志/SGGLDB_V2023-09-21.sql new file mode 100644 index 00000000..6a51c7fd --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-09-21.sql @@ -0,0 +1,96 @@ +ALTER TABLE HSSE_Hazard_HazardRegister ADD WorkPackageId NVARCHAR(2000) NULL +GO +ALTER TABLE HSSE_Hazard_HazardRegister ADD WorkPackageName NVARCHAR(2000) NULL +GO + +ALTER TABLE Check_CheckControl ADD WorkPackageId NVARCHAR(2000) NULL +GO +ALTER TABLE Check_CheckControl ADD WorkPackageName NVARCHAR(2000) NULL +GO + + +ALTER VIEW [dbo].[View_Hazard_HazardRegister] +AS +/**********ȫѲͼ*************/ +SELECT Registration.HazardRegisterId, + Registration.HazardCode, + Registration.RegisterDate, + Registration.RegisterDef, + Registration.Rectification, + Registration.Place, + Registration.ResponsibleUnit, + Registration.Observer, + Registration.RectifiedDate, + Registration.ProjectId, + Registration.states, + Registration.IsEffective, + Registration.ResponsibleMan, + Registration.CheckManId, + Registration.CheckTime, + Registration.RectificationPeriod, + (CASE WHEN Registration.ImageUrl IS NULL THEN at.AttachUrl ELSE Registration.ImageUrl END) AS ImageUrl, + (CASE WHEN Registration.RectificationImageUrl IS NULL THEN at_r.AttachUrl ELSE Registration.RectificationImageUrl END) AS RectificationImageUrl, + Registration.RectificationTime, + Registration.ConfirmMan, + Registration.ConfirmDate, + Registration.HandleIdea, + Registration.CutPayment, + Registration.ProblemTypes, + Registration.CheckSpecialId, + Registration.CheckItemDetailId, + Registration.SupCheckItemSetId, + Registration.CheckItemSetId, + Registration.SafeSupervisionId, + Registration.SafeSupervisionIsOK, + Project.ProjectName, + Registration.CheckCycle, + ISNULL(WorkArea.UnitWorkName,'') AS WorkAreaName, + Unit.UnitName AS ResponsibilityUnitName, + User1.PersonName AS ResponsibilityManName, + ISNULL(User1.Telephone,'') AS ResponsibilityManTel, + User2.PersonName AS CheckManName, + ISNULL(User2.Telephone,'') AS CheckManTel, + User2.UnitId AS SendUnitId, + User3.PersonName AS ConfirmManName, + ISNULL(User3.Telephone,'') AS ConfirmManTel, + User4.PersonName AS ResponsibilityManName2, + ISNULL(User4.Telephone,'') AS ResponsibilityMan2Tel, + (CASE WHEN Registration.states='1' and (Registration.SafeSupervisionIsOK is null OR Registration.SafeSupervisionIsOK=0) THEN '' + WHEN Registration.states='1' and Registration.SafeSupervisionIsOK=1 THEN 'ϸ' + WHEN Registration.states='2' THEN '' + WHEN Registration.states='3' THEN 'ѱջ' + ELSE '' END ) AS StatesStr, + RegisterTypes.RegisterTypesId, + RegisterTypes.RegisterTypesName, + Registration.DIC_ID, + Registration.CCManIds, + CCManNames = STUFF(( SELECT ',' + PersonName FROM Person_Persons + where PATINDEX('%,' + RTRIM(Person_Persons.PersonId) + ',%',',' + Registration.CCManIds + ',')>0 + ORDER BY PATINDEX('%,' + RTRIM(Registration.CCManIds) + ',%',',' + Registration.CCManIds + ',') + FOR XML PATH('')), 1, 1,''), + Registration.Requirements, + Registration.HazardValue, + Registration.RegisterTypes2Id , + RegisterTypes2.RegisterTypesName as RegisterTypes2Name, + Registration.RegisterTypes3Id , + RegisterTypes3.RegisterTypesName as RegisterTypes3Name, + Registration.RegisterTypes4Id , + RegisterTypes4.RegisterTypesName as RegisterTypes4Name, + Registration.WorkPackageId, + Registration.WorkPackageName +FROM dbo.HSSE_Hazard_HazardRegister AS Registration +LEFT JOIN dbo.Base_Project AS Project ON Project.ProjectId = Registration.ProjectId +LEFT JOIN dbo.WBS_UnitWork AS WorkArea ON WorkArea.UnitWorkId = Registration.Place +LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes ON RegisterTypes.RegisterTypesId = Registration.RegisterTypesId +LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes2 ON RegisterTypes2.RegisterTypesId = Registration.RegisterTypes2Id +LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes3 ON RegisterTypes3.RegisterTypesId = Registration.RegisterTypes3Id +LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes4 ON RegisterTypes4.RegisterTypesId = Registration.RegisterTypes4Id +LEFT JOIN dbo.Base_Unit AS Unit ON Unit.UnitId = Registration.ResponsibleUnit +LEFT JOIN dbo.Person_Persons AS User1 ON User1.PersonId = Registration.ResponsibleMan +LEFT JOIN dbo.Person_Persons AS User2 ON User2.PersonId = Registration.CheckManId +LEFT JOIN dbo.Person_Persons AS User3 ON User3.PersonId = Registration.ConfirmMan +LEFT JOIN dbo.Person_Persons AS User4 ON User4.PersonId = Registration.ResponsibleMan2 +LEFT JOIN dbo.AttachFile AS at ON at.ToKeyId = Registration.HazardRegisterId +LEFT JOIN dbo.AttachFile AS at_r ON at_r.ToKeyId = Registration.HazardRegisterId+'-R' + +GO diff --git a/DataBase/版本日志/SGGLDB_V2023-09-22.sql b/DataBase/版本日志/SGGLDB_V2023-09-22.sql new file mode 100644 index 00000000..56389702 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-09-22.sql @@ -0,0 +1,134 @@ +alter table [dbo].[ZHGL_ConstructionLog] add FileCode nvarchar(50) null +GO + +update Sys_Menu set MenuName='ʩ־',IsEnd=0 where MenuId='4CB03F8B-C967-4082-ADF1-08776FE40E21' +GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('0383A4A1-1565-4F11-BAF3-2B84CB621796','ʩ־','PZHGL/InformationProject/ConstructionLog.aspx',10,'4CB03F8B-C967-4082-ADF1-08776FE40E21','Menu_PZHGL',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D853D4D4-4D31-45D2-ADF4-F8799EC68B02','0383A4A1-1565-4F11-BAF3-2B84CB621796','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('3A559270-B5F8-4FD3-B6DA-37D5D5C7CAFB','0383A4A1-1565-4F11-BAF3-2B84CB621796','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('86812B35-34D8-42DE-B989-BC1DDA6B7CD3','0383A4A1-1565-4F11-BAF3-2B84CB621796','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('C179D43F-10C7-48F1-A06D-D09A9C0433D2','0383A4A1-1565-4F11-BAF3-2B84CB621796','',4) + GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','Ŀʩ־','PZHGL/InformationProject/ProjectConstructionLog.aspx',20,'4CB03F8B-C967-4082-ADF1-08776FE40E21','Menu_PZHGL',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D7CE42E6-2641-453B-9AE5-11F0570E00F8','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('2B47E22C-6A37-4E16-A6A1-70386DDC5F81','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','޸',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('817A0F17-C2F9-4EF7-9889-844064933757','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','ɾ',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('7CA03E95-00EA-4118-A8EA-F27CE48ACBA7','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','',4) + GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('1C190A15-CC04-441C-AEF3-C945A53A81A6','־ļ','PZHGL/InformationProject/ConstructionLogFileCabinet.aspx',30,'4CB03F8B-C967-4082-ADF1-08776FE40E21','Menu_PZHGL',0,1,1) + GO + +alter table [dbo].[WBS_UnitWork] add ContractId nvarchar(50) null +GO +alter table [dbo].[WBS_UnitWork] add MainItemCode nvarchar(50) null +GO +alter table [dbo].[ZHGL_ConstructionLog] alter column ContractNo nvarchar(500) null +GO +alter table [dbo].[ZHGL_ConstructionLog] add WorkPostId nvarchar(1000) null +GO +alter table [dbo].[ZHGL_ConstructionLog] add MachineId nvarchar(1000) null +GO +alter table [dbo].[Person_Persons] add LogWorkPostId nvarchar(1000) null +GO +alter table [dbo].[Person_Persons] add LogMachineId nvarchar(1000) null +GO +drop table [dbo].[ZHGL_ConstructionLogPerson] +GO + +CREATE TABLE [dbo].[ZHGL_ConstructionLogPerson]( + [ConstructionLogPersonId] [nvarchar](50) NOT NULL, + [ConstructionLogId] [nvarchar](50) NULL, + [UnitWorkId] [nvarchar](50) NULL, + [WorkPostId] [nvarchar](50) NULL, + [Num] [int] NULL, + CONSTRAINT [PK_ZHGL_ConstructionLogPerson] PRIMARY KEY CLUSTERED +( + [ConstructionLogPersonId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogPerson] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ConstructionLogPerson_ZHGL_ConstructionLog] FOREIGN KEY([ConstructionLogId]) +REFERENCES [dbo].[ZHGL_ConstructionLog] ([ConstructionLogId]) +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogPerson] CHECK CONSTRAINT [FK_ZHGL_ConstructionLogPerson_ZHGL_ConstructionLog] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogPerson', @level2type=N'COLUMN',@level2name=N'ConstructionLogPersonId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogPerson', @level2type=N'COLUMN',@level2name=N'ConstructionLogId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogPerson', @level2type=N'COLUMN',@level2name=N'UnitWorkId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogPerson', @level2type=N'COLUMN',@level2name=N'WorkPostId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'߹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogPerson', @level2type=N'COLUMN',@level2name=N'Num' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʩ־ҵԱϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogPerson' +GO + + +drop table [dbo].[ZHGL_ConstructionLogMachine] +GO + + +CREATE TABLE [dbo].[ZHGL_ConstructionLogMachine]( + [ConstructionLogMachineId] [nvarchar](50) NOT NULL, + [ConstructionLogId] [nvarchar](50) NULL, + [UnitWorkId] [nvarchar](50) NULL, + [MachineId] [nvarchar](50) NULL, + [Num] [int] NULL, + CONSTRAINT [PK_ZHGL_ConstructionLogMachine] PRIMARY KEY CLUSTERED +( + [ConstructionLogMachineId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogMachine] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ConstructionLogMachine_ZHGL_ConstructionLog] FOREIGN KEY([ConstructionLogId]) +REFERENCES [dbo].[ZHGL_ConstructionLog] ([ConstructionLogId]) +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogMachine] CHECK CONSTRAINT [FK_ZHGL_ConstructionLogMachine_ZHGL_ConstructionLog] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogMachine', @level2type=N'COLUMN',@level2name=N'ConstructionLogMachineId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogMachine', @level2type=N'COLUMN',@level2name=N'ConstructionLogId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogMachine', @level2type=N'COLUMN',@level2name=N'UnitWorkId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ڻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogMachine', @level2type=N'COLUMN',@level2name=N'Num' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʩ־еϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogMachine' +GO + + diff --git a/DataBase/版本日志/SGGLDB_V2023-09-25.sql b/DataBase/版本日志/SGGLDB_V2023-09-25.sql new file mode 100644 index 00000000..7cfb21a6 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-09-25.sql @@ -0,0 +1,104 @@ + +CREATE TABLE [dbo].[ZHGL_ProjectConstructionLog]( + [ProjectConstructionLogId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [Weather] [nvarchar](10) NULL, + [Temperature] [nvarchar](30) NULL, + [ContractNo] [nvarchar](500) NULL, + [UnitWorks] [nvarchar](500) NULL, + [Professional] [nvarchar](50) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + [State] [char](1) NULL, + [Remark] [nvarchar](500) NULL, + [HSETodaySummary] [nvarchar](3000) NULL, + [HSETodaySummaryRemark] [nvarchar](500) NULL, + [HSETomorrowPlan] [nvarchar](3000) NULL, + [HSETomorrowPlanRemark] [nvarchar](500) NULL, + [CQMSTodaySummary] [nvarchar](3000) NULL, + [CQMSTodaySummaryRemark] [nvarchar](500) NULL, + [CQMSTomorrowPlan] [nvarchar](3000) NULL, + [CQMSTomorrowPlanRemark] [nvarchar](500) NULL, + [FileCode] [nvarchar](50) NULL, + [WorkPostId] [nvarchar](1000) NULL, + [MachineId] [nvarchar](1000) NULL, + CONSTRAINT [PK_ZHGL_ProjectConstructionLog] PRIMARY KEY CLUSTERED +( + [ProjectConstructionLogId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[ZHGL_ProjectConstructionLog] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ProjectConstructionLog_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[ZHGL_ProjectConstructionLog] CHECK CONSTRAINT [FK_ZHGL_ProjectConstructionLog_Base_Project] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'ProjectConstructionLogId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'״' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'Weather' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¶' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'Temperature' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͬ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'ContractNo' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'UnitWorks' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'רҵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'Professional' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'״̬' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'State' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'Remark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫС' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'HSETodaySummary' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫСᱸע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'HSETodaySummaryRemark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫռƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'HSETomorrowPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ȫռƻע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'HSETomorrowPlanRemark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'С' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'CQMSTodaySummary' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Сᱸע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'CQMSTodaySummaryRemark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ռƻ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'CQMSTomorrowPlan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ռƻע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog', @level2type=N'COLUMN',@level2name=N'CQMSTomorrowPlanRemark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ŀʩ־' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ProjectConstructionLog' +GO + + + diff --git a/DataBase/版本日志/SGGLDB_V2023-10-07.sql b/DataBase/版本日志/SGGLDB_V2023-10-07.sql new file mode 100644 index 00000000..453b3561 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-10-07.sql @@ -0,0 +1,56 @@ + +CREATE TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiency]( + [ConstructionLogWorkEfficiencyId] [nvarchar](50) NOT NULL, + [ConstructionLogId] [nvarchar](50) NULL, + [ContractTrackId] [varchar](50) NULL, + [PhysicalCompletionQuantity] [decimal](18, 2) NULL, + [MaterialConsumption] [decimal](18, 2) NULL, + [Type] [nvarchar](20) NULL, + [TypeId] [nvarchar](50) NULL, + [ConsumeHours] [decimal](18, 2) NULL, + CONSTRAINT [PK_ZHGL_ConstructionLogWorkEfficiency] PRIMARY KEY CLUSTERED +( + [ConstructionLogWorkEfficiencyId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiency] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiency_PHTGL_ContractTrack] FOREIGN KEY([ContractTrackId]) +REFERENCES [dbo].[PHTGL_ContractTrack] ([Id]) +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiency] CHECK CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiency_PHTGL_ContractTrack] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'ConstructionLogWorkEfficiencyId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'ConstructionLogId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͬId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'ContractTrackId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'PhysicalCompletionQuantity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'MaterialConsumption' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͣ˹/е' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'Type' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'TypeId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ĺ/̨ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency', @level2type=N'COLUMN',@level2name=N'ConsumeHours' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʩ־Ч' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiency' +GO + + diff --git a/DataBase/菜单初始化脚本/1-8综合管理(Menu_PZHGL).sql b/DataBase/菜单初始化脚本/1-8综合管理(Menu_PZHGL).sql index 6f39a0ab..8b1c3466 100644 --- a/DataBase/菜单初始化脚本/1-8综合管理(Menu_PZHGL).sql +++ b/DataBase/菜单初始化脚本/1-8综合管理(Menu_PZHGL).sql @@ -12,8 +12,37 @@ VALUES('0DAFF358-EA16-44B2-8E4B-E15E40EFAAD0','总承包商施工报告','',20,' GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('4CB03F8B-C967-4082-ADF1-08776FE40E21','项目级施工日志','',30,'0','Menu_PZHGL',0,1,1) +VALUES('4CB03F8B-C967-4082-ADF1-08776FE40E21','施工日志','',30,'0','Menu_PZHGL',0,0,1) GO + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('0383A4A1-1565-4F11-BAF3-2B84CB621796','个人施工日志','PZHGL/InformationProject/ConstructionLog.aspx',10,'4CB03F8B-C967-4082-ADF1-08776FE40E21','Menu_PZHGL',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D853D4D4-4D31-45D2-ADF4-F8799EC68B02','0383A4A1-1565-4F11-BAF3-2B84CB621796','增加',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('3A559270-B5F8-4FD3-B6DA-37D5D5C7CAFB','0383A4A1-1565-4F11-BAF3-2B84CB621796','修改',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('86812B35-34D8-42DE-B989-BC1DDA6B7CD3','0383A4A1-1565-4F11-BAF3-2B84CB621796','删除',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('C179D43F-10C7-48F1-A06D-D09A9C0433D2','0383A4A1-1565-4F11-BAF3-2B84CB621796','保存',4) + GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','项目施工日志','PZHGL/InformationProject/ProjectConstructionLog.aspx',20,'4CB03F8B-C967-4082-ADF1-08776FE40E21','Menu_PZHGL',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('D7CE42E6-2641-453B-9AE5-11F0570E00F8','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','增加',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('2B47E22C-6A37-4E16-A6A1-70386DDC5F81','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','修改',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('817A0F17-C2F9-4EF7-9889-844064933757','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','删除',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('7CA03E95-00EA-4118-A8EA-F27CE48ACBA7','D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4','保存',4) + GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('1C190A15-CC04-441C-AEF3-C945A53A81A6','日志文件柜','PZHGL/InformationProject/ConstructionLogFileCabinet.aspx',30,'4CB03F8B-C967-4082-ADF1-08776FE40E21','Menu_PZHGL',0,1,1) + GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('CD88CE2A-A8E2-4F07-9A90-9161BD1C345C','工作交接','',40,'0','Menu_PZHGL',0,1,1) diff --git a/SGGL/BLL/API/APIBaseInfoService.cs b/SGGL/BLL/API/APIBaseInfoService.cs index ce396ca6..52a65a14 100644 --- a/SGGL/BLL/API/APIBaseInfoService.cs +++ b/SGGL/BLL/API/APIBaseInfoService.cs @@ -93,6 +93,29 @@ namespace BLL return getDataLists; } } + + /// + /// + + /// + /// + /// + public static List getProjectWBSByUnitWorkId(string projectId, string unitWorkId) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var getDataLists = (from x in db.WBS_WorkPackage + where x.ProjectId == projectId && x.SuperWorkPack == null && x.UnitWorkId == unitWorkId + orderby x.WorkPackageCode + select new Model.BaseInfoItem + { + BaseInfoId = x.WorkPackageId, + BaseInfoCode = x.WorkPackageCode, + BaseInfoName = x.PackageContent, + } + ).ToList(); + return getDataLists; + } + } /// /// 根据项目、单位ID获取单位工程 diff --git a/SGGL/BLL/API/HSSE/APIHazardRegisterService.cs b/SGGL/BLL/API/HSSE/APIHazardRegisterService.cs index a5d1933b..f6b55d29 100644 --- a/SGGL/BLL/API/HSSE/APIHazardRegisterService.cs +++ b/SGGL/BLL/API/HSSE/APIHazardRegisterService.cs @@ -82,6 +82,8 @@ namespace BLL RegisterTypes2Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes2Id) ? null : hazardRegister.RegisterTypes2Id, RegisterTypes3Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes3Id) ? null : hazardRegister.RegisterTypes3Id, RegisterTypes4Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes4Id) ? null : hazardRegister.RegisterTypes4Id, + WorkPackageId=WorkPackageService.getWorkPageIdsByControlItemAndCycle(hazardRegister.WorkPackageId, null), + WorkPackageName= WorkPackageService.getWorkPageNamesByControlItemAndCycle(hazardRegister.WorkPackageId, null), }; var isUpdate = db.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.HazardRegisterId == newHazardRegister.HazardRegisterId); if (isUpdate == null) diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 4c988148..dd14cece 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -647,12 +647,15 @@ + + + diff --git a/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs b/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs index 33210ab0..533e0313 100644 --- a/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs +++ b/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs @@ -21,6 +21,22 @@ namespace BLL return Funs.DB.Base_SpecialEquipment.FirstOrDefault(e => e.SpecialEquipmentId == specialEquipmentId); } + /// + /// 根据主键获取机具设备名称 + /// + /// + /// + public static string GetSpecialEquipmentNameById(string specialEquipmentId) + { + string name = string.Empty; + var q= Funs.DB.Base_SpecialEquipment.FirstOrDefault(e => e.SpecialEquipmentId == specialEquipmentId); + if (q != null) + { + name = q.SpecialEquipmentName; + } + return name; + } + /// /// 添加机具设备 /// @@ -87,6 +103,17 @@ namespace BLL select x).ToList(); } + /// + /// 获取机具设备列表 + /// + /// + public static List GetAllSpecialEquipmentList() + { + return (from x in Funs.DB.Base_SpecialEquipment + orderby x.SpecialEquipmentCode + select x).ToList(); + } + /// /// 设备下拉框 /// @@ -105,6 +132,24 @@ namespace BLL } } + /// + /// 设备下拉框 + /// + /// 下拉框名字 + /// 项目id + /// 是否显示请选择 + public static void InitAllSpecialEquipmentDropDownList(DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "SpecialEquipmentId"; + dropName.DataTextField = "SpecialEquipmentName"; + dropName.DataSource = GetAllSpecialEquipmentList(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + /// /// 获取机具设备列表 /// diff --git a/SGGL/BLL/CQMS/Check/CheckControlService.cs b/SGGL/BLL/CQMS/Check/CheckControlService.cs index 371282a8..41536434 100644 --- a/SGGL/BLL/CQMS/Check/CheckControlService.cs +++ b/SGGL/BLL/CQMS/Check/CheckControlService.cs @@ -62,6 +62,9 @@ namespace BLL newCheckControl.State = CheckControl.State; newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan; + newCheckControl.WorkPackageId = CheckControl.WorkPackageId; + newCheckControl.WorkPackageName = CheckControl.WorkPackageName; + db.Check_CheckControl.InsertOnSubmit(newCheckControl); db.SubmitChanges(); } @@ -93,6 +96,9 @@ namespace BLL newCheckControl.State = CheckControl.State; newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan; + newCheckControl.WorkPackageId = CheckControl.WorkPackageId; + newCheckControl.WorkPackageName = CheckControl.WorkPackageName; + db.Check_CheckControl.InsertOnSubmit(newCheckControl); db.SubmitChanges(); } @@ -215,6 +221,8 @@ namespace BLL newCheckControl.State = CheckControl.State; newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan; + newCheckControl.WorkPackageId = CheckControl.WorkPackageId; + newCheckControl.WorkPackageName = CheckControl.WorkPackageName; db.SubmitChanges(); } public static List GetListDataForApi(string state, string name, string projectId, int index, int page) @@ -277,7 +285,8 @@ namespace BLL x.RectifyOpinion, x.LimitDate, x.CNProfessionalCode, - + x.WorkPackageId, + x.WorkPackageName, CNProfessionalName = (from y in db.Base_CNProfessional where y.CNProfessionalId == x.CNProfessionalCode select y.ProfessionalName).First(), UnitWork = (from y in db.WBS_UnitWork where y.UnitWorkId == x.UnitWorkId select y.UnitWorkCode + "-" + y.UnitWorkName + (y.ProjectType == "1" ? "(建筑)" : "(安装)")).First(), CheckMan = (from y in db.Person_Persons where y.PersonId == x.CheckMan select y.PersonName).First() @@ -316,6 +325,8 @@ namespace BLL x.CNProfessionalCode = list[i].CNProfessionalCode + "$" + list[i].CNProfessionalName; x.AttachUrl = AttachFileService.getFileUrl(x.CheckControlCode); x.ReAttachUrl = AttachFileService.getFileUrl(x.CheckControlCode + "r"); + x.WorkPackageId = list[i].WorkPackageId; + x.WorkPackageName = list[i].WorkPackageName; listRes.Add(x); } return listRes; @@ -489,11 +500,11 @@ namespace BLL x.RectifyOpinion, x.LimitDate, x.CNProfessionalCode, - + x.WorkPackageId, + x.WorkPackageName, CNProfessionalName = (from y in db.Base_CNProfessional where y.CNProfessionalId == x.CNProfessionalCode select y.ProfessionalName).First(), UnitWork = (from y in db.WBS_UnitWork where y.UnitWorkId == x.UnitWorkId select y.UnitWorkCode + "-" + y.UnitWorkName + (y.ProjectType == "1" ? "(建筑)" : "(安装)")).First(), - CheckMan = (from y in db.Person_Persons where y.PersonId == x.CheckMan select y.PersonName).First() - + CheckMan = (from y in db.Person_Persons where y.PersonId == x.CheckMan select y.PersonName).First(), }; var list = qq1.Skip(index * page).Take(page).ToList(); @@ -522,6 +533,8 @@ namespace BLL x.CNProfessionalCode = list[i].CNProfessionalCode + "$" + list[i].CNProfessionalName; x.AttachUrl = AttachFileService.getFileUrl(x.CheckControlCode); x.ReAttachUrl = AttachFileService.getFileUrl(x.CheckControlCode + "r"); + x.WorkPackageId = list[i].WorkPackageId; + x.WorkPackageName = list[i].WorkPackageName; listRes.Add(x); } return listRes; diff --git a/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs b/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs index 95784829..fb667464 100644 --- a/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs +++ b/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs @@ -146,21 +146,23 @@ namespace BLL /// 实体验收审批实体 public static void AddSpotCheckApprove(Model.Check_SpotCheckApprove approve) { - Model.SGGLDB db = Funs.DB; - string newKeyID = SQLHelper.GetNewID(typeof(Model.Check_SpotCheckApprove)); - Model.Check_SpotCheckApprove newApprove = new Model.Check_SpotCheckApprove(); - newApprove.SpotCheckApproveId = newKeyID; - newApprove.SpotCheckCode = approve.SpotCheckCode; - newApprove.ApproveMan = approve.ApproveMan; - newApprove.ApproveDate = approve.ApproveDate; - newApprove.ApproveIdea = approve.ApproveIdea; - newApprove.IsAgree = approve.IsAgree; - newApprove.ApproveType = approve.ApproveType; - newApprove.SpotCheckDetailId = approve.SpotCheckDetailId; - newApprove.Sign = approve.Sign; + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + string newKeyID = SQLHelper.GetNewID(typeof(Model.Check_SpotCheckApprove)); + Model.Check_SpotCheckApprove newApprove = new Model.Check_SpotCheckApprove(); + newApprove.SpotCheckApproveId = newKeyID; + newApprove.SpotCheckCode = approve.SpotCheckCode; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.ApproveType = approve.ApproveType; + newApprove.SpotCheckDetailId = approve.SpotCheckDetailId; + newApprove.Sign = approve.Sign; - db.Check_SpotCheckApprove.InsertOnSubmit(newApprove); - db.SubmitChanges(); + db.Check_SpotCheckApprove.InsertOnSubmit(newApprove); + db.SubmitChanges(); + } } public static string AddSpotCheckApproveForApi(Model.Check_SpotCheckApprove approve) { @@ -193,16 +195,18 @@ namespace BLL /// 实体验收审批实体 public static void UpdateSpotCheckApprove(Model.Check_SpotCheckApprove approve) { - Model.SGGLDB db = Funs.DB; - Model.Check_SpotCheckApprove newApprove = db.Check_SpotCheckApprove.First(e => e.SpotCheckApproveId == approve.SpotCheckApproveId && e.ApproveDate == null); - newApprove.SpotCheckCode = approve.SpotCheckCode; - newApprove.ApproveMan = approve.ApproveMan; - newApprove.ApproveDate = approve.ApproveDate; - newApprove.ApproveIdea = approve.ApproveIdea; - newApprove.IsAgree = approve.IsAgree; - newApprove.ApproveType = approve.ApproveType; + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Check_SpotCheckApprove newApprove = db.Check_SpotCheckApprove.First(e => e.SpotCheckApproveId == approve.SpotCheckApproveId && e.ApproveDate == null); + newApprove.SpotCheckCode = approve.SpotCheckCode; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.ApproveType = approve.ApproveType; - db.SubmitChanges(); + db.SubmitChanges(); + } } /// diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageInitService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageInitService.cs index 7914b888..b5af2eab 100644 --- a/SGGL/BLL/CQMS/WBS/WorkPackageInitService.cs +++ b/SGGL/BLL/CQMS/WBS/WorkPackageInitService.cs @@ -79,6 +79,38 @@ namespace BLL return Funs.DB.WBS_WorkPackageInit.FirstOrDefault(x => x.WorkPackageCode == workPackageCode); } + /// + /// 根据分部分项编号获取分部分项信息 + /// + /// + /// + public static string GetWorkPackageCodeByPackageContent(string packageContent) + { + string workPackageCode = string.Empty; + var q= Funs.DB.WBS_WorkPackageInit.FirstOrDefault(x => x.PackageContent == packageContent); + if (q != null) + { + workPackageCode = q.WorkPackageCode; + } + return workPackageCode; + } + + /// + /// 根据分部分项编号获取分部分项信息 + /// + /// + /// + public static string GetPackageContentByWorkPackageCode(string workPackageCode) + { + string packageContent = string.Empty; + var q = Funs.DB.WBS_WorkPackageInit.FirstOrDefault(x => x.WorkPackageCode == workPackageCode); + if (q != null) + { + packageContent = q.PackageContent; + } + return packageContent; + } + /// /// 根据分部分项编号获取子级分部分项信息集合 /// @@ -88,5 +120,23 @@ namespace BLL { return (from x in Funs.DB.WBS_WorkPackageInit where x.SuperWorkPack == workPackageCode select x).ToList(); } + + /// + /// 样板类型下拉框 + /// + /// + /// + /// + public static void InitDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "PackageContent"; + dropName.DataTextField = "PackageContent"; + dropName.DataSource = from x in Funs.DB.WBS_WorkPackageInit where x.SuperWorkPack == null orderby x.ProjectType, x.WorkPackageCode select x; + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } } } diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs index f5ca9cf6..01bd6402 100644 --- a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs +++ b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs @@ -751,6 +751,84 @@ namespace BLL } #endregion + #region 根据工作包ID获取wbs节点及父节点名称字符串 + /// + /// 根据工作包ID获取wbs节点及父节点字符串 + /// + /// + /// + public static string getWorkPageNamesByControlItemAndCycle(string workPackageId, string controlItemAndCycleId) + { + string returnValues = string.Empty; + string ControlItemName=string.Empty; + if (!string.IsNullOrEmpty(controlItemAndCycleId)) + { + var getControlItemAndCycle = Funs.DB.WBS_ControlItemAndCycle.FirstOrDefault(x => x.ControlItemAndCycleId == controlItemAndCycleId); + if (getControlItemAndCycle != null) + { + workPackageId = getControlItemAndCycle.WorkPackageId; + ControlItemName = getControlItemAndCycle.ControlItemContent; + } + } + var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPackageId); + if (getWorkPackage != null) + { + if (!string.IsNullOrEmpty(ControlItemName)) + { + returnValues = getSelectNames(getWorkPackage.WorkPackageId, getWorkPackage.PackageContent + "|" + ControlItemName); + } + else + { + returnValues = getSelectNames(getWorkPackage.WorkPackageId, getWorkPackage.PackageContent); + } + } + + return returnValues; + } + + /// + /// id + /// + /// + /// + /// + public static string getSelectNames(string workPageId, string returnValues) + { + var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPageId); + if (getWorkPackage != null) + { + if (!string.IsNullOrEmpty(getWorkPackage.SuperWorkPackageId)) + { + var getSupWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == getWorkPackage.SuperWorkPackageId); + if (getSupWorkPackage != null) + { + returnValues = getWorkPackage.PackageContent + "|" + returnValues; + returnValues = getSelectIds(getWorkPackage.SuperWorkPackageId, returnValues); + } + + } + else + { + var getUnitWork = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == getWorkPackage.UnitWorkId); + if (getUnitWork != null) + { + if (getUnitWork.ProjectType == "1") + { + returnValues = "建筑工程|" + getUnitWork.UnitWorkName + "|" + returnValues; + } + else + { + returnValues = "安装工程|" + getUnitWork.UnitWorkName + "|" + returnValues; + } + + } + } + } + + return returnValues; + } + #endregion + #region 更新分部分项概算费用 /// /// 更新分部分项概算费用 @@ -788,7 +866,21 @@ namespace BLL IQueryable workPackages = from x in db.WBS_WorkPackage where x.ProjectId == projectId select x; IQueryable unitWorks = from x in db.WBS_UnitWork where x.ProjectId == projectId select x; IQueryable getDetails = from x in db.View_WBS_WorkPackageDetail where x.ProjectId == projectId select x; + //获取符合时间范围的所有项 List getWBSs = (from x in db.View_WBS where x.ProjectId == projectId select x).ToList(); + List list = getWBSs.Where(x => x.PlanEndDate > startTime && x.PlanEndDate <= endTime).ToList(); + List newLists = new List(); + foreach (var item in list) + { + var supItem = getWBSs.FirstOrDefault(x => x.Id == item.SupId); + if (supItem != null) + { + newLists.Add(item); + newLists.Add(supItem); + AddSupItem(supItem, getWBSs, newLists); + } + } + List ids = newLists.Select(x => x.Id).ToList(); List WBSList = new List(); DateTime startDate, endDate, startMonth, endMonth; List months = new List(); @@ -844,11 +936,11 @@ namespace BLL newList.Add(item); if (string.IsNullOrEmpty(IsOut)) { - AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime); + AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, ids); } else { - AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime); + AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, ids); } a++; } @@ -990,29 +1082,40 @@ namespace BLL } } - private static void AddDetail2(List newList, List oldList, string id, string preCode, DateTime startTime, DateTime endTime) + private static void AddSupItem(Model.View_WBS item, List getWBSs, List newLists) { - var items = oldList.Where(x => x.SupId == id && x.PlanEndDate > startTime && x.PlanEndDate <= endTime).OrderBy(x => x.Code); + var supItem = getWBSs.FirstOrDefault(x => x.Id == item.SupId); + if (supItem != null) + { + newLists.Add(item); + newLists.Add(supItem); + AddSupItem(supItem, getWBSs, newLists); + } + } + + private static void AddDetail2(List newList, List oldList, string id, string preCode, DateTime startTime, DateTime endTime,List ids) + { + var items = oldList.Where(x => x.SupId == id && ((x.PlanEndDate > startTime && x.PlanEndDate <= endTime) || ids.Contains(x.Id))).OrderBy(x => x.Code); int b = 1; foreach (var item in items) { item.Code = preCode + "." + b.ToString(); newList.Add(item); - AddDetail2(newList, oldList, item.Id, item.Code, startTime, endTime); + AddDetail2(newList, oldList, item.Id, item.Code, startTime, endTime, ids); b++; } } - private static void AddDetail2(List newList, List oldList, string id, string preCode, string prefix, DateTime startTime, DateTime endTime) + private static void AddDetail2(List newList, List oldList, string id, string preCode, string prefix, DateTime startTime, DateTime endTime, List ids) { - var items = oldList.Where(x => x.SupId == id && x.PlanEndDate > startTime && x.PlanEndDate <= endTime).OrderBy(x => x.Code); + var items = oldList.Where(x => x.SupId == id && ((x.PlanEndDate > startTime && x.PlanEndDate <= endTime) || ids.Contains(x.Id))).OrderBy(x => x.Code); int b = 1; foreach (var item in items) { item.Code = preCode + "." + b.ToString(); item.Name = prefix + "...." + item.Name; newList.Add(item); - AddDetail2(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime); + AddDetail2(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime, ids); b++; } } diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index fe03fd93..829132a1 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -342,6 +342,11 @@ namespace BLL /// public static string WorkPost_ProjectHSSEDirector = "5e6e259e-ea0a-4a63-8f52-df4a19a6c9fa"; + /// + /// 施工经理岗位Id + /// + public static string WorkPost_ConstructionManager = "49198d7c-8d14-4ea6-a495-2fe1aa179769"; + /// /// HSE工程师岗位Id /// @@ -367,6 +372,31 @@ namespace BLL /// public static string WorkPost_Checker = "595999E9-75A8-4064-9BD1-9EE02F236297"; + /// + /// 瓦工岗位Id + /// + public static string WorkPost_BricklayerId = "668CB91E-F067-42E6-95ED-FFF1BCCE4576"; + + /// + /// 钢筋工岗位Id + /// + public static string WorkPost_SteelFixerId = "48280AA2-62D6-4105-AAA7-C38471F44DA9"; + + /// + /// 木工岗位Id + /// + public static string WorkPost_CarpentryId = "FA155A27-E5E5-44DF-8CC3-05404F572DB8"; + + /// + /// 混凝土工岗位Id + /// + public static string WorkPost_ConcreteWorkerId = "65F02FD8-6C67-402E-9588-4DAB038A697A"; + + /// + /// 架子工岗位Id + /// + public static string WorkPost_ScaffolderId = "1331D109-6435-4709-9A35-65AEC7B3F06F"; + #endregion #region 系统环境设置常量 @@ -4522,9 +4552,14 @@ namespace BLL public const string ConstructionReportMenuId = "0DAFF358-EA16-44B2-8E4B-E15E40EFAAD0"; /// - /// 项目级施工日志 + /// 个人施工日志 /// - public const string ConstructionLogMenuId = "4CB03F8B-C967-4082-ADF1-08776FE40E21"; + public const string ConstructionLogMenuId = "0383A4A1-1565-4F11-BAF3-2B84CB621796"; + + /// + /// 项目施工日志 + /// + public const string ProjectConstructionLogMenuId = "D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4"; /// /// 项目级施工日志 diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index b017a205..cf58f845 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -1420,6 +1420,53 @@ namespace BLL IRestResponse response = client.Execute(request); return response.Content; } + + /// + /// ڼֵ + /// + /// + public static string GetWeekDay(string value) + { + if (!String.IsNullOrEmpty(value)) + { + if (value == "Sunday") + { + return ""; + } + else if (value == "Monday") + { + return "һ"; + } + else if (value == "Tuesday") + { + return ""; + } + else if (value == "Wednesday") + { + return ""; + } + else if (value == "Thursday") + { + return ""; + } + else if (value == "Friday") + { + return ""; + } + else if (value == "Saturday") + { + return ""; + } + else + { + return ""; + } + } + else + { + return ""; + } + } } } diff --git a/SGGL/BLL/DigData/CQMSDataDWService .cs b/SGGL/BLL/DigData/CQMSDataDWService .cs index 1c2127c5..074789db 100644 --- a/SGGL/BLL/DigData/CQMSDataDWService .cs +++ b/SGGL/BLL/DigData/CQMSDataDWService .cs @@ -26,7 +26,8 @@ namespace BLL /// 定义变量 /// private static IQueryable getDataLists = from x in db.Base_Project - select x; + where x.ProjectState == Const.ProjectState_1 + select x; /// /// 质量数据仓库 @@ -38,7 +39,7 @@ namespace BLL /// public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1) { - var getDataList = from x in Funs.DB.Base_Project select x; + IQueryable getDataList = getDataLists; if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null) { getDataList = getDataList.Where(x => x.ProjectId == projectId); @@ -56,13 +57,87 @@ namespace BLL x.ProjectId, x.ProjectName, x.ProjectCode, - Rate1 = "0%", //质量验收问题整改率 - Rate2 = "0%", //控制点完成率 - Rate3 = "0%", //质量检查问题整改率 - Rate4 = "0%", //管道焊接一次合格率 + Rate1 = getSpotCheckRate(x.ProjectId), //质量验收问题整改率 + Rate2 = getSpotCheckDataRate(x.ProjectId), //控制点完成率 + Rate3 = getCheckControlStates(x.ProjectId), //质量检查问题整改率 + Rate4 = getFirstPassRate(x.ProjectId), //管道焊接一次合格率 }; } #endregion + /// + /// 质量验收问题整改率 + /// + /// + /// + public static string getSpotCheckRate(string projectId) + { + + //// 实体验收 资料验收 + var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail + join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode + where (y.ProjectId == projectId || projectId == null) && y.State == "8" + select x; + int all = getSpotCheckDetail.Count(); + // this.lbSpotCheck1.Text = all.ToString(); + int onesOKCount = getSpotCheckDetail.Where(x => x.IsOnesOK == true).Count(); //一次合格 + // this.lbSpotCheck2.Text= okCount.ToString(); + + return all > 0 ? Math.Round(onesOKCount * 100.0 / (all * 1.0)).ToString() + "%" : "0%"; + } + + /// + /// 控制点完成率 + /// + /// + /// + public static string getSpotCheckDataRate(string projectId) + { + var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail + join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode + where (y.ProjectId == projectId || projectId == null) && y.State == "8" + select x; + /// 资料验收合格项目 + var getOKSpotCheckDetail = getSpotCheckDetail.Where(x => x.IsOK == true); + int okYSCount = getOKSpotCheckDetail.Count(); //验收合格 + int okDateCount = getSpotCheckDetail.Where(x => x.IsDataOK == "1").Count(); //资料合格 + return okYSCount > 0 ? Math.Round(okDateCount * 100.0 / (okYSCount * 1.0)).ToString() + "%" : "0%"; + } + + /// + /// 质量检查问题整改率 + /// + /// + /// + public static string getCheckControlStates(string projectId) + { + var getCheck_CheckControl = from x in Funs.DB.Check_CheckControl + where (x.ProjectId == projectId || projectId == null) + select x; + int allCheckControlCount = getCheck_CheckControl.Count(); + int okCheckControlCount = getCheck_CheckControl.Where(x => x.State == "7").Count(); ///已整改 + return allCheckControlCount > 0 ? Math.Round(okCheckControlCount * 100.0 / (allCheckControlCount * 1.0)).ToString() + "%" : "0%"; + + } + + /// + /// 管道焊接一次合格率 + /// + /// + /// + public static string getFirstPassRate(string projectId) + { + var getJots = from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId + join z in Funs.DB.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId + join a in Funs.DB.HJGL_Batch_NDE on x.NDEID equals a.NDEID + where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null + && (a.ProjectId == projectId || projectId == null) + select x; + int allHJCount = getJots.Count(); + var getOk = getJots.Where(x => x.CheckResult == "1"); + int okHJCount = getOk.Count(); + return allHJCount > 0 ? Math.Round(okHJCount * 100.0 / (allHJCount * 1.0)).ToString() + "%" : "0%"; + } } } \ No newline at end of file diff --git a/SGGL/BLL/DigData/HSEDataDWService.cs b/SGGL/BLL/DigData/HSEDataDWService.cs index 3805288c..0e5d0ebf 100644 --- a/SGGL/BLL/DigData/HSEDataDWService.cs +++ b/SGGL/BLL/DigData/HSEDataDWService.cs @@ -26,7 +26,8 @@ namespace BLL /// 定义变量 /// private static IQueryable getDataLists = from x in db.Base_Project - select x; + where x.ProjectState == Const.ProjectState_1 + select x; /// /// 安全数据仓库 @@ -38,7 +39,7 @@ namespace BLL /// public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1) { - var getDataList = from x in Funs.DB.Base_Project select x; + IQueryable getDataList = getDataLists; if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null) { getDataList = getDataList.Where(x => x.ProjectId == projectId); @@ -56,13 +57,48 @@ namespace BLL x.ProjectId, x.ProjectName, x.ProjectCode, - Count1=0, //人员数量 - Count2 =0, //安全人工时 - Count3 =0, //安全培训次数 - ProblemRate = "0%", //安全巡检整改率 + Count1=db.SitePerson_Person.Where(p=>p.ProjectId == x.ProjectId && p.States == Const.ProjectPersonStates_1).Count(), //人员数量 + Count2 = getProjecctSafeHours(x.ProjectId), //安全人工时 + Count3 =db.EduTrain_TrainRecord.Where(p => p.ProjectId == x.ProjectId && p.States == BLL.Const.State_2).Count(), //安全培训次数 + ProblemRate = getProblemRate(x.ProjectId), //安全巡检整改率 }; } #endregion + /// + /// 安全人工时 + /// + /// + /// + public static int getProjecctSafeHours(string projectId) + { + int count = 0; + var getPersonInOutNumber = (from x in Funs.DB.SitePerson_PersonInOutNumber + where (x.ProjectId == projectId || projectId == null) + select x).OrderByDescending(x => x.InOutDate).FirstOrDefault(); + if (getPersonInOutNumber != null) + { + count = getPersonInOutNumber.WorkHours ?? 0; + } + + return count; + } + + /// + /// 安全问题整改率 + /// + /// + /// + public static string getProblemRate(string projectId) + { + var getAllHazardRegister = from x in Funs.DB.HSSE_Hazard_HazardRegister + where (x.ProjectId == projectId || projectId == null) + && x.States != null && x.States != "4" && x.States != "0" + select x; + int allHazardCount = getAllHazardRegister.Count(); + int cHazardCount = getAllHazardRegister.Where(x => x.States == "3").Count(); + return allHazardCount > 0 ? Math.Round(cHazardCount * 100.0 / (allHazardCount * 1.0)).ToString() + "%" : "0%"; + } + } } \ No newline at end of file diff --git a/SGGL/BLL/DigData/HTGLDataDWService.cs b/SGGL/BLL/DigData/HTGLDataDWService.cs index 9d980c22..592f7e2a 100644 --- a/SGGL/BLL/DigData/HTGLDataDWService.cs +++ b/SGGL/BLL/DigData/HTGLDataDWService.cs @@ -36,7 +36,7 @@ namespace BLL /// /// /// - public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1) + public static IEnumerable getDataDWList( string projectId, Grid Grid1) { var getDataList = from x in Funs.DB.Base_Project select x; if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null) @@ -56,10 +56,29 @@ namespace BLL x.ProjectId, x.ProjectName, x.ProjectCode, - Count1=0, + Count1= getTotalProfit(x.ProjectId), }; } #endregion + public static string getTotalProfit(string projectId) + { + decimal contractAmount = 0; + var getContract = Funs.DB.PHTGL_Contract.Where(x => x.ProjectId == projectId); + if (getContract.Count() > 0) + { + contractAmount = getContract.Sum(x => x.ContractAmount ?? 0); + } + + decimal estimatedAmount = 0; + var getContractTrack = Funs.DB.PHTGL_ContractTrack.Where(x => x.ProjectId == projectId); + if (getContractTrack.Count() > 0) + { + estimatedAmount = getContractTrack.Sum(x => x.EstimatedAmount ?? 0); + } + + return estimatedAmount > 0 ? Math.Round(contractAmount / estimatedAmount).ToString() + "%" : "0%"; + + } } } \ No newline at end of file diff --git a/SGGL/BLL/DigData/JDGLDataDWService.cs b/SGGL/BLL/DigData/JDGLDataDWService.cs index be372d94..c993cc47 100644 --- a/SGGL/BLL/DigData/JDGLDataDWService.cs +++ b/SGGL/BLL/DigData/JDGLDataDWService.cs @@ -26,7 +26,7 @@ namespace BLL /// 定义变量 /// private static IQueryable getDataLists = from x in db.Base_Project - select x; + select x; /// /// 进度数据仓库 @@ -36,7 +36,7 @@ namespace BLL /// /// /// - public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1) + public static IEnumerable getDataDWList(string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1) { var getDataList = from x in Funs.DB.Base_Project select x; if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null) @@ -56,10 +56,44 @@ namespace BLL x.ProjectId, x.ProjectName, x.ProjectCode, - JDRate = "0%", //项目进度完成百分比 + JDRate = getJDRate(x.ProjectId, startTime, endTime), //项目进度完成百分比 }; } #endregion + /// + /// 进度百分比 + /// + /// + public static string getJDRate(string projectId, DateTime? startTime, DateTime? endTime) + { + double totalSJCost = 0; ////累计实际费用 + decimal totalPlanCost = 0; ////计划费用 + var getViewWorkPackageParentDetail = from x in Funs.DB.View_WBS_WorkPackageParentDetail + where (x.ProjectId == projectId || projectId == null) && (x.ParentId == "1" || x.ParentId == "2") + select x; + if (startTime.HasValue) + { + getViewWorkPackageParentDetail = getViewWorkPackageParentDetail.Where(x => x.Months >= startTime); + } + if (endTime.HasValue) + { + getViewWorkPackageParentDetail = getViewWorkPackageParentDetail.Where(x => x.Months <= endTime); + } + if (getViewWorkPackageParentDetail.Count() > 0) + { + totalSJCost = getViewWorkPackageParentDetail.Sum(x => x.TotalThisValue ?? 0); + } + + var getUnitWork = from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId select x; + if (getUnitWork.Count() > 0) + { + totalPlanCost = getUnitWork.Sum(x => x.PlanCost ?? 0); + } + + ///项目进度完成百分比 + decimal s = Convert.ToDecimal(totalSJCost); + return totalPlanCost > 0 ? Math.Round(s / totalPlanCost).ToString() + "%" : "0%"; + } } } \ No newline at end of file diff --git a/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs b/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs index 907dcbf9..44b0b565 100644 --- a/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs +++ b/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs @@ -48,14 +48,16 @@ namespace BLL List listWork = new List(); Model.WBS_WorkPackage work1 = new Model.WBS_WorkPackage { - WorkPackageCode = "1", + WorkPackageId = "Type1", PackageContent = "建筑工程", + ProjectId = projectId, }; listWork.Add(work1); Model.WBS_WorkPackage work2 = new Model.WBS_WorkPackage { - WorkPackageCode = "2", + WorkPackageId = "Type2", PackageContent = "安装工程", + ProjectId = projectId, }; listWork.Add(work2); getDataList = listWork.AsQueryable(); @@ -88,8 +90,9 @@ namespace BLL { Model.WBS_WorkPackage workItem = new Model.WBS_WorkPackage { - WorkPackageCode = item.UnitWorkId, + WorkPackageId = item.UnitWorkId, PackageContent = item.UnitWorkCode + "-" + item.UnitWorkName, + ProjectId = item.ProjectId, }; listWork.Add(workItem); } @@ -107,17 +110,16 @@ namespace BLL return from x in getDataList select new { - x.WorkPackageCode, + x.WorkPackageId, x.PackageContent, - Count1 = 0, - Count2 = 0, - Count3 = 0, - Count4 = 0, - Count5 = 0, - Count6 = 0, + Count1 = WBSAnalysisService.getWBSExpertArgumentCount(projectId,x.WorkPackageId), + Count2 = WBSAnalysisService.getWBSAccidentCount(projectId, x.WorkPackageId), + Count3 = WBSAnalysisService.getWBSHSEProblemCount(projectId, x.WorkPackageId), + Count4 = WBSAnalysisService.getWBSSpotCheckRate(projectId, x.WorkPackageId), + Count5 = WBSAnalysisService.getWBSSpotCheckDataRate(projectId, x.WorkPackageId), + Count6 = WBSAnalysisService.getWBSCheckControlCount(projectId, x.WorkPackageId), }; } #endregion - } } \ No newline at end of file diff --git a/SGGL/BLL/DigData/WBSAnalysisService.cs b/SGGL/BLL/DigData/WBSAnalysisService.cs index 6ada1642..bcd596ff 100644 --- a/SGGL/BLL/DigData/WBSAnalysisService.cs +++ b/SGGL/BLL/DigData/WBSAnalysisService.cs @@ -1,5 +1,7 @@ using FineUIPro; +using Microsoft.SqlServer.Dts.Runtime; using NPOI.SS.Formula.Functions; +using Org.BouncyCastle.Crypto.Tls; using System; using System.Collections; using System.Collections.Generic; @@ -46,13 +48,13 @@ namespace BLL List listWork = new List(); Model.WBS_WorkPackageInit work1 = new Model.WBS_WorkPackageInit { - WorkPackageCode = "1", + WorkPackageCode = "Type1", PackageContent = "建筑工程", }; listWork.Add(work1); Model.WBS_WorkPackageInit work2 = new Model.WBS_WorkPackageInit { - WorkPackageCode = "2", + WorkPackageCode = "Type2", PackageContent = "安装工程", }; listWork.Add(work2); @@ -85,15 +87,138 @@ namespace BLL { x.WorkPackageCode, x.PackageContent, - Count1=0, - Count2 = 0, - Count3 = 0, - Count4 = 0, - Count5 = 0, - Count6 = 0, + Count1= getWBSExpertArgumentCount(null, x.WorkPackageCode), + Count2 = getWBSAccidentCount(null,x.WorkPackageCode), + Count3 = getWBSHSEProblemCount(null, x.WorkPackageCode), + Count4 = getWBSSpotCheckRate(null, x.WorkPackageCode), + Count5 = getWBSSpotCheckDataRate(null, x.WorkPackageCode), + Count6 = getWBSCheckControlCount(null, x.WorkPackageCode), }; } #endregion + /// + /// 危大工程数量 + /// + /// + /// + public static int getWBSExpertArgumentCount(string projectId,string workPackageId) + { + var getLargerHazardListItem = from x in Funs.DB.Solution_LargerHazardListItem + join y in Funs.DB.Solution_LargerHazardList on x.LargerHazardListId equals y.LargerHazardListId + where x.WorkPackageId.Contains(workPackageId) + && y.States == Const.State_1 + select new {x.LargerHazardListItemId,y.LargerHazardListId,y.ProjectId,x.WorkPackageId }; + if (!string.IsNullOrEmpty(projectId)) + { + getLargerHazardListItem = getLargerHazardListItem.Where(x => x.ProjectId == projectId); + } + + return getLargerHazardListItem.Count(); + } + + /// + /// 安全事故数量 + /// + /// + /// + public static int getWBSAccidentCount(string projectId, string workPackageId) + { + var getAccidentPersonRecord = from x in Funs.DB.Accident_AccidentPersonRecord + where x.WorkPackageId.Contains(workPackageId) + && x.States == Const.State_2 + select x; + if (!string.IsNullOrEmpty(projectId)) + { + getAccidentPersonRecord = getAccidentPersonRecord.Where(x => x.ProjectId == projectId); + } + + return getAccidentPersonRecord.Count(); + } + + /// + /// 安全巡检问题总数 + /// + /// + /// + public static int getWBSHSEProblemCount(string projectId, string workPackageId) + { + var getHazardRegister = from x in Funs.DB.HSSE_Hazard_HazardRegister + where x.States != "4" && x.States != "0" + && x.WorkPackageId.Contains(workPackageId) + select x; + if (!string.IsNullOrEmpty(projectId)) + { + getHazardRegister = getHazardRegister.Where(x => x.ProjectId == projectId); + } + + return getHazardRegister.Count(); + } + + /// + /// 实体验收一次合格率 + /// + /// + /// + public static string getWBSSpotCheckRate(string projectId, string workPackageId) + { + var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail + join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode + where x.WorkPackageId.Contains(workPackageId) && (projectId ==null || y.ProjectId == projectId) + && y.State == "8" + select new { x.SpotCheckCode ,y.ProjectId,x.IsDataOK,x.IsOnesOK}; + if (!string.IsNullOrEmpty(projectId)) + { + getSpotCheckDetail = getSpotCheckDetail.Where(x => x.ProjectId == projectId); + } + + int all = getSpotCheckDetail.Count(); + // this.lbSpotCheck1.Text = all.ToString(); + int onesOKCount = getSpotCheckDetail.Where(x => x.IsOnesOK == true).Count(); //一次合格 + return (all > 0 ? Math.Round(onesOKCount * 100.0 / (all * 1.0)).ToString() + "%" : "0%"); + } + + /// + /// 施工资料同步率 + /// + /// + /// + public static string getWBSSpotCheckDataRate(string projectId, string workPackageId) + { + //// 实体验收 资料验收 + var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail + join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode + where x.WorkPackageId.Contains(workPackageId) + && y.State == "8" + select new { x.SpotCheckCode, y.ProjectId, x.IsDataOK, x.IsOnesOK,x.IsOK }; + if (!string.IsNullOrEmpty(projectId)) + { + getSpotCheckDetail = getSpotCheckDetail.Where(x => x.ProjectId == projectId); + } + /// 资料验收合格项目 + var getOKSpotCheckDetail = getSpotCheckDetail.Where(x => x.IsOK == true); + int okYSCount = getOKSpotCheckDetail.Count(); //验收合格 + int okDateCount = getSpotCheckDetail.Where(x => x.IsDataOK == "1").Count(); //资料合格 + + return (okYSCount > 0 ? Math.Round(okDateCount * 100.0 / (okYSCount * 1.0)).ToString() + "%" : "0%"); + } + + /// + /// 质量问题数 + /// + /// + /// + public static int getWBSCheckControlCount(string projectId, string workPackageId) + { + var getCheck_CheckControl = from x in Funs.DB.Check_CheckControl + where x.WorkPackageId.Contains(workPackageId) + select x; + if (!string.IsNullOrEmpty(projectId)) + { + getCheck_CheckControl = getCheck_CheckControl.Where(x => x.ProjectId == projectId); + } + + return getCheck_CheckControl.Count(); + } } } \ No newline at end of file diff --git a/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs b/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs index 30e003b4..ca6147f7 100644 --- a/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs +++ b/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs @@ -71,7 +71,11 @@ namespace BLL RegisterTypes2Id = hazardRegister.RegisterTypes2Id, RegisterTypes3Id = hazardRegister.RegisterTypes3Id, RegisterTypes4Id = hazardRegister.RegisterTypes4Id, - CCManIds = hazardRegister.CCManIds + CCManIds = hazardRegister.CCManIds, + + WorkPackageId = hazardRegister.WorkPackageId, + WorkPackageName = hazardRegister.WorkPackageName, + }; db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newHazardRegister); db.SubmitChanges(); @@ -116,6 +120,9 @@ namespace BLL newHazardRegister.RegisterTypes3Id = hazardRegister.RegisterTypes3Id; newHazardRegister.RegisterTypes4Id = hazardRegister.RegisterTypes4Id; newHazardRegister.CCManIds = hazardRegister.CCManIds; + + newHazardRegister.WorkPackageId = newHazardRegister.WorkPackageId; + newHazardRegister.WorkPackageName = newHazardRegister.WorkPackageName; //把附件表的路径复制过来 Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId); if (file != null) diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs index 7c164beb..d27aa849 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs @@ -250,8 +250,8 @@ namespace BLL { getInMaxs = getInMaxs.Where(x => x.IsIn == true); } - inCount = getInMaxs.Count(); - if (inCount == 0) + nowCount = getInMaxs.Count(); + if (nowCount == 0) { return null; } @@ -429,7 +429,7 @@ namespace BLL public static List GetSitePersonsByProjectIds(List ProjectIds) { return (from x in Funs.DB.SitePerson_Person - where ProjectIds.Contains(x.ProjectId) && x.RoleIds.Length > 1 + where ProjectIds.Contains(x.ProjectId) && x.RoleIds.Length > 1 && x.States == Const.ProjectPersonStates_1 select x).ToList(); } #endregion diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index 775ceb26..e7c1eced 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Data; using System.Linq; using EmitMapper; using FineUIPro; @@ -81,37 +82,37 @@ namespace BLL q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in q - select new - { - x.Id, - x.ContractNum, - x.MainItemCode, - x.MainItemName, - x.MajorName, - x.MajorCode, - x.SubProject, - x.SubItemProject, - x.ProjectCode, - x.ProjectName, - x.ProjectDescription, - x.UnitOfMeasurement, - x.Quantity, - x.TotalCostFixedComprehensiveUnitPrice, - x.MainMaterialCost, - x.TotalPrice, - x.CalculationRule, - x.WorkContent, - x.Remarks, - x.ConstructionSubcontractor, - x.ContractWeight, - x.MaterialSupplier, - x.IsWithinGeneralContractScope, - x.EstimatedQuantity, - x.EstimatedAmount, - x.SettledQuantity, - x.SettledAmount, - x.ContractId - }; + select new + { + x.Id, + x.ContractNum, + x.MainItemCode, + x.MainItemName, + x.MajorName, + x.MajorCode, + x.SubProject, + x.SubItemProject, + x.ProjectCode, + x.ProjectName, + x.ProjectDescription, + x.UnitOfMeasurement, + x.Quantity, + x.TotalCostFixedComprehensiveUnitPrice, + x.MainMaterialCost, + x.TotalPrice, + x.CalculationRule, + x.WorkContent, + x.Remarks, + x.ConstructionSubcontractor, + x.ContractWeight, + x.MaterialSupplier, + x.IsWithinGeneralContractScope, + x.EstimatedQuantity, + x.EstimatedAmount, + x.SettledQuantity, + x.SettledAmount, + x.ContractId + }; } #endregion @@ -195,8 +196,8 @@ namespace BLL table.EstimatedAmount = newtable.EstimatedAmount; table.SettledQuantity = newtable.SettledQuantity; table.SettledAmount = newtable.SettledAmount; - table.ContractId=newtable.ContractId; - table.ProjectId=newtable.ProjectId; + table.ContractId = newtable.ContractId; + table.ProjectId = newtable.ProjectId; Funs.DB.SubmitChanges(); } } @@ -250,7 +251,7 @@ namespace BLL }; if (string.IsNullOrEmpty(item.ProjectCode)) continue; var resultModel = GetPHTGL_ContractTrackByModle(phtglContractTrack); - item.ContractNum=ContractService.GetContractById(contractid)?.ContractNum; + item.ContractNum = ContractService.GetContractById(contractid)?.ContractNum; if (resultModel.Any()) { item.Id = resultModel[0].Id; @@ -267,6 +268,202 @@ namespace BLL return responeData; } + /// + /// 获取模拟树表格 + /// + /// + public static DataTable GetAllTreeDataTable(string projectId, string IsOut, List contractNoList, List professionalList, List workPostIds, List machineIds, string constructionLogId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var pros = BLL.PHTGL_QuantityService.GetMajorItems(); + List proNames = new List(); + foreach (var item in professionalList) + { + var pro = pros.FirstOrDefault(x => x.Text == item); + if (pro != null) + { + proNames.Add(pro.Value); + } + } + IQueryable getContractTracks = from x in db.PHTGL_ContractTrack + where x.ProjectId == projectId && contractNoList.Contains(x.ContractId) && proNames.Contains(x.MajorName) + orderby x.ProjectCode, x.ProjectName + select x; + IQueryable workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency + where x.ConstructionLogId == constructionLogId + select x; + var unitWorks = (from x in getContractTracks + select new { MainItemCode = x.MainItemCode, MainItemName = x.MainItemName }).Distinct().ToList(); + + DataTable table = new DataTable(); + table.Columns.Add(new DataColumn("Id", typeof(String))); + table.Columns.Add(new DataColumn("Code", typeof(String))); + table.Columns.Add(new DataColumn("ProjectCode", typeof(String))); + table.Columns.Add(new DataColumn("ProjectName", typeof(String))); + table.Columns.Add(new DataColumn("UnitOfMeasurement", typeof(String))); + table.Columns.Add(new DataColumn("PhysicalCompletionQuantity", typeof(String))); + table.Columns.Add(new DataColumn("MaterialConsumption", typeof(String))); + table.Columns.Add(new DataColumn("ShowId", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours0", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency0", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours1", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency1", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours2", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency2", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours3", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency3", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours4", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency4", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours5", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency5", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours6", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency6", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours7", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency7", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours8", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency8", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours9", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency9", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours10", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency10", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours11", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency11", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours12", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency12", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours13", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency13", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours14", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency14", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours15", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency15", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours16", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency16", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours17", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency17", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours18", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency18", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours19", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency19", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours0", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency0", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours1", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency1", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours2", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency2", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours3", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency3", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours4", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency4", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours5", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency5", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours6", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency6", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours7", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency7", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours8", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency8", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours9", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency9", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours10", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency10", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours11", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency11", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours12", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency12", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours13", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency13", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours14", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency14", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours15", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency15", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours16", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency16", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours17", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency17", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours18", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency18", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours19", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency19", typeof(String))); + DataRow row; + int a = 1; + foreach (var unitWork in unitWorks) + { + row = table.NewRow(); + row[0] = unitWork.MainItemCode; + row[1] = a; + row[2] = string.Empty; + row[3] = unitWork.MainItemName; + table.Rows.Add(row); + int b = 1; + foreach (var proName in proNames) + { + row = table.NewRow(); + row[0] = unitWork.MainItemCode + b.ToString(); + row[1] = a + "." + b; + row[2] = string.Empty; + row[3] = proName; + table.Rows.Add(row); + int c = 1; + var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName); + foreach (Model.PHTGL_ContractTrack item in contractTracks) + { + row = table.NewRow(); + row[0] = item.Id; + row[1] = a + "." + b + "." + c; + row[2] = item.ProjectCode; + row[3] = item.ProjectName; + row[4] = item.UnitOfMeasurement; + row[7] = item.Id; + if (workEfficiencys.Count() > 0) + { + var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id); + if (we != null) + { + row[5] = we.PhysicalCompletionQuantity; + row[6] = we.MaterialConsumption; + } + for (int i = 0; i < workPostIds.Count; i++) + { + var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId== item.Id); + if (workEfficiency != null) + { + if (workEfficiency.ConsumeHours != null) + { + row[8 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[9 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2); + } + } + } + } + for (int i = 0; i < machineIds.Count; i++) + { + var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); + if (workEfficiency != null) + { + if (workEfficiency.ConsumeHours != null) + { + row[48 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[49 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2); + } + } + } + } + } + table.Rows.Add(row); + c++; + } + b++; + } + a++; + } + return table; + } + } } public class PHTGL_ContractTrackDtoIn { @@ -331,5 +528,4 @@ namespace BLL /// [ExcelColumnIndex("P")] public string Remarks { get; set; } } - } \ No newline at end of file diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs index 2e4a852c..3c0cf59e 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs @@ -31,12 +31,8 @@ namespace BLL newConstructionLogMachine.ConstructionLogMachineId = constructionLogMachine.ConstructionLogMachineId; newConstructionLogMachine.ConstructionLogId = constructionLogMachine.ConstructionLogId; newConstructionLogMachine.UnitWorkId = constructionLogMachine.UnitWorkId; - newConstructionLogMachine.WJNum = constructionLogMachine.WJNum; - newConstructionLogMachine.DCNum = constructionLogMachine.DCNum; - newConstructionLogMachine.DZJNum = constructionLogMachine.DZJNum; - newConstructionLogMachine.GCNum = constructionLogMachine.GCNum; - newConstructionLogMachine.BCNum = constructionLogMachine.BCNum; - newConstructionLogMachine.BengCNum = constructionLogMachine.BengCNum; + newConstructionLogMachine.MachineId = constructionLogMachine.MachineId; + newConstructionLogMachine.Num = constructionLogMachine.Num; db.ZHGL_ConstructionLogMachine.InsertOnSubmit(newConstructionLogMachine); db.SubmitChanges(); diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs index c4f97068..47270a4b 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs @@ -61,7 +61,7 @@ namespace BLL public static List GetConstructionLogManagementsByConstructionLogId(string ConstructionLogId) { Model.SGGLDB db = Funs.DB; - return (from x in db.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId select x).ToList(); + return (from x in db.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId orderby x.UnitWorkId select x).ToList(); } } } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs index 3fc0990e..bb96c8cf 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs @@ -31,12 +31,8 @@ namespace BLL newConstructionLogPerson.ConstructionLogPersonId = constructionLogPerson.ConstructionLogPersonId; newConstructionLogPerson.ConstructionLogId = constructionLogPerson.ConstructionLogId; newConstructionLogPerson.UnitWorkId = constructionLogPerson.UnitWorkId; - newConstructionLogPerson.WGNum = constructionLogPerson.WGNum; - newConstructionLogPerson.GJGNum = constructionLogPerson.GJGNum; - newConstructionLogPerson.MGNum = constructionLogPerson.MGNum; - newConstructionLogPerson.HNTGNum = constructionLogPerson.HNTGNum; - newConstructionLogPerson.HGNum = constructionLogPerson.HGNum; - newConstructionLogPerson.JZGNum = constructionLogPerson.JZGNum; + newConstructionLogPerson.WorkPostId = constructionLogPerson.WorkPostId; + newConstructionLogPerson.Num = constructionLogPerson.Num; db.ZHGL_ConstructionLogPerson.InsertOnSubmit(newConstructionLogPerson); db.SubmitChanges(); diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs index 73c1da33..557f8a90 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs @@ -1,13 +1,68 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BLL { public class ConstructionLogProblemService { + public static Model.SGGLDB db = Funs.DB; + /// + /// 获取施工日志需要协调解决的问题明细列表 + /// + /// + /// + /// + public static List getListData(string ConstructionLogId) + { + return (from x in db.ZHGL_ConstructionLogProblem + where x.ConstructionLogId == ConstructionLogId + select x).ToList(); + } + + /// + /// 增加施工日志需要协调解决的问题明细 + /// + /// 施工日志需要协调解决的问题明细实体 + public static void AddConstructionLogProblem(Model.ZHGL_ConstructionLogProblem constructionLogProblem) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ConstructionLogProblem newConstructionLogProblem = new Model.ZHGL_ConstructionLogProblem(); + newConstructionLogProblem.ConstructionLogProblemId = constructionLogProblem.ConstructionLogProblemId; + newConstructionLogProblem.ConstructionLogId = constructionLogProblem.ConstructionLogId; + newConstructionLogProblem.UnitWorkId = constructionLogProblem.UnitWorkId; + newConstructionLogProblem.MainProblem = constructionLogProblem.MainProblem; + newConstructionLogProblem.HandlingMeasures = constructionLogProblem.HandlingMeasures; + newConstructionLogProblem.WorkPackageId = constructionLogProblem.WorkPackageId; + newConstructionLogProblem.ImportanceLevel = constructionLogProblem.ImportanceLevel; + + db.ZHGL_ConstructionLogProblem.InsertOnSubmit(newConstructionLogProblem); + db.SubmitChanges(); + } + + /// + /// 根据月报id删除对应的所有施工日志需要协调解决的问题明细 + /// + /// 施工日志需要协调解决的问题明细编号 + public static void DeleteConstructionLogProblemsByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in db.ZHGL_ConstructionLogProblem where x.ConstructionLogId == ConstructionLogId select x).ToList(); + if (q.Count() > 0) + { + db.ZHGL_ConstructionLogProblem.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + + /// + /// 根据月报id获取对应的所有施工日志需要协调解决的问题明细 + /// + /// 施工日志需要协调解决的问题明细编号 + public static List GetConstructionLogProblemsByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + return (from x in db.ZHGL_ConstructionLogProblem where x.ConstructionLogId == ConstructionLogId orderby x.UnitWorkId select x).ToList(); + } } } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogRecordService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogRecordService.cs new file mode 100644 index 00000000..ced09506 --- /dev/null +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogRecordService.cs @@ -0,0 +1,65 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + public class ConstructionLogRecordService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 获取施工日志施工经理相关记录明细列表 + /// + /// + /// + /// + public static List getListData(string ConstructionLogId) + { + return (from x in db.ZHGL_ConstructionLogRecord + where x.ConstructionLogId == ConstructionLogId + select x).ToList(); + } + + /// + /// 增加施工日志作业人员明细 + /// + /// 施工日志作业人员明细实体 + public static void AddConstructionLogRecord(Model.ZHGL_ConstructionLogRecord constructionLogRecord) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ConstructionLogRecord newConstructionLogRecord = new Model.ZHGL_ConstructionLogRecord(); + newConstructionLogRecord.ConstructionLogRecordId = constructionLogRecord.ConstructionLogRecordId; + newConstructionLogRecord.ConstructionLogId = constructionLogRecord.ConstructionLogId; + newConstructionLogRecord.Record = constructionLogRecord.Record; + newConstructionLogRecord.Remark = constructionLogRecord.Remark; + + db.ZHGL_ConstructionLogRecord.InsertOnSubmit(newConstructionLogRecord); + db.SubmitChanges(); + } + + /// + /// 根据月报id删除对应的所有施工日志作业人员明细 + /// + /// 施工日志作业人员明细编号 + public static void DeleteConstructionLogRecordsByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in db.ZHGL_ConstructionLogRecord where x.ConstructionLogId == ConstructionLogId select x).ToList(); + if (q.Count() > 0) + { + db.ZHGL_ConstructionLogRecord.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + + /// + /// 根据月报id获取对应的所有施工日志作业人员明细 + /// + /// 施工日志作业人员明细编号 + public static List GetConstructionLogRecordsByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + return (from x in db.ZHGL_ConstructionLogRecord where x.ConstructionLogId == ConstructionLogId select x).ToList(); + } + } +} diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs index 136fa252..99d17bcd 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs @@ -50,9 +50,9 @@ namespace BLL Professional = ConstructionLog.Professional, CompileMan = ConstructionLog.CompileMan, CompileDate = ConstructionLog.CompileDate, - State= ConstructionLog.State, - Remark= ConstructionLog.Remark, - HSETodaySummary= ConstructionLog.HSETodaySummary, + State = ConstructionLog.State, + Remark = ConstructionLog.Remark, + HSETodaySummary = ConstructionLog.HSETodaySummary, HSETodaySummaryRemark = ConstructionLog.HSETodaySummaryRemark, HSETomorrowPlan = ConstructionLog.HSETomorrowPlan, HSETomorrowPlanRemark = ConstructionLog.HSETomorrowPlanRemark, @@ -60,6 +60,9 @@ namespace BLL CQMSTodaySummaryRemark = ConstructionLog.CQMSTodaySummaryRemark, CQMSTomorrowPlan = ConstructionLog.CQMSTomorrowPlan, CQMSTomorrowPlanRemark = ConstructionLog.CQMSTomorrowPlanRemark, + FileCode = ConstructionLog.FileCode, + WorkPostId = ConstructionLog.WorkPostId, + MachineId = ConstructionLog.MachineId, }; db.ZHGL_ConstructionLog.InsertOnSubmit(newConstructionLog); db.SubmitChanges(); @@ -75,6 +78,7 @@ namespace BLL Model.ZHGL_ConstructionLog newConstructionLog = db.ZHGL_ConstructionLog.FirstOrDefault(e => e.ConstructionLogId == ConstructionLog.ConstructionLogId); if (newConstructionLog != null) { + newConstructionLog.FileCode = ConstructionLog.FileCode; newConstructionLog.Weather = ConstructionLog.Weather; newConstructionLog.Temperature = ConstructionLog.Temperature; newConstructionLog.ContractNo = ConstructionLog.ContractNo; @@ -90,6 +94,8 @@ namespace BLL newConstructionLog.CQMSTodaySummaryRemark = ConstructionLog.CQMSTodaySummaryRemark; newConstructionLog.CQMSTomorrowPlan = ConstructionLog.CQMSTomorrowPlan; newConstructionLog.CQMSTomorrowPlanRemark = ConstructionLog.CQMSTomorrowPlanRemark; + newConstructionLog.WorkPostId = ConstructionLog.WorkPostId; + newConstructionLog.MachineId = ConstructionLog.MachineId; db.SubmitChanges(); } } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyService.cs new file mode 100644 index 00000000..337c1ce7 --- /dev/null +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyService.cs @@ -0,0 +1,69 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + public class ConstructionLogWorkEfficiencyService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 获取施工日志工效明细列表 + /// + /// + /// + /// + public static List getListData(string ConstructionLogId) + { + return (from x in db.ZHGL_ConstructionLogWorkEfficiency + where x.ConstructionLogId == ConstructionLogId + select x).ToList(); + } + + /// + /// 增加施工日志工效明细 + /// + /// 施工日志工效明细实体 + public static void AddConstructionLogWorkEfficiency(Model.ZHGL_ConstructionLogWorkEfficiency constructionLogWorkEfficiency) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ConstructionLogWorkEfficiency newConstructionLogWorkEfficiency = new Model.ZHGL_ConstructionLogWorkEfficiency(); + newConstructionLogWorkEfficiency.ConstructionLogWorkEfficiencyId = constructionLogWorkEfficiency.ConstructionLogWorkEfficiencyId; + newConstructionLogWorkEfficiency.ConstructionLogId = constructionLogWorkEfficiency.ConstructionLogId; + newConstructionLogWorkEfficiency.ContractTrackId = constructionLogWorkEfficiency.ContractTrackId; + newConstructionLogWorkEfficiency.PhysicalCompletionQuantity = constructionLogWorkEfficiency.PhysicalCompletionQuantity; + newConstructionLogWorkEfficiency.MaterialConsumption = constructionLogWorkEfficiency.MaterialConsumption; + newConstructionLogWorkEfficiency.Type = constructionLogWorkEfficiency.Type; + newConstructionLogWorkEfficiency.TypeId = constructionLogWorkEfficiency.TypeId; + newConstructionLogWorkEfficiency.ConsumeHours = constructionLogWorkEfficiency.ConsumeHours; + + db.ZHGL_ConstructionLogWorkEfficiency.InsertOnSubmit(newConstructionLogWorkEfficiency); + db.SubmitChanges(); + } + + /// + /// 根据月报id删除对应的所有施工日志工效明细 + /// + /// 施工日志工效明细编号 + public static void DeleteConstructionLogWorkEfficiencysByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in db.ZHGL_ConstructionLogWorkEfficiency where x.ConstructionLogId == ConstructionLogId select x).ToList(); + if (q.Count() > 0) + { + db.ZHGL_ConstructionLogWorkEfficiency.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + + /// + /// 根据月报id获取对应的所有施工日志工效明细 + /// + /// 施工日志工效明细编号 + public static List GetConstructionLogWorkEfficiencysByConstructionLogId(string ConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + return (from x in db.ZHGL_ConstructionLogWorkEfficiency where x.ConstructionLogId == ConstructionLogId select x).ToList(); + } + } +} diff --git a/SGGL/BLL/PZHGL/InformationProject/ProjectConstructionLogService.cs b/SGGL/BLL/PZHGL/InformationProject/ProjectConstructionLogService.cs new file mode 100644 index 00000000..60cff24c --- /dev/null +++ b/SGGL/BLL/PZHGL/InformationProject/ProjectConstructionLogService.cs @@ -0,0 +1,134 @@ +using System; +using System.Linq; +using System.Web.UI.WebControls; + +namespace BLL +{ + /// + /// 项目级施工日志 + /// + public static class ProjectConstructionLogService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 根据主键获取项目级施工日志 + /// + /// + /// + public static Model.ZHGL_ProjectConstructionLog GetProjectConstructionLogById(string ProjectConstructionLogId) + { + return Funs.DB.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId == ProjectConstructionLogId); + } + + /// + /// 根据项目、用户及日期获取项目级施工日志 + /// + /// + /// + public static Model.ZHGL_ProjectConstructionLog GetProjectConstructionLogByProjectIdAndUserIDAndDate(string ProjectConstructionLogId, string projectId, string userId, DateTime date) + { + return Funs.DB.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId != ProjectConstructionLogId && e.ProjectId == projectId && e.CompileMan == userId); + //return Funs.DB.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId != ProjectConstructionLogId && e.ProjectId == projectId && e.CompileMan == userId && e.CompileDate == date); + } + + /// + /// 添加项目级施工日志 + /// + /// + public static void AddProjectConstructionLog(Model.ZHGL_ProjectConstructionLog ProjectConstructionLog) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ProjectConstructionLog newProjectConstructionLog = new Model.ZHGL_ProjectConstructionLog + { + ProjectConstructionLogId = ProjectConstructionLog.ProjectConstructionLogId, + ProjectId = ProjectConstructionLog.ProjectId, + Weather = ProjectConstructionLog.Weather, + Temperature = ProjectConstructionLog.Temperature, + ContractNo = ProjectConstructionLog.ContractNo, + UnitWorks = ProjectConstructionLog.UnitWorks, + Professional = ProjectConstructionLog.Professional, + CompileMan = ProjectConstructionLog.CompileMan, + CompileDate = ProjectConstructionLog.CompileDate, + State = ProjectConstructionLog.State, + Remark = ProjectConstructionLog.Remark, + HSETodaySummary = ProjectConstructionLog.HSETodaySummary, + HSETodaySummaryRemark = ProjectConstructionLog.HSETodaySummaryRemark, + HSETomorrowPlan = ProjectConstructionLog.HSETomorrowPlan, + HSETomorrowPlanRemark = ProjectConstructionLog.HSETomorrowPlanRemark, + CQMSTodaySummary = ProjectConstructionLog.CQMSTodaySummary, + CQMSTodaySummaryRemark = ProjectConstructionLog.CQMSTodaySummaryRemark, + CQMSTomorrowPlan = ProjectConstructionLog.CQMSTomorrowPlan, + CQMSTomorrowPlanRemark = ProjectConstructionLog.CQMSTomorrowPlanRemark, + FileCode = ProjectConstructionLog.FileCode, + WorkPostId = ProjectConstructionLog.WorkPostId, + MachineId = ProjectConstructionLog.MachineId, + }; + db.ZHGL_ProjectConstructionLog.InsertOnSubmit(newProjectConstructionLog); + db.SubmitChanges(); + } + + /// + /// 修改项目级施工日志 + /// + /// + public static void UpdateProjectConstructionLog(Model.ZHGL_ProjectConstructionLog ProjectConstructionLog) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ProjectConstructionLog newProjectConstructionLog = db.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId == ProjectConstructionLog.ProjectConstructionLogId); + if (newProjectConstructionLog != null) + { + newProjectConstructionLog.FileCode = ProjectConstructionLog.FileCode; + newProjectConstructionLog.Weather = ProjectConstructionLog.Weather; + newProjectConstructionLog.Temperature = ProjectConstructionLog.Temperature; + newProjectConstructionLog.ContractNo = ProjectConstructionLog.ContractNo; + newProjectConstructionLog.UnitWorks = ProjectConstructionLog.UnitWorks; + newProjectConstructionLog.Professional = ProjectConstructionLog.Professional; + newProjectConstructionLog.State = ProjectConstructionLog.State; + newProjectConstructionLog.Remark = ProjectConstructionLog.Remark; + newProjectConstructionLog.HSETodaySummary = ProjectConstructionLog.HSETodaySummary; + newProjectConstructionLog.HSETodaySummaryRemark = ProjectConstructionLog.HSETodaySummaryRemark; + newProjectConstructionLog.HSETomorrowPlan = ProjectConstructionLog.HSETomorrowPlan; + newProjectConstructionLog.HSETomorrowPlanRemark = ProjectConstructionLog.HSETomorrowPlanRemark; + newProjectConstructionLog.CQMSTodaySummary = ProjectConstructionLog.CQMSTodaySummary; + newProjectConstructionLog.CQMSTodaySummaryRemark = ProjectConstructionLog.CQMSTodaySummaryRemark; + newProjectConstructionLog.CQMSTomorrowPlan = ProjectConstructionLog.CQMSTomorrowPlan; + newProjectConstructionLog.CQMSTomorrowPlanRemark = ProjectConstructionLog.CQMSTomorrowPlanRemark; + newProjectConstructionLog.WorkPostId = ProjectConstructionLog.WorkPostId; + newProjectConstructionLog.MachineId = ProjectConstructionLog.MachineId; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除项目级施工日志 + /// + /// + public static void DeleteProjectConstructionLogById(string ProjectConstructionLogId) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ProjectConstructionLog ProjectConstructionLog = db.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId == ProjectConstructionLogId); + if (ProjectConstructionLog != null) + { + ////删除附件表 + BLL.CommonService.DeleteAttachFileById(ProjectConstructionLog.ProjectConstructionLogId); + db.ZHGL_ProjectConstructionLog.DeleteOnSubmit(ProjectConstructionLog); + db.SubmitChanges(); + } + } + + /// + /// 获取天气状况 + /// + /// + public static ListItem[] GetWeatherList() + { + ListItem[] lis = new ListItem[4]; + lis[0] = new ListItem("阴", "阴"); + lis[1] = new ListItem("晴", "晴"); + lis[2] = new ListItem("雨", "雨"); + lis[3] = new ListItem("雪", "雪"); + return lis; + } + } +} diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs index 487406ed..c9d874d1 100644 --- a/SGGL/BLL/Person/Person_PersonsService.cs +++ b/SGGL/BLL/Person/Person_PersonsService.cs @@ -841,6 +841,8 @@ namespace BLL newPerson.RelativeTel = person.RelativeTel; newPerson.MultiProject = person.MultiProject; newPerson.HomePageType = person.HomePageType; + newPerson.LogWorkPostId = person.LogWorkPostId; + newPerson.LogMachineId = person.LogMachineId; newPerson.IsCardNoOK = IDCardValid.CheckIDCard(person.IdentityCard); if (string.IsNullOrEmpty(person.QRCodeAttachUrl)) diff --git a/SGGL/BLL/ProjectData/UnitWorkService.cs b/SGGL/BLL/ProjectData/UnitWorkService.cs index 5b75b8bd..79fac28f 100644 --- a/SGGL/BLL/ProjectData/UnitWorkService.cs +++ b/SGGL/BLL/ProjectData/UnitWorkService.cs @@ -30,6 +30,8 @@ namespace BLL newUnitWork.NDEUnit = UnitWork.NDEUnit; newUnitWork.Costs = UnitWork.Costs; newUnitWork.MainItemAndDesignProfessionalIds = UnitWork.MainItemAndDesignProfessionalIds; + newUnitWork.ContractId = UnitWork.ContractId; + newUnitWork.MainItemCode = UnitWork.MainItemCode; db.WBS_UnitWork.InsertOnSubmit(newUnitWork); db.SubmitChanges(); GetWeights(UnitWork.ProjectId); @@ -64,6 +66,8 @@ namespace BLL newUnitWork.RealEndDate = UnitWork.RealEndDate; newUnitWork.PlanCost = UnitWork.PlanCost; newUnitWork.JDWeights = UnitWork.JDWeights; + newUnitWork.ContractId = UnitWork.ContractId; + newUnitWork.MainItemCode = UnitWork.MainItemCode; db.SubmitChanges(); } GetWeights(UnitWork.ProjectId); @@ -273,6 +277,21 @@ namespace BLL return item; } /// + /// 获取单位工程名称项 + /// + /// 项目Id + /// + public static ListItem[] GetUnitWorkListByContract(string projectId, List contracts) + { + List q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && x.SuperUnitWork == null && contracts.Contains(x.ContractId) orderby x.UnitWorkCode select x).ToList(); + ListItem[] item = new ListItem[q.Count()]; + for (int i = 0; i < q.Count(); i++) + { + item[i] = new ListItem((q[i].UnitWorkCode + "-" + q[i].UnitWorkName + GetProjectType(q[i].ProjectType)) ?? "", q[i].UnitWorkId.ToString()); + } + return item; + } + /// /// 获取安装工程单位工程名称项 /// /// 项目Id @@ -358,6 +377,22 @@ namespace BLL } } /// + /// 单位工程表下拉框 + /// + /// 下拉框名字 + /// 是否显示请选择 + public static void InitContractUnitWorkDownList(FineUIPro.DropDownList dropName, string projectId, List contracts, bool isShowPlease) + { + dropName.DataValueField = "Value"; + dropName.DataTextField = "Text"; + dropName.DataSource = BLL.UnitWorkService.GetUnitWorkListByContract(projectId, contracts); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + /// /// 安装工程单位工程表下拉框 /// /// 下拉框名字 diff --git a/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.cs index 1c220b18..267fde3b 100644 --- a/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Check/CheckList.aspx.cs @@ -51,12 +51,9 @@ namespace FineUIPro.Web.CQMS.Check Funs.FineUIPleaseSelect(this.dpHandelStatus); btnNew.OnClientClick = Window1.GetShowReference("ChecklistEdit.aspx") + "return false;"; ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); - // 绑定表格 BindGrid(); - - } @@ -99,7 +96,8 @@ namespace FineUIPro.Web.CQMS.Check } protected DataTable ChecklistData() { - string strSql = @"SELECT chec.CheckControlCode,chec.CheckSite,chec.ProjectId,chec.unitId,cNProfessional.ProfessionalName," + string strSql = @"SELECT chec.CheckControlCode,(case when chec.WorkPackageName is null then chec.CheckSite else chec.WorkPackageName end) as CheckSite + ,chec.ProjectId,chec.unitId,cNProfessional.ProfessionalName," + @" QualityQuestionType.QualityQuestionType as QuestionType," + @" chec.checkman,chec.CheckDate,chec.DocCode,chec.submitman,chec.state,chec.CNProfessionalCode," + @" unit.UnitName,unitWork.UnitWorkName+(case unitWork.ProjectType when '1' then '(建筑)' else '(安装)' end) as UnitWorkName,u.PersonName " diff --git a/SGGL/FineUIPro.Web/CQMS/Check/CheckListView.aspx b/SGGL/FineUIPro.Web/CQMS/Check/CheckListView.aspx index 13f72caf..cf62a86d 100644 --- a/SGGL/FineUIPro.Web/CQMS/Check/CheckListView.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Check/CheckListView.aspx @@ -39,9 +39,8 @@ BodyPadding="10px" EnableCollapse="true" ShowHeader="true" AutoScroll="true" runat="server"> + BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right" LabelWidth="110px"> - - + + + + + - //------------------------------------------------------------------------------ -namespace FineUIPro.Web.CQMS.Check { - - - public partial class CheckListView { - +namespace FineUIPro.Web.CQMS.Check +{ + + + public partial class CheckListView + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// SimpleForm1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// ContentPanel2 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ContentPanel ContentPanel2; - + /// /// Form2 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form Form2; - + /// /// txtProjectName 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtProjectName; - + /// /// txtDocCode 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtDocCode; - + /// /// drpUnit 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox drpUnit; - + /// /// drpUnitWork 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox drpUnitWork; - + /// /// drpCNProfessional 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox drpCNProfessional; - + /// /// drpQuestionType 控件。 /// @@ -110,7 +112,16 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox drpQuestionType; - + + /// + /// txtWorkPackageId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtWorkPackageId; + /// /// txtCheckSite 控件。 /// @@ -119,7 +130,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCheckSite; - + /// /// txtCheckDate 控件。 /// @@ -128,7 +139,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCheckDate; - + /// /// drpProposeUnit 控件。 /// @@ -137,7 +148,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox drpProposeUnit; - + /// /// txtLimitDate 控件。 /// @@ -146,7 +157,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtLimitDate; - + /// /// txtQuestionDef 控件。 /// @@ -155,7 +166,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextArea txtQuestionDef; - + /// /// txtRectifyOpinion 控件。 /// @@ -164,7 +175,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextArea txtRectifyOpinion; - + /// /// Panel1 控件。 /// @@ -173,7 +184,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// imgBtnFile 控件。 /// @@ -182,7 +193,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button imgBtnFile; - + /// /// ContentPanel3 控件。 /// @@ -191,7 +202,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ContentPanel ContentPanel3; - + /// /// For 控件。 /// @@ -200,7 +211,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form For; - + /// /// txtHandleWay 控件。 /// @@ -209,7 +220,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextArea txtHandleWay; - + /// /// txtRectifyDate 控件。 /// @@ -218,7 +229,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtRectifyDate; - + /// /// Panel2 控件。 /// @@ -227,7 +238,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel2; - + /// /// lblAttach 控件。 /// @@ -236,7 +247,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblAttach; - + /// /// btnAttach 控件。 /// @@ -245,7 +256,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnAttach; - + /// /// plApprove 控件。 /// @@ -254,7 +265,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.FormRow plApprove; - + /// /// gvApprove 控件。 /// @@ -263,7 +274,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid gvApprove; - + /// /// lbtype 控件。 /// @@ -272,7 +283,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lbtype; - + /// /// Window1 控件。 /// @@ -281,7 +292,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// WindowAtt 控件。 /// @@ -290,7 +301,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; - + /// /// Menu1 控件。 /// @@ -299,7 +310,7 @@ namespace FineUIPro.Web.CQMS.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuEdit 控件。 /// diff --git a/SGGL/FineUIPro.Web/CQMS/Check/ChecklistEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Check/ChecklistEdit.aspx index 4a09ea70..a664d574 100644 --- a/SGGL/FineUIPro.Web/CQMS/Check/ChecklistEdit.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Check/ChecklistEdit.aspx @@ -4,7 +4,7 @@ -质量巡检 + 质量巡检
@@ -12,22 +19,25 @@ - - + + - - - + @@ -39,7 +49,7 @@ - @@ -73,6 +83,9 @@ FieldType="String" HeaderText="进场时间" HeaderTextAlign="Center" TextAlign="Center"> + + + @@ -86,5 +99,16 @@
+ diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs index cccd2a25..887a9b85 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs @@ -1,7 +1,7 @@ using BLL; +using Microsoft.Office.Core; +using Newtonsoft.Json.Linq; using System; -using System.Collections.Generic; -using System.Data; using System.Linq; namespace FineUIPro.Web.HSSE.SitePerson @@ -23,11 +23,15 @@ namespace FineUIPro.Web.HSSE.SitePerson } } + /// + /// 加载页面 + /// + /// + /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { - Funs.DropDownPageSize(this.ddlPageSize); this.ProjectId = this.CurrUser.LoginProjectId; if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId) { @@ -41,34 +45,50 @@ namespace FineUIPro.Web.HSSE.SitePerson } WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + Funs.DropDownPageSize(this.ddlPageSize); // 绑定表格 this.BindGrid(); } } - #region 绑定数据 /// /// 绑定数据 /// private void BindGrid() { var getData = SitePerson_PersonService.getNowPersonListData(this.ProjectId, this.drpUnit.SelectedValue, this.drpWorkPost.SelectedValue - , this.txtPersonName.Text.Trim(),this.txtIdcard.Text.Trim(),Funs.GetNewDateTimeOrNow(this.txtStartDate.Text), Grid1); + , this.txtPersonName.Text.Trim(), this.txtIdcard.Text.Trim(), Funs.GetNewDateTimeOrNow(this.txtStartDate.Text), Grid1); Grid1.RecordCount = SitePerson_PersonService.nowCount; Grid1.DataSource = getData; - Grid1.DataBind(); + Grid1.DataBind(); } - #endregion + #region 查询 + /// + /// 查询 + /// + /// + /// protected void btnSearch_Click(object sender, EventArgs e) { - // 绑定表格 this.BindGrid(); } + #endregion - #region 分页选择下拉改变事件 + + #region 分页 /// - /// 分页选择下拉改变事件 + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 /// /// /// @@ -77,21 +97,40 @@ namespace FineUIPro.Web.HSSE.SitePerson Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); BindGrid(); } - #endregion - #region 页索引改变事件 /// - /// 页索引改变事件 + /// 排序 /// /// /// - protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) { - Grid1.PageIndex = e.NewPageIndex; BindGrid(); } #endregion + #region Grid编辑事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + + } + #endregion + #region 导出按钮 /// 导出按钮 ///
@@ -110,7 +149,5 @@ namespace FineUIPro.Web.HSSE.SitePerson Response.End(); } #endregion - - } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx index 0390026c..d5e18b1a 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx @@ -4,104 +4,425 @@ - - 项目级施工日志 + + 个人施工日志
- - + + - - + - - + - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -