From cfd069933eec3e80e305228a8b9a7fdac00b2690 Mon Sep 17 00:00:00 2001
From: gaofei1985 <181547018@qq.com>
Date: Fri, 1 Sep 2023 08:53:55 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E4=BD=BF?=
 =?UTF-8?q?=E7=94=A8=E6=83=85=E5=86=B5=E6=B1=87=E6=80=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 DataBase/版本日志/SGGLDB_WH_2023-09-01.sql    |  153 +++
 SGGL/BLL/BLL.csproj                           |    1 +
 .../InspectionSummaryService.cs               |   58 +
 SGGL/FineUIPro.Web/ErrLog.txt                 |  253 ++++
 SGGL/FineUIPro.Web/FineUIPro.Web.csproj       |    8 +
 .../InspectionSummary/InspectionSummary.aspx  |  137 +++
 .../InspectionSummary.aspx.cs                 | 1092 +++++++++++++++++
 .../InspectionSummary.aspx.designer.cs        |  107 ++
 SGGL/FineUIPro.Web/index.aspx                 |    5 +
 SGGL/FineUIPro.Web/indexProject.aspx          |   41 +-
 SGGL/Model/Model.cs                           |  386 ++++++
 11 files changed, 2239 insertions(+), 2 deletions(-)
 create mode 100644 DataBase/版本日志/SGGLDB_WH_2023-09-01.sql
 create mode 100644 SGGL/BLL/ZHGL/InspectionSummary/InspectionSummaryService.cs
 create mode 100644 SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx
 create mode 100644 SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs
 create mode 100644 SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.designer.cs
diff --git a/DataBase/版本日志/SGGLDB_WH_2023-09-01.sql b/DataBase/版本日志/SGGLDB_WH_2023-09-01.sql
new file mode 100644
index 00000000..a3af5ce6
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_WH_2023-09-01.sql
@@ -0,0 +1,153 @@
+--ܱ
+CREATE TABLE [dbo].[Inspection_Summary](
+	[InspectionSummaryId] [nvarchar](50) NOT NULL,
+	[InspectionSummaryMbId] [nvarchar](50) NULL,
+	[ProjectId] [nvarchar](50) NULL,
+	[SummeryResult] [nvarchar](50) NULL,
+	[CompileDate] [datetime] NULL,
+	[CompileDateMonth] [nvarchar](50) NULL,
+ CONSTRAINT [PK_Inspection_Summary] PRIMARY KEY CLUSTERED 
+(
+	[InspectionSummaryId] 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
+
+--ģ
+CREATE TABLE [dbo].[Inspection_SummaryMb](
+	[InspectionSummaryMbId] [nvarchar](50) NOT NULL,
+	[SNumber] [nvarchar](50) NULL,
+	[ModuleName] [nvarchar](50) NULL,
+	[MenuP] [nvarchar](50) NULL,
+	[MenuC] [nvarchar](50) NULL,
+	[SortId] [int] NULL,
+ CONSTRAINT [PK_Inspection_SummaryMb] PRIMARY KEY CLUSTERED 
+(
+	[InspectionSummaryMbId] 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'Inspection_Summary', @level2type=N'COLUMN',@level2name=N'InspectionSummaryMbId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ŀid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Inspection_Summary', @level2type=N'COLUMN',@level2name=N'ProjectId'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Inspection_Summary', @level2type=N'COLUMN',@level2name=N'SummeryResult'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Inspection_Summary', @level2type=N'COLUMN',@level2name=N'CompileDate'
+GO
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Inspection_Summary', @level2type=N'COLUMN',@level2name=N'CompileDateMonth'
+GO
+
+--Ӳ˵ĿѲ
+delete From sys_menu where menuid='EA413D2A-8D29-4DE2-932D-8511BB7F6CB2' 
+insert into sys_menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
+values('EA413D2A-8D29-4DE2-932D-8511BB7F6CB2','ĿѲ','ZHGL/InspectionSummary/InspectionSummary.aspx',140,
+'0','Menu_ZHGL','1','1','1')
+
+
+
+
+
+
+
+
+--ģ
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'1', N'1.1', N'ȫģ', N'ԱϢ', N'ԱϢ', 1)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'10', N'2.2', N'ģ', N'WBS', N'WBS', 10)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'11', N'2.3', N'ģ', N'ۺϹ', N'豸ϱ', 11)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'12', N'2.3', N'ģ', N'ۺϹ', N'Ա', 12)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'13', N'2.3', N'ģ', N'ۺϹ', N'߱', 13)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'14', N'2.3', N'ģ', N'ۺϹ', N'Ʊ', 14)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'15', N'2.3', N'ģ', N'ۺϹ', N'ʩ', 15)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'16', N'2.3', N'ģ', N'ۺϹ', N'ƽ', 16)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'17', N'2.3', N'ģ', N'ۺϹ', N'NCR', 17)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'18', N'2.4', N'ģ', N'', N'ܱ', 18)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'19', N'2.4', N'ģ', N'', N'±', 19)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'2', N'1.1', N'ȫģ', N'ԱϢ', N'ҵԱ', 2)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'20', N'2.5', N'ģ', N'̿ƹ', N'һιϸ', 20)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'21', N'2.5', N'ģ', N'̿ƹ', N'', 21)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'22', N'2.5', N'ģ', N'̿ƹ', N'һιϸϸ', 22)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'23', N'3', N'ؼ', N'ؼ', N'ؼ', 23)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'24', N'4.1', N'ֳ', N'', N'', 24)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'25', N'4.2', N'ֳ', N'ʵƶԽ', N'ʵƶԽ', 25)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'26', N'5', N'Ƶ', N'Ƶ', N'Ƶ', 26)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'27', N'6', N'Ŀ', N'Ŀ', N'Ŀ', 27)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'3', N'1.2', N'ȫģ', N'ȫѲ', N'ȫѲ', 3)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'4', N'1.3', N'ȫģ', N'', N'', 4)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'5', N'1.3', N'ȫģ', N'', N'', 5)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'6', N'1.4', N'ȫģ', N'ҵƱ', N'ҵƱ', 6)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'7', N'1.5', N'ȫģ', N'', N'ʦ־', 7)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'8', N'1.5', N'ȫģ', N'', N'HSE±', 8)
+INSERT [dbo].[Inspection_SummaryMb] ([InspectionSummaryMbId], [SNumber], [ModuleName], [MenuP], [MenuC], [SortId]) VALUES (N'9', N'2.1', N'ģ', N'Ѳ', N'Ѳ', 9)
+GO
+
+
+--ΪWBS_BreakdownProjectprojectid
+CREATE INDEX index_projectid
+ON WBS_BreakdownProject (projectid)
+
+--ΪMeeting_WeekMeeting projectid
+CREATE INDEX index_projectid
+ON Meeting_WeekMeeting (projectid)
+
+--ΪMeeting_MonthMeeting projectid
+CREATE INDEX index_projectid
+ON Meeting_MonthMeeting (projectid)
+
+--ΪProject_HSEDiary projectid
+CREATE INDEX index_projectid
+ON Project_HSEDiary (projectid)
+
+--ΪManager_ManagerWeek projectid
+CREATE INDEX index_projectid
+ON Manager_ManagerWeek (projectid)
+
+--ΪCheck_CheckControl projectid
+CREATE INDEX index_projectid
+ON Check_CheckControl (projectid)
+
+--ΪComprehensive_InspectionEquipment projectid
+CREATE INDEX index_projectid
+ON Comprehensive_InspectionEquipment (projectid)
+
+--ΪComprehensive_InspectionEquipment projectid
+CREATE INDEX index_projectid
+ON Comprehensive_InspectionPerson (projectid)
+
+--ΪComprehensive_InspectionMachine projectid
+CREATE INDEX index_projectid
+ON Comprehensive_InspectionMachine (projectid)
+
+--ΪComprehensive_DesignChangeOrder projectid
+CREATE INDEX index_projectid
+ON Comprehensive_DesignChangeOrder (projectid)
+
+--Ϊʩ projectid
+CREATE INDEX index_projectid
+ON Comprehensive_GeneralPlanApproval (projectid)
+
+--ΪComprehensive_DesignDetails projectid
+CREATE INDEX index_projectid
+ON Comprehensive_DesignDetails (projectid)
+
+--ΪComprehensive_NCRManagement projectid
+CREATE INDEX index_projectid
+ON Comprehensive_NCRManagement (projectid)
+
+--ΪReport_WeekAndMonthReport projectid
+CREATE INDEX index_projectid
+ON Report_WeekAndMonthReport (projectid)
+
+--ΪInspection_Summary projectid
+CREATE INDEX index_projectid
+ON Inspection_Summary (projectid)
+
+CREATE INDEX index_InspectionSummaryMbId
+ON Inspection_Summary (InspectionSummaryMbId)
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 355a0e97..a90535d5 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -808,6 +808,7 @@
     
     
     
+    
     
     
     
diff --git a/SGGL/BLL/ZHGL/InspectionSummary/InspectionSummaryService.cs b/SGGL/BLL/ZHGL/InspectionSummary/InspectionSummaryService.cs
new file mode 100644
index 00000000..4d7144fd
--- /dev/null
+++ b/SGGL/BLL/ZHGL/InspectionSummary/InspectionSummaryService.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+/// 
+/// 各项目巡查汇总
+/// 
+namespace BLL
+{
+    public class InspectionSummaryService
+    {
+        public static Model.SGGLDB db = Funs.DB;
+
+        
+        /// 
+        /// 批量添加
+        /// 
+        /// 
+        public static void AddAll(List list)
+        {
+            Model.SGGLDB db = Funs.DB;
+            db.Inspection_Summary.InsertAllOnSubmit(list);
+            db.SubmitChanges();
+        }
+
+        /// 
+        /// 修改(暂无)
+        /// 
+        /// 
+        public static void Update(Model.Inspection_Summary model)
+        {
+            Model.SGGLDB db = Funs.DB;
+            Model.Inspection_Summary newmodel = db.Inspection_Summary.FirstOrDefault(e => e.InspectionSummaryId == model.InspectionSummaryId);
+            if (newmodel != null)
+            {
+               
+                db.SubmitChanges();
+            }
+        }
+
+        /// 
+        /// 根据年月删除
+        /// 
+        /// 
+        public static void Delete(string CompileDateMonth)
+        {
+            Model.SGGLDB db = Funs.DB;
+            List list = db.Inspection_Summary.Where(e => e.CompileDateMonth == CompileDateMonth).ToList();
+            if (list.Count>0)
+            {
+                ///删除编码表记录
+                db.Inspection_Summary.DeleteAllOnSubmit(list);
+                db.SubmitChanges();
+            }
+        }
+
+    }
+}
diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt
index 4d28f8e3..01866bc0 100644
--- a/SGGL/FineUIPro.Web/ErrLog.txt
+++ b/SGGL/FineUIPro.Web/ErrLog.txt
@@ -2401,3 +2401,256 @@
 出错时间:08/24/2023 15:20:00
 出错时间:08/24/2023 15:20:00
 
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:21
+出错时间:08/30/2023 10:54:21
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:21
+出错时间:08/30/2023 10:54:21
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:22
+出错时间:08/30/2023 10:54:22
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:22
+出错时间:08/30/2023 10:54:22
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:22
+出错时间:08/30/2023 10:54:22
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:23
+出错时间:08/30/2023 10:54:23
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:23
+出错时间:08/30/2023 10:54:23
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:23
+出错时间:08/30/2023 10:54:23
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:24
+出错时间:08/30/2023 10:54:24
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:24
+出错时间:08/30/2023 10:54:24
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:24
+出错时间:08/30/2023 10:54:24
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:24
+出错时间:08/30/2023 10:54:24
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:24
+出错时间:08/30/2023 10:54:24
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:24
+出错时间:08/30/2023 10:54:24
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:25
+出错时间:08/30/2023 10:54:25
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:25
+出错时间:08/30/2023 10:54:25
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:25
+出错时间:08/30/2023 10:54:25
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:25
+出错时间:08/30/2023 10:54:25
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:26
+出错时间:08/30/2023 10:54:26
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:26
+出错时间:08/30/2023 10:54:26
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:27
+出错时间:08/30/2023 10:54:27
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:28
+出错时间:08/30/2023 10:54:28
+
+
+错误信息开始=====>
+错误类型:InvalidOperationException
+错误信息:不能添加已经存在的实体。
+错误堆栈:
+   在 System.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
+   在 System.Data.Linq.Table`1.InsertAllOnSubmit[TSubEntity](IEnumerable`1 entities)
+   在 BLL.BOSHENGMonitorService.AddPerson(String projectId, JArray arr, Sys_User user) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\BoSheng\BOSHENGMonitorService.cs:行号 323
+出错时间:08/30/2023 10:54:28
+出错时间:08/30/2023 10:54:28
+
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index f3d9a345..4e4b636f 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -1859,6 +1859,7 @@
     
     
     
+    
     
     
     
@@ -16442,6 +16443,13 @@
     
       WorkSummaryReportEdit.aspx
     
+    
+      InspectionSummary.aspx
+      ASPXCodeBehind
+    
+    
+      InspectionSummary.aspx
+    
     
       ReportRemind.aspx
       ASPXCodeBehind
diff --git a/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx b/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx
new file mode 100644
index 00000000..843ab25c
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx
@@ -0,0 +1,137 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InspectionSummary.aspx.cs" Inherits="FineUIPro.Web.ZHGL.InspectionSummary.InspectionSummary" %>
+
+
+
+
+
+    
+    各项目巡查汇总
+
+
+    
+    
+
+
diff --git a/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs
new file mode 100644
index 00000000..b9cee7c7
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/InspectionSummary/InspectionSummary.aspx.cs
@@ -0,0 +1,1092 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Web.UI.WebControls;
+using BLL;
+using Model;
+using AspNet = System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.ZHGL.InspectionSummary
+{
+    public partial class InspectionSummary : PageBase
+    {
+        /// 
+        /// 页面加载
+        /// 
+        /// 
+        /// 
+        protected void Page_Load(object sender, EventArgs e)
+        {
+            if (!IsPostBack)
+            {
+                
+            }
+        }
+
+        /// 
+        /// 加载表头
+        /// 
+        protected void Page_Init(object sender, EventArgs e)
+        {
+            InitGrid();
+        }
+
+        #region 加载表头
+        private void InitGrid()
+        {
+            //根据在建项目获取表头
+            var list = Funs.DB.Base_Project.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).OrderBy(x => x.ProjectCode).ToList();
+            for (int i = 0; i < list.Count; i++)
+            {
+                GroupField p = new GroupField();
+                p.Width = Unit.Pixel(200);
+                p.HeaderText = list[i].ShortName;
+                p.TextAlign = TextAlign.Left;
+                //p.HeaderToolTip= list[i].
+
+                BoundField person = new BoundField();
+                person.Width = Unit.Pixel(200);
+                person.DataField = "ThisProject" + (i + 1).ToString();
+                #region 加载施工、安全、质量经理
+                var textJl = "";
+                var getPUser = Funs.DB.Project_ProjectUser.Where(x => x.ProjectId == list[i].ProjectId);
+                var getSysUser = Funs.DB.Sys_User;
+                if (getPUser.Count() > 0)
+                {
+
+                    ///施工经理 
+                    var c = getPUser.FirstOrDefault(x => x.RoleId.Contains(BLL.Const.ConstructionManager));
+                    if (c != null)
+                    {
+                        textJl += getSysUser.Where(x => x.UserId == c.UserId).FirstOrDefault().UserName + ",";
+                    }
+                    ////安全经理
+                    var h = getPUser.FirstOrDefault(x => x.RoleId.Contains(BLL.Const.HSSEManager));
+                    if (h != null)
+                    {
+                        textJl += getSysUser.Where(x => x.UserId == h.UserId).FirstOrDefault().UserName + ",";
+                    }
+                    ////质量经理
+                    var qa = getPUser.FirstOrDefault(x => x.RoleId.Contains(BLL.Const.QAManager));
+                    if (qa != null)
+                    {
+                        textJl += getSysUser.Where(x => x.UserId == qa.UserId).FirstOrDefault().UserName;
+                    }
+
+                }
+                #endregion
+                person.HeaderText = textJl;
+                person.DataToolTipField = "CompileDate" + (i + 1).ToString();
+                person.ColumnID = "ThisProject" + (i + 1).ToString();
+                
+                p.Columns.Add(person);
+                
+                Grid1.Columns.Add(p);
+
+            }
+        }
+        #endregion
+
+        /// 
+        /// 判断生成操作
+        /// 
+        protected void btnNew_Juge(object sender, EventArgs e)
+        {
+            if (string.IsNullOrEmpty(this.drpCompileDateMonth.Text.Trim()))
+            {
+                ShowNotify("日期不能为空。", MessageBoxIcon.Warning);
+                PageContext.RegisterStartupScript("CloseRefresh()");
+                return;
+            }
+            //根据日期查询是否有数据
+            var modelSum = Funs.DB.Inspection_Summary.Where(x => x.CompileDateMonth == this.drpCompileDateMonth.Text.Trim()).FirstOrDefault();
+            //查到数据,二次确认
+            if (modelSum != null)
+            {
+                PageContext.RegisterStartupScript(Confirm.GetShowReference("该日期已生成数据,是否确认重新生成?", String.Empty, MessageBoxIcon.Question,
+                    PageManager1.GetCustomEventReference(false, "Confirmgd_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
+                PageContext.RegisterStartupScript("CloseRefresh()");
+            }
+            else
+            {
+                btnNew_Click();
+            }
+
+        }
+
+        /// 
+        /// 确认按钮
+        /// 
+        /// 
+        /// 
+        protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
+        {
+            if (e.EventArgument == "Confirmgd_OK" || e.EventArgument == "Confirmgy_OK")
+            {
+                // 根据日期查询是否有数据
+                var modelSum = Funs.DB.Inspection_Summary.Where(x => x.CompileDateMonth == this.drpCompileDateMonth.Text.Trim()).FirstOrDefault();
+                //删除数据
+                InspectionSummaryService.Delete(modelSum.CompileDateMonth);
+                BindGrid();
+                btnNew_Click();
+            }
+        }
+        public class ProjectIdAndDate {
+            public string ProjectId { get; set; }
+
+            public DateTime? Mdate { get; set; }
+        }
+
+        #region 生成按钮
+        protected void btnNew_Click()
+        {
+            if (string.IsNullOrEmpty(this.drpCompileDateMonth.Text.Trim()))
+            {
+                ShowNotify("日期不能为空。", MessageBoxIcon.Warning);
+                PageContext.RegisterStartupScript("CloseRefresh()");
+                return;
+            }
+
+            List allList = new List();
+            #region 生成操作
+            //1.获取项目
+            var SummeryResult = "0";
+            #region 先一步查询各个表的数据
+
+            var getPersonLists = (from x in Funs.DB.View_SitePerson_Person
+                                  select new
+                                  {
+                                      x.ProjectId
+                                  }).ToList();
+            //特种作业人员
+            var tzPersonList = (from x in Funs.DB.SitePerson_Person
+                                join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
+                                where y.PostType == Const.PostType_2 && x.OutTime == null
+                                select new { x.ProjectId, y.PostType }).ToList();
+
+            //移动端安全巡检
+            var list2 = Funs.DB.View_Hazard_HazardRegister.Select(x => new View_Hazard_HazardRegister
+            {
+                ProblemTypes = x.ProblemTypes,
+                ProjectId = x.ProjectId,
+                CheckTime=x.CheckTime
+            }).Where(x => x.ProblemTypes == "1").ToList();
+            //周例会
+            var list3 = Funs.DB.Meeting_WeekMeeting.Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.WeekMeetingDate }).ToList();
+            //月例会
+            var list4 = Funs.DB.Meeting_MonthMeeting.Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.MonthMeetingDate }).ToList();
+
+            //作业票
+            var list5 = Funs.DB.View_License_LicenseManager
+                .Select(x => new ProjectIdAndDate { ProjectId = x.ProjectId, Mdate = x.CompileDate })
+                .ToList();
+
+            //工程师日志
+            var list6 = (from x in Funs.DB.Manager_HSSELog
+                         where x.IsVisible !=false
+                         select new
+                         {
+                             x.ProjectId,
+                             x.CompileDate,
+                             x.IsVisible
+                         }).ToList();
+            //HSE管理月报
+            var list7 = Funs.DB.Manager_MonthReportC.Select(x=> new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.Months }).ToList();
+
+            //质量巡检
+            var list8 = Funs.DB.Check_CheckControl.Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.CheckDate }).ToList();
+
+            //设备材料报验
+            var list10 = Funs.DB.Comprehensive_InspectionEquipment.Select
+                (x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.InspectionDate }).ToList();
+
+            //人员报验
+            var list11 = Funs.DB.Comprehensive_InspectionPerson.
+                Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.ApprovalTime }).ToList();
+
+            //机具报验
+            var list13 = Funs.DB.Comprehensive_InspectionMachine
+                .Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.InspectionDate }).ToList();
+
+            //设计变更管理
+            var list14 = Funs.DB.Comprehensive_DesignChangeOrder
+                .Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.IssuedDate }).ToList();
+
+            //施工方案管理
+            var list15 = Funs.DB.Comprehensive_GeneralPlanApproval
+                .Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.ApprovalDate }).ToList();
+
+            //设计交底管理
+            var list16 = Funs.DB.Comprehensive_DesignDetails
+                .Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.DetailsDate }).ToList();
+
+            //NCR
+            var list17 = Funs.DB.Comprehensive_NCRManagement
+                .Select(x=>new ProjectIdAndDate { ProjectId=x.ProjectId, Mdate = x.IssuedDate }).ToList();
+
+            //质量周报
+            var list18 = (from x in Funs.DB.Report_WeekAndMonthReport
+                          where x.ReportType=="1"
+                          select new
+                          {
+                              x.ProjectId,
+                              x.EndDate,
+                              x.ReportType
+                          }).ToList();
+
+            //质量月报
+            var list19 = (from x in Funs.DB.Report_WeekAndMonthReport
+                          where x.ReportType == "2"
+                          select new
+                          {
+                              x.ProjectId,
+                              x.EndDate,
+                              x.ReportType
+                          }).ToList();
+
+            //一次共检合格数
+            var list20 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+                          join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
+                          where y.IsOnceQualified == true
+                          select new {  y.ProjectId,y.InspectionDate }).ToList();
+            ////总数
+            var list21 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
+                          join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
+                          
+                          select new {  y.ProjectId}).ToList();
+
+            //关键事项
+            var list22 = (from x in Funs.DB.GJSX
+                          select new
+                          {
+                              x.ProjectId,
+                              x.CreateDate
+                          }).ToList();
+
+            //人脸考勤
+            //var list23 = (from x in Funs.DB.T_d_facerecord
+            //              select new { x.ProjectId }).ToList();
+
+            //实名制是否启用
+            var list24 = (from x in Funs.DB.RealName_SynchroSet
+                          join y in Funs.DB.Base_Project on x.ProCode equals y.ProjectCode
+                          select new { y.ProjectId }).ToList();
+
+            #endregion
+            List listProjectid = new List();
+            var list = (from x in Funs.DB.Base_Project
+                        where x.ProjectState == Const.ProjectState_1 || x.ProjectState == null
+                        orderby x.ProjectCode
+                        select new
+                        {
+                            x.ProjectId,
+                            x.ProjectState,
+                            x.ProjectCode
+                        }).ToList();
+            //查询所有的projectid数据
+            for (int i = 0; i < list.Count; i++)
+            {
+                listProjectid.Add(list[i].ProjectId);
+            }
+            //wbs数据查询
+            var listWbs = Funs.DB.WBS_BreakdownProject.Select(x => new { ProjectId = x.ProjectId }).ToList();
+
+            using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+            {
+
+                for (int i = 0; i < list.Count; i++)
+                {
+                    var pid = list[i].ProjectId;
+                    #region 安全模块
+                    Inspection_Summary model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    //显示日期
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    //人员信息档案
+                    model.InspectionSummaryMbId = "1";
+                    model.SummeryResult = getPersonLists.Where(x => x.ProjectId == pid).ToList().Count().ToString();
+                    allList.Add(model);
+
+                    //特种作业人员
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "2";
+                    model.SummeryResult = tzPersonList.Where(x=>x.ProjectId==pid).Count().ToString();
+                    allList.Add(model);
+
+                    //安全巡检
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "3";
+                    var AqxjCount = list2.Where(x => x.ProjectId == pid).ToList().Count();
+                    model.SummeryResult = AqxjCount.ToString();
+                    //时间
+                    if (AqxjCount > 0)
+                    {
+                        model.CompileDate = list2.Where(x => x.ProjectId == pid).OrderByDescending(x=>x.CheckTime).FirstOrDefault().CheckTime;
+                    }
+                    
+                    allList.Add(model);
+
+
+                    //周例会
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDate = DateTime.Now;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "4";
+                    var ZlhCount = list3.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = ZlhCount.ToString();
+                    if (ZlhCount > 0)
+                    {
+                        //会议时间
+                        model.CompileDate = list3.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+
+                    //月例会
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "5";
+                    var YlhCount = list4.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = YlhCount.ToString();
+                    if (YlhCount > 0)
+                    {
+                        //会议时间
+                        model.CompileDate = list4.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate; 
+                    }
+                    
+                    allList.Add(model);
+
+                    //作业票
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "6";
+                    var ZypCount = list5.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = ZypCount.ToString();
+                    if (ZypCount>0)
+                    {
+                        //申请时间
+                        model.CompileDate = list5.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+                    
+                    //工作报告
+
+                    //工程师日志
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "7";
+                    var GcsrzCount = list6.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = GcsrzCount.ToString();
+                    if (GcsrzCount>0)
+                    {
+                        //日志时间
+                        model.CompileDate = list6.Where(x => x.ProjectId == pid).OrderByDescending(x => x.CompileDate).FirstOrDefault().CompileDate;
+                    }
+                    allList.Add(model);
+
+                    //HSE管理月报
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "8";
+                    var HsseGlybCount = list7.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = HsseGlybCount.ToString();
+                    if (HsseGlybCount>0)
+                    {
+                        var date = Convert.ToDateTime(list7.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().
+                            Mdate);
+                        date = date.AddDays(24);
+                        //月份(显示25号)
+                        model.CompileDate = date;
+                    }
+                    allList.Add(model);
+                    #endregion
+
+                    #region 质量模块
+
+                    //质量巡检
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDate = DateTime.Now;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "9";
+                    var ZlxjCount = list8.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = ZlxjCount.ToString();
+                    if (ZlxjCount>0)
+                    {
+                        //巡检日期
+                        model.CompileDate = list8.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate; 
+                    }
+                    allList.Add(model);
+
+                    //WBS数据
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "10";
+                    model.SummeryResult = listWbs.Where(x => x.ProjectId == pid).ToList().Count.ToString();
+                    allList.Add(model);
+
+                    //综合管理
+                    //设备材料报验
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "11";
+                    var SbclByCount = list10.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = SbclByCount.ToString();
+                    if (SbclByCount>0)
+                    {
+                        //报验日期
+                        model.CompileDate = list10.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+
+                    //人员报验
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "12";
+                    var RybyCount = list11.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = RybyCount.ToString();
+                    if (RybyCount>0)
+                    {
+                        //批准日期
+                        model.CompileDate = list11.Where(x => x.ProjectId == pid && x.Mdate != null).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    
+                    allList.Add(model);
+
+                    //机具报验
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "13";
+                    var JjbyCount = list13.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = JjbyCount.ToString();
+                    if (JjbyCount>0)
+                    {
+                        //报验日期
+                        model.CompileDate = list13.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+
+                    //设计变更单管理
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "14";
+                    var SjdbgCount = list14.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = SjdbgCount.ToString();
+                    if (SjdbgCount>0)
+                    {
+                        //下发日期
+                        model.CompileDate = list14.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+
+                    //施工方案管理
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "15";
+                    var SgfaCount = list15.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = SgfaCount.ToString();
+                    if (SgfaCount>0)
+                    {
+                        //审批日期
+                        model.CompileDate = list15.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+
+                    //设计交底管理
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "16";
+                    var SjjdCount = list16.Where(x => x.ProjectId == pid).ToList().Count; 
+                    model.SummeryResult = SjjdCount.ToString();
+                    if (SjjdCount>0)
+                    {
+                        //交底日期
+                        model.CompileDate = list16.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+
+                    //NCR
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "17";
+                    var NcrCount = list17.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = NcrCount.ToString();
+                    if (NcrCount>0)
+                    {
+                        //下发日期
+                        model.CompileDate = list17.Where(x => x.ProjectId == pid).OrderByDescending(x => x.Mdate).FirstOrDefault().Mdate;
+                    }
+                    allList.Add(model);
+
+                    //质量报表管理
+
+                    //质量周报
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "18";
+                    var SgzbCount = list18.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = SgzbCount.ToString();
+                    if (SgzbCount>0)
+                    {
+                        //StartDate,EndDate
+                        model.CompileDate = list18.Where(x => x.ProjectId == pid).OrderByDescending(x => x.EndDate).FirstOrDefault().EndDate;
+                    }
+                    allList.Add(model);
+
+                    //质量月报
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "19";
+                    var SgybCount = list19.Where(x => x.ProjectId == pid).ToList().Count;
+                    model.SummeryResult = SgybCount.ToString();
+                    if (SgybCount>0)
+                    {
+                        //StartDate,EndDate
+                        model.CompileDate = list19.Where(x => x.ProjectId == pid).OrderByDescending(x => x.EndDate).FirstOrDefault().EndDate;
+                    }
+                    allList.Add(model);
+
+                    //过程控制管理
+
+                    //一次共检合格数
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "20";
+                    var hgs = list20.Where(x=>x.ProjectId==pid).ToList().Count();
+                    if (hgs>0)
+                    {
+                        //验收日期
+                        model.CompileDate = list20.Where(x => x.ProjectId == pid).OrderByDescending(x => x.InspectionDate).FirstOrDefault().InspectionDate;
+                    }
+                    model.SummeryResult = hgs.ToString();
+                    allList.Add(model);
+
+                    //总数
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "21";
+                    var zs = list21.Where(x => x.ProjectId == pid).ToList().Count();
+                    model.SummeryResult = zs.ToString();
+                    allList.Add(model);
+
+                    //一次共检合格合格率
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "22";
+                    if (zs > 0)
+                    {
+                        model.SummeryResult = String.Format("{0:N2}", 100 * hgs / zs) + "%";
+                    }
+                    else
+                    {
+                        model.SummeryResult = "0%";
+                    }
+
+                    allList.Add(model);
+
+
+                    #endregion
+
+                    #region 关键事项
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "23";
+                    var GjsxCount = list22.Where(x => x.ProjectId == pid).ToList().Count();
+                    model.SummeryResult = GjsxCount.ToString();
+                    if (GjsxCount>0)
+                    {
+                        //提出日期
+                        model.CompileDate = list22.Where(x => x.ProjectId == pid).OrderByDescending(x => x.CreateDate).FirstOrDefault().CreateDate;
+                    }
+                    allList.Add(model);
+                    #endregion
+
+                    #region 现场考勤(是否对接)
+
+                    //人脸考勤
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "24";
+                    var Rykq =db.T_d_facerecord.Where(x => x.ProjectId == pid).FirstOrDefault();
+                    if (Rykq !=null)
+                    {
+                        model.SummeryResult = "已对接";
+                    }
+                    else {
+                        model.SummeryResult = "未对接";
+                    }
+                    
+                    allList.Add(model);
+
+                    //集团实名制对接
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "25";
+                    var Smz = list24.Where(x => x.ProjectId == pid).ToList().Count;
+                    if (Smz > 0)
+                    {
+                        model.SummeryResult = "已对接";
+                    }
+                    else
+                    {
+                        model.SummeryResult = "未对接";
+                    }
+                    allList.Add(model);
+                    #endregion
+
+                    #region 视频监控(是否对接)
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "26";
+                    model.SummeryResult = "";
+                    allList.Add(model);
+                    #endregion
+
+                    #region 项目看板(暂时不弄)
+                    model = new Inspection_Summary();
+                    model.ProjectId = pid;
+                    model.CompileDateMonth = this.drpCompileDateMonth.Text.Trim();
+                    model.InspectionSummaryId = Guid.NewGuid().ToString();
+                    model.InspectionSummaryMbId = "27";
+                    model.SummeryResult = "";
+                    allList.Add(model);
+                    #endregion
+
+
+                }
+            }
+            InspectionSummaryService.AddAll(allList);
+            #endregion
+
+
+
+            ShowNotify("生成成功!", MessageBoxIcon.Success);
+            BindGrid();
+            PageContext.RegisterStartupScript("CloseRefresh()");
+        }
+        #endregion
+
+        #region 查询事件
+        protected void btnSearch_Click(object sender, EventArgs e)
+        {
+            if (string.IsNullOrEmpty(this.drpCompileDateMonth.Text.Trim()))
+            {
+                ShowNotify("日期不能为空。", MessageBoxIcon.Warning);
+                PageContext.RegisterStartupScript("CloseRefresh()");
+                return;
+            }
+
+            //根据日期来加载 先判断有没有,没有则提示生成。
+            var count = Funs.DB.Inspection_Summary.Where(x => x.CompileDateMonth == this.drpCompileDateMonth.Text.Trim()).ToList().Count();
+            if (count == 0)
+            {
+                BindGrid();
+                ShowNotify("当前日期暂无数据,请点击生成。", MessageBoxIcon.Warning);
+                PageContext.RegisterStartupScript("CloseRefresh()");
+                return;
+            }
+            BindGrid();
+            PageContext.RegisterStartupScript("CloseRefresh()");
+        }
+        #endregion
+
+        #region 加载数据
+        private void BindGrid()
+        {
+            DataTable table = new DataTable();
+            table.Columns.Add(new DataColumn("SNumber", typeof(string)));
+            table.Columns.Add(new DataColumn("ModuleName", typeof(string)));
+            table.Columns.Add(new DataColumn("MenuP", typeof(string)));
+            table.Columns.Add(new DataColumn("MenuC", typeof(string)));
+            table.Columns.Add(new DataColumn("InspectionSummaryId", typeof(string)));
+            var list = Funs.DB.Base_Project.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).OrderBy(x => x.ProjectCode).ToList();
+            for (int i = 0; i < list.Count; i++)
+            {
+                //当前数值的列
+                table.Columns.Add(new DataColumn("ThisProject" + (i + 1).ToString(), typeof(string)));
+                //当前日期的列
+                table.Columns.Add(new DataColumn("CompileDate" + (i + 1).ToString(), typeof(string)));
+            }
+
+            DataRow row;
+            var SumModels = Funs.DB.Inspection_Summary.Where(x =>  x.CompileDateMonth == this.drpCompileDateMonth.Text.Trim()).FirstOrDefault();
+            if (SumModels == null)
+            {
+                table = null;
+                Grid1.DataSource = table;
+                Grid1.DataBind();
+                return;
+            }
+            else {
+                using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+                {
+                    //首先获取模板表
+                    var mbList = db.Inspection_SummaryMb.OrderBy(x => x.SortId).ToList();
+                    for (int i = 0; i < mbList.Count; i++)
+                    {
+                        row = table.NewRow();
+                        row[0] = mbList[i].SNumber;
+                        row[1] = mbList[i].ModuleName;
+                        row[2] = mbList[i].MenuP;
+                        row[3] = mbList[i].MenuC;
+                        row[4] = Guid.NewGuid().ToString();
+                        int indexMb = 5;
+                        //开始获取每列项目的数据
+                        for (int k = 0; k < list.Count; k++)
+                        {
+                            var SumModel = db.Inspection_Summary.Where(x => x.ProjectId == list[k].ProjectId
+                            && x.InspectionSummaryMbId == mbList[i].InspectionSummaryMbId
+                            && x.CompileDateMonth == this.drpCompileDateMonth.Text.Trim()).FirstOrDefault();
+                            row[indexMb] = SumModel.SummeryResult;
+                            indexMb += 1;
+                            row[indexMb] = SumModel.CompileDate.ToString().Split(' ')[0].Replace('/','-');
+                            indexMb += 1;
+                        }
+
+                        table.Rows.Add(row);
+                    }
+                }
+            }
+
+            Grid1.DataSource = table;
+            Grid1.DataBind();
+
+        }
+        #endregion
+
+        #region 导出excel
+        protected void btnOut_Click(object sender, EventArgs e)
+        {
+            Response.ClearContent();
+            var FileName = "各项目巡查汇总(" + this.drpCompileDateMonth.Text.Trim() + ")";
+            Response.AddHeader("content-disposition", "attachment; filename="+ FileName + ".xls");
+            Response.ContentType = "application/vnd.ms-excel";
+            Response.ContentEncoding = System.Text.Encoding.UTF8;
+            Response.Write(GetGridTableHtml(Grid1));
+            Response.End();
+        }
+
+
+        #endregion
+
+        /// 
+        /// 格式化html
+        /// 
+        /// 
+        /// 
+        private string GetGridTableHtml(Grid grid)
+        {
+            StringBuilder sb = new StringBuilder();
+
+            MultiHeaderTable mht = new MultiHeaderTable();
+            mht.ResolveMultiHeaderTable(Grid1.Columns);
+
+
+            sb.Append("");
+
+
+            sb.Append("");
+
+            ////列数
+            //var rowCount = "";
+            //var list = Funs.DB.Base_Project.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).OrderBy(x => x.ProjectCode).ToList();
+            //for (int i = 0; i < list.Count; i++)
+            //{
+            //    rowCount+="{}"
+            //}
+
+                foreach (List
");
+
+            return sb.ToString();
+        }
+
+
+        public static string MidStrEx(string sourse, string startstr, string endstr)
+        {
+            string result = string.Empty;
+            int startindex, endindex;
+            try
+            {
+                startindex = sourse.IndexOf(startstr);
+                if (startindex == -1)
+                    return result;
+                string tmpstr = sourse.Substring(startindex + startstr.Length);
+                endindex = tmpstr.IndexOf(endstr);
+                if (endindex == -1)
+                    return result;
+                result = tmpstr.Remove(endindex);
+            }
+            catch (Exception ex)
+            {
+                
+            }
+            return result;
+        }
+
+
+        #region 多表头处理
+
+        /// 
+        /// 处理多表头的类
+        /// 
+        public class MultiHeaderTable
+        {
+            // 包含 rowspan,colspan 的多表头,方便生成 HTML 的 table 标签
+            public List> MultiTable = new List>();
+            // 最终渲染的列数组
+            public List Columns = new List();
+
+
+            public void ResolveMultiHeaderTable(GridColumnCollection columns)
+            {
+                List