diff --git a/DataBase/版本日志/SGGLDB_WH_2024-03-07-gaofei.sql b/DataBase/版本日志/SGGLDB_WH_2024-03-07-gaofei.sql new file mode 100644 index 00000000..0a1a4eb0 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2024-03-07-gaofei.sql @@ -0,0 +1,918 @@ + +CREATE TABLE [dbo].[Base_TestRunPerformanceStandard]( + [TestRunPerformanceStandardId] [nvarchar](50) NOT NULL, + [Code] [nvarchar](10) NULL, + [Code1] [int] NULL, + [Code2] [int] NULL, + [Code3] [int] NULL, + [Type] [nvarchar](50) NULL, + [Item] [nvarchar](50) NULL, + [Unit] [nvarchar](50) NULL, + [Days] [int] NULL, + CONSTRAINT [PK_Base_TestRunPerformanceStandard] PRIMARY KEY CLUSTERED +( + [TestRunPerformanceStandardId] 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 + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'TestRunPerformanceStandardId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Code' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Code1' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Code2' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'3' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Code3' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Type' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Item' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Unit' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'׼' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard', @level2type=N'COLUMN',@level2name=N'Days' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ԳЧ۱׼' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_TestRunPerformanceStandard' +GO + + + +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.1',1,1,1,'Ż','רҵѵ','׼',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.1',1,1,2,'Ż','רҵѵ','ڿ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.1',1,1,3,'Ż','רҵѵ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.1',1,1,4,'Ż','רҵѵ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.1',1,1,5,'Ż','רҵѵ','ܽ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.2',1,2,1,'Ż','ϵļ','ޱ',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.2',1,2,2,'Ż','ϵļ','±',7) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.2',1,2,3,'Ż','ϵļ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.2',1,2,4,'Ż','ϵļ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.2',1,2,5,'Ż','ϵļ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.2',1,2,6,'Ż','ϵļ','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.3',1,3,1,'Ż','ҵ','ޱ',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.3',1,3,2,'Ż','ҵ','±',7) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.3',1,3,3,'Ż','ҵ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.3',1,3,4,'Ż','ҵ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.3',1,3,5,'Ż','ҵ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.3',1,3,6,'Ż','ҵ','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.4',1,4,1,'Ż','ļ','ޱ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.4',1,4,2,'Ż','ļ','±',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.4',1,4,3,'Ż','ļ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.4',1,4,4,'Ż','ļ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.4',1,4,5,'Ż','ļ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.4',1,4,6,'Ż','ļ','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.5',1,5,1,'Ż','ܽ','±',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.5',1,5,2,'Ż','ܽ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.5',1,5,3,'Ż','ܽ','׼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.6',1,6,1,'Ż','»ר','֯',30) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.6',1,6,2,'Ż','»ר','μ',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.7',1,7,1,'Ż','¼','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.7',1,7,2,'Ż','¼','ռ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.7',1,7,3,'Ż','¼','鵵',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'1.8',1,8,1,'Ż','','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'2.1',2,1,1,'˾ѵ','','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'2.1',2,1,2,'˾ѵ','','ڿ',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'2.1',2,1,3,'˾ѵ','','ܽ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'2.2',2,2,1,'˾ѵ','','׼',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'2.2',2,2,2,'˾ѵ','','ڿ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'2.2',2,2,3,'˾ѵ','','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'2.2',2,2,4,'˾ѵ','','ܽ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.1',3,1,1,'ĿͶ','Ͷ׼','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.1',3,1,2,'ĿͶ','Ͷ׼','Ϥ',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.1',3,1,3,'ĿͶ','Ͷ׼','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.1',3,1,4,'ĿͶ','Ͷ׼','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.1',3,1,5,'ĿͶ','Ͷ׼','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.2',3,2,1,'ĿͶ','ѵ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.2',3,2,2,'ĿͶ','ѵ','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.2',3,2,3,'ĿͶ','ѵ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.2',3,2,4,'ĿͶ','ѵ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.3',3,3,1,'ĿͶ','ԤԳԳ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.3',3,3,2,'ĿͶ','ԤԳԳ','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.3',3,3,3,'ĿͶ','ԤԳԳ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.3',3,3,4,'ĿͶ','ԤԳԳ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.4',3,4,1,'ĿͶ','˳','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.4',3,4,2,'ĿͶ','˳','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.4',3,4,3,'ĿͶ','˳','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.4',3,4,4,'ĿͶ','˳','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.5',3,5,1,'ĿͶ','ù','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.5',3,5,2,'ĿͶ','ù','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.5',3,5,3,'ĿͶ','ù','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.5',3,5,4,'ĿͶ','ù','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.6',3,6,1,'ĿͶ','ƻ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.6',3,6,2,'ĿͶ','ƻ','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.6',3,6,3,'ĿͶ','ƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'3.6',3,6,4,'ĿͶ','ƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.1',4,1,1,'߻','ǰ׼','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.1',4,1,2,'߻','ǰ׼','Ϥļ',15) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.1',4,1,3,'߻','ǰ׼','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.1',4,1,4,'߻','ǰ׼','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.2',4,2,1,'߻','ʵʩƻ','',7) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.3',4,3,1,'߻','Աƻ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.3',4,3,2,'߻','Աƻ','У',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.3',4,3,3,'߻','Աƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.4',4,4,1,'߻','ηֹ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.4',4,4,2,'߻','ηֹ','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.4',4,4,3,'߻','ηֹ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.5',4,5,1,'߻','ļƼƻ','',4) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.5',4,5,2,'߻','ļƼƻ','У',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.5',4,5,3,'߻','ļƼƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.6',4,6,1,'߻','ְƻ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.6',4,6,2,'߻','ְƻ','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.6',4,6,3,'߻','ְƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.7',4,7,1,'߻','ƻ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.7',4,7,2,'߻','ƻ','У',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.7',4,7,3,'߻','ƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.8',4,8,1,'߻','ƻ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.8',4,8,2,'߻','ƻ','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.8',4,8,3,'߻','ƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.9',4,9,1,'߻','ȼƻ','',4) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.9',4,9,2,'߻','ȼƻ','У',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.9',4,9,3,'߻','ȼƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.10',4,10,1,'߻','߻','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.10',4,10,2,'߻','߻','У',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'4.10',4,10,3,'߻','߻','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.1',5,1,1,'ѵ','ҵԱѵƻ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.1',5,1,2,'ѵ','ҵԱѵƻ','У',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.1',5,1,3,'ѵ','ҵԱѵƻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.2',5,2,1,'ѵ','칫','׼',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.2',5,2,2,'ѵ','칫','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.2',5,2,3,'ѵ','칫','ڿ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.2',5,2,4,'ѵ','칫','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.2',5,2,5,'ѵ','칫','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.3',5,3,1,'ѵ','ؼ豸쳧','׼',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.3',5,3,2,'ѵ','ؼ豸쳧','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.3',5,3,3,'ѵ','ؼ豸쳧','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.3',5,3,4,'ѵ','ؼ豸쳧','ڿ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.3',5,3,5,'ѵ','ؼ豸쳧','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.3',5,3,6,'ѵ','ؼ豸쳧','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.4',5,4,1,'ѵ','װò','׼',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.4',5,4,2,'ѵ','װò','֯',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.4',5,4,3,'ѵ','װò','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.4',5,4,4,'ѵ','װò','ڿ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.4',5,4,5,'ѵ','װò','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.4',5,4,6,'ѵ','װò','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.5',5,5,1,'ѵ','ͬװֳ','׼',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.5',5,5,2,'ѵ','ͬװֳ','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.5',5,5,3,'ѵ','ͬװֳ','ڿ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.5',5,5,4,'ѵ','ͬװֳ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'5.5',5,5,5,'ѵ','ͬװֳ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.1',6,1,1,'ͬ','ְ̿','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.1',6,1,2,'ͬ','ְ̿','μ',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.1',6,1,3,'ͬ','ְ̿','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.2',6,2,1,'ͬ','Ӻͬ','',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.2',6,2,2,'ͬ','Ӻͬ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.2',6,2,3,'ͬ','Ӻͬ','̸',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.2',6,2,4,'ͬ','Ӻͬ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.2',6,2,5,'ͬ','Ӻͬ','ǩ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.3',6,3,1,'ͬ','ͬ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.3',6,3,2,'ͬ','ͬ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.3',6,3,3,'ͬ','ͬ','̸',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.3',6,3,4,'ͬ','ͬ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.3',6,3,5,'ͬ','ͬ','ǩ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.4',6,4,1,'ͬ','ͬ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.4',6,4,2,'ͬ','ͬ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.4',6,4,3,'ͬ','ͬ','׼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.5',6,5,1,'ͬ','ͬԼ','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.5',6,5,2,'ͬ','ͬԼ','μ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'6.5',6,5,3,'ͬ','ͬԼ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.1',7,1,1,'ԤԳ','ѭˮϵͳϴ','',7) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.1',7,1,2,'ԤԳ','ѭˮϵͳϴ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.1',7,1,3,'ԤԳ','ѭˮϵͳϴ','֯',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.1',7,1,4,'ԤԳ','ѭˮϵͳϴ','μ',8) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.1',7,1,5,'ԤԳ','ѭˮϵͳϴ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.2',7,2,1,'ԤԳ','ܵˮϴ_·','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.2',7,2,2,'ԤԳ','ܵˮϴ_·','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.2',7,2,3,'ԤԳ','ܵˮϴ_·','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.2',7,2,4,'ԤԳ','ܵˮϴ_·','μ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.2',7,2,5,'ԤԳ','ܵˮϴ_·','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.3',7,3,1,'ԤԳ','ܵɨ_·','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.3',7,3,2,'ԤԳ','ܵɨ_·','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.3',7,3,3,'ԤԳ','ܵɨ_·','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.3',7,3,4,'ԤԳ','ܵɨ_·','μ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.3',7,3,5,'ԤԳ','ܵɨ_·','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.4',7,4,1,'ԤԳ','ܵɨ','',15) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.4',7,4,2,'ԤԳ','ܵɨ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.4',7,4,3,'ԤԳ','ܵɨ','֯',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.4',7,4,4,'ԤԳ','ܵɨ','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.4',7,4,5,'ԤԳ','ܵɨ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.5',7,5,1,'ԤԳ','ܵɨ','',30) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.5',7,5,2,'ԤԳ','ܵɨ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.5',7,5,3,'ԤԳ','ܵɨ','֯',10) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.5',7,5,4,'ԤԳ','ܵɨ','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.5',7,5,5,'ԤԳ','ܵɨ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.6',7,6,1,'ԤԳ','ѧϴ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.6',7,6,2,'ԤԳ','ѧϴ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.6',7,6,3,'ԤԳ','ѧϴ','֯',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.6',7,6,4,'ԤԳ','ѧϴ','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.6',7,6,5,'ԤԳ','ѧϴ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.7',7,7,1,'ԤԳ','߻ɸװ_̨','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.7',7,7,2,'ԤԳ','߻ɸװ_̨','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.7',7,7,3,'ԤԳ','߻ɸװ_̨','֯',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.7',7,7,4,'ԤԳ','߻ɸװ_̨','μ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.7',7,7,5,'ԤԳ','߻ɸװ_̨','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.8',7,8,1,'ԤԳ','豸ͻϸ¯_̨','',7) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.8',7,8,2,'ԤԳ','豸ͻϸ¯_̨','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.8',7,8,3,'ԤԳ','豸ͻϸ¯_̨','֯',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.8',7,8,4,'ԤԳ','豸ͻϸ¯_̨','μ',7) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.8',7,8,5,'ԤԳ','豸ͻϸ¯_̨','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.9',7,9,1,'ԤԳ','ϵͳ_·','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.9',7,9,2,'ԤԳ','ϵͳ_·','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.9',7,9,3,'ԤԳ','ϵͳ_·','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.9',7,9,4,'ԤԳ','ϵͳ_·','μ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.9',7,9,5,'ԤԳ','ϵͳ_·','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.10',7,10,1,'ԤԳ','һ豸Գ_̨','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.10',7,10,2,'ԤԳ','һ豸Գ_̨','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.10',7,10,3,'ԤԳ','һ豸Գ_̨','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.10',7,10,4,'ԤԳ','һ豸Գ_̨','μ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.10',7,10,5,'ԤԳ','һ豸Գ_̨','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.11',7,11,1,'ԤԳ','ѭ_̨','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.11',7,11,2,'ԤԳ','ѭ_̨','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.11',7,11,3,'ԤԳ','ѭ_̨','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.11',7,11,4,'ԤԳ','ѭ_̨','μ',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.11',7,11,5,'ԤԳ','ѭ_̨','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.12',7,12,1,'ԤԳ','ֻԳ_̨','',7) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.12',7,12,2,'ԤԳ','ֻԳ_̨','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.12',7,12,3,'ԤԳ','ֻԳ_̨','֯',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.12',7,12,4,'ԤԳ','ֻԳ_̨','μ',8) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.12',7,12,5,'ԤԳ','ֻԳ_̨','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.13',7,13,1,'ԤԳ','Գ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.13',7,13,2,'ԤԳ','Գ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.13',7,13,3,'ԤԳ','Գ','֯',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.13',7,13,4,'ԤԳ','Գ','μ',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'7.13',7,13,5,'ԤԳ','Գ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.1',8,1,1,'Գ','ϵͳ顢_·','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.1',8,1,2,'Գ','ϵͳ顢_·','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.1',8,1,3,'Գ','ϵͳ顢_·','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.1',8,1,4,'Գ','ϵͳ顢_·','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.1',8,1,5,'Գ','ϵͳ顢_·','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.2',8,2,1,'Գ','ϵͳԤĤۻ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.2',8,2,2,'Գ','ϵͳԤĤۻ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.2',8,2,3,'Գ','ϵͳԤĤۻ','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.2',8,2,4,'Գ','ϵͳԤĤۻ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.2',8,2,5,'Գ','ϵͳԤĤۻ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.3',8,3,1,'Գ','¯Ϲ¯','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.3',8,3,2,'Գ','¯Ϲ¯','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.3',8,3,3,'Գ','¯Ϲ¯','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.3',8,3,4,'Գ','¯Ϲ¯','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.3',8,3,5,'Գ','¯Ϲ¯','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.4',8,4,1,'Գ','Գ_ϵͳ','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.4',8,4,2,'Գ','Գ_ϵͳ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.4',8,4,3,'Գ','Գ_ϵͳ','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.4',8,4,4,'Գ','Գ_ϵͳ','μ',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.4',8,4,5,'Գ','Գ_ϵͳ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.5',8,5,1,'Գ','ϵͳ_ϵͳ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.5',8,5,2,'Գ','ϵͳ_ϵͳ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.5',8,5,3,'Գ','ϵͳ_ϵͳ','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.5',8,5,4,'Գ','ϵͳ_ϵͳ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.5',8,5,5,'Գ','ϵͳ_ϵͳ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.6',8,6,1,'Գ','û_ϵͳ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.6',8,6,2,'Գ','û_ϵͳ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.6',8,6,3,'Գ','û_ϵͳ','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.6',8,6,4,'Գ','û_ϵͳ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.6',8,6,5,'Գ','û_ϵͳ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.7',8,7,1,'Գ','߻»ԭ_̨','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.7',8,7,2,'Գ','߻»ԭ_̨','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.7',8,7,3,'Գ','߻»ԭ_̨','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.7',8,7,4,'Գ','߻»ԭ_̨','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.7',8,7,5,'Գ','߻»ԭ_̨','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.8',8,8,1,'Գ','ϵͳԤȡԤ','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.8',8,8,2,'Գ','ϵͳԤȡԤ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.8',8,8,3,'Գ','ϵͳԤȡԤ','֯',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.8',8,8,4,'Գ','ϵͳԤȡԤ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.8',8,8,5,'Գ','ϵͳԤȡԤ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.9',8,9,1,'Գ','ͶԳ_Ԫ','',8) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.9',8,9,2,'Գ','ͶԳ_Ԫ','',4) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.9',8,9,3,'Գ','ͶԳ_Ԫ','֯',4) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.9',8,9,4,'Գ','ͶԳ_Ԫ','μ',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'8.9',8,9,5,'Գ','ͶԳ_Ԫ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'9.1',9,1,1,'м','йƶ_','',3) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'9.1',9,1,2,'м','йƶ_','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'9.1',9,1,3,'м','йƶ_','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'9.2',9,2,1,'м','ʵʩ','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'9.2',9,2,2,'м','ʵʩ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'9.3',9,3,1,'м','ܿ','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'9.3',9,3,2,'м','ܿ','¼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.1',10,1,1,'β','±','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.1',10,1,2,'β','±','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.1',10,1,3,'β','±','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.2',10,2,1,'β','깤','',5) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.2',10,2,2,'β','깤','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.2',10,2,3,'β','깤','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.3',10,3,1,'β','ļ','ռ',4) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.3',10,3,2,'β','ļ','',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.3',10,3,3,'β','ļ','鵵',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.4',10,4,1,'β','ܽ','',4) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.5',10,5,1,'β','ֳʱ','μӣֶ룩',0) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.6',10,6,1,'β','ʦִ','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.6',10,6,2,'β','ʦִ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.6',10,6,3,'β','ʦִ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.7',10,7,1,'β','Լ','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.7',10,7,2,'β','Լ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'10.7',10,7,3,'β','Լ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.1',11,1,1,'ĿЭ','','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.1',11,1,2,'ĿЭ','','׼',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.1',11,1,3,'ĿЭ','','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.2',11,2,1,'ĿЭ','ʩ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.2',11,2,2,'ĿЭ','ʩ','׼',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.2',11,2,3,'ĿЭ','ʩ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.3',11,3,1,'ĿЭ','ɹ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.3',11,3,2,'ĿЭ','ɹ','׼',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.3',11,3,3,'ĿЭ','ɹ','',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.4',11,4,1,'ĿЭ','Ŀ','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.4',11,4,2,'ĿЭ','Ŀ','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.5',11,5,1,'ĿЭ','⴦','֯',2) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'11.5',11,5,2,'ĿЭ','⴦','μ',1) +GO +insert into [dbo].[Base_TestRunPerformanceStandard] values +(NEWID(),'12.1',12,1,1,'','','μӣֶ룩',0) +GO + + + + + + + + + + + + diff --git a/DataBase/版本日志/SGGLDB_WH_2024-03-11-gaofei.sql b/DataBase/版本日志/SGGLDB_WH_2024-03-11-gaofei.sql new file mode 100644 index 00000000..7fa17328 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2024-03-11-gaofei.sql @@ -0,0 +1,32 @@ +delete Sys_Menu where MenuId='EE7E37CA-384F-41B3-BAEE-89CBD9954AB3' +delete Sys_Menu where MenuId='E9EF7C6D-7F0A-4FBA-8A79-474D4E61AF27' +delete Sys_Menu where MenuId='9ACDF513-BD63-48F5-BFA3-B9B1B7FA19E1' +delete Sys_Menu where MenuId='3D554109-D95F-4051-8A6C-5616A7A95C94' +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('EE7E37CA-384F-41B3-BAEE-89CBD9954AB3','ԤԳ',null,'TestRun/Report/PreRunSchedule.aspx',1,'2BF9C16D-536F-4F89-AA59-49ED1A1A164C','Menu_TestRun',0,1,1) +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('E9EF7C6D-7F0A-4FBA-8A79-474D4E61AF27','Ķ',null,'TestRun/Report/FourDecisionSchedule.aspx',2,'2BF9C16D-536F-4F89-AA59-49ED1A1A164C','Menu_TestRun',0,1,1) +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('9ACDF513-BD63-48F5-BFA3-B9B1B7FA19E1','Գ',null,'TestRun/Report/TestRunSchedule.aspx',3,'2BF9C16D-536F-4F89-AA59-49ED1A1A164C','Menu_TestRun',0,1,1) +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('3D554109-D95F-4051-8A6C-5616A7A95C94','ҳ',null,'TestRun/Report/ScheduleSetUp.aspx',4,'2BF9C16D-536F-4F89-AA59-49ED1A1A164C','Menu_TestRun',0,1,1) +go + +--==ԤԳ/Գ/Ķ +if object_id(N'Run_ScheduleSetUp',N'U') is not null +drop table dbo.Run_ScheduleSetUp +CREATE TABLE dbo.Run_ScheduleSetUp( + ScheduleId varchar(50) NOT NULL,-- + WorkPackId varchar(50) NULL,-- + LevelName varchar(50) NULL,--Ķ + ProjectId varchar(50) NULL,--Ŀ + States int null,--1:ԤԳ2:Գ3:Ķ + AllNum int null,--ȫ + ProgressNum int NULL,-- + CompleteNum int NULL,-- + CompleteRate decimal(18,2) NULL,-- + AddUser varchar(50) NULL,-- + AddTime datetime NULL,-- + Sort int NULL,-- + CONSTRAINT PK_Run_ScheduleSetUp PRIMARY KEY CLUSTERED +( + ScheduleId 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 \ No newline at end of file diff --git a/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql b/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql index 06715a8c..3e305f00 100644 --- a/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql +++ b/DataBase/菜单初始化脚本/0-8综合管理(Menu_ZHGL).sql @@ -510,4 +510,23 @@ GO VALUES('7C866795-2E56-47CD-B937-C468C46DB007','172F25E0-F5E2-42E3-AD67-AC824D4E0FBB','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('27E0EE6E-D96F-4300-9574-423F378D79C4','172F25E0-F5E2-42E3-AD67-AC824D4E0FBB','保存',4) - GO \ No newline at end of file + GO + +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +VALUES('53D8CED2-9AA7-43EA-B27D-EA10A06DF713','开车人员绩效管理','',160,'0','Menu_ZHGL',0,0,1) +GO + + INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) + VALUES('383290E0-60AE-4D16-8B5E-3899B85EC2ED','开车绩效评分标准','ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx',10,'53D8CED2-9AA7-43EA-B27D-EA10A06DF713','Menu_ZHGL',0,1,1) + GO + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('988B984C-8B74-4D15-B0A7-3A00776984FB','383290E0-60AE-4D16-8B5E-3899B85EC2ED','增加',1) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('B4923645-FCBE-4670-8F27-C85B8FE4C48F','383290E0-60AE-4D16-8B5E-3899B85EC2ED','修改',2) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('5D005176-CE4C-4CDF-8720-505A8BB273F7','383290E0-60AE-4D16-8B5E-3899B85EC2ED','删除',3) + INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) + VALUES('A14DE61A-2E1B-4F4D-84E8-D87DBB2C5F4D','383290E0-60AE-4D16-8B5E-3899B85EC2ED','保存',4) + GO + + \ No newline at end of file diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index b5108cb7..25015428 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -167,6 +167,7 @@ + diff --git a/SGGL/BLL/BaseInfo/TestRunPerformanceStandardService.cs b/SGGL/BLL/BaseInfo/TestRunPerformanceStandardService.cs new file mode 100644 index 00000000..5ad25572 --- /dev/null +++ b/SGGL/BLL/BaseInfo/TestRunPerformanceStandardService.cs @@ -0,0 +1,106 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 开车绩效计算标准 + /// + public class TestRunPerformanceStandardService + { + /// + /// 根据主键获取开车绩效计算标准 + /// + /// + /// + public static Model.Base_TestRunPerformanceStandard GetPerformanceStandardById(string TestRunPerformanceStandardId) + { + return Funs.DB.Base_TestRunPerformanceStandard.FirstOrDefault(e => e.TestRunPerformanceStandardId == TestRunPerformanceStandardId); + } + + /// + /// 添加开车绩效计算标准 + /// + /// + public static void AddTestRunPerformanceStandard(Model.Base_TestRunPerformanceStandard testRunPerformanceStandard) + { + Model.Base_TestRunPerformanceStandard newTestRunPerformanceStandard = new Model.Base_TestRunPerformanceStandard + { + TestRunPerformanceStandardId = testRunPerformanceStandard.TestRunPerformanceStandardId, + Code = testRunPerformanceStandard.Code, + Code1 = testRunPerformanceStandard.Code1, + Code2 = testRunPerformanceStandard.Code2, + Code3 = testRunPerformanceStandard.Code3, + Type = testRunPerformanceStandard.Type, + Item = testRunPerformanceStandard.Item, + Unit = testRunPerformanceStandard.Unit, + Days = testRunPerformanceStandard.Days + }; + Funs.DB.Base_TestRunPerformanceStandard.InsertOnSubmit(newTestRunPerformanceStandard); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改开车绩效计算标准 + /// + /// + public static void UpdateTestRunPerformanceStandard(Model.Base_TestRunPerformanceStandard testRunPerformanceStandard) + { + Model.Base_TestRunPerformanceStandard newTestRunPerformanceStandard = Funs.DB.Base_TestRunPerformanceStandard.FirstOrDefault(e => e.TestRunPerformanceStandardId == testRunPerformanceStandard.TestRunPerformanceStandardId); + if (newTestRunPerformanceStandard != null) + { + newTestRunPerformanceStandard.Code = testRunPerformanceStandard.Code; + newTestRunPerformanceStandard.Code1 = testRunPerformanceStandard.Code1; + newTestRunPerformanceStandard.Code2 = testRunPerformanceStandard.Code2; + newTestRunPerformanceStandard.Code3 = testRunPerformanceStandard.Code3; + newTestRunPerformanceStandard.Type = testRunPerformanceStandard.Type; + newTestRunPerformanceStandard.Item = testRunPerformanceStandard.Item; + newTestRunPerformanceStandard.Unit = testRunPerformanceStandard.Unit; + newTestRunPerformanceStandard.Days = testRunPerformanceStandard.Days; + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除开车绩效计算标准 + /// + /// + public static void DeleteTestRunPerformanceStandardById(string TestRunPerformanceStandardId) + { + Model.Base_TestRunPerformanceStandard newTestRunPerformanceStandard = Funs.DB.Base_TestRunPerformanceStandard.FirstOrDefault(e => e.TestRunPerformanceStandardId == TestRunPerformanceStandardId); + if (newTestRunPerformanceStandard != null) + { + CommonService.DeleteAttachFileById(TestRunPerformanceStandardId);//删除附件 + Funs.DB.Base_TestRunPerformanceStandard.DeleteOnSubmit(newTestRunPerformanceStandard); + Funs.DB.SubmitChanges(); + } + } + + /// + /// 获取开车绩效计算标准下拉列表项 + /// + /// + public static List GetTestRunPerformanceStandardList() + { + return (from x in Funs.DB.Base_TestRunPerformanceStandard orderby x.Code1, x.Code2 select x).ToList(); + } + + /// + /// 开车绩效计算标准下拉框 + /// + /// 下拉框名字 + /// 项目id + /// 是否显示请选择 + public static void InitPerformanceStandardDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "TestRunPerformanceStandardId"; + dropName.DataTextField = "PerformanceStandardName"; + dropName.DataSource = GetTestRunPerformanceStandardList(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + } +} diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index be55d7d6..31c25177 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -4871,6 +4871,11 @@ namespace BLL /// 项目应急物资管理 /// public const string ServerEmergencySupplyMenuId = "3EA741CE-66A6-4CF8-8620-0C5906AC7D94"; + + /// + /// 开车绩效评分标准 + /// + public const string TestRunPerformanceStandardMenuId = "383290E0-60AE-4D16-8B5E-3899B85EC2ED"; #endregion #region 施工综合流程定义 diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index b01e9d2c..3109b857 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1824,6 +1824,7 @@ + @@ -2052,6 +2053,8 @@ + + @@ -16305,6 +16308,13 @@ TestRunReportEdit.aspx + + FourDecisionSchedule.aspx + ASPXCodeBehind + + + FourDecisionSchedule.aspx + PreRunSchedule.aspx ASPXCodeBehind @@ -17894,6 +17904,20 @@ SuperviseCheckReportEdit.aspx + + TestRunPerformanceStandard.aspx + ASPXCodeBehind + + + TestRunPerformanceStandard.aspx + + + TestRunPerformanceStandardEdit.aspx + ASPXCodeBehind + + + TestRunPerformanceStandardEdit.aspx + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs index a5e541da..28040f7d 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs @@ -335,10 +335,10 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun model.PipingLevel = itemTb.Rows[j][41].ToString(); model.NormalTemperature = itemTb.Rows[j][43].ToString(); model.NormalPressure = itemTb.Rows[j][45].ToString(); - model.DesignTemperature = itemTb.Rows[j][46].ToString(); - model.DesignPressure = itemTb.Rows[j][48].ToString(); - model.PaintLevel = itemTb.Rows[j][50].ToString(); - model.Remark = itemTb.Rows[j][53].ToString(); + model.DesignTemperature = itemTb.Rows[j][47].ToString(); + model.DesignPressure = itemTb.Rows[j][49].ToString(); + model.PaintLevel = itemTb.Rows[j][51].ToString(); + model.Remark = itemTb.Rows[j][54].ToString(); model.AddUser = this.CurrUser.UserId; model.AddTime = DateTime.Now; model.Sort = sortnum; diff --git a/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx b/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx new file mode 100644 index 00000000..29438eb3 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx @@ -0,0 +1,99 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FourDecisionSchedule.aspx.cs" Inherits="FineUIPro.Web.TestRun.Report.FourDecisionSchedule" %> + + + + + + 子系统工作包管理 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx.cs new file mode 100644 index 00000000..2432fe32 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx.cs @@ -0,0 +1,460 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Reflection; +using NPOI.SS.UserModel; +using NPOI.SS.Util; +using NPOI.XSSF.UserModel; +using System.IO; +using Newtonsoft.Json.Linq; + +namespace FineUIPro.Web.TestRun.Report +{ + public partial class FourDecisionSchedule : PageBase + { + /// + /// 点击树状主键 + /// + public string TreePreRunId { get { return (string)ViewState["TreePreRunId"]; } set { ViewState["TreePreRunId"] = value; } } + /// + /// 子系统主键 + /// + public List SubSystemIds { get { return (List)ViewState["SubSystemIds"]; } set { ViewState["SubSystemIds"] = value; } } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (SubSystemIds == null) SubSystemIds = new List(); + this.InitTreeMenu();//加载树 + } + } + + #region 加载树 + + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "系统划分"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + rootNode.ToolTip = ""; + rootNode.EnableClickEvent = true; + this.tvControlItem.Nodes.Add(rootNode); + var allPreRunLs = Funs.DB.PreRun_SysDevice.Where(p => p.ProjectId == this.CurrUser.LoginProjectId).ToList(); + var onePreRunLs = allPreRunLs.Where(p => p.PreRunLevel == 1).OrderBy(x => x.Sort); + foreach (var item in onePreRunLs) + { + TreeNode rootUnitNode = new TreeNode();//定义根节点 + rootUnitNode.NodeID = item.PreRunId; + rootUnitNode.Text = item.PreRunName; + rootUnitNode.ToolTip = item.PreRunName; + rootUnitNode.CommandName = ""; + rootUnitNode.EnableClickEvent = true; + rootUnitNode.EnableExpandEvent = true; + rootNode.Nodes.Add(rootUnitNode); + rootUnitNode.Expanded = true; + var otherPreRunls = allPreRunLs.Where(p => p.PreRunLevel != 1).ToList(); + this.BindNodes(rootUnitNode, otherPreRunls, item.PreRunId); + } + } + + /// + /// 绑定树节点 + /// + private void BindNodes(TreeNode node, List list, string parentId) + { + + var itemList = list.Where(p => p.ParentId == parentId).OrderBy(x => x.Sort).ToList(); + if (itemList.Count > 0) + { + foreach (var item in itemList) + { + TreeNode newNode = new TreeNode(); + newNode.Text = item.PreRunName; + newNode.NodeID = item.PreRunId; + newNode.ToolTip = item.PreRunName; + newNode.CommandName = ""; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + BindNodes(newNode, list, item.PreRunId); + } + } + } + + /// + /// 数加载 + /// + protected void tvControlItem_NodeExpand(object sender, TreeNodeEventArgs e) + { + if (e.Node.Nodes != null) + { + e.Node.Nodes.Clear(); + } + var allPreRunLs = Funs.DB.PreRun_SysDevice.Where(p => p.ProjectId == this.CurrUser.LoginProjectId).ToList(); + this.BindNodes(e.Node, allPreRunLs, e.NodeID); + } + + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + var devices = new List(); + this.TreePreRunId = tvControlItem.SelectedNodeID != "0" ? tvControlItem.SelectedNodeID : string.Empty; + if (!string.IsNullOrWhiteSpace(this.TreePreRunId)) + { + var model = Funs.DB.PreRun_SysDevice.FirstOrDefault(x => x.PreRunId == this.TreePreRunId); + if (model.PreRunLevel == 4) + { + this.SubSystemIds = new List() { model.PreRunId }; + } + else if (model.PreRunLevel == 3) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4 && x.SystemId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + else if (model.PreRunLevel == 2) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4 && x.ProcessesId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + else if (model.PreRunLevel == 1) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4 && x.InstallationId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + } + else + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + FourDecisionBrid(); + } + + #endregion + + #region 数据绑定/导出 + + /// + /// 三查四定绑定 + /// + public void FourDecisionBrid() + { + var result = new List(); + if (this.SubSystemIds.Count > 0) + { + result = GetFourDecisionSchedules(); + } + GridFourDecision.DataSource = result; + GridFourDecision.DataBind(); + JObject summary = new JObject(); + summary.Add("AllNum", result.Sum(x => x.AllNum)); + summary.Add("NoCloseNum", result.Sum(x => x.NoCloseNum)); + summary.Add("CloseNum", result.Sum(x => x.CloseNum)); + GridFourDecision.SummaryData = summary; + } + + /// + /// 导出 + /// + protected void btnScsdExport_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + string ReportFileName = filePath + "三查四定进度.xlsx"; + + var result = GetFourDecisionSchedules(); + + if (result.Count > 0) + { + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("三查四定进度"); + + #region 列宽 + + ws.SetColumnWidth(0, (30 * 256)); + ws.SetColumnWidth(1, (20 * 256)); + ws.SetColumnWidth(2, (20 * 256)); + ws.SetColumnWidth(3, (20 * 256)); + ws.SetColumnWidth(4, (20 * 256)); + ws.SetColumnWidth(5, (20 * 256)); + ws.SetColumnWidth(6, (20 * 256)); + ws.SetColumnWidth(7, (20 * 256)); + + #endregion + + #region 样式 + //公共样式 + ICellStyle style = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true); + //公共样式加粗 + ICellStyle styleBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, true); + + #endregion + + #region 头部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, 0, 0, 0, 7); + //行1 + ws.GetRow(0).GetCell(0).CellStyle = styleBold; + ws.GetRow(0).GetCell(0).SetCellValue("级别"); + ws.GetRow(0).GetCell(1).CellStyle = styleBold; + ws.GetRow(0).GetCell(1).SetCellValue("装置名称"); + ws.GetRow(0).GetCell(2).CellStyle = styleBold; + ws.GetRow(0).GetCell(2).SetCellValue("工序名称"); + ws.GetRow(0).GetCell(3).CellStyle = styleBold; + ws.GetRow(0).GetCell(3).SetCellValue("系统名称"); + ws.GetRow(0).GetCell(4).CellStyle = styleBold; + ws.GetRow(0).GetCell(4).SetCellValue("子系统名称"); + ws.GetRow(0).GetCell(5).CellStyle = styleBold; + ws.GetRow(0).GetCell(5).SetCellValue("尾项数量"); + ws.GetRow(0).GetCell(6).CellStyle = styleBold; + ws.GetRow(0).GetCell(6).SetCellValue("未关闭尾项数量"); + ws.GetRow(0).GetCell(7).CellStyle = styleBold; + ws.GetRow(0).GetCell(7).SetCellValue("已关闭尾项数量"); + + #endregion + + #region 表格 + + var start = 1; + var end = result.Count; + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, start, end, 0, 7); + + //数据 + var dataIndex = 1; + foreach (var item in result) + { + ws.GetRow(dataIndex).GetCell(0).SetCellValue(item.Level); + ws.GetRow(dataIndex).GetCell(1).SetCellValue(item.InstallationName); + ws.GetRow(dataIndex).GetCell(2).SetCellValue(item.ProcessesName); + ws.GetRow(dataIndex).GetCell(3).SetCellValue(item.SystemName); + ws.GetRow(dataIndex).GetCell(4).SetCellValue(item.SubsystemName); + ws.GetRow(dataIndex).GetCell(5).SetCellValue(item.AllNum); + ws.GetRow(dataIndex).GetCell(6).SetCellValue(item.NoCloseNum); + ws.GetRow(dataIndex).GetCell(7).SetCellValue(item.CloseNum); + dataIndex++; + } + + #endregion + + #region 尾部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, end + 1, end + 1, 0, 7); + var region = new CellRangeAddress(end + 1, end + 1, 0, 4); + ws.AddMergedRegion(region); + ws.GetRow(end + 1).GetCell(0).SetCellValue("合计"); + ws.GetRow(end + 1).GetCell(5).SetCellValue(result.Count > 0 ? result.Sum(x => x.AllNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(6).SetCellValue(result.Count > 0 ? result.Sum(x => x.NoCloseNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(7).SetCellValue(result.Count > 0 ? result.Sum(x => x.CloseNum).ToString() : "0"); + + #endregion + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("三查四定进度.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); + } + } + + #endregion + + #region 私有方法 + + /// + /// 创建头部 + /// + /// + private XSSFSheet ExcelCreateRowTitle(XSSFSheet ws, XSSFWorkbook hssfworkbook, ICellStyle style, int sRows, int eRows, int cStart, int cEnd, float height = 21) + { + for (int i = sRows; i <= eRows; i++) + { + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = height; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).CreateCell(j).CellStyle = style; + } + } + return ws; + } + + /// + /// 创建样式 + /// + /// + public static ICellStyle SetExcelStyle(XSSFWorkbook wb, BorderStyle Bottom, BorderStyle Left, BorderStyle Right, BorderStyle Top, VerticalAlignment VerAig, HorizontalAlignment HorAig, double FontSize, bool WrapText = true, bool Bold = false, string FontName = "宋体") + { + ICellStyle style = wb.CreateCellStyle(); + style.BorderBottom = Bottom; + style.BorderLeft = Left; + style.BorderRight = Right; + style.BorderTop = Top; + style.VerticalAlignment = VerAig; + style.Alignment = HorAig; + IFont font = wb.CreateFont(); + font.FontHeightInPoints = FontSize; + font.IsBold = Bold; + font.FontName = FontName; + style.SetFont(font); + style.WrapText = WrapText; + return style; + } + + /// + /// 获取三查四定统计 + /// + /// + private List GetFourDecisionSchedules() + { + var list = new List(); + string allStr = $"select Level,COUNT(1) as AllNum,SUM(case ISNULL(a.DecisionIsClose,0) when 0 then 1 else 0 end) as NoCloseNum,SUM(case ISNULL(a.DecisionIsClose,0) when 1 then 1 else 0 end) as CloseNum from PreRun_SubThreeChecksFourDecision as a where a.SubSystemId in ('{string.Join("','", this.SubSystemIds)}') and a.ProjectId='{this.CurrUser.LoginProjectId}' group by a.Level order by a.Level asc"; + var dt = SQLHelper.GetDataTableRunText(allStr); + if (dt.Rows.Count > 0) + { + string deviceStr = $"select b.PreRunName as InstallationName,c.PreRunName as ProcessesName,d.PreRunName as SystemName,e.PreRunName as SubsystemName from PreRun_SysDevice as a left join PreRun_SysDevice as b on b.PreRunId=ISNULL(a.InstallationId,a.PreRunId) left join PreRun_SysDevice as c on c.PreRunId=a.ProcessesId left join PreRun_SysDevice as d on d.PreRunId=a.SystemId left join PreRun_SysDevice as e on e.PreRunId=a.SubsystemId where a.PreRunId='{this.TreePreRunId}'"; + var driveDt = SQLHelper.GetDataTableRunText(deviceStr); + + list = DataTableToList(dt); + + foreach (var item in list) + { + if (driveDt.Rows.Count > 0) + { + item.InstallationName = driveDt.Rows[0]["InstallationName"].ToString(); + item.ProcessesName = driveDt.Rows[0]["ProcessesName"].ToString(); + item.SystemName = driveDt.Rows[0]["SystemName"].ToString(); + item.SubsystemName = driveDt.Rows[0]["SubsystemName"].ToString(); + } + } + } + + return list; + } + + /// + /// 三查四定统计实体 + /// + public class FourDecisionScheduleBridDto + { + /// + /// 级别 + /// + public string Level { get; set; } + /// + /// 装置名称 + /// + public string InstallationName { get; set; } + /// + /// 工序名称 + /// + public string ProcessesName { get; set; } + /// + /// 系统名称 + /// + public string SystemName { get; set; } + /// + /// 子系统名称 + /// + public string SubsystemName { get; set; } + /// + /// 尾项数量 + /// + public int AllNum { get; set; } + /// + /// 未关闭尾项数量 + /// + public int NoCloseNum { get; set; } + /// + /// 已关闭尾项数量 + /// + public int CloseNum { get; set; } + } + + #endregion + + #region 转换 + + /// + /// DataTable转换List + /// + /// + public List DataTableToList(DataTable table) + { + List list = new List(); + T t = default(T); + PropertyInfo[] propertypes = null; + string tempName = string.Empty; + foreach (DataRow row in table.Rows) + { + t = Activator.CreateInstance(); + propertypes = t.GetType().GetProperties(); + foreach (PropertyInfo pro in propertypes) + { + tempName = pro.Name; + if (table.Columns.Contains(tempName)) + { + object value = row[tempName]; + if (!value.ToString().Equals("")) + { + pro.SetValue(t, value, null); + } + } + } + list.Add(t); + } + return list.Count == 0 ? new List() : list; + } + + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx.designer.cs new file mode 100644 index 00000000..9a540b1c --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/Report/FourDecisionSchedule.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.TestRun.Report +{ + + + public partial class FourDecisionSchedule + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdTrustID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdTrustID; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// zxtsc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow zxtsc; + + /// + /// GridFourDecision 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid GridFourDecision; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnScsdExport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnScsdExport; + } +} diff --git a/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx b/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx index 38a98a4e..b4646745 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx +++ b/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx @@ -44,84 +44,46 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.cs index 6bb1b730..b72210c2 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.cs @@ -1,14 +1,23 @@ using Aspose.Words.Lists; using BLL; +using FineUIPro.Web.DataShow; using Model; using System; +using System.ArrayExtensions; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.IO; using System.Linq; +using System.Reflection; using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; +using WIA; +using NPOI.SS.UserModel; +using NPOI.SS.Util; +using NPOI.XSSF.UserModel; +using System.Drawing; +using Newtonsoft.Json.Linq; namespace FineUIPro.Web.TestRun.Report { @@ -21,14 +30,14 @@ namespace FineUIPro.Web.TestRun.Report /// /// 子系统主键 /// - public string SsubSystemId { get { return (string)ViewState["SsubSystemId"]; } set { ViewState["SsubSystemId"] = value; } } + public List SubSystemIds { get { return (List)ViewState["SubSystemIds"]; } set { ViewState["SubSystemIds"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { + if (SubSystemIds == null) SubSystemIds = new List(); this.InitTreeMenu();//加载树 - TabStrip1.ActiveTabIndex = 0; } } @@ -108,146 +117,214 @@ namespace FineUIPro.Web.TestRun.Report /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { + var devices = new List(); this.TreePreRunId = tvControlItem.SelectedNodeID != "0" ? tvControlItem.SelectedNodeID : string.Empty; - if (TabStrip1.ActiveTabIndex == 0) + if (!string.IsNullOrWhiteSpace(this.TreePreRunId)) { - PreRunBrid(); + var model = Funs.DB.PreRun_SysDevice.FirstOrDefault(x => x.PreRunId == this.TreePreRunId); + if (model.PreRunLevel == 4) + { + this.SubSystemIds = new List() { model.PreRunId }; + } + else if (model.PreRunLevel == 3) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4 && x.SystemId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + else if (model.PreRunLevel == 2) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4 && x.ProcessesId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + else if (model.PreRunLevel == 1) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4 && x.InstallationId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + } } - else if (TabStrip1.ActiveTabIndex == 1) + else { - FourDecisionBrid(); + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4).ToList(); + if (devices.Count > 0) + { + this.SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } } + PreRunBrid(); } #endregion - #region 数据绑定 + #region 数据绑定/导出 /// /// 预试车绑定 /// public void PreRunBrid() { - var result = new List(); - string strSql = "select a.WorkPackId,b.WorkPackName,b.Sort,SUM(case ISNULL(a.InspectIsClose,0) when 1 then 1 else 0 end) as ygbnum,SUM(case ISNULL(a.InspectIsClose,0) when 0 then 1 else 0 end) as wgbnum,COUNT(1) as allnum from PreRun_SubInspectTerm as a inner join PreRun_WorkPackage as b on a.WorkPackId=b.WorkPackId where 1=1 and a.ProjectId=@ProjectId "; - List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - string installationName = "-"; - string processesName = "-"; - string systemName = "-"; - string subsystemName = "-"; - string columnames = string.Empty; - if (!string.IsNullOrWhiteSpace(this.TreePreRunId)) + var result = new List(); + if (this.SubSystemIds.Count > 0) { - var model = Funs.DB.PreRun_SysDevice.FirstOrDefault(p => p.PreRunId == this.TreePreRunId); - if (model.PreRunLevel == 1) - { - installationName = model.PreRunName; - columnames = "a.InstallationId"; - } - else if (model.PreRunLevel == 2) - { - processesName = model.PreRunName; - columnames = "a.ProcessesId"; - } - else if (model.PreRunLevel == 3) - { - systemName = model.PreRunName; - columnames = "a.SystemId"; - } - else if (model.PreRunLevel == 4) - { - subsystemName = model.PreRunName; - columnames = "a.SubsystemId"; - } - strSql += $"and {columnames}='{model.PreRunId}'"; - } - strSql += "group by a.WorkPackId,b.WorkPackName,b.Sort order by b.Sort asc"; - SqlParameter[] parameter = listStr.ToArray(); - var dt = SQLHelper.GetDataTableRunText(strSql, parameter); - if (dt != null) - { - foreach (DataRow item in dt.Rows) - { - result.Add(new ScheduleBridDto() - { - WorkPackId = item["WorkPackId"].ToString(), - WorkName = item["WorkPackName"].ToString(), - InstallationName = installationName, - ProcessesName = processesName, - SystemName = systemName, - SubsystemName = subsystemName, - AllNum = item["allnum"].ToString(), - NoCloseNum = item["wgbnum"].ToString(), - CloseNum = item["ygbnum"].ToString() - }); - } + result = GetPreRunSchedules(); } GridPreRun.DataSource = result; GridPreRun.DataBind(); + JObject summary = new JObject(); + summary.Add("WorkPackNum", result.Sum(x => x.WorkPackNum)); + summary.Add("WorkPackNoCloseNum", result.Sum(x => x.WorkPackNoCloseNum)); + summary.Add("WorkPackCloseNum", result.Sum(x => x.WorkPackCloseNum)); + summary.Add("InspectNum", result.Sum(x => x.InspectNum)); + summary.Add("InspectNoCloseNum", result.Sum(x => x.InspectNoCloseNum)); + summary.Add("InspectCloseNum", result.Sum(x => x.InspectCloseNum)); + GridPreRun.SummaryData = summary; } /// - /// 三查四定绑定 + /// 导出 /// - public void FourDecisionBrid() + protected void btnYscExport_Click(object sender, EventArgs e) { - var result = new List(); - string strSql = "select b.PreRunId,b.InstallationId,b.ProcessesId,b.SystemId,b.SubsystemId,b.Sort,SUM(case ISNULL(a.DecisionIsClose,0) when 1 then 1 else 0 end) as ygbnum,SUM(case ISNULL(a.DecisionIsClose,0) when 0 then 1 else 0 end) as wgbnum,COUNT(1) as allnum from PreRun_SubThreeChecksFourDecision as a inner join PreRun_SysDevice as b on a.SubSystemId=b.PreRunId where 1=1 and a.ProjectId=@ProjectId "; - List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - string installationName = "-"; - string processesName = "-"; - string systemName = "-"; - string subsystemName = "-"; - string columnames = string.Empty; - if (!string.IsNullOrWhiteSpace(this.TreePreRunId)) + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) { - var model = Funs.DB.PreRun_SysDevice.FirstOrDefault(p => p.PreRunId == this.TreePreRunId); - if (model.PreRunLevel == 1) - { - installationName = model.PreRunName; - columnames = "b.InstallationId"; - } - else if (model.PreRunLevel == 2) - { - processesName = model.PreRunName; - columnames = "b.ProcessesId"; - } - else if (model.PreRunLevel == 3) - { - systemName = model.PreRunName; - columnames = "b.SystemId"; - } - else if (model.PreRunLevel == 4) - { - subsystemName = model.PreRunName; - columnames = "b.SubsystemId"; - } - strSql += $"and {columnames}='{model.PreRunId}'"; + Directory.CreateDirectory(filePath); } - strSql += "group by b.PreRunId,b.InstallationId,b.ProcessesId,b.SystemId,b.SubsystemId,b.Sort order by b.Sort asc"; - SqlParameter[] parameter = listStr.ToArray(); - var dt = SQLHelper.GetDataTableRunText(strSql, parameter); - if (dt != null) + string ReportFileName = filePath + "预试车进度.xlsx"; + + var result = GetPreRunSchedules(); + + if (result.Count > 0) { - foreach (DataRow item in dt.Rows) + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("预试车进度"); + + #region 列宽 + + ws.SetColumnWidth(0, (30 * 256)); + ws.SetColumnWidth(1, (20 * 256)); + ws.SetColumnWidth(2, (20 * 256)); + ws.SetColumnWidth(3, (20 * 256)); + ws.SetColumnWidth(4, (20 * 256)); + ws.SetColumnWidth(5, (20 * 256)); + ws.SetColumnWidth(6, (20 * 256)); + ws.SetColumnWidth(7, (20 * 256)); + ws.SetColumnWidth(8, (20 * 256)); + ws.SetColumnWidth(9, (20 * 256)); + ws.SetColumnWidth(10, (20 * 256)); + + #endregion + + #region 样式 + //公共样式 + ICellStyle style = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true); + //公共样式加粗 + ICellStyle styleBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, true); + + #endregion + + #region 头部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, 0, 0, 0, 10); + //行1 + ws.GetRow(0).GetCell(0).CellStyle = styleBold; + ws.GetRow(0).GetCell(0).SetCellValue("工作包名称"); + ws.GetRow(0).GetCell(1).CellStyle = styleBold; + ws.GetRow(0).GetCell(1).SetCellValue("装置名称"); + ws.GetRow(0).GetCell(2).CellStyle = styleBold; + ws.GetRow(0).GetCell(2).SetCellValue("工序名称"); + ws.GetRow(0).GetCell(3).CellStyle = styleBold; + ws.GetRow(0).GetCell(3).SetCellValue("系统名称"); + ws.GetRow(0).GetCell(4).CellStyle = styleBold; + ws.GetRow(0).GetCell(4).SetCellValue("子系统名称"); + ws.GetRow(0).GetCell(5).CellStyle = styleBold; + ws.GetRow(0).GetCell(5).SetCellValue("工作包数量"); + ws.GetRow(0).GetCell(6).CellStyle = styleBold; + ws.GetRow(0).GetCell(6).SetCellValue("工作包未关闭数量"); + ws.GetRow(0).GetCell(7).CellStyle = styleBold; + ws.GetRow(0).GetCell(7).SetCellValue("工作包已关闭数量"); + ws.GetRow(0).GetCell(8).CellStyle = styleBold; + ws.GetRow(0).GetCell(8).SetCellValue("检查表数量"); + ws.GetRow(0).GetCell(9).CellStyle = styleBold; + ws.GetRow(0).GetCell(9).SetCellValue("检查表未关闭数量"); + ws.GetRow(0).GetCell(10).CellStyle = styleBold; + ws.GetRow(0).GetCell(10).SetCellValue("检查表已关闭数量"); + + #endregion + + #region 表格 + + var start = 1; + var end = result.Count; + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, start, end, 0, 10); + + //数据 + var dataIndex = 1; + foreach (var item in result) { - result.Add(new ScheduleBridDto() - { - PreRunId = item["PreRunId"].ToString(), - InstallationName = installationName, - ProcessesName = processesName, - SystemName = systemName, - SubsystemName = subsystemName, - AllNum = item["allnum"].ToString(), - NoCloseNum = item["wgbnum"].ToString(), - CloseNum = item["ygbnum"].ToString() - }); + ws.GetRow(dataIndex).GetCell(0).SetCellValue(item.WorkPackName); + ws.GetRow(dataIndex).GetCell(1).SetCellValue(item.InstallationName); + ws.GetRow(dataIndex).GetCell(2).SetCellValue(item.ProcessesName); + ws.GetRow(dataIndex).GetCell(3).SetCellValue(item.SystemName); + ws.GetRow(dataIndex).GetCell(4).SetCellValue(item.SubsystemName); + ws.GetRow(dataIndex).GetCell(5).SetCellValue(item.WorkPackNum); + ws.GetRow(dataIndex).GetCell(6).SetCellValue(item.WorkPackNoCloseNum); + ws.GetRow(dataIndex).GetCell(7).SetCellValue(item.WorkPackCloseNum); + ws.GetRow(dataIndex).GetCell(8).SetCellValue(item.InspectNum); + ws.GetRow(dataIndex).GetCell(9).SetCellValue(item.InspectNoCloseNum); + ws.GetRow(dataIndex).GetCell(10).SetCellValue(item.InspectCloseNum); + dataIndex++; } + + #endregion + + #region 尾部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, end + 1, end + 1, 0, 10); + var region = new CellRangeAddress(end + 1, end + 1, 0, 4); + ws.AddMergedRegion(region); + ws.GetRow(end + 1).GetCell(0).SetCellValue("合计"); + ws.GetRow(end + 1).GetCell(5).SetCellValue(result.Count > 0 ? result.Sum(x => x.WorkPackNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(6).SetCellValue(result.Count > 0 ? result.Sum(x => x.WorkPackNoCloseNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(7).SetCellValue(result.Count > 0 ? result.Sum(x => x.WorkPackCloseNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(8).SetCellValue(result.Count > 0 ? result.Sum(x => x.InspectNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(9).SetCellValue(result.Count > 0 ? result.Sum(x => x.InspectNoCloseNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(10).SetCellValue(result.Count > 0 ? result.Sum(x => x.InspectCloseNum).ToString() : "0"); + + #endregion + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("预试车进度.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); } - GridFourDecision.DataSource = result; - GridFourDecision.DataBind(); } #endregion @@ -255,18 +332,146 @@ namespace FineUIPro.Web.TestRun.Report #region 私有方法 /// - /// 点击tab + /// 创建头部 /// - protected void TabStrip1_TabIndexChanged(object sender, EventArgs e) + /// + private XSSFSheet ExcelCreateRowTitle(XSSFSheet ws, XSSFWorkbook hssfworkbook, ICellStyle style, int sRows, int eRows, int cStart, int cEnd, float height = 21) { - if (TabStrip1.ActiveTabIndex == 0) + for (int i = sRows; i <= eRows; i++) { - PreRunBrid(); + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = height; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).CreateCell(j).CellStyle = style; + } } - else if (TabStrip1.ActiveTabIndex == 1) + return ws; + } + + /// + /// 创建样式 + /// + /// + public static ICellStyle SetExcelStyle(XSSFWorkbook wb, BorderStyle Bottom, BorderStyle Left, BorderStyle Right, BorderStyle Top, VerticalAlignment VerAig, HorizontalAlignment HorAig, double FontSize, bool WrapText = true, bool Bold = false, string FontName = "宋体") + { + ICellStyle style = wb.CreateCellStyle(); + style.BorderBottom = Bottom; + style.BorderLeft = Left; + style.BorderRight = Right; + style.BorderTop = Top; + style.VerticalAlignment = VerAig; + style.Alignment = HorAig; + IFont font = wb.CreateFont(); + font.FontHeightInPoints = FontSize; + font.IsBold = Bold; + font.FontName = FontName; + style.SetFont(font); + style.WrapText = WrapText; + return style; + } + + /// + /// 获取预试车统计 + /// + /// + private List GetPreRunSchedules() + { + string allStr = $"select a.SubSystemId,a.SystemId,b.WorkPackId,b.WorkPackName,b.WorkPackType,(select count(1) from PreRun_SubPropertySelect as gd where gd.SubSystemId = a.SubSystemId) as GdallNum,(select count(1) from PreRun_SubTechnologySelect as sb where sb.SubSystemId = a.SubSystemId) as SballNum,(select count(1) from PreRun_SubInstrumentSelect as sy where sy.SubSystemId = a.SubSystemId) as SyallNum from PreRun_SubSysWorkPackage as a inner join PreRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where a.SubSystemId in ('{string.Join("','", this.SubSystemIds)}') order by a.WorkPackCode asc"; + var dt = SQLHelper.GetDataTableRunText(allStr); + + var list = new List(); + string deviceStr = $"select b.PreRunName as InstallationName,c.PreRunName as ProcessesName,d.PreRunName as SystemName,e.PreRunName as SubsystemName from PreRun_SysDevice as a left join PreRun_SysDevice as b on b.PreRunId=ISNULL(a.InstallationId,a.PreRunId) left join PreRun_SysDevice as c on c.PreRunId=a.ProcessesId left join PreRun_SysDevice as d on d.PreRunId=a.SystemId left join PreRun_SysDevice as e on e.PreRunId=a.SubsystemId where a.PreRunId='{this.TreePreRunId}'"; + var driveDt = SQLHelper.GetDataTableRunText(deviceStr); + + string inspectStr = $"select a.WorkPackId,b.WorkPackName,b.Sort,SUM(case ISNULL(a.InspectIsClose, 0) when 1 then 1 else 0 end) as CloseNum,SUM(case ISNULL(a.InspectIsClose, 0) when 0 then 1 else 0 end) as NoCloseNum,COUNT(1) as AllNum from PreRun_SubInspectTerm as a inner join PreRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where 1=1 and a.ProjectId = '{this.CurrUser.LoginProjectId}' and a.SubSystemId in ('{string.Join("','", this.SubSystemIds)}') group by a.WorkPackId,b.WorkPackName,b.Sort order by b.Sort asc"; + var inspectDt = SQLHelper.GetDataTableRunText(inspectStr); + var inspectlist = DataTableToList(inspectDt); + if (dt.Rows.Count > 0) { - FourDecisionBrid(); + //获取所有子系统数量 + var inspects = Funs.DB.PreRun_SubInspectTerm.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && this.SubSystemIds.Contains(x.SubSystemId)); + var querylist = DataTableToList(dt); + var queryGroup = querylist.GroupBy(x => new { x.WorkPackId, x.WorkPackName, x.WorkPackType }).Select(p => new + { + p.Key.WorkPackId, + p.Key.WorkPackName, + p.Key.WorkPackType, + GdallNum = p.Sum(i => i.GdallNum), + SballNum = p.Sum(i => i.SballNum), + SyallNum = p.Sum(i => i.SyallNum) + }); + foreach (var itemPack in queryGroup) + { + var itemQueryList = querylist.Where(x => x.WorkPackId == itemPack.WorkPackId).ToList(); + var model = new PreRunScheduleDto(); + model.WorkPackId = itemPack.WorkPackId; + model.WorkPackName = itemPack.WorkPackName; + model.WorkPackType = itemPack.WorkPackType; + if (driveDt.Rows.Count > 0) + { + model.InstallationName = driveDt.Rows[0]["InstallationName"].ToString(); + model.ProcessesName = driveDt.Rows[0]["ProcessesName"].ToString(); + model.SystemName = driveDt.Rows[0]["SystemName"].ToString(); + model.SubsystemName = driveDt.Rows[0]["SubsystemName"].ToString(); + } + model.GdallNum = itemPack.GdallNum; + model.SballNum = itemPack.SballNum; + model.SyallNum = itemPack.SyallNum; + model.AllGdSbYbNum = (itemPack.GdallNum + itemPack.SballNum + itemPack.SyallNum); + model.WorkPackNum = itemQueryList.Count(x => x.WorkPackId == itemPack.WorkPackId); + if (inspectlist.Count(a => a.WorkPackId == itemPack.WorkPackId) > 0) + { + var itemInspect = inspectlist.FirstOrDefault(a => a.WorkPackId == itemPack.WorkPackId); + model.InspectNum = itemInspect.AllNum; + model.InspectNoCloseNum = itemInspect.NoCloseNum; + model.InspectCloseNum = itemInspect.CloseNum; + } + else + { + model.WorkPackCloseNum = 0; + model.WorkPackNoCloseNum = model.WorkPackNum; + model.InspectNum = 0; + model.InspectNoCloseNum = 0; + model.InspectCloseNum = 0; + } + model.WorkPackCloseNum = 0; + model.WorkPackNoCloseNum = 0; + var subsystemids = itemQueryList.ConvertAll(a => a.SubSystemId).Distinct(); + foreach (var itemsubid in subsystemids) + { + if (inspects.Count(x => x.SubSystemId == itemsubid) > 0) + { + var itemQuerylist = itemQueryList.FirstOrDefault(x => x.SubSystemId == itemsubid && x.WorkPackId == itemPack.WorkPackId); + var allNum = itemQuerylist.GdallNum + itemQuerylist.SballNum + itemQuerylist.SyallNum; + if (inspects.Count(x => x.SubInspectId == itemsubid && x.InspectIsClose != 1) > 0) + { + model.WorkPackNoCloseNum += 1; + } + else + { + var closeInspect = inspects.Where(x => x.SubInspectId == itemsubid && x.InspectIsClose == 1); + var closeNums = closeInspect.Count() > 0 ? closeInspect.Select(x => x.PropertyTechnologyId.Split(',').Count()).Sum(x => x) : 0; + if (allNum > closeNums) + { + model.WorkPackNoCloseNum += 1; + } + else + { + model.WorkPackCloseNum += 1; + } + } + } + else + { + model.WorkPackNoCloseNum += 1; + } + } + list.Add(model); + } } + return list; } /// @@ -316,6 +521,186 @@ namespace FineUIPro.Web.TestRun.Report public string CloseNum { get; set; } } + /// + /// 预试车统计实体 + /// + public class PreRunScheduleDto + { + /// + /// 工作包主键 + /// + public string WorkPackId { get; set; } + /// + /// 工作包名称 + /// + public string WorkPackName { get; set; } + /// + /// 工作包类型 + /// + public int WorkPackType { get; set; } + /// + /// 装置名称 + /// + public string InstallationName { get; set; } + /// + /// 工序名称 + /// + public string ProcessesName { get; set; } + /// + /// 系统名称 + /// + public string SystemName { get; set; } + /// + /// 子系统名称 + /// + public string SubsystemName { get; set; } + /// + /// 所有管道,设备,仪表索引数量 + /// + public int AllGdSbYbNum { get; set; } + /// + /// 工作包所有管道数量 + /// + public int GdallNum { get; set; } + /// + /// 工作包所有设备数量 + /// + public int SballNum { get; set; } + /// + /// 工作包所有仪表索引数量 + /// + public int SyallNum { get; set; } + /// + /// 工作包数量 + /// + public int WorkPackNum { get; set; } + /// + /// 工作包未关闭数量 + /// + public int WorkPackNoCloseNum { get; set; } + /// + /// 工作包已关闭数量 + /// + public int WorkPackCloseNum { get; set; } + /// + /// 检查表数量 + /// + public int InspectNum { get; set; } + /// + /// 检查表未关闭数量 + /// + public int InspectNoCloseNum { get; set; } + /// + /// 检查表已关闭数量 + /// + public int InspectCloseNum { get; set; } + } + + /// + /// 预试车检查表实体 + /// + public class WorkPackageInspectDto + { + /// + /// 子系统主键 + /// + public string SubSystemId { get; set; } + /// + /// 工作包主键 + /// + public string WorkPackId { get; set; } + /// + /// 工作包名称 + /// + public string WorkPackName { get; set; } + /// + /// 检查表数量 + /// + public int AllNum { get; set; } + /// + /// 未关闭任务单数量 + /// + public int NoCloseNum { get; set; } + /// + /// 已关闭任务单数量 + /// + public int CloseNum { get; set; } + } + + /// + /// 子系统工作包和总设备/管道/仪表数量 + /// + public class QuerySubSysWorkPackage + { + /// + /// 子系统主键 + /// + public string SubSystemId { get; set; } + /// + /// 系统主键 + /// + public string SystemId { get; set; } + /// + /// 工作包主键 + /// + public string WorkPackId { get; set; } + /// + /// 工作包名称 + /// + public string WorkPackName { get; set; } + /// + /// 工作包类型 + /// + public int WorkPackType { get; set; } + /// + /// 管道总数量 + /// + public int GdallNum { get; set; } + /// + /// 设备总数量 + /// + public int SballNum { get; set; } + /// + /// 仪表索引总数量 + /// + public int SyallNum { get; set; } + } + + #endregion + + #region 转换 + + /// + /// DataTable转换List + /// + /// + public List DataTableToList(DataTable table) + { + List list = new List(); + T t = default(T); + PropertyInfo[] propertypes = null; + string tempName = string.Empty; + foreach (DataRow row in table.Rows) + { + t = Activator.CreateInstance(); + propertypes = t.GetType().GetProperties(); + foreach (PropertyInfo pro in propertypes) + { + tempName = pro.Name; + if (table.Columns.Contains(tempName)) + { + object value = row[tempName]; + if (!value.ToString().Equals("")) + { + pro.SetValue(t, value, null); + } + } + } + list.Add(t); + } + return list.Count == 0 ? new List() : list; + } + #endregion } diff --git a/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.designer.cs index 6f80cd30..f9ccaf66 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/PreRunSchedule.aspx.designer.cs @@ -104,15 +104,6 @@ namespace FineUIPro.Web.TestRun.Report /// protected global::FineUIPro.FormRow zxtsc; - /// - /// TabStrip1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TabStrip TabStrip1; - /// /// GridPreRun 控件。 /// @@ -141,30 +132,12 @@ namespace FineUIPro.Web.TestRun.Report protected global::FineUIPro.ToolbarFill ToolbarFill; /// - /// GridFourDecision 控件。 + /// btnYscExport 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Grid GridFourDecision; - - /// - /// Toolbar3 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar3; - - /// - /// ToolbarFill1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarFill ToolbarFill1; + protected global::FineUIPro.Button btnYscExport; } } diff --git a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx index 8dcea427..a44b708e 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx +++ b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx @@ -38,12 +38,14 @@ - + - + + + @@ -51,24 +53,25 @@ - + - + - + - + - + - + + @@ -76,12 +79,14 @@ - + - + + + @@ -89,17 +94,17 @@ - + - + - + @@ -107,11 +112,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -131,6 +180,138 @@ function reloadGrid() { __doPostBack(null, 'reloadGrid'); } + + //预试车验证 + function isYscValid() { + var gridysc = F('<%= GridYsc.ClientID %>'); + var valid = true, modifiedData = gridysc.getMergedData();//gridysc.getModifiedData(); + + $.each(modifiedData, function (index, rowData) { + var allNum = parseInt(rowData.values['AllNum']); + var progressNum = parseInt(rowData.values['ProgressNum']); + var completeNum = parseInt(rowData.values['CompleteNum']); + var workPackName = rowData.values['WorkPackName']; + if (allNum != (progressNum + completeNum)) { + F.alert({ + message: '工作包(' + workPackName + ')全部数量不等于进行中数量加已完成数量!', + ok: function () { + grid1.startEdit(rowData.id, 'AllNum'); + } + }); + + valid = false; + + return false; // break + } + }); + return valid; + } + //预试车合计 + function onGridYscAfterEdit(event, value, params) { + var me = F('<%= GridYsc.ClientID %>'); + var allNumTotal = 0; + var progressNumTotal = 0; + var completeNumTotal = 0; + me.getRowEls().each(function (index, tr) { + debugger; + allNumTotal += me.getCellValue(tr, 'AllNum'); + progressNumTotal += me.getCellValue(tr, 'ProgressNum'); + completeNumTotal += me.getCellValue(tr, 'CompleteNum'); + }); + // 第三个参数 true,强制更新,不显示左上角的更改标识 + me.updateSummaryCellValue('AllNum', allNumTotal, true); + me.updateSummaryCellValue('ProgressNum', progressNumTotal, true); + me.updateSummaryCellValue('CompleteNum', completeNumTotal, true); + } + + //试车验证 + function isScValid() { + var gridSc = F('<%= GridSc.ClientID %>'); + var valid = true, modifiedData = gridSc.getMergedData(); + + $.each(modifiedData, function (index, rowData) { + var allNum = parseInt(rowData.values['AllNum']); + var progressNum = parseInt(rowData.values['ProgressNum']); + var completeNum = parseInt(rowData.values['CompleteNum']); + var workPackName = rowData.values['WorkPackName']; + if (allNum != (progressNum + completeNum)) { + F.alert({ + message: '工作包(' + workPackName + ')全部数量不等于进行中数量加已完成数量!', + ok: function () { + grid1.startEdit(rowData.id, 'AllNum'); + } + }); + + valid = false; + + return false; // break + } + }); + return valid; + } + + //试车合计 + function onGridScAfterEdit(event, value, params) { + var me = F('<%= GridSc.ClientID %>'); + var allNumTotal = 0; + var progressNumTotal = 0; + var completeNumTotal = 0; + me.getRowEls().each(function (index, tr) { + debugger; + allNumTotal += me.getCellValue(tr, 'AllNum'); + progressNumTotal += me.getCellValue(tr, 'ProgressNum'); + completeNumTotal += me.getCellValue(tr, 'CompleteNum'); + }); + // 第三个参数 true,强制更新,不显示左上角的更改标识 + me.updateSummaryCellValue('AllNum', allNumTotal, true); + me.updateSummaryCellValue('ProgressNum', progressNumTotal, true); + me.updateSummaryCellValue('CompleteNum', completeNumTotal, true); + } + + //三查四定验证 + function isScsdValid() { + var gridyScsd = F('<%= GridScsd.ClientID %>'); + var valid = true, modifiedData = gridyScsd.getMergedData(); + + $.each(modifiedData, function (index, rowData) { + var allNum = parseInt(rowData.values['AllNum']); + var progressNum = parseInt(rowData.values['ProgressNum']); + var completeNum = parseInt(rowData.values['CompleteNum']); + var levelName = rowData.values['LevelName']; + if (allNum != (progressNum + completeNum)) { + F.alert({ + message: '类别(' + levelName + ')全部数量不等于进行中数量加已完成数量!', + ok: function () { + grid1.startEdit(rowData.id, 'AllNum'); + } + }); + + valid = false; + + return false; // break + } + }); + return valid; + } + //三查四定合计 + function onGridScsdAfterEdit(event, value, params) { + var me = F('<%= GridScsd.ClientID %>'); + var allNumTotal = 0; + var progressNumTotal = 0; + var completeNumTotal = 0; + me.getRowEls().each(function (index, tr) { + debugger; + allNumTotal += me.getCellValue(tr, 'AllNum'); + progressNumTotal += me.getCellValue(tr, 'ProgressNum'); + completeNumTotal += me.getCellValue(tr, 'CompleteNum'); + }); + // 第三个参数 true,强制更新,不显示左上角的更改标识 + me.updateSummaryCellValue('AllNum', allNumTotal, true); + me.updateSummaryCellValue('ProgressNum', progressNumTotal, true); + me.updateSummaryCellValue('CompleteNum', completeNumTotal, true); + } + + diff --git a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs index 22c01fad..a00e51b6 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.cs @@ -6,7 +6,6 @@ using System.Data; using System.Linq; using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; using Model; using System.Collections; using Apache.NMS.ActiveMQ.Threads; @@ -14,6 +13,14 @@ using FineUIPro.Web.DataShow; using Newtonsoft.Json.Linq; using Aspose.Words.Lists; using System.Web.UI.DataVisualization.Charting; +using static FineUIPro.Web.TestRun.Report.PreRunSchedule; +using System.Reflection; +using static FineUIPro.Web.TestRun.Report.TestRunSchedule; +using NPOI.SS.UserModel; +using NPOI.SS.Util; +using NPOI.XSSF.UserModel; +using System.IO; +using NPOI.SS.Formula.Functions; namespace FineUIPro.Web.TestRun.Report { @@ -35,6 +42,25 @@ namespace FineUIPro.Web.TestRun.Report /// public void DataBridYsc() { + var result = YscData(); + GridYsc.DataSource = result; + TabStrip1.ActiveTabIndex = 0; + GridYsc.DataBind(); + JObject summary = new JObject(); + summary.Add("AllNum", result.Sum(x => x.AllNum)); + summary.Add("ProgressNum", result.Sum(x => x.ProgressNum)); + summary.Add("CompleteNum", result.Sum(x => x.CompleteNum)); + GridYsc.SummaryData = summary; + } + + /// + /// 预试车数据 + /// + /// + public List YscData() + { + var result = new List(); + if (Funs.DB.Run_ScheduleSetUp.Count(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 1) > 0) { var query = from a in Funs.DB.Run_ScheduleSetUp @@ -56,29 +82,75 @@ namespace FineUIPro.Web.TestRun.Report AddTime = a.AddTime, Sort = a.Sort }; - GridYsc.DataSource = query.ToList(); + result = query.ToList(); } else { - var result = new List(); - string strSql = @"select a.WorkPackId,a.WorkPackName,(select COUNT(1) from PreRun_SubInspectTerm as b where b.WorkPackId=a.WorkPackId and b.ProjectId=@ProjectId) as AllNum,(select COUNT(1) from PreRun_SubInspectTerm as b where b.WorkPackId=a.WorkPackId and b.ProjectId=@ProjectId and ISNULL(b.InspectIsClose,0)=0) as ProgressNum,(select COUNT(1) from PreRun_SubInspectTerm as b where b.WorkPackId=a.WorkPackId and b.ProjectId=@ProjectId and ISNULL(b.InspectIsClose,0)=1) as CompleteNum from PreRun_WorkPackage as a order by a.Sort"; List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - if (tb.Rows.Count > 0) + List SubSystemIds = new List(); + var devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 4).ToList(); + if (devices.Count > 0) { - int i = 1; - foreach (DataRow row in tb.Rows) + SubSystemIds = devices.ConvertAll(x => x.PreRunId); + } + string allStr = $"select a.SubSystemId,a.SystemId,b.WorkPackId,b.WorkPackName,b.WorkPackType,(select count(1) from PreRun_SubPropertySelect as gd where gd.SubSystemId = a.SubSystemId) as GdallNum,(select count(1) from PreRun_SubTechnologySelect as sb where sb.SubSystemId = a.SubSystemId) as SballNum,(select count(1) from PreRun_SubInstrumentSelect as sy where sy.SubSystemId = a.SubSystemId) as SyallNum from PreRun_SubSysWorkPackage as a inner join PreRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where a.SubSystemId in ('{string.Join("','", SubSystemIds)}') order by a.WorkPackCode asc"; + var dt = SQLHelper.GetDataTableRunText(allStr); + string inspectStr = $"select a.WorkPackId,b.WorkPackName,b.Sort,SUM(case ISNULL(a.InspectIsClose, 0) when 1 then 1 else 0 end) as CloseNum,SUM(case ISNULL(a.InspectIsClose, 0) when 0 then 1 else 0 end) as NoCloseNum,COUNT(1) as AllNum from PreRun_SubInspectTerm as a inner join PreRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where 1=1 and a.ProjectId = '{this.CurrUser.LoginProjectId}' and a.SubSystemId in ('{string.Join("','", SubSystemIds)}') group by a.WorkPackId,b.WorkPackName,b.Sort order by b.Sort asc"; + var inspectDt = SQLHelper.GetDataTableRunText(inspectStr); + var inspectlist = DataTableToList(inspectDt); + if (dt.Rows.Count > 0) + { + //获取所有子系统数量 + var inspects = Funs.DB.PreRun_SubInspectTerm.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && SubSystemIds.Contains(x.SubSystemId)); + var querylist = DataTableToList(dt); + var queryGroup = querylist.GroupBy(x => new { x.WorkPackId, x.WorkPackName, x.WorkPackType }).Select(p => new { + p.Key.WorkPackId, + p.Key.WorkPackName, + p.Key.WorkPackType + }); + int i = 1; + foreach (var itemPack in queryGroup) + { + var itemQueryList = querylist.Where(x => x.WorkPackId == itemPack.WorkPackId).ToList(); var model = new Run_ScheduleSetUpDto(); model.ScheduleId = Guid.NewGuid().ToString(); - model.WorkPackId = row["WorkPackId"].ToString(); - model.WorkPackName = row["WorkPackName"].ToString(); + model.WorkPackId = itemPack.WorkPackId; + model.WorkPackName = itemPack.WorkPackName; model.ProjectId = this.CurrUser.LoginProjectId; model.States = 1; - model.AllNum = int.Parse(row["AllNum"].ToString()); - model.ProgressNum = int.Parse(row["ProgressNum"].ToString()); - model.CompleteNum = int.Parse(row["CompleteNum"].ToString()); + model.AllNum = itemQueryList.Count(x => x.WorkPackId == itemPack.WorkPackId); + model.ProgressNum = 0; + model.CompleteNum = 0; + var subsystemids = itemQueryList.ConvertAll(a => a.SubSystemId).Distinct(); + foreach (var itemsubid in subsystemids) + { + if (inspects.Count(x => x.SubSystemId == itemsubid) > 0) + { + var itemQuerylist = itemQueryList.FirstOrDefault(x => x.SubSystemId == itemsubid && x.WorkPackId == itemPack.WorkPackId); + var allNum = itemQuerylist.GdallNum + itemQuerylist.SballNum + itemQuerylist.SyallNum; + if (inspects.Count(x => x.SubInspectId == itemsubid && x.InspectIsClose != 1) > 0) + { + model.ProgressNum += 1; + } + else + { + var closeInspect = inspects.Where(x => x.SubInspectId == itemsubid && x.InspectIsClose == 1); + var closeNums = closeInspect.Count() > 0 ? closeInspect.Select(x => x.PropertyTechnologyId.Split(',').Count()).Sum(x => x) : 0; + if (allNum > closeNums) + { + model.ProgressNum += 1; + } + else + { + model.CompleteNum += 1; + } + } + } + else + { + model.ProgressNum += 1; + } + } var rate = model.CompleteNum > 0 ? (decimal)Math.Round((float)model.CompleteNum / (float)model.AllNum * 100, 2, MidpointRounding.AwayFromZero) : 0; if (rate > 100) rate = 100; model.CompleteRate = rate; @@ -89,10 +161,9 @@ namespace FineUIPro.Web.TestRun.Report i++; } } - GridYsc.DataSource = result; } - TabStrip1.ActiveTabIndex = 0; - GridYsc.DataBind(); + + return result; } /// @@ -155,6 +226,115 @@ namespace FineUIPro.Web.TestRun.Report } } + /// + /// 预试车导出 + /// + /// + /// + protected void btnYscExport_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + string ReportFileName = filePath + "预试车进度.xlsx"; + + var result = YscData(); + + if (result.Count > 0) + { + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("预试车进度"); + + #region 列宽 + + ws.SetColumnWidth(0, (30 * 256)); + ws.SetColumnWidth(1, (20 * 256)); + ws.SetColumnWidth(2, (20 * 256)); + ws.SetColumnWidth(3, (20 * 256)); + + #endregion + + #region 样式 + //公共样式 + ICellStyle style = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true); + //公共样式加粗 + ICellStyle styleBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, true); + + #endregion + + #region 头部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, 0, 0, 0, 3); + //行1 + ws.GetRow(0).GetCell(0).CellStyle = styleBold; + ws.GetRow(0).GetCell(0).SetCellValue("工作包名称"); + ws.GetRow(0).GetCell(1).CellStyle = styleBold; + ws.GetRow(0).GetCell(1).SetCellValue("全部数量"); + ws.GetRow(0).GetCell(2).CellStyle = styleBold; + ws.GetRow(0).GetCell(2).SetCellValue("进行中数量"); + ws.GetRow(0).GetCell(3).CellStyle = styleBold; + ws.GetRow(0).GetCell(3).SetCellValue("已完成数量"); + + #endregion + + #region 表格 + + var start = 1; + var end = result.Count; + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, start, end, 0, 3); + + //数据 + var dataIndex = 1; + foreach (var item in result) + { + ws.GetRow(dataIndex).GetCell(0).SetCellValue(item.WorkPackName); + ws.GetRow(dataIndex).GetCell(1).SetCellValue(item.AllNum.ToString()); + ws.GetRow(dataIndex).GetCell(2).SetCellValue(item.ProgressNum.ToString()); + ws.GetRow(dataIndex).GetCell(3).SetCellValue(item.CompleteNum.ToString()); + dataIndex++; + } + + #endregion + + #region 尾部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, end + 1, end + 1, 0, 3); + ws.GetRow(end + 1).GetCell(0).SetCellValue("合计"); + ws.GetRow(end + 1).GetCell(1).SetCellValue(result.Count > 0 ? result.Sum(x => x.AllNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(2).SetCellValue(result.Count > 0 ? result.Sum(x => x.ProgressNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(3).SetCellValue(result.Count > 0 ? result.Sum(x => x.CompleteNum).ToString() : "0"); + + + #endregion + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("预试车进度.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); + } + } + #endregion #region 试车 @@ -164,6 +344,26 @@ namespace FineUIPro.Web.TestRun.Report /// public void DataBridSc() { + var result = ScData(); + GridSc.DataSource = result; + TabStrip1.ActiveTabIndex = 1; + GridSc.DataBind(); + + JObject summary = new JObject(); + summary.Add("AllNum", result.Sum(x => x.AllNum)); + summary.Add("ProgressNum", result.Sum(x => x.ProgressNum)); + summary.Add("CompleteNum", result.Sum(x => x.CompleteNum)); + GridSc.SummaryData = summary; + } + + /// + /// 试车数据 + /// + /// + public List ScData() + { + var result = new List(); + if (Funs.DB.Run_ScheduleSetUp.Count(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 2) > 0) { var query = from a in Funs.DB.Run_ScheduleSetUp @@ -185,29 +385,48 @@ namespace FineUIPro.Web.TestRun.Report AddTime = a.AddTime, Sort = a.Sort }; - GridSc.DataSource = query.ToList(); + result = query.ToList(); } else { - var result = new List(); - string strSql = @"select a.WorkPackId,a.WorkPackName,(select COUNT(1) from TestRun_SubInspectTerm as b where b.WorkPackId=a.WorkPackId and b.ProjectId=@ProjectId) as AllNum,(select COUNT(1) from TestRun_SubInspectTerm as b where b.WorkPackId=a.WorkPackId and b.ProjectId=@ProjectId and ISNULL(b.InspectIsClose,0)=0) as ProgressNum,(select COUNT(1) from TestRun_SubInspectTerm as b where b.WorkPackId=a.WorkPackId and b.ProjectId=@ProjectId and ISNULL(b.InspectIsClose,0)=1) as CompleteNum from TestRun_WorkPackage as a order by a.Sort"; List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - if (tb.Rows.Count > 0) + List SystemIds = new List(); + var devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 3).ToList(); + if (devices.Count > 0) { + SystemIds = devices.ConvertAll(x => x.PreRunId); + } + string allStr = $"select b.WorkPackId,b.WorkPackName,COUNT(a.SystemId) as WorkPackNum from TestRun_SubSysWorkPackage as a inner join TestRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where a.SystemId in ('{string.Join("','", SystemIds)}') group by b.WorkPackId,b.WorkPackName"; + var dt = SQLHelper.GetDataTableRunText(allStr); + if (dt.Rows.Count > 0) + { + string inspectStr = $"select a.WorkPackId,b.WorkPackName,b.Sort,SUM(case ISNULL(a.InspectIsClose, 0) when 1 then 1 else 0 end) as CloseNum,SUM(case ISNULL(a.InspectIsClose, 0) when 0 then 1 else 0 end) as NoCloseNum,COUNT(1) as AllNum from TestRun_SubInspectTerm as a inner join TestRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where 1=1 and a.ProjectId = '{this.CurrUser.LoginProjectId}' group by a.WorkPackId,b.WorkPackName,b.Sort order by b.Sort asc"; + var inspectDt = SQLHelper.GetDataTableRunText(inspectStr); + var inspectlist = DataTableToList(inspectDt); + int i = 1; - foreach (DataRow row in tb.Rows) + var list = DataTableToList(dt); + foreach (var item in list) { var model = new Run_ScheduleSetUpDto(); model.ScheduleId = Guid.NewGuid().ToString(); - model.WorkPackId = row["WorkPackId"].ToString(); - model.WorkPackName = row["WorkPackName"].ToString(); + model.WorkPackId = item.WorkPackId; + model.WorkPackName = item.WorkPackName; model.ProjectId = this.CurrUser.LoginProjectId; model.States = 2; - model.AllNum = int.Parse(row["AllNum"].ToString()); - model.ProgressNum = int.Parse(row["ProgressNum"].ToString()); - model.CompleteNum = int.Parse(row["CompleteNum"].ToString()); + + if (inspectlist.Count(x => x.WorkPackId == item.WorkPackId) > 0) + { + var itemInspect = inspectlist.FirstOrDefault(x => x.WorkPackId == item.WorkPackId); + model.AllNum = itemInspect.AllNum; + model.ProgressNum = itemInspect.NoCloseNum; + model.CompleteNum = itemInspect.CloseNum; + } + else + { + model.AllNum = 0; + model.ProgressNum = 0; + model.CompleteNum = 0; + } model.CompleteRate = model.CompleteNum > 0 ? (decimal)Math.Round((float)model.CompleteNum / (float)model.AllNum, 2, MidpointRounding.AwayFromZero) : 0; model.AddUser = this.CurrUser.UserId; model.AddTime = DateTime.Now; @@ -216,10 +435,9 @@ namespace FineUIPro.Web.TestRun.Report i++; } } - GridSc.DataSource = result; } - TabStrip1.ActiveTabIndex = 1; - GridSc.DataBind(); + + return result; } /// @@ -280,10 +498,389 @@ namespace FineUIPro.Web.TestRun.Report } } + /// + /// 试车导出 + /// + protected void btnScExport_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + string ReportFileName = filePath + "试车进度.xlsx"; + + var result = ScData(); + + if (result.Count > 0) + { + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("试车进度"); + + #region 列宽 + + ws.SetColumnWidth(0, (30 * 256)); + ws.SetColumnWidth(1, (20 * 256)); + ws.SetColumnWidth(2, (20 * 256)); + ws.SetColumnWidth(3, (20 * 256)); + + #endregion + + #region 样式 + //公共样式 + ICellStyle style = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true); + //公共样式加粗 + ICellStyle styleBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, true); + + #endregion + + #region 头部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, 0, 0, 0, 3); + //行1 + ws.GetRow(0).GetCell(0).CellStyle = styleBold; + ws.GetRow(0).GetCell(0).SetCellValue("工作包名称"); + ws.GetRow(0).GetCell(1).CellStyle = styleBold; + ws.GetRow(0).GetCell(1).SetCellValue("全部数量"); + ws.GetRow(0).GetCell(2).CellStyle = styleBold; + ws.GetRow(0).GetCell(2).SetCellValue("进行中数量"); + ws.GetRow(0).GetCell(3).CellStyle = styleBold; + ws.GetRow(0).GetCell(3).SetCellValue("已完成数量"); + + #endregion + + #region 表格 + + var start = 1; + var end = result.Count; + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, start, end, 0, 3); + + //数据 + var dataIndex = 1; + foreach (var item in result) + { + ws.GetRow(dataIndex).GetCell(0).SetCellValue(item.WorkPackName); + ws.GetRow(dataIndex).GetCell(1).SetCellValue(item.AllNum.ToString()); + ws.GetRow(dataIndex).GetCell(2).SetCellValue(item.ProgressNum.ToString()); + ws.GetRow(dataIndex).GetCell(3).SetCellValue(item.CompleteNum.ToString()); + dataIndex++; + } + + #endregion + + #region 尾部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, end + 1, end + 1, 0, 3); + ws.GetRow(end + 1).GetCell(0).SetCellValue("合计"); + ws.GetRow(end + 1).GetCell(1).SetCellValue(result.Count > 0 ? result.Sum(x => x.AllNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(2).SetCellValue(result.Count > 0 ? result.Sum(x => x.ProgressNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(3).SetCellValue(result.Count > 0 ? result.Sum(x => x.CompleteNum).ToString() : "0"); + + + #endregion + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("试车进度.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); + } + } + + #endregion + + #region 三查四定 + + /// + /// 三查四定绑定 + /// + public void DataBridScsd() + { + var result = ScsdData(); + GridScsd.DataSource = result; + TabStrip1.ActiveTabIndex = 2; + GridScsd.DataBind(); + JObject summary = new JObject(); + summary.Add("AllNum", result.Sum(x => x.AllNum)); + summary.Add("ProgressNum", result.Sum(x => x.ProgressNum)); + summary.Add("CompleteNum", result.Sum(x => x.CompleteNum)); + GridScsd.SummaryData = summary; + } + + /// + /// 三查四定数据 + /// + /// + public List ScsdData() + { + var result = new List(); + + if (Funs.DB.Run_ScheduleSetUp.Count(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 3) > 0) + { + result = Funs.DB.Run_ScheduleSetUp.Where(a => a.States == 3 && a.ProjectId == this.CurrUser.LoginProjectId).OrderBy(o => o.LevelName).ToList(); + } + else + { + var list = new List(); + string allStr = $"select Level,COUNT(1) as AllNum,SUM(case ISNULL(a.DecisionIsClose,0) when 0 then 1 else 0 end) as NoCloseNum,SUM(case ISNULL(a.DecisionIsClose,0) when 1 then 1 else 0 end) as CloseNum from PreRun_SubThreeChecksFourDecision as a where a.ProjectId='{this.CurrUser.LoginProjectId}' group by a.Level order by a.Level asc"; + var dt = SQLHelper.GetDataTableRunText(allStr); + if (dt.Rows.Count > 0) + { + int i = 1; + list = DataTableToList(dt); + foreach (var item in list) + { + var model = new Run_ScheduleSetUp(); + model.ScheduleId = Guid.NewGuid().ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.LevelName = item.Level; + model.States = 3; + model.AllNum = item.AllNum; + model.ProgressNum = item.NoCloseNum; + model.CompleteNum = item.CloseNum; + model.CompleteRate = model.CompleteNum > 0 ? (decimal)Math.Round((float)model.CompleteNum / (float)model.AllNum, 2, MidpointRounding.AwayFromZero) : 0; + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i; + result.Add(model); + i++; + } + } + } + + return result; + } + + /// + /// 三查四定重置 + /// + protected void btnScsdReset_Click(object sender, EventArgs e) + { + var list = Funs.DB.Run_ScheduleSetUp.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 3); + if (list.Count() > 0) + { + Funs.DB.Run_ScheduleSetUp.DeleteAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + DataBridScsd(); + ShowNotify("重置成功!", MessageBoxIcon.Success); + } + + /// + /// 三查四定保存 + /// + protected void btnScsdSave_Click(object sender, EventArgs e) + { + try + { + var deletelist = Funs.DB.Run_ScheduleSetUp.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.States == 3); + Funs.DB.Run_ScheduleSetUp.DeleteAllOnSubmit(deletelist); + Funs.DB.SubmitChanges(); + var addList = new List(); + JArray mergedData = GridScsd.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + var model = new Run_ScheduleSetUp(); + model.ScheduleId = this.GridScsd.Rows[i].DataKeys[0].ToString(); + model.LevelName = this.GridScsd.Rows[i].DataKeys[1].ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.States = 3; + model.AllNum = !string.IsNullOrWhiteSpace(values.Value("AllNum")) ? int.Parse(values.Value("AllNum")) : 0; + model.ProgressNum = !string.IsNullOrWhiteSpace(values.Value("ProgressNum")) ? int.Parse(values.Value("ProgressNum")) : 0; + model.CompleteNum = !string.IsNullOrWhiteSpace(values.Value("CompleteNum")) ? int.Parse(values.Value("CompleteNum")) : 0; + model.CompleteRate = model.CompleteNum > 0 ? (decimal)Math.Round((float)model.CompleteNum / (float)model.AllNum, 2, MidpointRounding.AwayFromZero) : 0; + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i; + addList.Add(model); + } + + Funs.DB.Run_ScheduleSetUp.InsertAllOnSubmit(addList); + Funs.DB.SubmitChanges(); + DataBridScsd(); + ShowNotify("保存成功!"); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Error); + } + } + + /// + /// 三查四定导出 + /// + /// + /// + protected void btnScsdExport_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + string ReportFileName = filePath + "三查四定进度.xlsx"; + + var result = ScsdData(); + + if (result.Count > 0) + { + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("三查四定进度"); + + #region 列宽 + + ws.SetColumnWidth(0, (30 * 256)); + ws.SetColumnWidth(1, (20 * 256)); + ws.SetColumnWidth(2, (20 * 256)); + ws.SetColumnWidth(3, (20 * 256)); + + #endregion + + #region 样式 + //公共样式 + ICellStyle style = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true); + //公共样式加粗 + ICellStyle styleBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, true); + + #endregion + + #region 头部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, 0, 0, 0, 3); + //行1 + ws.GetRow(0).GetCell(0).CellStyle = styleBold; + ws.GetRow(0).GetCell(0).SetCellValue("类别名称"); + ws.GetRow(0).GetCell(1).CellStyle = styleBold; + ws.GetRow(0).GetCell(1).SetCellValue("全部数量"); + ws.GetRow(0).GetCell(2).CellStyle = styleBold; + ws.GetRow(0).GetCell(2).SetCellValue("进行中数量"); + ws.GetRow(0).GetCell(3).CellStyle = styleBold; + ws.GetRow(0).GetCell(3).SetCellValue("已完成数量"); + + #endregion + + #region 表格 + + var start = 1; + var end = result.Count; + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, start, end, 0, 3); + + //数据 + var dataIndex = 1; + foreach (var item in result) + { + ws.GetRow(dataIndex).GetCell(0).SetCellValue(item.LevelName); + ws.GetRow(dataIndex).GetCell(1).SetCellValue(item.AllNum.ToString()); + ws.GetRow(dataIndex).GetCell(2).SetCellValue(item.ProgressNum.ToString()); + ws.GetRow(dataIndex).GetCell(3).SetCellValue(item.CompleteNum.ToString()); + dataIndex++; + } + + #endregion + + #region 尾部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, end + 1, end + 1, 0, 3); + ws.GetRow(end + 1).GetCell(0).SetCellValue("合计"); + ws.GetRow(end + 1).GetCell(1).SetCellValue(result.Count > 0 ? result.Sum(x => x.AllNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(2).SetCellValue(result.Count > 0 ? result.Sum(x => x.ProgressNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(3).SetCellValue(result.Count > 0 ? result.Sum(x => x.CompleteNum).ToString() : "0"); + + + #endregion + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("三查四定进度.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); + } + } + #endregion #region 私有方法 + /// + /// 创建头部 + /// + /// + private XSSFSheet ExcelCreateRowTitle(XSSFSheet ws, XSSFWorkbook hssfworkbook, ICellStyle style, int sRows, int eRows, int cStart, int cEnd, float height = 21) + { + for (int i = sRows; i <= eRows; i++) + { + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = height; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).CreateCell(j).CellStyle = style; + } + } + return ws; + } + + /// + /// 创建样式 + /// + /// + public static ICellStyle SetExcelStyle(XSSFWorkbook wb, BorderStyle Bottom, BorderStyle Left, BorderStyle Right, BorderStyle Top, VerticalAlignment VerAig, HorizontalAlignment HorAig, double FontSize, bool WrapText = true, bool Bold = false, string FontName = "宋体") + { + ICellStyle style = wb.CreateCellStyle(); + style.BorderBottom = Bottom; + style.BorderLeft = Left; + style.BorderRight = Right; + style.BorderTop = Top; + style.VerticalAlignment = VerAig; + style.Alignment = HorAig; + IFont font = wb.CreateFont(); + font.FontHeightInPoints = FontSize; + font.IsBold = Bold; + font.FontName = FontName; + style.SetFont(font); + style.WrapText = WrapText; + return style; + } + /// /// 私有方法 /// @@ -299,6 +896,11 @@ namespace FineUIPro.Web.TestRun.Report //试车 DataBridSc(); } + else if (TabStrip1.ActiveTabIndex == 2) + { + //三查四定 + DataBridScsd(); + } } public class Run_ScheduleSetUpDto : Run_ScheduleSetUp @@ -309,7 +911,92 @@ namespace FineUIPro.Web.TestRun.Report public string WorkPackName { get; set; } } + /// + /// 试车检查表实体 + /// + public class WorkPackageInspectDto + { + /// + /// 工作包主键 + /// + public string WorkPackId { get; set; } + /// + /// 工作包名称 + /// + public string WorkPackName { get; set; } + /// + /// 检查表数量 + /// + public int AllNum { get; set; } + /// + /// 未关闭任务单数量 + /// + public int NoCloseNum { get; set; } + /// + /// 已关闭任务单数量 + /// + public int CloseNum { get; set; } + } + + /// + /// 三查四定统计实体 + /// + public class FourDecisionScheduleBridDto + { + /// + /// 级别 + /// + public string Level { get; set; } + /// + /// 尾项数量 + /// + public int AllNum { get; set; } + /// + /// 未关闭尾项数量 + /// + public int NoCloseNum { get; set; } + /// + /// 已关闭尾项数量 + /// + public int CloseNum { get; set; } + } + #endregion + + #region 转换 + + /// + /// DataTable转换List + /// + /// + public List DataTableToList(DataTable table) + { + List list = new List(); + T t = default(T); + PropertyInfo[] propertypes = null; + string tempName = string.Empty; + foreach (DataRow row in table.Rows) + { + t = Activator.CreateInstance(); + propertypes = t.GetType().GetProperties(); + foreach (PropertyInfo pro in propertypes) + { + tempName = pro.Name; + if (table.Columns.Contains(tempName)) + { + object value = row[tempName]; + if (!value.ToString().Equals("")) + { + pro.SetValue(t, value, null); + } + } + } + list.Add(t); + } + return list.Count == 0 ? new List() : list; + } + + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs index 5baafb6d..2a52987a 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/ScheduleSetUp.aspx.designer.cs @@ -122,6 +122,24 @@ namespace FineUIPro.Web.TestRun.Report /// protected global::FineUIPro.Button btnYscSave; + /// + /// ToolbarFill 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill; + + /// + /// btnYscExport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnYscExport; + /// /// txtAllNum 控件。 /// @@ -185,6 +203,24 @@ namespace FineUIPro.Web.TestRun.Report /// protected global::FineUIPro.Button btnScSave; + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnScExport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnScExport; + /// /// txtAllNum1 控件。 /// @@ -211,5 +247,86 @@ namespace FineUIPro.Web.TestRun.Report /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.NumberBox txtCompleteNum1; + + /// + /// GridScsd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid GridScsd; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// btnScsdReset 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnScsdReset; + + /// + /// btnScsdSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnScsdSave; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnScsdExport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnScsdExport; + + /// + /// NumberBox1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox NumberBox1; + + /// + /// NumberBox2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox NumberBox2; + + /// + /// NumberBox3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox NumberBox3; } } diff --git a/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx b/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx index ef55ff51..4f8e51bf 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx +++ b/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx @@ -44,17 +44,18 @@ - + + - + @@ -62,13 +63,17 @@ - + - + - + - + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.cs b/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.cs index 6c23377c..e075f720 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.cs @@ -7,7 +7,13 @@ using System.Data; using System.Linq; using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; +using static FineUIPro.Web.TestRun.Report.PreRunSchedule; +using System.Reflection; +using Newtonsoft.Json.Linq; +using NPOI.SS.UserModel; +using NPOI.SS.Util; +using NPOI.XSSF.UserModel; +using System.IO; namespace FineUIPro.Web.TestRun.Report { @@ -18,14 +24,15 @@ namespace FineUIPro.Web.TestRun.Report /// public string TreePreRunId { get { return (string)ViewState["TreePreRunId"]; } set { ViewState["TreePreRunId"] = value; } } /// - /// 子系统主键 + /// 系统主键 /// - public string SsubSystemId { get { return (string)ViewState["SsubSystemId"]; } set { ViewState["SsubSystemId"] = value; } } + public List SystemIds { get { return (List)ViewState["SystemIds"]; } set { ViewState["SystemIds"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { + if (SystemIds == null) SystemIds = new List(); this.InitTreeMenu();//加载树 } } @@ -107,76 +114,203 @@ namespace FineUIPro.Web.TestRun.Report /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { + var devices = new List(); this.TreePreRunId = tvControlItem.SelectedNodeID != "0" ? tvControlItem.SelectedNodeID : string.Empty; + if (!string.IsNullOrWhiteSpace(this.TreePreRunId)) + { + var model = Funs.DB.PreRun_SysDevice.FirstOrDefault(x => x.PreRunId == this.TreePreRunId); + if (model.PreRunLevel == 3) + { + this.SystemIds = new List() { model.PreRunId }; + } + else if (model.PreRunLevel == 2) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 3 && x.ProcessesId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + else if (model.PreRunLevel == 1) + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 3 && x.InstallationId == model.PreRunId).ToList(); + if (devices.Count > 0) + { + this.SystemIds = devices.ConvertAll(x => x.PreRunId); + } + } + } + else + { + devices = Funs.DB.PreRun_SysDevice.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.PreRunLevel == 3).ToList(); + if (devices.Count > 0) + { + this.SystemIds = devices.ConvertAll(x => x.PreRunId); + } + } TestRunBrid(); } #endregion - #region 数据绑定 + #region 数据绑定/导出 /// /// 预试车绑定 /// public void TestRunBrid() { - var result = new List(); - string strSql = "select a.WorkPackId,b.WorkPackName,b.Sort,SUM(case ISNULL(a.InspectIsClose,0) when 1 then 1 else 0 end) as ygbnum,SUM(case ISNULL(a.InspectIsClose,0) when 0 then 1 else 0 end) as wgbnum,COUNT(1) as allnum from TestRun_SubInspectTerm as a inner join TestRun_WorkPackage as b on a.WorkPackId=b.WorkPackId where 1=1 and a.ProjectId=@ProjectId "; - List listStr = new List(); - listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - string installationName = "-"; - string processesName = "-"; - string systemName = "-"; - string subsystemName = "-"; - string columnames = string.Empty; - if (!string.IsNullOrWhiteSpace(this.TreePreRunId)) + var result = new List(); + if (this.SystemIds.Count > 0) { - var model = Funs.DB.PreRun_SysDevice.FirstOrDefault(p => p.PreRunId == this.TreePreRunId); - if (model.PreRunLevel == 1) - { - installationName = model.PreRunName; - columnames = "a.InstallationId"; - } - else if (model.PreRunLevel == 2) - { - processesName = model.PreRunName; - columnames = "a.ProcessesId"; - } - else if (model.PreRunLevel == 3) - { - systemName = model.PreRunName; - columnames = "a.SystemId"; - } - else if (model.PreRunLevel == 4) - { - subsystemName = model.PreRunName; - columnames = "a.SubsystemId"; - } - strSql += $"and {columnames}='{model.PreRunId}'"; - } - strSql += "group by a.WorkPackId,b.WorkPackName,b.Sort order by b.Sort asc"; - SqlParameter[] parameter = listStr.ToArray(); - var dt = SQLHelper.GetDataTableRunText(strSql, parameter); - if (dt != null) - { - foreach (DataRow item in dt.Rows) - { - result.Add(new ScheduleBridDto() - { - WorkPackId = item["WorkPackId"].ToString(), - WorkName = item["WorkPackName"].ToString(), - InstallationName = installationName, - ProcessesName = processesName, - SystemName = systemName, - SubsystemName = subsystemName, - AllNum = item["allnum"].ToString(), - NoCloseNum = item["wgbnum"].ToString(), - CloseNum = item["ygbnum"].ToString() - }); - } + result = GetTestRunSchedules(); } + GridTestRun.DataSource = result; GridTestRun.DataBind(); + JObject summary = new JObject(); + summary.Add("WorkPackNum", result.Sum(x => x.WorkPackNum)); + summary.Add("WorkPackNoCloseNum", result.Sum(x => x.WorkPackNoCloseNum)); + summary.Add("WorkPackCloseNum", result.Sum(x => x.WorkPackCloseNum)); + summary.Add("InspectNum", result.Sum(x => x.InspectNum)); + summary.Add("InspectNoCloseNum", result.Sum(x => x.InspectNoCloseNum)); + summary.Add("InspectCloseNum", result.Sum(x => x.InspectCloseNum)); + GridTestRun.SummaryData = summary; + } + + /// + /// 试车导出 + /// + protected void btnScExport_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + string ReportFileName = filePath + "试车进度.xlsx"; + + var result = GetTestRunSchedules(); + + if (result.Count > 0) + { + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("试车进度"); + + #region 列宽 + + ws.SetColumnWidth(0, (30 * 256)); + ws.SetColumnWidth(1, (20 * 256)); + ws.SetColumnWidth(2, (20 * 256)); + ws.SetColumnWidth(3, (20 * 256)); + ws.SetColumnWidth(4, (20 * 256)); + ws.SetColumnWidth(5, (20 * 256)); + ws.SetColumnWidth(6, (20 * 256)); + ws.SetColumnWidth(7, (20 * 256)); + ws.SetColumnWidth(8, (20 * 256)); + ws.SetColumnWidth(9, (20 * 256)); + + #endregion + + #region 样式 + //公共样式 + ICellStyle style = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true); + //公共样式加粗 + ICellStyle styleBold = SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, true); + + #endregion + + #region 头部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, 0, 0, 0, 9); + //行1 + ws.GetRow(0).GetCell(0).CellStyle = styleBold; + ws.GetRow(0).GetCell(0).SetCellValue("工作包名称"); + ws.GetRow(0).GetCell(1).CellStyle = styleBold; + ws.GetRow(0).GetCell(1).SetCellValue("装置名称"); + ws.GetRow(0).GetCell(2).CellStyle = styleBold; + ws.GetRow(0).GetCell(2).SetCellValue("工序名称"); + ws.GetRow(0).GetCell(3).CellStyle = styleBold; + ws.GetRow(0).GetCell(3).SetCellValue("系统名称"); + ws.GetRow(0).GetCell(4).CellStyle = styleBold; + ws.GetRow(0).GetCell(4).SetCellValue("工作包数量"); + ws.GetRow(0).GetCell(5).CellStyle = styleBold; + ws.GetRow(0).GetCell(5).SetCellValue("工作包未关闭数量"); + ws.GetRow(0).GetCell(6).CellStyle = styleBold; + ws.GetRow(0).GetCell(6).SetCellValue("工作包已关闭数量"); + ws.GetRow(0).GetCell(7).CellStyle = styleBold; + ws.GetRow(0).GetCell(7).SetCellValue("检查表数量"); + ws.GetRow(0).GetCell(8).CellStyle = styleBold; + ws.GetRow(0).GetCell(8).SetCellValue("检查表未关闭数量"); + ws.GetRow(0).GetCell(9).CellStyle = styleBold; + ws.GetRow(0).GetCell(9).SetCellValue("检查表已关闭数量"); + + #endregion + + #region 表格 + + var start = 1; + var end = result.Count; + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, start, end, 0, 9); + + //数据 + var dataIndex = 1; + foreach (var item in result) + { + ws.GetRow(dataIndex).GetCell(0).SetCellValue(item.WorkPackName); + ws.GetRow(dataIndex).GetCell(1).SetCellValue(item.InstallationName); + ws.GetRow(dataIndex).GetCell(2).SetCellValue(item.ProcessesName); + ws.GetRow(dataIndex).GetCell(3).SetCellValue(item.SystemName); + ws.GetRow(dataIndex).GetCell(4).SetCellValue(item.WorkPackNum); + ws.GetRow(dataIndex).GetCell(5).SetCellValue(item.WorkPackNoCloseNum); + ws.GetRow(dataIndex).GetCell(6).SetCellValue(item.WorkPackCloseNum); + ws.GetRow(dataIndex).GetCell(7).SetCellValue(item.InspectNum); + ws.GetRow(dataIndex).GetCell(8).SetCellValue(item.InspectNoCloseNum); + ws.GetRow(dataIndex).GetCell(9).SetCellValue(item.InspectCloseNum); + dataIndex++; + } + + #endregion + + #region 尾部 + + ws = ExcelCreateRowTitle(ws, hssfworkbook, style, end + 1, end + 1, 0, 9); + var region = new CellRangeAddress(end + 1, end + 1, 0, 3); + ws.AddMergedRegion(region); + ws.GetRow(end + 1).GetCell(0).SetCellValue("合计"); + ws.GetRow(end + 1).GetCell(4).SetCellValue(result.Count > 0 ? result.Sum(x => x.WorkPackNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(5).SetCellValue(result.Count > 0 ? result.Sum(x => x.WorkPackNoCloseNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(6).SetCellValue(result.Count > 0 ? result.Sum(x => x.WorkPackCloseNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(7).SetCellValue(result.Count > 0 ? result.Sum(x => x.InspectNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(8).SetCellValue(result.Count > 0 ? result.Sum(x => x.InspectNoCloseNum).ToString() : "0"); + ws.GetRow(end + 1).GetCell(9).SetCellValue(result.Count > 0 ? result.Sum(x => x.InspectCloseNum).ToString() : "0"); + + #endregion + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("试车进度.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); + } } #endregion @@ -184,7 +318,48 @@ namespace FineUIPro.Web.TestRun.Report #region 私有方法 /// - /// 试车统计实体 + /// 创建头部 + /// + /// + private XSSFSheet ExcelCreateRowTitle(XSSFSheet ws, XSSFWorkbook hssfworkbook, ICellStyle style, int sRows, int eRows, int cStart, int cEnd, float height = 21) + { + for (int i = sRows; i <= eRows; i++) + { + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = height; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).CreateCell(j).CellStyle = style; + } + } + return ws; + } + + /// + /// 创建样式 + /// + /// + public static ICellStyle SetExcelStyle(XSSFWorkbook wb, BorderStyle Bottom, BorderStyle Left, BorderStyle Right, BorderStyle Top, VerticalAlignment VerAig, HorizontalAlignment HorAig, double FontSize, bool WrapText = true, bool Bold = false, string FontName = "宋体") + { + ICellStyle style = wb.CreateCellStyle(); + style.BorderBottom = Bottom; + style.BorderLeft = Left; + style.BorderRight = Right; + style.BorderTop = Top; + style.VerticalAlignment = VerAig; + style.Alignment = HorAig; + IFont font = wb.CreateFont(); + font.FontHeightInPoints = FontSize; + font.IsBold = Bold; + font.FontName = FontName; + style.SetFont(font); + style.WrapText = WrapText; + return style; + } + + /// + /// 试车统计实体(老) /// public class ScheduleBridDto { @@ -226,6 +401,171 @@ namespace FineUIPro.Web.TestRun.Report public string CloseNum { get; set; } } + /// + /// 获取试车统计 + /// + /// + private List GetTestRunSchedules() + { + var list = new List(); + + string allStr = $"select b.WorkPackId,b.WorkPackName,COUNT(a.SystemId) as WorkPackNum from TestRun_SubSysWorkPackage as a inner join TestRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where a.SystemId in ('{string.Join("','", this.SystemIds)}') group by b.WorkPackId,b.WorkPackName"; + var dt = SQLHelper.GetDataTableRunText(allStr); + + string inspectStr = $"select a.WorkPackId,b.WorkPackName,b.Sort,SUM(case ISNULL(a.InspectIsClose, 0) when 1 then 1 else 0 end) as CloseNum,SUM(case ISNULL(a.InspectIsClose, 0) when 0 then 1 else 0 end) as NoCloseNum,COUNT(1) as AllNum from TestRun_SubInspectTerm as a inner join TestRun_WorkPackage as b on a.WorkPackId = b.WorkPackId where 1=1 and a.ProjectId = '{this.CurrUser.LoginProjectId}' group by a.WorkPackId,b.WorkPackName,b.Sort order by b.Sort asc"; + var inspectDt = SQLHelper.GetDataTableRunText(inspectStr); + var inspectlist = DataTableToList(inspectDt); + + string deviceStr = $"select b.PreRunName as InstallationName,c.PreRunName as ProcessesName,d.PreRunName as SystemName from PreRun_SysDevice as a left join PreRun_SysDevice as b on b.PreRunId=ISNULL(a.InstallationId,a.PreRunId) left join PreRun_SysDevice as c on c.PreRunId=a.ProcessesId left join PreRun_SysDevice as d on d.PreRunId=a.SystemId where a.PreRunId='{this.TreePreRunId}'"; + var driveDt = SQLHelper.GetDataTableRunText(deviceStr); + + if (dt.Rows.Count > 0) + { + list = DataTableToList(dt); + foreach (var item in list) + { + if (inspectlist.Count(x => x.WorkPackId == item.WorkPackId) > 0) + { + var itemInspect = inspectlist.FirstOrDefault(x => x.WorkPackId == item.WorkPackId); + item.InspectNum = itemInspect.AllNum; + item.InspectCloseNum = itemInspect.CloseNum; + item.InspectNoCloseNum = itemInspect.NoCloseNum; + item.WorkPackCloseNum = itemInspect.CloseNum; + item.WorkPackNoCloseNum = itemInspect.NoCloseNum; + } + else + { + item.InspectNum = 0; + item.InspectCloseNum = 0; + item.InspectNoCloseNum = 0; + item.WorkPackNoCloseNum = 0; + item.WorkPackCloseNum = 0; + } + if (driveDt.Rows.Count > 0) + { + item.InstallationName = driveDt.Rows[0]["InstallationName"].ToString(); + item.ProcessesName = driveDt.Rows[0]["ProcessesName"].ToString(); + item.SystemName = driveDt.Rows[0]["SystemName"].ToString(); + } + } + } + + return list; + } + + /// + /// 试车统计实体 + /// + public class TestRunScheduleDto + { + /// + /// 工作包主键 + /// + public string WorkPackId { get; set; } + /// + /// 工作包名称 + /// + public string WorkPackName { get; set; } + /// + /// 装置名称 + /// + public string InstallationName { get; set; } + /// + /// 工序名称 + /// + public string ProcessesName { get; set; } + /// + /// 系统名称 + /// + public string SystemName { get; set; } + /// + /// 工作包数量 + /// + public int WorkPackNum { get; set; } + /// + /// 工作包未关闭数量 + /// + public int WorkPackNoCloseNum { get; set; } + /// + /// 工作包已关闭数量 + /// + public int WorkPackCloseNum { get; set; } + /// + /// 检查表数量 + /// + public int InspectNum { get; set; } + /// + /// 检查表未关闭数量 + /// + public int InspectNoCloseNum { get; set; } + /// + /// 检查表已关闭数量 + /// + public int InspectCloseNum { get; set; } + } + + /// + /// 试车检查表实体 + /// + public class WorkPackageInspectDto + { + /// + /// 工作包主键 + /// + public string WorkPackId { get; set; } + /// + /// 工作包名称 + /// + public string WorkPackName { get; set; } + /// + /// 检查表数量 + /// + public int AllNum { get; set; } + /// + /// 未关闭任务单数量 + /// + public int NoCloseNum { get; set; } + /// + /// 已关闭任务单数量 + /// + public int CloseNum { get; set; } + } + + #endregion + + #region 转换 + + /// + /// DataTable转换List + /// + /// + public List DataTableToList(DataTable table) + { + List list = new List(); + T t = default(T); + PropertyInfo[] propertypes = null; + string tempName = string.Empty; + foreach (DataRow row in table.Rows) + { + t = Activator.CreateInstance(); + propertypes = t.GetType().GetProperties(); + foreach (PropertyInfo pro in propertypes) + { + tempName = pro.Name; + if (table.Columns.Contains(tempName)) + { + object value = row[tempName]; + if (!value.ToString().Equals("")) + { + pro.SetValue(t, value, null); + } + } + } + list.Add(t); + } + return list.Count == 0 ? new List() : list; + } + #endregion } diff --git a/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.designer.cs index 4220ff77..72131b93 100644 --- a/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/Report/TestRunSchedule.aspx.designer.cs @@ -130,5 +130,14 @@ namespace FineUIPro.Web.TestRun.Report /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill; + + /// + /// btnScExport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnScExport; } } diff --git a/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx new file mode 100644 index 00000000..7692eea4 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx @@ -0,0 +1,86 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestRunPerformanceStandard.aspx.cs" Inherits="FineUIPro.Web.ZHGL.TestRunPerformance.TestRunPerformanceStandard" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx.cs new file mode 100644 index 00000000..8a92aa65 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx.cs @@ -0,0 +1,137 @@ +using BLL; +using Newtonsoft.Json.Linq; +using NPOI.SS.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; + +namespace FineUIPro.Web.ZHGL.TestRunPerformance +{ + public partial class TestRunPerformanceStandard : PageBase + { + #region 加载 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + BindGrid(); + } + } + #endregion + + #region 数据绑定 + //加载列表 + public void BindGrid() + { + string strSql = @"select * from Base_TestRunPerformanceStandard"; + List listStr = new List(); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 编辑 + protected void btnMenuModify_Click(object sender, EventArgs e) + { + EditData(); + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + EditData(); + } + + /// + /// 编辑 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TestRunPerformanceStandardEdit.aspx?TestRunPerformanceStandardId={0}", Grid1.SelectedRowID, "编辑 - "))); + } + #endregion + + #region 删除 + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + BLL.TestRunPerformanceStandardService.DeleteTestRunPerformanceStandardById(Grid1.SelectedRowID); + } + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 权限设置 + /// + /// 权限设置 + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TestRunPerformanceStandardMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + this.Grid1.EnableRowDoubleClickEvent = true; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + } + } + #endregion + + #region 新增 + /// + /// 新增 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TestRunPerformanceStandardEdit.aspx", "新增 - "))); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx.designer.cs new file mode 100644 index 00000000..9452f5f8 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.TestRunPerformance { + + + public partial class TestRunPerformanceStandard { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx new file mode 100644 index 00000000..87a0832a --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx @@ -0,0 +1,56 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestRunPerformanceStandardEdit.aspx.cs" Inherits="FineUIPro.Web.ZHGL.TestRunPerformance.TestRunPerformanceStandardEdit" %> + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx.cs new file mode 100644 index 00000000..416846a8 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using BLL; + +namespace FineUIPro.Web.ZHGL.TestRunPerformance +{ + public partial class TestRunPerformanceStandardEdit : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + string TestRunPerformanceStandardId = Request.Params["TestRunPerformanceStandardId"]; + if (!string.IsNullOrEmpty(TestRunPerformanceStandardId)) + { + Model.Base_TestRunPerformanceStandard item = TestRunPerformanceStandardService.GetPerformanceStandardById(TestRunPerformanceStandardId); + if (item != null) + { + this.txtCode.Text = item.Code; + if (item.Code3 != null) + { + this.txtCode3.Text = item.Code3.ToString(); + } + this.txtType.Text = item.Type; + this.txtItem.Text = item.Item; + this.txtUnit.Text = item.Unit; + if (item.Days != null) + { + this.txtDays.Text = item.Days.ToString(); + } + } + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!this.txtCode.Text.Contains(".")) + { + Alert.ShowInTop("编号格式不正确", MessageBoxIcon.Warning); + return; + } + string TestRunPerformanceStandardId = Request.Params["TestRunPerformanceStandardId"]; + Model.Base_TestRunPerformanceStandard newItem = new Model.Base_TestRunPerformanceStandard(); + newItem.Code = this.txtCode.Text.Trim(); + var strs = this.txtCode.Text.Trim().Split(','); + if (strs.Length == 2) + { + newItem.Code1 = Funs.GetNewInt(strs[0]); + newItem.Code2 = Funs.GetNewInt(strs[1]); + } + newItem.Code3 = Funs.GetNewInt(this.txtCode3.Text.Trim()); + newItem.Type = this.txtType.Text.Trim(); + newItem.Item = this.txtItem.Text.Trim(); + newItem.Unit = this.txtUnit.Text.Trim(); + newItem.Days= Funs.GetNewInt(this.txtDays.Text.Trim()); + if (string.IsNullOrEmpty(TestRunPerformanceStandardId)) + { + newItem.TestRunPerformanceStandardId = SQLHelper.GetNewID(); + BLL.TestRunPerformanceStandardService.AddTestRunPerformanceStandard(newItem); + BLL.LogService.AddSys_Log(this.CurrUser, newItem.Type, newItem.Item, BLL.Const.ControlItemInitSetMenuId, "增加试车绩效考核标准!"); + } + else + { + newItem.TestRunPerformanceStandardId = TestRunPerformanceStandardId; + BLL.TestRunPerformanceStandardService.UpdateTestRunPerformanceStandard(newItem); + BLL.LogService.AddSys_Log(this.CurrUser, newItem.Type, newItem.Item, BLL.Const.ControlItemInitSetMenuId, "修改试车绩效考核标准!"); + } + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx.designer.cs new file mode 100644 index 00000000..f9dc7061 --- /dev/null +++ b/SGGL/FineUIPro.Web/ZHGL/TestRunPerformance/TestRunPerformanceStandardEdit.aspx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ZHGL.TestRunPerformance { + + + public partial class TestRunPerformanceStandardEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCode; + + /// + /// txtCode3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtCode3; + + /// + /// txtType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtType; + + /// + /// txtItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtItem; + + /// + /// txtUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnit; + + /// + /// txtDays 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtDays; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index ed44c8fe..cc7e0f27 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -83,4 +83,6 @@ + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx index 863999f3..fe66d4f7 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx +++ b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx @@ -95,6 +95,19 @@ +
+
+
+
+
+
+
+
+
+
+
+
+
@@ -204,7 +217,7 @@ var oneNameData = []; var oneArr = JSON.parse(oneArrStr); var oneData = JSON.parse(oneDataStr); - $.each(oneData, function (inxex, item) { + $.each(oneData, function (index, item) { var obj = { name: item }; oneNameData.push(obj); }); @@ -224,15 +237,6 @@ tooltip: { formatter: '{a}:{c}%'//a 是series中每条数据name值,c 是data数值 }, - //legend: { - // orient: 'vertical', // 'horizontal' - // data: oneData, - // textStyle: { // 图列内容样式 - // color: '#fff', // 字体颜色 - // }, - // x: '70%',//图例位置,设置right发现图例和文字位置反了,设置一个数值就好了 - // y: 'center'//延Y轴居中 - //}, grid: { left: '3%', //right: '30%', @@ -253,7 +257,9 @@ }, axisLabel: { interval: 0, - rotate: -90, + formatter: function (value) { + return value.split("").join("\n"); + } } } ], @@ -271,16 +277,6 @@ } } ], - //dataZoom: [ - // { - // type: "slider",//slider表示有滑动块的, - // show: true, - //// xAxisIndex: [0],//表示x轴折叠 - // start: 1,//数据窗口范围的起始百分比,表示1% - // end: 70,//数据窗口范围的结束百分比,表示35%坐标 - // bottom: "0", - // }, - //], series: [{ name: '进度率', type: 'bar', @@ -288,9 +284,11 @@ data: oneArr, label: { show: true, - position: 'inside', - interval: 0, - rotate: -90, + position: 'top', + color: "#00D8FE", + fontWeight: "bold", + //interval: 0, + //rotate: -90, formatter: function (params) { if (params.value > 0) { return params.value + '%'; @@ -308,35 +306,10 @@ } } }] - //series: oneNameData }; - //for (var i = 0; i < option.series.length; i++) { - // var style = { //定义柱状图的样式 - // type: 'bar', - // barWidth: 20, - // normal: { - // label: { - // show: true, - // position: 'inside', //柱子下显示 数值 - // interval: 0, - // rotate: -90, - // formatter: function (params) { - // if (params.value > 0) { - // return params.value + '%'; - // } else { - // return ' '; - // } - // }, - // } - // } - // }; - // option.series[i].type = 'bar'; //每条数据指定类型为'bar' - // option.series[i].itemStyle = style; // series中每条数据都加的样式 - // option.series[i].data = [bar_data[i]]; //series 中 data赋值 - //}; chart.setOption(option); - + //图2 var twoDataStr = '<%=twoDataStr%>'; var towData = JSON.parse(twoDataStr); var data = towData.map((item, index) => item.Rate); @@ -397,11 +370,12 @@ fontSize: 12, }, itemStyle: { - borderRadius: 10, + borderRadius: [10, 10, 10, 10], color: new echarts.graphic.LinearGradient(0, 1, 1, 1, [ { offset: 0, color: '#395CFE' }, { offset: 1, color: '#2EC7CF' }, ]), + barBorderRadius: [10, 10, 10, 10] }, }, { @@ -428,12 +402,406 @@ itemStyle: { borderRadius: 10, color: 'rgba(3,169,244, 0.5)', + barBorderRadius: [10, 10, 10, 10] }, }, ], }; chart1.setOption(option); + //图3 + var fourDecisionStr = '<%=fourDecisionStr%>'; + var threeData = JSON.parse(fourDecisionStr); + var threewidth = Math.floor(100 / threeData.length); + $.each(threeData, function (index, item) { + $("#three").append("
"); + }); + + $(function () { + $.each(threeData, function (index, item) { + var chart = echarts.init(document.getElementById('three' + index)); + var value = item.Rate; + option = { + backgroundColor: '000', + title: { + text: `${value}%`, + subtext: '三查四定' + item.Name + '类', + left: 'center', + top: '45%', //top待调整 + textStyle: { + color: '#fff', + fontSize: 20, + fontFamily: 'DINAlternate-Bold', + }, + subtextStyle: { + color: '#ff', + fontSize: 14, + fontFamily: 'PingFangSC-Regular', + top: 'center' + }, + itemGap: 16 //主副标题间距 + }, + xAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + yAxis: { + splitLine: { + show: false + }, + axisLabel: { + show: false + }, + axisLine: { + show: false + } + }, + series: [ + // 内圆 + { + type: 'pie', + radius: ['0', '50%'], + center: ['50%', '50%'], + z: 0, + itemStyle: { + normal: { + color: new echarts.graphic.RadialGradient(0.5, 0.5, 0.5, [ + { + offset: 0, + color: '#1a68c0' + }, + { + offset: 0.44, + color: '#1a68c0' + }, + { + offset: 0.73, + color: '#194c88' + }, + { + offset: 1, + color: '#162c46' + } + ]), + label: { + show: false + }, + labelLine: { + show: false + } + }, + }, + label: { + normal: { + position: "center", + + } + }, + data: [100], + }, + // 进度圈 + { + type: 'pie', + clockWise: true, + radius: ["60%", "55%"], + data: [{ + value: value, + itemStyle: { + normal: { + borderWidth: 2, + borderColor: { + colorStops: [{ + offset: 0, + color: '#1d87ff' || '#00cefc' // 0% 处的颜色 + }, { + offset: 1, + color: '#1d87ff' || '#367bec' // 100% 处的颜色 + }] + }, + color: { // 完成的圆环的颜色 + colorStops: [{ + offset: 0, + color: '#1d87ff' || '#00cefc' // 0% 处的颜色 + }, { + offset: 1, + color: '#1d87ff' || '#367bec' // 100% 处的颜色 + }] + }, + label: { + show: false + }, + labelLine: { + show: false + }, + }, + } + }, + { + name: '', + value: 100 - value, + itemStyle: { + normal: { + label: { + show: false + }, + labelLine: { + show: false + }, + color: 'rgba(0, 0, 0, 0)', + borderColor: 'rgba(0, 0, 0, 0)', + borderWidth: 0, + } + }, + } + ] + }, + //刻度尺 + { + // name: "白色圈刻度", + type: "gauge", + radius: "77%", + startAngle: 225, //刻度起始 + endAngle: -134.8, //刻度结束 + z: 4, + axisTick: { + show: true, + lineStyle: { + width: 2, + color: '#354e6c' + } + }, + splitLine: { + length: 16, //刻度节点线长度 + lineStyle: { + width: 2, + color: '#354e6c' + } //刻度节点线 + }, + axisLabel: { + color: 'rgba(255,255,255,0)', + fontSize: 12, + }, //刻度节点文字颜色 + pointer: { + show: false + }, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + detail: { + show: false + }, + data: [{ + value: 0, + name: "" + }] + }, + ] + }; + chart.setOption(option); + }); + }); + + + + //data = [ + // { + // name: 'A类', + // value: 20, + // }, + // { + // name: 'B类', + // value: 30, + // }, + // { + // name: 'C类', + // value: 50, + // }, + //]; + //arrName = getArrayValue(data, 'name'); + //arrValue = getArrayValue(data, 'value'); + //sumValue = eval(arrValue.join('+')); + //objData = array2obj(data, 'name'); + //optionData = getData(data); + + //function getArrayValue(array, key) { + // var key = key || 'value'; + // var res = []; + // if (array) { + // array.forEach(function (t) { + // res.push(t[key]); + // }); + // } + // return res; + //} + //function array2obj(array, key) { + // var resObj = {}; + // for (var i = 0; i < array.length; i++) { + // resObj[array[i][key]] = array[i]; + // } + // return resObj; + //} + //function getData(data) { + // var res = { + // series: [], + // yAxis: [], + // }; + // for (let i = 0; i < data.length; i++) { + // res.series.push({ + // name: '', + // type: 'pie', + // clockWise: false, //顺时加载 + // hoverAnimation: false, //鼠标移入变大 + // radius: [73 - i * 15 + '%', 68 - i * 15 + '%'], + // center: ['40%', '55%'], + // label: { + // show: false, + // }, + // itemStyle: { + // label: { + // show: false, + // }, + // labelLine: { + // show: false, + // }, + // borderWidth: 5, + // }, + // data: [ + // { + // value: data[i].value, + // name: data[i].name, + // }, + // { + // value: sumValue - data[i].value, + // name: '', + // itemStyle: { + // color: 'rgba(0,0,0,0)', + // borderWidth: 0, + // }, + // tooltip: { + // show: false, + // }, + // hoverAnimation: false, + // }, + // ], + // }); + // res.series.push({ + // name: '', + // type: 'pie', + // silent: true, + // z: 1, + // clockWise: false, //顺时加载 + // hoverAnimation: false, //鼠标移入变大 + // radius: [73 - i * 15 + '%', 68 - i * 15 + '%'], + // center: ['40%', '55%'], + // label: { + // show: false, + // }, + // itemStyle: { + // label: { + // show: false, + // }, + // labelLine: { + // show: false, + // }, + // borderWidth: 5, + // }, + // data: [ + // { + // value: 7.5, + // itemStyle: { + // color: '#add2d2', //圆环背景色-全 + // borderWidth: 0, + // }, + // tooltip: { + // show: false, + // }, + // hoverAnimation: false, + // }, + // { + // value: 2.5, + // name: '', + // itemStyle: { + // color: 'rgba(0,0,0,0)', + // borderWidth: 0, + // }, + // tooltip: { + // show: false, + // }, + // hoverAnimation: false, + // }, + // ], + // }); + // res.yAxis.push(((data[i].value / sumValue) * 100).toFixed(2) + '%'); + // } + // return res; + //} + //option = { + // //backgroundColor: '#ddd', + // legend: { + // show: true, + // icon: 'circle', + // top: 'center', + // top: '16%', + // bottom: '53%', + // left: '40%', + // data: arrName, + // width: 40, + // padding: [0, 16], + // itemGap: 25, + // //图例显示 + // formatter: function (name) { + // return '{title|' + name + '}{value|' + ((objData[name].value / sumValue) * 100).toFixed(2) + '} {title|%}'; + // }, + + // textStyle: { + // rich: { + // title: { + // fontSize: 20, + // lineHeight: 30, + // color: '#fff', + // }, + // value: { + // fontSize: 18, + // lineHeight: 20, + // color: '#fff', + // }, + // }, + // }, + // }, + // title: { + // text: '', //图形标题,配置在中间对应效果图的80% + // left: '20%', + // top: '50%', + // textStyle: { + // color: 'rgb(50,197,233)', + // fontSize: 16, + // align: 'left', + // }, + // }, + // tooltip: { + // show: true, + // trigger: 'item', + // formatter: '{a}
{b}:{c}({d}%)', + // }, + // color: ['yellow', 'blue', 'green'], + // xAxis: [ + // { + // show: false, + // }, + // ], + // series: optionData.series, + //}; + //chart2.setOption(option); + <%--