From adedb7e83d8725b20a533dda8f6f3db9b80cd3d4 Mon Sep 17 00:00:00 2001
From: gaofei1985 <181547018@qq.com>
Date: Fri, 6 Mar 2026 17:58:48 +0800
Subject: [PATCH] 1
---
DataBase/版本日志/SGGLDB_V2026-02-02-lpf.sql | 106 +
DataBase/版本日志/SGGLDB_V2026-02-06-geh.sql | 23 +
.../SGGLDB_V2026-02-06-xiaj(SP_DataIdMove).sql | 59 +
DataBase/版本日志/SGGLDB_V2026-02-09-lpf.sql | 17 +
.../SGGLDB_V2026-02-09-xiaj(DataIdMove).sql | 21 +
.../SGGLDB_V2026-02-10-xiaj(SP_DataIdMove).sql | 58 +
DataBase/版本日志/SGGLDB_V2026-02-13-xiaj.sql | 101 +
DataBase/版本日志/SGGLDB_V2026-02-26-gf.sql | 4 +
DataBase/版本日志/SGGLDB_V2026-02-27-geh.sql | 95 +
...2026-03-01-xiaj(View_CheckSpecialDetail).sql | 88 +
...-03-03-xiaj(View_License_LicenseManager).sql | 59 +
DataBase/版本日志/SGGLDB_V2026-03-04-geh.sql | 44 +
SGGL/BLL/BLL.csproj | 10 +
.../BLL/BaseInfo/SuperviseCheckTypeService.cs | 19 +
SGGL/BLL/Common/Const.cs | 53 +-
SGGL/BLL/Common/DataCleanupMergeHelper.cs | 71 +
SGGL/BLL/DataShare/APIDataShareSyncService.cs | 615 +++++
.../HSSE/APICheckSpecialSyncService.cs | 537 +++++
.../HSSE/APIHazardRegisterSyncService.cs | 468 ++++
.../DataShare/HSSE/APILicenseSyncService.cs | 265 +++
.../DataShare/HSSE/APIMeetingSyncService.cs | 277 +++
.../DataShare/HSSE/APIPersonSyncService.cs | 575 +++++
.../HSSE/QualityAudit/PersonQualityService.cs | 10 +
.../Solution/TemporaryElectricityService.cs | 72 +
SGGL/BLL/OpenService/FileInsertService.cs | 161 +-
SGGL/BLL/Person/Person_PersonsService.cs | 85 +
SGGL/BLL/ProjectData/ProjectService.cs | 55 +
SGGL/BLL/SQLHelper.cs | 34 +
SGGL/BLL/SysManage/UnitService.cs | 185 ++
.../UnitHazardRegisterItemService.cs | 338 +++
.../Supervise/UnitHazardRegisterService.cs | 301 +++
SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx | 6 +
SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.cs | 18 +
.../BaseInfo/WorkPost.aspx.designer.cs | 96 +-
.../BaseInfo/WorkPostCleanupMerge.aspx | 161 ++
.../BaseInfo/WorkPostCleanupMerge.aspx.cs | 276 +++
.../WorkPostCleanupMerge.aspx.designer.cs | 224 ++
.../Excel/DataIn/专项检查明细导入模板.xls | Bin 0 -> 19456 bytes
SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 72 +
.../HSSE/Check/CheckSpecial.aspx | 2 +
.../HSSE/Check/CheckSpecial.aspx.cs | 13 +
.../HSSE/Check/CheckSpecial.aspx.designer.cs | 9 +
.../HiddenRectificationList.aspx | 15 +-
.../HiddenRectificationList.aspx.designer.cs | 9 +
.../HSSE/License/LicenseManager.aspx | 14 +
.../HSSE/License/LicenseManager.aspx.cs | 15 +-
.../License/LicenseManager.aspx.designer.cs | 18 +
.../HSSE/License/LicenseManagerEdit.aspx | 3 +
.../HSSE/License/LicenseManagerEdit.aspx.cs | 20 +
.../LicenseManagerEdit.aspx.designer.cs | 9 +
.../HSSE/License/LicenseManagerView.aspx | 3 +
.../HSSE/License/LicenseManagerView.aspx.cs | 13 +
.../LicenseManagerView.aspx.designer.cs | 9 +
.../HSSE/Meeting/ClassMeeting.aspx | 9 +
.../HSSE/Meeting/ClassMeeting.aspx.cs | 34 +-
.../Meeting/ClassMeeting.aspx.designer.cs | 9 +
.../HSSE/Meeting/ClassMeetingEdit.aspx.cs | 6 +
.../HSSE/Solution/TemporaryElectricity.aspx | 127 +
.../Solution/TemporaryElectricity.aspx.cs | 240 ++
.../TemporaryElectricity.aspx.designer.cs | 197 ++
.../Solution/TemporaryElectricityEdit.aspx | 102 +
.../Solution/TemporaryElectricityEdit.aspx.cs | 119 +
.../TemporaryElectricityEdit.aspx.designer.cs | 188 ++
.../Solution/TemporaryElectricityView.aspx | 100 +
.../Solution/TemporaryElectricityView.aspx.cs | 78 +
.../TemporaryElectricityView.aspx.designer.cs | 179 ++
SGGL/FineUIPro.Web/SysManage/Unit.aspx | 4 +-
SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs | 19 +
.../SysManage/Unit.aspx.designer.cs | 9 +
.../SysManage/UnitCleanupMerge.aspx | 151 ++
.../SysManage/UnitCleanupMerge.aspx.cs | 299 +++
.../UnitCleanupMerge.aspx.designer.cs | 224 ++
.../ZHGL/Supervise/UnitHazardRegister.aspx | 122 +
.../ZHGL/Supervise/UnitHazardRegister.aspx.cs | 166 ++
.../UnitHazardRegister.aspx.designer.cs | 170 ++
.../Supervise/UnitHazardRegisterEdit.aspx | 169 ++
.../Supervise/UnitHazardRegisterEdit.aspx.cs | 425 ++++
.../UnitHazardRegisterEdit.aspx.designer.cs | 287 +++
.../Supervise/UnitHazardRegisterRecord.aspx | 225 ++
.../UnitHazardRegisterRecord.aspx.cs | 285 +++
.../UnitHazardRegisterRecord.aspx.designer.cs | 242 ++
.../UnitHazardRegisterRecordEdit.aspx | 113 +
.../UnitHazardRegisterRecordEdit.aspx.cs | 255 ++
...tHazardRegisterRecordEdit.aspx.designer.cs | 215 ++
.../APIItem/DataShare/CheckSpecialSyncData.cs | 97 +
.../APIItem/DataShare/ClassMeetingData.cs | 93 +
.../DataShare/HazardRegisterSyncData.cs | 89 +
.../APIItem/DataShare/LicenseManagerData.cs | 94 +
.../Model/APIItem/DataShare/PersonSyncData.cs | 118 +
SGGL/Model/Model.cs | 2113 +++++++++++++++--
SGGL/Model/Model.csproj | 9 +
SGGL/Model/ZHGL/UnitHazardRegisterInput.cs | 30 +
.../Model/ZHGL/UnitHazardRegisterItemInput.cs | 63 +
.../ZHGL/UnitHazardRegisterItemOutput.cs | 96 +
SGGL/Model/ZHGL/UnitHazardRegisterOutput.cs | 75 +
.../HSSE/CheckSpecialSyncController.cs | 119 +
.../HSSE/HazardRegisterSyncController.cs | 119 +
.../DataShare/HSSE/LicenseSyncController.cs | 64 +
.../DataShare/HSSE/MeetingSyncController.cs | 64 +
.../DataShare/HSSE/PersonSyncController.cs | 120 +
SGGL/WebAPI/Filter/TestPermissionAttribute.cs | 15 +-
SGGL/WebAPI/WebAPI.csproj | 5 +
102 files changed, 13691 insertions(+), 271 deletions(-)
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-02-lpf.sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-06-geh.sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-06-xiaj(SP_DataIdMove).sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-09-lpf.sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-09-xiaj(DataIdMove).sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-10-xiaj(SP_DataIdMove).sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-13-xiaj.sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-26-gf.sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-02-27-geh.sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-03-01-xiaj(View_CheckSpecialDetail).sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-03-03-xiaj(View_License_LicenseManager).sql
create mode 100644 DataBase/版本日志/SGGLDB_V2026-03-04-geh.sql
create mode 100644 SGGL/BLL/Common/DataCleanupMergeHelper.cs
create mode 100644 SGGL/BLL/DataShare/APIDataShareSyncService.cs
create mode 100644 SGGL/BLL/DataShare/HSSE/APICheckSpecialSyncService.cs
create mode 100644 SGGL/BLL/DataShare/HSSE/APIHazardRegisterSyncService.cs
create mode 100644 SGGL/BLL/DataShare/HSSE/APILicenseSyncService.cs
create mode 100644 SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs
create mode 100644 SGGL/BLL/DataShare/HSSE/APIPersonSyncService.cs
create mode 100644 SGGL/BLL/HSSE/Solution/TemporaryElectricityService.cs
create mode 100644 SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterItemService.cs
create mode 100644 SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterService.cs
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/WorkPostCleanupMerge.aspx
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/WorkPostCleanupMerge.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/BaseInfo/WorkPostCleanupMerge.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/File/Excel/DataIn/专项检查明细导入模板.xls
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx
create mode 100644 SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.designer.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.designer.cs
create mode 100644 SGGL/Model/APIItem/DataShare/CheckSpecialSyncData.cs
create mode 100644 SGGL/Model/APIItem/DataShare/ClassMeetingData.cs
create mode 100644 SGGL/Model/APIItem/DataShare/HazardRegisterSyncData.cs
create mode 100644 SGGL/Model/APIItem/DataShare/LicenseManagerData.cs
create mode 100644 SGGL/Model/APIItem/DataShare/PersonSyncData.cs
create mode 100644 SGGL/Model/ZHGL/UnitHazardRegisterInput.cs
create mode 100644 SGGL/Model/ZHGL/UnitHazardRegisterItemInput.cs
create mode 100644 SGGL/Model/ZHGL/UnitHazardRegisterItemOutput.cs
create mode 100644 SGGL/Model/ZHGL/UnitHazardRegisterOutput.cs
create mode 100644 SGGL/WebAPI/Controllers/DataShare/HSSE/CheckSpecialSyncController.cs
create mode 100644 SGGL/WebAPI/Controllers/DataShare/HSSE/HazardRegisterSyncController.cs
create mode 100644 SGGL/WebAPI/Controllers/DataShare/HSSE/LicenseSyncController.cs
create mode 100644 SGGL/WebAPI/Controllers/DataShare/HSSE/MeetingSyncController.cs
create mode 100644 SGGL/WebAPI/Controllers/DataShare/HSSE/PersonSyncController.cs
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-02-lpf.sql b/DataBase/版本日志/SGGLDB_V2026-02-02-lpf.sql
new file mode 100644
index 00000000..7c0b1920
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-02-lpf.sql
@@ -0,0 +1,106 @@
+-- auto-generated definition
+create table dbo.Supervise_UnitHazardRegister
+(
+ UnitHazardRegisterId nvarchar(50) not null
+ primary key,
+ UnitHazardRegisterCode nvarchar(50) not null,
+ CheckDate datetime,
+ CheckMainType nvarchar(2),
+ CheckType nvarchar(50),
+ ProjectId nvarchar(50)
+ constraint FK_UnitHazardRegister_Project
+ references dbo.Base_Project,
+ UnitId nvarchar(50)
+ constraint FK_UnitHazardRegister_Unit
+ references dbo.Base_Unit,
+ CheckObjectId nvarchar(200),
+ CheckUnitId nvarchar(50)
+ constraint FK_UnitHazardRegister_CheckUnit
+ references dbo.Base_Unit,
+ CheckTeam nvarchar(200),
+ CheckManIds nvarchar(max),
+ CheckManNames nvarchar(max),
+ EvaluationResult nvarchar(max),
+ AttachUrl nvarchar(2000),
+ States int default 0,
+ CompileMan nvarchar(50),
+ CreateDate datetime,
+ UpdateDate datetime,
+ IsUpdate bit
+)
+go
+
+create index IX_UnitHazardRegister_CheckDate
+ on dbo.Supervise_UnitHazardRegister (CheckDate desc)
+go
+
+create index IX_UnitHazardRegister_CheckMainType
+ on dbo.Supervise_UnitHazardRegister (CheckMainType)
+go
+
+create index IX_UnitHazardRegister_ProjectId
+ on dbo.Supervise_UnitHazardRegister (ProjectId)
+go
+
+-- auto-generated definition
+create table dbo.Supervise_UnitHazardRegisterItem
+(
+ UnitHazardRegisterItemId nvarchar(50) not null
+ primary key,
+ UnitHazardRegisterId nvarchar(50) not null
+ constraint FK_UnitHazardRegisterItem_Register
+ references dbo.Supervise_UnitHazardRegister
+ on delete cascade,
+ ProblemDescription nvarchar(max),
+ ProblemType nvarchar(50),
+ RiskLevel nvarchar(50),
+ RectifyRequirement nvarchar(max),
+ CompleteStatus int default 0,
+ CompletedDate datetime,
+ SortIndex int default 0,
+ RectificationMeasures nvarchar(100),
+ IsUpdate bit
+)
+go
+
+create index IX_UnitHazardRegisterItem_RegisterId
+ on dbo.Supervise_UnitHazardRegisterItem (UnitHazardRegisterId)
+go
+
+
+INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
+VALUES (N'C46C007E-A100-4A52-9317-3B885442E130', N'ҵȫ', null, N'/ZHGL/Supervise/UnitHazardRegister.aspx?type=0', 40, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Hsse_S_Hsse', 1, 1, 1);
+go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'D15F74F2-CD1A-4F45-9501-DF00ED845730', N'C46C007E-A100-4A52-9317-3B885442E130', N'', 2);
+ go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'A2CCDFF7-9593-4BCB-9425-769C99F8EFEE', N'C46C007E-A100-4A52-9317-3B885442E130', N'ɾ', 3);
+ go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'435F26E9-232F-4CAA-835F-CAF41DA2B175', N'C46C007E-A100-4A52-9317-3B885442E130', N'', 4);
+ go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'B822D703-CFE3-422A-88F3-67B26B0A255A', N'C46C007E-A100-4A52-9317-3B885442E130', N'', 1);
+
+go
+INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
+VALUES (N'73283863-CF67-44CA-9DF8-67071734A528', N'ҵȫ¼', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=0', 45, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Hsse_S_Hsse', 1, 1, 1);
+
+INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
+VALUES (N'73283863-CF67-44CA-9DF8-67071734A528', N'ҵȫ¼', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=0', 10, N'467A0CB9-737D-4451-965E-869EBC3A4BD6', N'Menu_System_Hsse_P_Hsse', 1, 1, 1);
+
+go
+INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
+VALUES (N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'ҵ', null, N'/ZHGL/Supervise/UnitHazardRegister.aspx?type=1', 40, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Qwms_S_Cqms', 1, 1, 1);
+go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'B980C835-B079-4485-AE0E-EE721C191470', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'', 2);
+ go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'9BABA2CE-2593-422A-A792-80E826D164AB', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'ɾ', 3);
+ go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'5C9AF2B1-4AF0-4F16-BC5D-154055A6BF8F', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'', 4);
+ go
+ INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'E3CD6629-9B4B-4B26-A24B-97F9F3E4428F', N'FDA7722C-383E-4BB1-B29D-BB0BF87AA942', N'', 1);
+go
+INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
+VALUES (N'15511354-9822-4A21-AB24-2483D889FDB8', N'ҵ¼', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=1', 45, N'CD9FC4C8-4B02-4619-8B02-50DA6AE6146E', N'Menu_System_Qwms_S_Cqms', 1, 1, 1);
+go
+INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
+VALUES (N'15511354-9822-4A21-AB24-2483D889FDB8', N'ҵ¼', null, N'/ZHGL/Supervise/UnitHazardRegisterRecord.aspx?type=1', 10, N'A54EC449-5F77-4068-83B9-AA305B721A0B', N'Menu_System_Qwms_P_Cqms', 1, 1, 1);
+go
\ No newline at end of file
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-06-geh.sql b/DataBase/版本日志/SGGLDB_V2026-02-06-geh.sql
new file mode 100644
index 00000000..3e6c0a34
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-06-geh.sql
@@ -0,0 +1,23 @@
+
+
+-- 总包单位
+alter table Base_Project add SubjectUnit nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL;
+-- 总包单位下项目id
+alter table Base_Project add SubjectProject nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL;
+GO
+
+--数据来源
+alter table HSSE_Hazard_HazardRegister add DataSource char(1) COLLATE Chinese_PRC_CI_AS NULL;
+EXEC sp_addextendedproperty
+'MS_Description', N'数据来源(1总包,0本单位)',
+'SCHEMA', N'dbo',
+'TABLE', N'HSSE_Hazard_HazardRegister',
+'COLUMN', N'DataSource'
+GO
+
+
+
+--定制版需要根据具体的菜单名称进行修改为"安全健康检查"
+update [dbo].[Sys_Menu] set MenuName = '安全健康检查' WHERE MenuName = '安全健康日常巡检' and IsUsed = '1'
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-06-xiaj(SP_DataIdMove).sql b/DataBase/版本日志/SGGLDB_V2026-02-06-xiaj(SP_DataIdMove).sql
new file mode 100644
index 00000000..1ffaaae1
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-06-xiaj(SP_DataIdMove).sql
@@ -0,0 +1,59 @@
+
+
+/****** Object: StoredProcedure [dbo].[SP_DataIdMove] Script Date: 2026-2-6 17:34:01 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+
+
+CREATE PROC [dbo].[SP_DataIdMove]
+ @exTable NVARCHAR(50) = NULL ,
+ @colums NVARCHAR(50) = NULL ,
+ @trueId NVARCHAR(50) = NULL
+ --,@returnVal int output
+AS
+
+BEGIN
+--DECLARE @returnVal int =0
+--SET @returnVal = 0
+DECLARE @OldId nvarchar(50),@NewId nvarchar(50)
+DECLARE @tablename nvarchar(1000),@columnname nvarchar(1000)
+DECLARE @sql nvarchar(2000)
+DECLARE cursor_Id CURSOR FOR -- 定义游标
+ SELECT OldId ,NewIds FROM DataIdMove WHERE ColumType = @colums and NewIds = @trueId
+ OPEN cursor_Id
+ FETCH NEXT FROM cursor_Id INTO @OldId, @NewId -- 抓取下一行游标数据
+ WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
+ BEGIN
+ --SET @returnVal=@returnVal+1
+ --print @OldId
+ DECLARE cursor_name CURSOR FOR -- 定义游标
+ SELECT DISTINCT TABLE_NAME,COLUMN_NAME
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE COLUMN_NAME like '%'+@colums+'%' and TABLE_NAME in (SELECT distinct TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE') and TABLE_NAME <> @exTable
+ OPEN cursor_name -- 打开游标
+ FETCH NEXT FROM cursor_name INTO @tablename ,@columnname -- 抓取下一行游标数据
+ WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
+ BEGIN
+ SET @sql = 'update ' + @tablename + ' set ' + @columnname + ' =REPLACE('+@columnname+', '''+@OldId+''', '''+@NewId+''') where '+ @columnname + ' like '+'''%'+@OldId+'%'';' ;
+ --print @sql
+ EXEC sp_executesql @sql
+ FETCH NEXT FROM cursor_name INTO @tablename,@columnname;
+ END
+ CLOSE cursor_name -- 关闭游标
+ DEALLOCATE cursor_name -- 释放游标
+ FETCH NEXT FROM cursor_Id INTO @OldId, @NewId
+ END
+CLOSE cursor_Id -- 关闭游标
+DEALLOCATE cursor_Id -- 释放游标
+--SELECT @returnVal
+END
+
+
+
+GO
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-09-lpf.sql b/DataBase/版本日志/SGGLDB_V2026-02-09-lpf.sql
new file mode 100644
index 00000000..4ce60bbe
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-09-lpf.sql
@@ -0,0 +1,17 @@
+alter table dbo.Supervise_UnitHazardRegister
+ add InsResponsibleUserId nvarchar(50)
+go
+
+exec sp_addextendedproperty 'MS_Description', N'受检责任人', 'SCHEMA', 'dbo', 'TABLE', 'Supervise_UnitHazardRegister',
+ 'COLUMN', 'InsResponsibleUserId'
+go
+alter table dbo.Supervise_UnitHazardRegister
+ drop constraint FK_UnitHazardRegister_Unit
+go
+alter table dbo.Supervise_UnitHazardRegister
+ drop column UnitId
+go
+
+alter table dbo.Supervise_UnitHazardRegister
+ drop column CheckObjectId
+go
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-09-xiaj(DataIdMove).sql b/DataBase/版本日志/SGGLDB_V2026-02-09-xiaj(DataIdMove).sql
new file mode 100644
index 00000000..2fe54de6
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-09-xiaj(DataIdMove).sql
@@ -0,0 +1,21 @@
+
+
+IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DataIdMove') AND type = N'U')
+BEGIN
+CREATE TABLE [dbo].[DataIdMove](
+ [OldId] [nvarchar](50) NOT NULL,
+ [NewIds] [nvarchar](50) NULL,
+ [ColumType] [nvarchar](50) NULL,
+ CONSTRAINT [PK_DataIdMove] PRIMARY KEY CLUSTERED
+(
+ [OldId] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY]
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'OldId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove', @level2type=N'COLUMN',@level2name=N'OldId'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'NewIds' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove', @level2type=N'COLUMN',@level2name=N'NewIds'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ColumType' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove', @level2type=N'COLUMN',@level2name=N'ColumType'
+
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'滻ݱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataIdMove'
+END
+
+GO
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-10-xiaj(SP_DataIdMove).sql b/DataBase/版本日志/SGGLDB_V2026-02-10-xiaj(SP_DataIdMove).sql
new file mode 100644
index 00000000..c716098d
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-10-xiaj(SP_DataIdMove).sql
@@ -0,0 +1,58 @@
+
+/****** Object: StoredProcedure [dbo].[SP_DataIdMove] Script Date: 2026-2-6 17:14:03 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+
+
+ALTER PROC [dbo].[SP_DataIdMove]
+ @exTable NVARCHAR(50) = NULL ,
+ @colums NVARCHAR(50) = NULL ,
+ @trueId NVARCHAR(50) = NULL
+ --,@returnVal int output
+AS
+
+BEGIN
+--DECLARE @returnVal int =0
+--SET @returnVal = 0
+DECLARE @OldId nvarchar(50),@NewId nvarchar(50)
+DECLARE @tablename nvarchar(1000),@columnname nvarchar(1000)
+DECLARE @sql nvarchar(2000)
+DECLARE cursor_Id CURSOR FOR -- 定义游标
+ SELECT OldId ,NewIds FROM DataIdMove WHERE ColumType = @colums and NewIds = @trueId
+ OPEN cursor_Id
+ FETCH NEXT FROM cursor_Id INTO @OldId, @NewId -- 抓取下一行游标数据
+ WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
+ BEGIN
+ --SET @returnVal=@returnVal+1
+ --print @OldId
+ DECLARE cursor_name CURSOR FOR -- 定义游标
+ SELECT DISTINCT TABLE_NAME,COLUMN_NAME
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE COLUMN_NAME like '%'+@colums+'%' and TABLE_NAME in (SELECT distinct TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE') and TABLE_NAME <> @exTable
+ OPEN cursor_name -- 打开游标
+ FETCH NEXT FROM cursor_name INTO @tablename ,@columnname -- 抓取下一行游标数据
+ WHILE @@FETCH_STATUS = 0 --(-1 语句失败, -2 被提取行不存在)
+ BEGIN
+ SET @sql = 'update ' + @tablename + ' set ' + @columnname + ' =REPLACE('+@columnname+', '''+@OldId+''', '''+@NewId+''') where '+ @columnname + ' like '+'''%'+@OldId+'%'';' ;
+ --print @sql
+ EXEC sp_executesql @sql
+ FETCH NEXT FROM cursor_name INTO @tablename,@columnname;
+ END
+ CLOSE cursor_name -- 关闭游标
+ DEALLOCATE cursor_name -- 释放游标
+ FETCH NEXT FROM cursor_Id INTO @OldId, @NewId
+ END
+CLOSE cursor_Id -- 关闭游标
+DEALLOCATE cursor_Id -- 释放游标
+--SELECT @returnVal
+END
+
+
+
+GO
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-13-xiaj.sql b/DataBase/版本日志/SGGLDB_V2026-02-13-xiaj.sql
new file mode 100644
index 00000000..7630a2a4
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-13-xiaj.sql
@@ -0,0 +1,101 @@
+
+
+--ǰᲹֶ
+IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Meeting_ClassMeeting' AND COLUMN_NAME = 'Remark')
+BEGIN
+ ALTER TABLE Meeting_ClassMeeting ADD Remark nvarchar(500);
+END
+GO
+
+
+--˵ȫ-ʱõ緽
+--ע⣺˵λøݶƵλṹá廷ʩ(Menu_HSSE)桿
+ IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '09B2A0A6-A693-4F1D-A4F5-D5DEA803D771')
+BEGIN
+INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
+VALUES (N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'ʱõ緽', N'HSSE/Solution/TemporaryElectricity.aspx', 40, ˵λ, ˵, 0,1, 1);
+END
+
+--ȫ-ʱõ緽
+IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Solution_TemporaryElectricity') AND type = N'U')
+BEGIN
+
+CREATE TABLE [dbo].[Solution_TemporaryElectricity](
+ [TemporaryElectricityId] [nvarchar](50) NOT NULL,
+ [ProjectId] [nvarchar](50) NULL,
+ [Code] [nvarchar](100) NULL,
+ [Name] [nvarchar](200) NULL,
+ [Content] [nvarchar](2000) NULL,
+ [Remark] [nvarchar](500) NULL,
+ [CompileMan] [nvarchar](50) NULL,
+ [CompileDate] [datetime] NULL,
+ CONSTRAINT [PK_Solution_TemporaryElectricity] PRIMARY KEY CLUSTERED
+(
+ [TemporaryElectricityId] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY]
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'TemporaryElectricityId'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ŀid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'ProjectId'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Code'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Name'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Content'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Remark'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'CompileMan'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'CompileDate'
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱõ緽' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity'
+
+END
+
+GO
+
+update Sys_Menu set MenuName='ʱõ緽'
+WHERE MenuId = '09B2A0A6-A693-4F1D-A4F5-D5DEA803D771'
+update Sys_Menu set MenuName='ʱõ緽'
+WHERE MenuId = 'B04483D5-4421-4046-8B1A-E97589952150'
+
+GO
+
+--ʱõ緽ֶ
+IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Solution_TemporaryElectricity' AND COLUMN_NAME = 'Remark')
+BEGIN
+ ALTER TABLE Solution_TemporaryElectricity ADD Content nvarchar(2000);
+ ALTER TABLE Solution_TemporaryElectricity ADD Remark nvarchar(500);
+ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Content'
+ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Solution_TemporaryElectricity', @level2type=N'COLUMN',@level2name=N'Remark'
+END
+GO
+
+--ȫ-ʱõť
+IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '09B2A0A6-A693-4F1D-A4F5-D5DEA803D771')
+BEGIN
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
+VALUES (N'A633C879-BE46-4D2B-BAC3-9A656396AD53', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'', 1);
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
+VALUES (N'3C001F6B-428B-4BDC-8913-FD00CAC63C64', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'', 2);
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
+VALUES (N'E510ABD6-50B2-4685-8DB8-E362B88E8F9E', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'ɾ', 3);
+INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
+VALUES (N'9552542D-879F-49A7-BB33-7F1B54D9658F', N'09B2A0A6-A693-4F1D-A4F5-D5DEA803D771', N'', 4);
+END
+GO
+
+
+
+
+----˵ñű䴦
+--IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ID = '28BF7713-44E7-43C1-B24A-7342CDD561A7')
+--BEGIN
+-- INSERT INTO dbo.Sys_Const (ID, ConstValue, ConstText, SortIndex, GroupId, Remark)
+-- VALUES (N'28BF7713-44E7-43C1-B24A-7342CDD561A7', N'System_Qwms', N'뺸ӹϵͳ', 2, N'SystemClassification', null);
+--END
+
+--GO
+
+--IF NOT EXISTS (SELECT * FROM Sys_Const WHERE ID = '5823ADE9-302E-4402-BA6E-80F440BF184E')
+--BEGIN
+-- INSERT INTO dbo.Sys_Const (ID, ConstValue, ConstText, SortIndex, GroupId, Remark)
+-- VALUES (N'5823ADE9-302E-4402-BA6E-80F440BF184E', N'System_Hsse', N'ȫְҵϵͳ', 1, N'SystemClassification', null);
+--END
+--GO
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-26-gf.sql b/DataBase/版本日志/SGGLDB_V2026-02-26-gf.sql
new file mode 100644
index 00000000..33e107f0
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-26-gf.sql
@@ -0,0 +1,4 @@
+alter table SitePerson_Person add IsSyncWelder bit null
+GO
+alter table BS_Welder add PersonId nvarchar(50) null
+GO
diff --git a/DataBase/版本日志/SGGLDB_V2026-02-27-geh.sql b/DataBase/版本日志/SGGLDB_V2026-02-27-geh.sql
new file mode 100644
index 00000000..35bfe845
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-02-27-geh.sql
@@ -0,0 +1,95 @@
+
+
+---修改安全检查视图(添加数据来源字段Registration.DataSource)
+ALTER VIEW [dbo].[View_Hazard_HazardRegister] AS
+SELECT Registration.HazardRegisterId,
+ Registration.HazardCode,
+ Registration.RegisterDate,
+ Registration.RegisterDef,
+ Registration.Rectification,
+ Registration.Place,
+ Registration.ResponsibleUnit,
+ Registration.Observer,
+ Registration.HazardValue,
+ case when Registration.HazardValue='3' then '重大' else '一般' end as Risk_Level,
+ Registration.RectifiedDate,
+ Registration.ProjectId,
+ Project.UnitId AS PUnitId,
+ Project.ProjectState as ProjectState,
+ null as isDelete,
+ ProjectUnit.UnitName AS PUnitName,
+ case when ProjectUnit.UnitId='d72a27c9-4ba9-41c5-ab0b-c010409f20f2' then 1 else 0 end as IsThisUnit,
+ ProjectUnit.IsBranch as IsBranch,
+ Project.ProjectAddress,
+ Registration.states,
+ Registration.IsEffective,
+ Registration.ResponsibleMan,
+ Registration.CheckManId,
+ Registration.CheckTime,
+ Registration.RectificationPeriod,
+ Registration.ImageUrl,
+ Registration.RectificationImageUrl,
+ Registration.RectificationTime,
+ Registration.ConfirmMan,
+ Registration.ConfirmDate,
+ Registration.HandleIdea,
+ Registration.CutPayment,
+ Registration.ProblemTypes,
+ Registration.CheckSpecialId,
+ Registration.CheckItemDetailId,
+ Registration.SupCheckItemSetId,
+ Registration.CheckItemSetId,
+ Registration.SafeSupervisionId,
+ Registration.SafeSupervisionIsOK,
+ Registration.WorkPackageId,
+ Registration.WorkPackageName,
+ Registration.IsUpdate,
+ Project.ProjectName,
+ Registration.CheckCycle,
+ ISNULL(WorkArea.UnitWorkName,'') AS WorkAreaName,
+ Unit.UnitName as ResponsibilityUnitName,
+ Unit.CollCropCode as ResponsibilityUnitCollCropCode,
+ User1.PersonName AS ResponsibilityManName,
+ ISNULL(User1.Telephone,'') AS ResponsibilityManTel,
+ User2.PersonName AS CheckManName,
+ ISNULL(User2.Telephone,'') AS CheckManTel,
+ User2.UnitId AS SendUnitId,
+ User3.PersonName AS ConfirmManName,
+ ISNULL(User3.Telephone,'') AS ConfirmManTel,
+ User4.PersonName AS ResponsibilityManName2,
+ CCManNames = STUFF(( SELECT ',' + PersonName FROM Person_Persons
+ where PATINDEX('%,' + RTRIM(Person_Persons.PersonId) + ',%',',' + Registration.CCManIds + ',')>0
+ ORDER BY PATINDEX('%,' + RTRIM(Registration.CCManIds) + ',%',',' + Registration.CCManIds + ',')
+ FOR XML PATH('')), 1, 1,''),
+ ISNULL(User4.Telephone,'') AS ResponsibilityMan2Tel,
+ (CASE WHEN Registration.states='1' and (Registration.SafeSupervisionIsOK is null OR Registration.SafeSupervisionIsOK=0) THEN '待整改'
+ WHEN Registration.states='1' and Registration.SafeSupervisionIsOK=1 THEN '合格'
+ WHEN Registration.states='2' THEN '已整改-待复查验收'
+ WHEN Registration.states='3' THEN '已闭环'
+ ELSE '已作废' END ) AS StatesStr,
+ RegisterTypes.RegisterTypesId,
+ RegisterTypes.RegisterTypesName,
+ Registration.DIC_ID,
+ Registration.CCManIds,
+ Registration.DataSource,
+ Registration.RegisterTypes2Id ,
+ RegisterTypes2.RegisterTypesName as RegisterTypes2Name,
+ Registration.RegisterTypes3Id ,
+ RegisterTypes3.RegisterTypesName as RegisterTypes3Name,
+ Registration.RegisterTypes4Id ,
+ RegisterTypes4.RegisterTypesName as RegisterTypes4Name,
+ Registration.Requirements
+FROM dbo.HSSE_Hazard_HazardRegister AS Registration
+LEFT JOIN dbo.Base_Project AS Project ON Project.ProjectId = Registration.ProjectId
+LEFT JOIN dbo.Base_Unit AS ProjectUnit ON Project.UnitId = ProjectUnit.UnitId
+LEFT JOIN dbo.WBS_UnitWork AS WorkArea ON WorkArea.UnitWorkId = Registration.Place
+LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes ON RegisterTypes.RegisterTypesId = Registration.RegisterTypesId
+LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes2 ON RegisterTypes2.RegisterTypesId = Registration.RegisterTypes2Id
+LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes3 ON RegisterTypes3.RegisterTypesId = Registration.RegisterTypes3Id
+LEFT JOIN dbo.HSSE_Hazard_HazardRegisterTypes AS RegisterTypes4 ON RegisterTypes4.RegisterTypesId = Registration.RegisterTypes4Id
+LEFT JOIN dbo.Base_Unit AS Unit ON Unit.UnitId = Registration.ResponsibleUnit
+LEFT JOIN dbo.Person_Persons AS User1 ON User1.PersonId = Registration.ResponsibleMan
+LEFT JOIN dbo.Person_Persons AS User2 ON User2.PersonId = Registration.CheckManId
+LEFT JOIN dbo.Person_Persons AS User3 ON User3.PersonId = Registration.ConfirmMan
+LEFT JOIN dbo.Person_Persons AS User4 ON User4.PersonId = Registration.ResponsibleMan2
+go
diff --git a/DataBase/版本日志/SGGLDB_V2026-03-01-xiaj(View_CheckSpecialDetail).sql b/DataBase/版本日志/SGGLDB_V2026-03-01-xiaj(View_CheckSpecialDetail).sql
new file mode 100644
index 00000000..723b1601
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-03-01-xiaj(View_CheckSpecialDetail).sql
@@ -0,0 +1,88 @@
+
+update Check_CheckSpecialDetail
+set HiddenHazardType=1
+where HiddenHazardType='0' or HiddenHazardType='' or HiddenHazardType='һ' or HiddenHazardType='' or HiddenHazardType is null
+
+go
+update Check_CheckSpecialDetail
+set HiddenHazardType=2
+where HiddenHazardType='ϴ' or HiddenHazardType='ϸ'
+
+go
+update Check_CheckSpecialDetail
+set HiddenHazardType=3
+where HiddenHazardType='' or HiddenHazardType='ش'
+
+go
+
+
+
+ALTER VIEW [dbo].[View_CheckSpecialDetail]
+ AS
+/*רϸбͼ*/
+SELECT detail.CheckSpecialDetailId,
+ detail.CheckSpecialId,
+ detail.CheckItem,
+ checkItemSet.RegisterTypesName as CheckItemName,
+ --detail.CheckItemType,
+ detail.Unqualified,
+ detail.SortIndex,
+ detail.UnitId,
+ detail.HandleStep,
+ detail.CompleteStatus,
+ (case when detail.CompleteStatus =1 then '' else '' end) as CompleteStatusName,
+ detail.LimitedDate,
+ detail.CompletedDate,
+ --detail.Suggestions,
+ detail.CheckContent,
+ detail.CheckArea,
+ '' as HandleWay,
+ detail.Suggestions,
+ detail.HandleStep as RectifyOpinion,
+ 'd72a27c9-4ba9-41c5-ab0b-c010409f20f2' as ProposeUnitId,
+ workArea.UnitWorkName + (CASE WHEN workArea.ProjectType ='1' THEN '()'
+ WHEN workArea.ProjectType ='2' THEN '(װ)' ELSE '' END)AS CheckAreaName,
+ detail.DataId,
+ detail.DataType,
+ unit.UnitName,
+ dbo.GetConstTextByIds(detail.HandleStep) as HandleStepStr,
+ --const.ConstText as HandleStepStr,
+ (CASE WHEN detail.DataType like '%1%'
+ THEN '·ĵ:'+(SELECT RectifyNoticesCode FROM Check_RectifyNotices WHERE detail.DataId like '%'+RectifyNoticesId+'%')
+ else '' end)+
+ (CASE WHEN detail.DataType like '%2%'
+ THEN '·:'+(SELECT PunishNoticeCode FROM Check_PunishNotice WHERE detail.DataId like '%'+PunishNoticeId+'%')
+ else '' end)+
+ (CASE WHEN detail.DataType = '3'
+ THEN '·ͣ:'+(SELECT PauseNoticeCode FROM Check_PauseNotice WHERE detail.DataId like '%'+ PauseNoticeId+'%')
+ else '' end) AS HandleStepLink
+ ,
+ --(case when detail.riskLevel ='0' then ''
+ -- when detail.riskLevel = '1' then 'һ'
+ -- when detail.riskLevel = '2' then 'ϸ'
+ -- when detail.riskLevel = '3' then ''
+ -- else detail.riskLevel end) as riskLevel,
+ (case when detail.HiddenHazardType = '1' then 'һ'
+ when detail.HiddenHazardType = '2' then 'ϸ'
+ when detail.HiddenHazardType = '3' then ''
+ else 'һ' end) as riskLevel,
+ --sysuser.PersonName as HSEManage
+ '' as HSEManage
+ ,(CASE WHEN detail.HiddenHazardType='3' THEN 'ش'
+ WHEN detail.HiddenHazardType='2' THEN 'ϴ'
+ WHEN detail.HiddenHazardType='1' THEN 'һ' ELSE '' END) AS HiddenHazardTypeName
+FROM dbo.Check_CheckSpecialDetail AS detail
+LEFT JOIN dbo. HSSE_Hazard_HazardRegisterTypes AS checkItemSet ON checkItemSet.RegisterTypesId=detail.CheckItem
+LEFT JOIN dbo.Base_Unit AS unit ON unit.UnitId=detail.UnitId
+LEFT JOIN dbo.WBS_UnitWork AS workArea ON detail.CheckArea=workArea.UnitWorkId
+--LEFT JOIN dbo.Person_Persons AS sysuser ON sysuser.PersonId=detail.HSEManage
+
+
+
+
+
+
+
+GO
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2026-03-03-xiaj(View_License_LicenseManager).sql b/DataBase/版本日志/SGGLDB_V2026-03-03-xiaj(View_License_LicenseManager).sql
new file mode 100644
index 00000000..57940902
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-03-03-xiaj(View_License_LicenseManager).sql
@@ -0,0 +1,59 @@
+
+
+--ҵƱ岹ֶΣԴ˵
+IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'License_LicenseManager' AND COLUMN_NAME = 'SourceDes')
+BEGIN
+ ALTER TABLE License_LicenseManager ADD SourceDes nvarchar(500);
+END
+GO
+
+-- ͼ
+ALTER VIEW [dbo].[View_License_LicenseManager] AS SELECT LicenseManager.LicenseManagerId,
+ LicenseManager.ProjectId,
+ LicenseManager.LicenseTypeId,
+ LicenseManager.LicenseManagerCode,
+ LicenseManager.LicenseManageName,
+ LicenseManager.UnitId,
+ LicenseManager.LicenseManageContents,
+ LicenseManager.CompileMan,
+ LicenseManager.CompileDate,
+ LicenseManager.States,
+ Project.ProjectCode,
+ Project.ProjectName,
+ LicenseType.LicenseTypeName,
+ Unit.UnitName,
+ UnitType.UnitTypeId,
+ UnitType.UnitTypeName,
+ Users.PersonName as UserName,
+ LicenseManager.WorkAreaId,
+ --WorkArea.WorkAreaName,
+ LicenseManager.StartDate,
+ LicenseManager.EndDate,
+ LicenseManager.ApplicantMan,
+ LicenseManager.IsHighRisk,
+ LicenseManager.WorkStates,
+ LicenseManager.IsUpdate,
+ --LicenseManager.SourceDes,
+ --LicenseManager.LicenseCodes,
+ '' as SourceDes,
+ '' as LicenseCodes,
+ case LicenseManager.WorkStates when '1' then ''
+ when '2' then 'ҵ'
+ when '3' then 'ѹر'
+ when '-1' then 'ȡ'
+ else '' end as WorkStatesStr,
+ WorkAreaName = STUFF(( SELECT ',' + UnitWorkName FROM WBS_UnitWork
+ where PATINDEX('%,' + RTRIM(WBS_UnitWork.UnitWorkId) + ',%',',' + LicenseManager.WorkAreaId + ',')>0
+ ORDER BY PATINDEX('%,' + RTRIM(LicenseManager.WorkAreaId) + ',%',',' + LicenseManager.WorkAreaId + ',')
+ FOR XML PATH('')), 1, 1,'')
+FROM dbo.License_LicenseManager AS LicenseManager
+LEFT JOIN dbo.Base_Project AS Project ON Project.ProjectId = LicenseManager.ProjectId
+LEFT JOIN dbo.Base_LicenseType AS LicenseType ON LicenseType.LicenseTypeId = LicenseManager.LicenseTypeId
+LEFT JOIN dbo.Base_Unit AS Unit ON Unit.UnitId = LicenseManager.UnitId
+LEFT JOIN dbo.Person_Persons AS Users ON Users.PersonId = LicenseManager.CompileMan
+LEFT JOIN dbo.WBS_UnitWork AS WorkArea ON WorkArea.UnitWorkId = LicenseManager.WorkAreaId
+LEFT JOIN dbo.Base_UnitType as UnitType ON UnitType.UnitTypeId=Unit.UnitTypeId
+
+GO
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2026-03-04-geh.sql b/DataBase/版本日志/SGGLDB_V2026-03-04-geh.sql
new file mode 100644
index 00000000..f94acf65
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-03-04-geh.sql
@@ -0,0 +1,44 @@
+
+
+
+--企业大检查移到督查管理下
+update Sys_Menu set MenuType = 'Menu_System_Hsse_S_DCGL' where MenuId ='CD9FC4C8-4B02-4619-8B02-50DA6AE6146E' and MenuType = 'Menu_System_Hsse_S_Hsse';
+
+
+--企业大检查下面的企业安全检查,企业安全检查记录也移到督查管理下
+update Sys_Menu set MenuType = 'Menu_System_Hsse_S_DCGL' where MenuId ='73283863-CF67-44CA-9DF8-67071734A528' and MenuType = 'Menu_System_Hsse_S_Hsse';
+update Sys_Menu set MenuType = 'Menu_System_Hsse_S_DCGL' where MenuId ='C46C007E-A100-4A52-9317-3B885442E130' and MenuType = 'Menu_System_Hsse_S_Hsse';
+
+
+
+--隐藏掉原来的安全监督检查报告
+update Sys_Menu set IsUsed = '0' where MenuId ='40387C48-95A0-435C-82FB-57AF0A81B9D4' and MenuType = 'Menu_System_Hsse_S_Hsse';
+
+--隐藏原来的安全监督检查整改
+update Sys_Menu set IsUsed = '0' where MenuId ='A02E0365-383C-49A0-BF1A-B3E42052959B' and MenuType = 'Menu_System_Hsse_S_Hsse';
+
+
+
+--隐藏问题类别定义
+update Sys_Menu set IsUsed = '0' where MenuId ='3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B';
+
+--隐藏执业资格证书定义
+update Sys_Menu set IsUsed = '0' where MenuId ='1390195D8-874B-4E7B-8DBF-D81A5984E973'
+
+
+--隐藏合同设置
+update Sys_Menu set IsUsed = '0' where MenuId ='24A40837-0756-49B0-8B3C-EFB8A9879336';
+
+
+
+--隐藏作业人员角色定义
+update Sys_Menu set IsUsed = '0' where MenuId ='4AEA28ED-327C-4A8F-977D-BB56F423CEA4';
+
+--隐藏管理人员角色定义
+update Sys_Menu set IsUsed = '0' where MenuId ='145523FE-B49A-4420-9DFB-565A79F4AF36';
+
+
+
+--隐藏质量月
+update Sys_Menu set IsUsed = '0' where MenuId ='B6A867A0-3EBB-4EFC-8BCC-050816547BBE' and MenuType = 'Menu_System_Hsse_P_Hsse';
+update Sys_Menu set IsUsed = '0' where MenuId ='ED3846F3-B677-4958-A85C-BF235909B071' and MenuType = 'Menu_System_Hsse_S_Hsse';
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 84946509..e18e1ef9 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -276,7 +276,14 @@
+
+
+
+
+
+
+
@@ -580,6 +587,7 @@
+
@@ -833,6 +841,8 @@
+
+
diff --git a/SGGL/BLL/BaseInfo/SuperviseCheckTypeService.cs b/SGGL/BLL/BaseInfo/SuperviseCheckTypeService.cs
index 364c4e93..0e2f774f 100644
--- a/SGGL/BLL/BaseInfo/SuperviseCheckTypeService.cs
+++ b/SGGL/BLL/BaseInfo/SuperviseCheckTypeService.cs
@@ -100,5 +100,24 @@ namespace BLL
Funs.FineUIPleaseSelect(dropName);
}
}
+
+ ///
+ /// 根据检查大类和检查类别代码获取检查类别名称
+ ///
+ /// 检查大类(0=安全,1=质量)
+ /// 检查类别代码
+ /// 检查类别名称
+ public static string GetCheckTypeName(string checkMainType, string checkTypeCode)
+ {
+ if (string.IsNullOrEmpty(checkMainType) || string.IsNullOrEmpty(checkTypeCode))
+ {
+ return string.Empty;
+ }
+
+ var checkType = Funs.DB.Base_SuperviseCheckType
+ .FirstOrDefault(x => x.CheckMainType == checkMainType && x.CheckTypeCode == checkTypeCode);
+
+ return checkType?.CheckTypeName ?? string.Empty;
+ }
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 12317853..69c18f9f 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -1601,18 +1601,6 @@ namespace BLL
#endregion
- #region 企业安全大检查
- ///
- /// 安全监督检查报告
- ///
- public const string SuperviseCheckReportMenuId = "40387C48-95A0-435C-82FB-57AF0A81B9D4";
-
- ///
- /// 安全监督检查整改
- ///
- public const string SuperviseCheckRectifyMenuId = "55976B16-2C33-406E-B514-2FE42D031071";
- #endregion
-
#region 集团安全监督
///
/// 企业上报监督检查报告
@@ -3354,6 +3342,10 @@ namespace BLL
///
public const string CheckSpecialTemplateUrl = "File\\Excel\\DataIn\\专项检查导入模板.xls";
///
+ /// 专项检查明细导入模板
+ ///
+ public const string CheckSpecialDetailTemplateUrl = "File\\Excel\\DataIn\\专项检查明细导入模板.xls";
+ ///
/// 综合检查导入模板
///
public const string CheckColligationTemplateUrl = "File\\Excel\\DataIn\\综合检查导入模板.xls";
@@ -5280,5 +5272,42 @@ namespace BLL
/// 重点工程项目质量专项整治行动开展情况台账
///
public const string DCGLKeyProjectRectificationSituationLedgerMenuId = "35BA8E89-4575-4A3F-9C22-98B323E67DA1";
+
+ ///
+ /// 临时用电
+ ///
+ public const string ProjectTemporaryElectricityListMenuId = "09B2A0A6-A693-4F1D-A4F5-D5DEA803D771";
+
+ #region 企业安全大检查
+ ///
+ /// 安全监督检查报告
+ ///
+ public const string SuperviseCheckReportMenuId = "40387C48-95A0-435C-82FB-57AF0A81B9D4";
+
+ ///
+ /// 安全监督检查整改
+ ///
+ public const string SuperviseCheckRectifyMenuId = "A02E0365-383C-49A0-BF1A-B3E42052959B";
+
+
+ ///
+ /// 企业安全检查菜单ID
+ ///
+ public const string UnitHazardRegisterMenu_Safety = "C46C007E-A100-4A52-9317-3B885442E130";
+ ///
+ /// 企业质量检查菜单ID
+ ///
+ public const string UnitHazardRegisterMenu_Quality = "FDA7722C-383E-4BB1-B29D-BB0BF87AA942";
+ ///
+ /// 企业安全检查菜单记录ID
+ ///
+ public const string UnitHazardRegisterMenuRecord_Safety = "73283863-CF67-44CA-9DF8-67071734A528";
+
+ ///
+ /// 企业质量检查菜单记录ID
+ ///
+ public const string UnitHazardRegisterMenuRecord_Quality = "15511354-9822-4A21-AB24-2483D889FDB8";
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/Common/DataCleanupMergeHelper.cs b/SGGL/BLL/Common/DataCleanupMergeHelper.cs
new file mode 100644
index 00000000..e6b9185a
--- /dev/null
+++ b/SGGL/BLL/Common/DataCleanupMergeHelper.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 数据合并清理
+ ///
+ public class DataCleanupMergeHelper
+ {
+ ///
+ /// 数据合并清理
+ ///
+ /// 排除操作数据表
+ /// 替换字段(模糊匹配)
+ /// 需要替换的数据值
+ /// 新的字段数据值
+ ///
+ public static bool DataCleanupMerge(string exTable, string columType, List mergeDataIds, string dataId, ref string msg)
+ {
+ bool result = false;
+ try
+ {
+ Model.SGGLDB db = Funs.DB;
+ var clist = db.DataIdMove.Where(x => x.ColumType == columType && x.NewIds == dataId).ToList();
+ db.DataIdMove.DeleteAllOnSubmit(clist);
+ db.SubmitChanges();
+ List list = new List();
+ foreach (var mergeId in mergeDataIds)
+ {
+ list.Add(new Model.DataIdMove { OldId = mergeId.Trim(), NewIds = dataId.Trim(), ColumType = columType });
+ }
+
+ db.DataIdMove.InsertAllOnSubmit(list);
+ db.SubmitChanges();
+
+
+ //SP_DataIdMove[排除操作数据表,替换字段(模糊匹配),字段数据值]
+ string strSql = $"exec SP_DataIdMove '{exTable}','{columType}','{dataId}'";
+ result = BLL.SQLHelper.ExecuteSql(strSql);
+
+ //SqlParameter[] parameters = {
+ // new SqlParameter("@exTable", exTable),
+ // new SqlParameter("@colums", columType),
+ // new SqlParameter("@trueId", dataId),
+ // new SqlParameter("@returnVal", SqlDbType.Int)
+ //};
+ //BLL.SQLHelper.ExecuteNonQueryStoredProcedure("SP_DataIdMove", parameters);
+ //int succ = BLL.SQLHelper.ExecuteProcedure("SP_DataIdMove", parameters);
+ //Thread.Sleep(30000); // 等待30秒,30000毫秒等于30秒
+ if (result)
+ {
+ db.DataIdMove.DeleteAllOnSubmit(list);
+ db.SubmitChanges();
+ msg = "数据合并成功!";
+ }
+ else
+ {
+ msg = "数据合并失败,请稍后再试!";
+ }
+ }
+ catch (Exception ex)
+ {
+ msg = ex.Message;
+ result = false;
+ }
+ return result;
+ }
+ }
+}
diff --git a/SGGL/BLL/DataShare/APIDataShareSyncService.cs b/SGGL/BLL/DataShare/APIDataShareSyncService.cs
new file mode 100644
index 00000000..50aaa97a
--- /dev/null
+++ b/SGGL/BLL/DataShare/APIDataShareSyncService.cs
@@ -0,0 +1,615 @@
+using System.Linq;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
+using System.Net.Http;
+using System.Threading.Tasks;
+
+
+namespace BLL
+{
+ ///
+ /// 数据共享互通辅助服务
+ ///
+ public class APIDataShareSyncService
+ {
+ #region 班组
+
+ ///
+ /// 获取班组Id
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string GetTeamGroupId(string TeamGroupName, string projectId, string unitId)
+ {
+ string TeamGroupId = null;
+ if (!string.IsNullOrEmpty(TeamGroupName))
+ {
+ var tg = Funs.DB.ProjectData_TeamGroup.Where(x =>
+ x.TeamGroupName == TeamGroupName && x.ProjectId == projectId && x.UnitId == unitId).ToList();
+ if (tg.Count == 0)
+ {
+ Model.ProjectData_TeamGroup newTeamGroup = new Model.ProjectData_TeamGroup
+ {
+ TeamGroupId = SQLHelper.GetNewID(typeof(Model.ProjectData_TeamGroup)),
+ ProjectId = projectId,
+ UnitId = unitId,
+ TeamGroupName = TeamGroupName,
+ Remark = "分包数据同步导入"
+ };
+ TeamGroupService.AddTeamGroup(newTeamGroup);
+ TeamGroupId = newTeamGroup.TeamGroupId;
+ }
+ else
+ {
+ TeamGroupId = tg.FirstOrDefault().TeamGroupId;
+ }
+ }
+
+ return TeamGroupId;
+ }
+
+ #endregion
+
+ #region 作业票许可证类型
+
+ ///
+ /// 获取作业票许可证类型Id
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string GetLicenseTypeId(string LicenseTypeId, string LicenseTypeCode, string LicenseTypeName)
+ {
+ string Id = null;
+ if (!string.IsNullOrEmpty(LicenseTypeName))
+ {
+ var obj = Funs.DB.Base_LicenseType.Where(x => x.LicenseTypeName == LicenseTypeName).ToList();
+ if (obj.Count == 0)
+ {
+ string newId = LicenseTypeId;
+ var type = Funs.DB.Base_LicenseType.Where(x => x.LicenseTypeId == LicenseTypeId).FirstOrDefault();
+ if (type == null)
+ {
+ newId = SQLHelper.GetNewID(typeof(Model.Base_LicenseType));
+ }
+ Model.Base_LicenseType newModel = new Model.Base_LicenseType
+ {
+ LicenseTypeId = newId,
+ LicenseTypeCode = LicenseTypeCode,
+ LicenseTypeName = LicenseTypeName,
+ Remark = "分包数据同步导入"
+ };
+ LicenseTypeService.AddLicenseType(newModel);
+ Id = newId;
+ }
+ else
+ {
+ Id = obj.FirstOrDefault().LicenseTypeId;
+ }
+ }
+ return Id;
+ }
+
+ #endregion
+
+
+ #region 获取作业区域
+
+ ///
+ /// 作业区域
+ ///
+ ///
+ ///
+ ///
+ public static string getUnitWorkId(string UnitWorkName, string projectId)
+ {
+ string UnitWorkId = null;
+ if (!string.IsNullOrEmpty(UnitWorkName))
+ {
+ var uw = Funs.DB.WBS_UnitWork.Where(x =>
+ x.UnitWorkName == UnitWorkName && x.ProjectId == projectId && x.SuperUnitWork == null).ToList();
+ if (uw.Count == 0)
+ {
+ Model.WBS_UnitWork newUnitWork = new Model.WBS_UnitWork
+ {
+ UnitWorkId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork)),
+ ProjectId = projectId,
+ UnitWorkName = UnitWorkName,
+ };
+ UnitWorkService.AddUnitWork(newUnitWork);
+ UnitWorkId = newUnitWork.UnitWorkId;
+ }
+ else
+ {
+ UnitWorkId = uw.FirstOrDefault().UnitWorkId;
+ }
+ }
+ return UnitWorkId;
+ }
+
+
+ #endregion
+
+ #region 获取系统用户
+
+ ///
+ /// 获取系统用户
+ ///
+ ///
+ ///
+ public static string getUserId(string userName)
+ {
+ string UserId = null;
+ if (!string.IsNullOrEmpty(userName))
+ {
+ var u = Funs.DB.Person_Persons.Where(x =>
+ x.PersonName == userName).ToList();
+ if (u.Count == 0)
+ {
+ Model.Person_Persons newUser = new Model.Person_Persons
+ {
+ PersonId = SQLHelper.GetNewID(typeof(Model.Person_Persons)),
+ PersonName = userName,
+ // Remark = "导入",
+ };
+ Person_PersonsService.AddPerson(newUser);
+ UserId = newUser.PersonId;
+ }
+ else
+ {
+ UserId = u.FirstOrDefault().PersonId;
+ }
+ }
+
+ return UserId;
+ }
+
+
+ #endregion
+
+
+ #region 获取检查类别
+
+ ///
+ /// 获取检查类别
+ ///
+ ///
+ ///
+ public static string getCheckItemSetId(string checkItemName)
+ {
+ string CheckItemSetId = null;
+ if (!string.IsNullOrEmpty(checkItemName))
+ {
+ var cis = Funs.DB.Technique_CheckItemSet.Where(x =>
+ x.CheckItemName == checkItemName && x.CheckType == "2").ToList();
+ if (cis.Count == 0)
+ {
+ Model.Technique_CheckItemSet newCheckItemSet = new Model.Technique_CheckItemSet
+ {
+ CheckItemSetId = SQLHelper.GetNewID(typeof(Model.Technique_CheckItemSet)),
+ CheckItemName = checkItemName,
+ SupCheckItem = "0",
+ CheckType = "2",
+ };
+ Technique_CheckItemSetService.AddCheckItemSet(newCheckItemSet);
+ CheckItemSetId = newCheckItemSet.CheckItemSetId;
+ }
+ else
+ {
+ CheckItemSetId = cis.FirstOrDefault().CheckItemSetId;
+ }
+ }
+
+ return CheckItemSetId;
+ }
+
+
+ #endregion
+
+
+ #region 获取巡检问题类型
+
+ ///
+ /// 获取巡检问题类型
+ ///
+ ///
+ ///
+ public static string getRegisterTypesId(string RegisterTypesName)
+ {
+
+ string RegisterTypesId = null;
+ if (!string.IsNullOrEmpty(RegisterTypesName))
+ {
+ var ht = Funs.DB.HSSE_Hazard_HazardRegisterTypes.Where(x =>
+ x.RegisterTypesName == RegisterTypesName && x.HazardRegisterType == "1").ToList();
+ if (ht.Count == 0)
+ {
+ Model.HSSE_Hazard_HazardRegisterTypes newHazardRegisterTypes = new Model.HSSE_Hazard_HazardRegisterTypes
+ {
+ RegisterTypesId = SQLHelper.GetNewID(typeof(Model.HSSE_Hazard_HazardRegisterTypes)),
+ RegisterTypesName = RegisterTypesName,
+ HazardRegisterType = "1",
+ Remark = "导入",
+ };
+ HSSE_Hazard_HazardRegisterTypesService.AddHazardRegisterTypes(newHazardRegisterTypes);
+ RegisterTypesId = newHazardRegisterTypes.RegisterTypesId;
+ }
+ else
+ {
+ RegisterTypesId = ht.FirstOrDefault().RegisterTypesId;
+ }
+ }
+ return RegisterTypesId;
+ }
+
+
+ #endregion
+
+
+ #region 获取特岗证书
+
+ ///
+ /// 特岗证书
+ ///
+ ///
+ ///
+ public static Model.CertificateItem GetPersonQualityByPersonId(string personId)
+ {
+
+ Model.CertificateItem item = new Model.CertificateItem();
+ var personQuality = PersonQualityService.GetPersonQualityByPersonId(personId);
+ if (personQuality != null)
+ {
+ item.PersonQualityId = personQuality.PersonQualityId;//主键
+ item.CertificateId = personQuality.CertificateId;
+ item.CertificateName = personQuality.CertificateName;
+ item.CertificateNo = personQuality.CertificateNo;
+ item.CertificateLimitDate = personQuality.LimitDate;
+ }
+ return item;
+ }
+
+ #endregion
+
+
+ #region 保存或修改特岗证书数据
+
+ public static void ProcessPersonQualityData(Model.CertificateItem item, string personId)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ if (item == null)
+ {
+ return;
+ }
+ if (!string.IsNullOrEmpty(item.CertificateId))
+ {
+ var personQuality = BLL.PersonQualityService.GetPersonQualityByPersonId(personId);
+ var certificate =
+ db.Base_Certificate.FirstOrDefault(e => e.CertificateId == item.CertificateId);
+ var CertificateId = string.Empty;
+ if (certificate != null)
+ {
+ CertificateId = certificate.CertificateId;
+ }
+ else
+ {
+ Model.Base_Certificate newCertificate = new Model.Base_Certificate
+ {
+ CertificateId = SQLHelper.GetNewID(typeof(Model.Base_Certificate)),
+ CertificateName = item.CertificateName,
+ Remark = "导入"
+ };
+ db.Base_Certificate.InsertOnSubmit(newCertificate);
+ db.SubmitChanges();
+ // BLL.CertificateService.AddCertificate(newCertificate);
+ CertificateId = newCertificate.CertificateId;
+ }
+
+ if (personQuality != null)
+ {
+ personQuality.CertificateId = CertificateId;
+ personQuality.CertificateName = item.CertificateName;
+ personQuality.CertificateNo = item.CertificateNo;
+ personQuality.LimitDate = item.CertificateLimitDate;
+
+ BLL.PersonQualityService.UpdatePersonQuality(personQuality);
+ }
+ else
+ {
+ Model.QualityAudit_PersonQuality newPersonQuality = new Model.QualityAudit_PersonQuality
+ {
+ PersonQualityId = SQLHelper.GetNewID(typeof(Model.QualityAudit_PersonQuality)),
+ PersonId = personId,
+ };
+ newPersonQuality.CertificateId = CertificateId;
+ newPersonQuality.CertificateName = item.CertificateName;
+ newPersonQuality.CertificateNo = item.CertificateNo;
+ newPersonQuality.LimitDate = item.CertificateLimitDate;
+ BLL.PersonQualityService.AddPersonQuality(newPersonQuality);
+ }
+ }
+ }
+ }
+
+ #endregion
+
+
+ #region 岗位
+
+ ///
+ /// 岗位
+ ///
+ ///
+ ///
+ public static string getWorkPostId(string WorkPostName, string PostType, string IsHsse, string IsCQMS)
+ {
+ string WorkPostId = null;
+ if (!string.IsNullOrEmpty(WorkPostName))
+ {
+ var wp = Funs.DB.Base_WorkPost.Where(x => x.WorkPostName == WorkPostName).ToList();
+ if (wp.Count == 0)
+ {
+ Model.Base_WorkPost newWorkPost = new Model.Base_WorkPost
+ {
+ WorkPostId = SQLHelper.GetNewID(typeof(Model.Base_WorkPost)),
+ WorkPostName = WorkPostName,
+ PostType = PostType,
+ IsHsse = Convert.ToBoolean(IsHsse),
+ IsCQMS = Convert.ToBoolean(IsCQMS),
+ Remark = "导入"
+ };
+ WorkPostService.AddWorkPost(newWorkPost);
+ WorkPostId = newWorkPost.WorkPostId;
+ }
+ else
+ {
+ WorkPostId = wp.FirstOrDefault().WorkPostId;
+ }
+ }
+
+ return WorkPostId;
+ }
+
+ #endregion
+
+ #region 单位工程
+
+ ///
+ /// 单位工程
+ ///
+ ///
+ ///
+ ///
+ public static string getWorkAreaId(string WorkAreaName, string projectId)
+ {
+ string WorkAreaId = null;
+ if (!string.IsNullOrEmpty(WorkAreaName))
+ {
+ var names = WorkAreaName.Split(',');
+ List workAreaIdList = new List();
+ foreach (var name in names)
+ {
+ var uw = Funs.DB.WBS_UnitWork.Where(x =>
+ x.UnitWorkName == name && x.ProjectId == projectId).ToList();
+ if (uw.Count == 0)
+ {
+ Model.WBS_UnitWork newUnitWork = new Model.WBS_UnitWork
+ {
+ UnitWorkId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork)),
+ ProjectId = projectId,
+ UnitWorkName = name,
+ };
+ UnitWorkService.AddUnitWork(newUnitWork);
+ workAreaIdList.Add(newUnitWork.UnitWorkId);
+ }
+ else
+ {
+ workAreaIdList.Add(uw.FirstOrDefault().UnitWorkId);
+ }
+ }
+
+ WorkAreaId = string.Join(",", workAreaIdList);
+ }
+
+ return WorkAreaId;
+ }
+
+ #endregion
+
+ #region 获取根据id获取单位工程名称
+
+ ///
+ /// 获取根据id获取单位工程名称
+ ///
+ ///
+ ///
+ ///
+ public static string GetWorkAreaNames(string WorkAreaId, string projectId)
+ {
+ string WorkAreaNames = string.Empty;
+ if (!string.IsNullOrEmpty(WorkAreaId))
+ {
+ var workAreas = WorkAreaId.Split(',');
+ //创建一个数组集合
+ List workAreaNameList = new List();
+ foreach (var workArea in workAreas)
+ {
+ var WorkAreaName = Funs.DB.WBS_UnitWork
+ .First(x => x.UnitWorkId == workArea && x.ProjectId == projectId)
+ .UnitWorkName;
+ workAreaNameList.Add(WorkAreaName);
+ }
+
+ WorkAreaNames = string.Join(",", workAreaNameList);
+ }
+
+ return WorkAreaNames;
+ }
+
+ #endregion
+
+ #region 根据地址获取base64的文件
+
+ public static async Task DownloadHeadImageAsync(string webUrl, string photoUrl)
+ {
+ byte[] b = null;
+ try
+ {
+ if (!string.IsNullOrEmpty(photoUrl))
+ {
+ string localRoot = ConfigurationManager.AppSettings["localRoot"]; // 物理路径
+ // 先下载到本地(异步等待完成)
+ DownloadAndSaveFileWithRetryAsync(webUrl, photoUrl, localRoot);
+ b = AttachFileService.SetImageToByteArray(localRoot + photoUrl.Split(',')[0]);
+ }
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+
+ return b;
+ }
+
+ #endregion
+
+ #region 向AttachFile文件表中添加或修改数据
+
+ public static async Task OperationAttachFile(string webUrl, string tokeyId, string menuId, string attachFileUrl)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ if (!string.IsNullOrEmpty(attachFileUrl))
+ {
+ string localRoot = ConfigurationManager.AppSettings["localRoot"]; //物理路径
+ //attachFileUrl可能是多个
+ string[] attachFileUrls = attachFileUrl.Split(',');
+
+ var attachFile = db.AttachFile.FirstOrDefault(x => x.ToKeyId == tokeyId && x.MenuId == menuId);
+ if (attachFile != null)
+ {
+ if (attachFile.AttachUrl != attachFileUrl)
+ {
+ string[] oldAttachFileUrls = attachFile.AttachUrl.Split(',');
+ foreach (var oldFileUrl in oldAttachFileUrls)
+ {
+ //删除之前的
+ UploadFileService.DeleteFile(localRoot, oldFileUrl);
+ }
+ foreach (var fileUrl in attachFileUrls)
+ {
+ DownloadAndSaveFileWithRetryAsync(webUrl, fileUrl, localRoot);
+ }
+ UploadFileService.SaveAttachUrl(
+ UploadFileService.GetSourceByAttachUrl(attachFileUrl, 10, null),
+ attachFileUrl, menuId, tokeyId);
+ }
+ }
+ else
+ {
+ foreach (var fileUrl in attachFileUrls)
+ {
+ DownloadAndSaveFileWithRetryAsync(webUrl, fileUrl, localRoot);
+ }
+ UploadFileService.SaveAttachUrl(
+ UploadFileService.GetSourceByAttachUrl(attachFileUrl, 10, null),
+ attachFileUrl, menuId, tokeyId);
+ }
+ }
+ }
+ }
+
+
+ public static async Task DownloadAndSaveFileAsync(string webUrl, string attachFileUrl, string localPath)
+ {
+ // 验证输入参数
+ if (string.IsNullOrEmpty(webUrl) || string.IsNullOrEmpty(attachFileUrl) || string.IsNullOrEmpty(localPath))
+ {
+ BLL.ErrLogInfo.WriteLog(
+ $"下载文件参数无效: webUrl={webUrl}, attachFileUrl={attachFileUrl}, localPath={localPath}");
+ return;
+ }
+ try
+ {
+ // 构造完整的远程文件 URL
+ string fullRemoteUrl = $"{webUrl.TrimEnd('/')}/{attachFileUrl.TrimStart('/')}";
+
+ // 构造本地文件路径
+ string localFilePath = Path.Combine(localPath, attachFileUrl);
+
+ // 确保本地目录存在
+ string directoryPath = Path.GetDirectoryName(localFilePath);
+ if (!string.IsNullOrEmpty(directoryPath) && !Directory.Exists(directoryPath))
+ {
+ Directory.CreateDirectory(directoryPath);
+ }
+
+ // 使用独立的HttpClient实例并配置不捕获同步上下文
+ using (var httpClient = new HttpClient())
+ {
+ // 设置合理的超时时间
+ httpClient.Timeout = TimeSpan.FromMinutes(3);
+
+ // 下载文件字节(使用ConfigureAwait(false)避免上下文问题)
+ byte[] fileBytes = await httpClient.GetByteArrayAsync(fullRemoteUrl).ConfigureAwait(false);
+
+ // 写入文件(同样使用ConfigureAwait(false))
+ await Task.Run(() => File.WriteAllBytes(localFilePath, fileBytes)).ConfigureAwait(false);
+ }
+
+ }
+ catch (HttpRequestException httpEx)
+ {
+ BLL.ErrLogInfo.WriteLog($"HTTP请求失败 - URL: {webUrl}/{attachFileUrl}", httpEx);
+ // 不抛出异常,让调用方继续处理
+ }
+ catch (DirectoryNotFoundException dirEx)
+ {
+ BLL.ErrLogInfo.WriteLog($"目录创建失败 - 路径: {localPath}", dirEx);
+ }
+ catch (UnauthorizedAccessException authEx)
+ {
+ BLL.ErrLogInfo.WriteLog($"文件访问权限不足 - 路径: {Path.Combine(localPath, attachFileUrl)}", authEx);
+ }
+ catch (Exception ex)
+ {
+ BLL.ErrLogInfo.WriteLog($"下载文件失败 - URL: {webUrl}/{attachFileUrl}", ex);
+ // 不重新抛出异常,避免中断整个流程
+ }
+ }
+
+ // 添加重试机制的下载方法
+ public static async Task DownloadAndSaveFileWithRetryAsync(string webUrl, string attachFileUrl,
+ string localPath, int maxRetries = 3)
+ {
+ for (int attempt = 0; attempt < maxRetries; attempt++)
+ {
+ try
+ {
+ await DownloadAndSaveFileAsync(webUrl, attachFileUrl, localPath);
+ return true; // 成功下载
+ }
+ catch (HttpRequestException)
+ {
+ if (attempt == maxRetries - 1)
+ {
+ BLL.ErrLogInfo.WriteLog($"下载失败,已重试{maxRetries}次 - URL: {webUrl}/{attachFileUrl}");
+ return false;
+ }
+
+ // 等待后重试
+ await Task.Delay(TimeSpan.FromSeconds(Math.Pow(2, attempt)));
+ }
+ }
+ return false;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/DataShare/HSSE/APICheckSpecialSyncService.cs b/SGGL/BLL/DataShare/HSSE/APICheckSpecialSyncService.cs
new file mode 100644
index 00000000..728cc9ef
--- /dev/null
+++ b/SGGL/BLL/DataShare/HSSE/APICheckSpecialSyncService.cs
@@ -0,0 +1,537 @@
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Configuration;
+using System.IO;
+using System.Net.Http;
+using System.Threading.Tasks;
+using Model;
+using Newtonsoft.Json;
+using RestSharp;
+using System.Net;
+
+
+namespace BLL
+{
+ public class APICheckSpecialSyncService
+ {
+ #region 根据项目、单位获取专项检查列表
+
+ public static List GetCheckSpecialLitsByprojectIdUnitId(string projectId,
+ string unitId, string dataId = "")
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var list = from x in db.Check_CheckSpecial where x.ProjectId == projectId select x;
+ if (!string.IsNullOrEmpty(unitId))
+ {
+ // 通过关联明细表来筛选包含指定单位的主表数据
+ var specialIdsWithUnit = (from detail in db.Check_CheckSpecialDetail
+ where detail.UnitId == unitId
+ select detail.CheckSpecialId).Distinct();
+
+ list = list.Where(x => specialIdsWithUnit.Contains(x.CheckSpecialId));
+ }
+
+ if (!string.IsNullOrEmpty(dataId))
+ {
+ list = list.Where(x => x.CheckSpecialId == dataId);
+ }
+
+ var dataList = (from x in list
+ join cis in db.Technique_CheckItemSet on x.CheckItemSetId equals cis.CheckItemSetId into cisTemp
+ from cis in cisTemp.DefaultIfEmpty()
+ join att in db.AttachFile on x.CheckSpecialId equals att.ToKeyId into attTemp
+ from att in attTemp.DefaultIfEmpty()
+ select new CheckSpecialSyncItem
+ {
+ CheckSpecialId = x.CheckSpecialId,
+ CheckSpecialCode = x.CheckSpecialCode,
+ ProjectId = x.ProjectId,
+ CheckPerson = x.CheckPerson,
+ CheckTime = x.CheckTime,
+ ScanUrl = x.ScanUrl,
+ DaySummary = x.DaySummary,
+ PartInUnits = x.PartInUnits,
+ PartInPersons = x.PartInPersons,
+ CheckAreas = x.CheckAreas,
+ States = x.States,
+ CompileMan = x.CompileMan,
+ CheckType = x.CheckType,
+ PartInPersonIds = x.PartInPersonIds,
+ PartInPersonNames = x.PartInPersonNames,
+ CheckItemSetId = x.CheckItemSetId,
+ CheckItemName = cis.CheckItemName,
+ AttachFileId1 = att.AttachFileId,
+ ToKeyId1 = att.ToKeyId,
+ AttachSource1 = att.AttachSource,
+ AttachUrl1 = att.AttachUrl,
+ CheckSpecialDetails = GetCheckSpecialDetailLists(x.CheckSpecialId),
+ }).ToList();
+
+ return dataList;
+ }
+ }
+
+
+ //根据专项检查id获取专项检查明细数据
+ public static List GetCheckSpecialDetailLists(string checkSpecialId)
+ {
+ var detailLists = (from x in Funs.DB.Check_CheckSpecialDetail
+ join ht in Funs.DB.HSSE_Hazard_HazardRegisterTypes on x.CheckItem equals ht.RegisterTypesId into htTemp
+ from ht in htTemp.DefaultIfEmpty()
+ join uw in Funs.DB.WBS_UnitWork on x.CheckArea equals uw.UnitWorkId into uwTemp
+ from uw in uwTemp.DefaultIfEmpty()
+ //join u1 in Funs.DB.Sys_User on x.HSEManage equals u1.UserId into u1Temp
+ //from u1 in u1Temp.DefaultIfEmpty()
+ join att in Funs.DB.AttachFile on x.CheckSpecialDetailId equals att.ToKeyId into attTemp
+ from att in attTemp.DefaultIfEmpty()
+ where x.CheckSpecialId == checkSpecialId
+ select new CheckSpecialDetailSyncItem
+ {
+ CheckSpecialDetailId = x.CheckSpecialDetailId,
+ CheckSpecialId = x.CheckSpecialId,
+ CheckItem = x.CheckItem,
+ CheckItemName = ht.RegisterTypesName,
+ CheckItemType = x.CheckItemType,
+ Unqualified = x.Unqualified,
+ CheckArea = x.CheckArea,
+ CheckAreaName = uw.UnitWorkName,
+ UnitId = x.UnitId,
+ CompleteStatus = x.CompleteStatus,
+ LimitedDate = x.LimitedDate,
+ CompletedDate = x.CompletedDate,
+ Suggestions = x.Suggestions,
+ HandleStep = x.HandleStep,
+ RectifyNoticeId = x.RectifyNoticeId,
+ CheckContent = x.CheckContent,
+ WorkArea = x.WorkArea,
+ DataId = x.DataId,
+ DataType = x.DataType,
+ SortIndex = x.SortIndex,
+ HiddenHazardType = x.HiddenHazardType,
+ //HSEManage = x.HSEManage,
+ HSEManage="",
+ //HSEManageName = u1.UserName,
+ HSEManageName = "",
+ RiskLevel = x.HiddenHazardType,
+ //LimitDate = x.LimitDate,
+ //AttachUrl = x.AttachUrl,
+ //HandleWay = x.HandleWay,
+ //RectifyOpinion = x.RectifyOpinion,
+ RectifyOpinion = x.HandleStep,
+ //RectifyDate = x.RectifyDate,
+ //ReAttachUrl = x.ReAttachUrl,
+ //State = x.State,
+ //ProposeUnitId = x.ProposeUnitId,
+ //SaveHandleMan = x.SaveHandleMan,
+ AttachFileId1 = att.AttachFileId,
+ ToKeyId1 = att.ToKeyId,
+ AttachSource1 = att.AttachSource,
+ AttachUrl1 = att.AttachUrl,
+ })
+ .ToList();
+
+ return detailLists;
+ }
+
+ #endregion
+
+ #region 拉取项目专项检查数据
+
+ public static async Task getCheckSpecialLists(string projectId = "")
+ {
+ int code = 0;
+ string message = "";
+ try
+ {
+ string CollCropCode = string.Empty;
+ string unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit(); //当前单位
+ if (thisUnit != null)
+ {
+ CollCropCode = thisUnit.CollCropCode; //社会统一信用代码
+ unitId = thisUnit.UnitId;
+ }
+
+ var ProjectList = (from x in Funs.DB.Base_Project
+ where x.SubjectUnit != null &&
+ x.SubjectProject != null
+ select x).ToList();
+
+ if (!string.IsNullOrEmpty(projectId))
+ {
+ ProjectList = ProjectList.Where(x => x.ProjectId == projectId).ToList();
+ }
+
+ if (ProjectList.Count > 0)
+ {
+ foreach (var project in ProjectList)
+ {
+ string SubjectUnitId = project.SubjectUnit; //集团的单位id
+ string SubjectProjectId = project.SubjectProject; //集团的单位id
+ //获取对应单位的apiurl地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(SubjectUnitId);
+ var ApiUrl = "";
+ var WebUrl = "";
+ if (!string.IsNullOrEmpty(Url))
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+
+ // CollCropCode = "913404001520228377Y"; //三化建 测试使用
+ // SubjectProjectId = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
+
+ string url = "/api/CheckSpecialSync/getCheckSpecialListByProjectIdAndCollCropCode?projectId=" +
+ SubjectProjectId + "&collCropCode=" + CollCropCode;
+ string baseurl = ApiUrl + url;
+
+ string contenttype = "application/json;charset=unicode";
+ var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, null, null);
+ if (!string.IsNullOrEmpty(strJosn))
+ {
+ JObject obj = JObject.Parse(strJosn);
+ code = Funs.GetNewIntOrZero(obj["code"].ToString());
+ message = obj["message"].ToString();
+ if (code == 1)
+ {
+ var getData =
+ JsonConvert.DeserializeObject>(obj["data"].ToString());
+ if (getData.Count() > 0)
+ {
+ ProcessCheckSpecialData(getData, project.ProjectId, unitId, WebUrl);
+ }
+
+ message = "获取成功:同步专项检查数" + getData.Count().ToString() + "条";
+ }
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ message = "获取失败:" + ex.Message;
+ ErrLogInfo.WriteLog("专项检查获取!", ex);
+ }
+
+ return message;
+ }
+
+ #endregion
+
+ #region 推送专项检查数据
+
+ public static ReturnData pushCheckSpecialLists(string projectId, string dataId = "")
+ {
+ Model.ReturnData responeData = new Model.ReturnData();
+ responeData.code = 0;
+ responeData.message = string.Empty;
+ try
+ {
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == projectId);
+ if (project != null)
+ {
+ //获取专项检查数据
+ var items = GetCheckSpecialLitsByprojectIdUnitId(projectId, "", dataId);
+ //总包地址推送
+ if (items.Count() > 0)
+ {
+ var thisUnit = CommonService.GetIsThisUnit(); //当前单位
+ var apiurl = "/api/CheckSpecialSync/SaveCheckSpecialSyncData";
+ //总包单位接口地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(project.SubjectUnit);
+ var ApiUrl = "";
+ var WebUrl = "";
+ if (!string.IsNullOrEmpty(Url))
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+
+ // thisUnit.CollCropCode = "913404001520228377Y";//测试使用
+ // project.SubjectProject = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
+
+ var pushData = new CheckSpecialSyncData
+ {
+ CollCropCode = thisUnit.CollCropCode, //分包单位社会统一信用码
+ ProjectId = project.SubjectProject, //主包项目Id
+ UnitDomain = Funs.SGGLUrl, //分包单位域名地址【文件存储地址】
+ Items = items //专项检查数据
+ };
+ var pushContent = JsonConvert.SerializeObject(pushData);
+ string baseurl = ApiUrl + apiurl;
+ string contenttype = "application/json;charset=unicode";
+ var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, null, pushContent);
+ if (!string.IsNullOrEmpty(returndata))
+ {
+ JObject obj = JObject.Parse(returndata);
+ string code = obj["code"].ToString();
+ string message = obj["message"].ToString();
+ responeData.code = int.Parse(code);
+ responeData.message = message;
+ }
+ }
+ else
+ {
+ responeData.code = 0;
+ responeData.message = "当前没有项目专项检查数据";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.message = "同步到总包单位失败!";
+ ErrLogInfo.WriteLog("【项目专项检查】同步到总包单位失败!", ex);
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+ #region 接收保存项目专项检查数据
+
+ public static async Task SaveCheckSpecialSyncData(Model.CheckSpecialSyncData items)
+ {
+ int code = 0;
+ string message = "";
+ try
+ {
+ if (items.Items.Count > 0 || items.Items.Count > 0)
+ {
+ //获取CollCropCode
+ var CollCropCode = items.CollCropCode;
+ var ProjectId = items.ProjectId;
+ var UnitDomain = items.UnitDomain; //分包单位域名地址【文件存储地址】
+ //根据CollCropCode获取单位id
+ var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == CollCropCode);
+ if (unit == null)
+ {
+ message = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
+ }
+ else
+ {
+ //2、判断主包项目是否存在
+ var porject = BLL.ProjectService.GetProjectByProjectId(ProjectId);
+ if (porject == null)
+ {
+ message = "总包单位不存在本项目,请检查总包项目关联是否正确!";
+ }
+ else
+ {
+ ProcessCheckSpecialData(items.Items, ProjectId, unit.UnitId, UnitDomain);
+ message = "数据推送成功!";
+ }
+ }
+ }
+ else
+ {
+ message = "暂无项目专项检查数据!";
+ }
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+
+ return message;
+ }
+
+ #endregion
+
+ #region 处理单项目专项检查数据的新增或更新逻辑
+
+ ///
+ /// 处理单项目专项检查数据的新增或更新逻辑
+ ///
+ /// 专项检查数据项
+ /// 项目id
+ /// 单位ID
+ /// Web地址
+ private static void ProcessCheckSpecialData(List getData, string projectId,
+ string unitId, string WebUrl)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ foreach (var item in getData)
+ {
+ var model = db.Check_CheckSpecial.FirstOrDefault(e => e.CheckSpecialId == item.CheckSpecialId);
+ if (model == null)
+ {
+ Model.Check_CheckSpecial newModel = new Model.Check_CheckSpecial
+ {
+ CheckSpecialId = item.CheckSpecialId,
+ CheckSpecialCode = item.CheckSpecialCode,
+ ProjectId = projectId,
+ CheckPerson = item.CheckPerson,
+ CheckTime = item.CheckTime,
+ ScanUrl = item.ScanUrl,
+ DaySummary = item.DaySummary,
+ PartInUnits = item.PartInUnits,
+ PartInPersons = item.PartInPersons,
+ CheckAreas = item.CheckAreas,
+ States = item.States,
+ CompileMan = item.CompileMan,
+ CheckType = item.CheckType,
+ PartInPersonIds = item.PartInPersonIds,
+ PartInPersonNames = item.PartInPersonNames,
+ CheckItemSetId = APIDataShareSyncService.getCheckItemSetId(item.CheckItemName),
+ };
+
+ db.Check_CheckSpecial.InsertOnSubmit(newModel);
+ db.SubmitChanges();
+ }
+ else
+ {
+ model.CheckSpecialId = item.CheckSpecialId;
+ model.CheckSpecialCode = item.CheckSpecialCode;
+ model.ProjectId = projectId;
+ model.CheckPerson = item.CheckPerson;
+ model.CheckTime = item.CheckTime;
+ model.ScanUrl = item.ScanUrl;
+ model.DaySummary = item.DaySummary;
+ model.PartInUnits = item.PartInUnits;
+ model.PartInPersons = item.PartInPersons;
+ model.CheckAreas = item.CheckAreas;
+ model.States = item.States;
+ model.CompileMan = item.CompileMan;
+ model.CheckType = item.CheckType;
+ model.PartInPersonIds = item.PartInPersonIds;
+ model.PartInPersonNames = item.PartInPersonNames;
+ model.CheckItemSetId = APIDataShareSyncService.getCheckItemSetId(item.CheckItemName);
+ db.SubmitChanges();
+ }
+
+ if (!string.IsNullOrEmpty(item.AttachUrl1)) //主表附件
+ {
+ APIDataShareSyncService.OperationAttachFile(WebUrl, item.CheckSpecialId,
+ BLL.Const.ProjectCheckSpecialMenuId, item.AttachUrl1);
+ }
+
+ //处理专项检查明细数据
+ ProcessCheckSpecialDetailData(item.CheckSpecialDetails, projectId, unitId, WebUrl);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 处理单项目专项检查明细数据的新增或更新逻辑
+
+ ///
+ /// 处理单项目专项检查明细数据的新增或更新逻辑
+ ///
+ /// 专项检查数据项
+ /// 项目id
+ /// 单位ID
+ /// Web地址
+ private static void ProcessCheckSpecialDetailData(List getData,
+ string projectId,
+ string unitId, string WebUrl)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ foreach (var item in getData)
+ {
+ var model = db.Check_CheckSpecialDetail.FirstOrDefault(e =>
+ e.CheckSpecialDetailId == item.CheckSpecialDetailId);
+ if (model == null)
+ {
+ Model.Check_CheckSpecialDetail newModel = new Model.Check_CheckSpecialDetail
+ {
+ CheckSpecialDetailId = item.CheckSpecialDetailId,
+ CheckSpecialId = item.CheckSpecialId,
+ CheckItem = APIDataShareSyncService.getRegisterTypesId(item.CheckItemName),
+ CheckItemType = item.CheckItemType,
+ Unqualified = item.Unqualified,
+ CheckArea = APIDataShareSyncService.getUnitWorkId(item.CheckAreaName, projectId),
+ UnitId = unitId,
+ CompleteStatus = item.CompleteStatus,
+ LimitedDate = item.LimitedDate,
+ CompletedDate = item.CompletedDate,
+ Suggestions = item.Suggestions,
+ HandleStep = item.HandleStep,
+ RectifyNoticeId = item.RectifyNoticeId,
+ CheckContent = item.CheckContent,
+ WorkArea = item.WorkArea,
+ DataId = item.DataId,
+ DataType = item.DataType,
+ SortIndex = item.SortIndex,
+ HiddenHazardType = item.HiddenHazardType,
+ //HSEManage = APIDataShareSyncService.getUserId(item.HSEManageName),
+ //RiskLevel = item.RiskLevel,
+ //LimitDate = item.LimitDate,
+ //AttachUrl = item.AttachUrl,
+ //HandleWay = item.HandleWay,
+ //RectifyOpinion = item.RectifyOpinion,
+ //HandleStep= item.RectifyOpinion,
+ //RectifyDate = item.RectifyDate,
+ //ReAttachUrl = item.ReAttachUrl,
+ //State = item.State,
+ //ProposeUnitId = item.ProposeUnitId,
+ //SaveHandleMan = item.SaveHandleMan,
+ };
+
+ db.Check_CheckSpecialDetail.InsertOnSubmit(newModel);
+ db.SubmitChanges();
+ }
+ else
+ {
+ // model.CheckSpecialDetailId = item.CheckSpecialDetailId;
+ model.CheckSpecialId = item.CheckSpecialId;
+ model.CheckItem = APIDataShareSyncService.getRegisterTypesId(item.CheckItemName);
+ model.CheckItemType = item.CheckItemType;
+ model.Unqualified = item.Unqualified;
+ model.CheckArea = APIDataShareSyncService.getUnitWorkId(item.CheckAreaName, projectId);
+ model.UnitId = unitId;
+ model.CompleteStatus = item.CompleteStatus;
+ model.LimitedDate = item.LimitedDate;
+ model.CompletedDate = item.CompletedDate;
+ model.Suggestions = item.Suggestions;
+ model.HandleStep = item.HandleStep;
+ model.RectifyNoticeId = item.RectifyNoticeId;
+ model.CheckContent = item.CheckContent;
+ model.WorkArea = item.WorkArea;
+ model.DataId = item.DataId;
+ model.DataType = item.DataType;
+ model.SortIndex = item.SortIndex;
+ model.HiddenHazardType = item.HiddenHazardType;
+ //model.HSEManage = APIDataShareSyncService.getUserId(item.HSEManageName);
+ //model.RiskLevel = item.RiskLevel;
+ model.HiddenHazardType = item.RiskLevel;
+ //model.LimitDate = item.LimitDate;
+ //model.AttachUrl = item.AttachUrl;
+ //model.HandleWay = item.HandleWay;
+ //model.RectifyOpinion = item.RectifyOpinion;
+ //model.RectifyDate = item.RectifyDate;
+ //model.ReAttachUrl = item.ReAttachUrl;
+ //model.State = item.State;
+ //model.ProposeUnitId = item.ProposeUnitId;
+ //model.SaveHandleMan = item.SaveHandleMan;
+
+ db.SubmitChanges();
+ }
+
+ if (!string.IsNullOrEmpty(item.AttachUrl1)) //整改前图片
+ {
+ APIDataShareSyncService.OperationAttachFile(WebUrl, item.CheckSpecialDetailId,
+ BLL.Const.ProjectCheckSpecialMenuId, item.AttachUrl1);
+ }
+ }
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/DataShare/HSSE/APIHazardRegisterSyncService.cs b/SGGL/BLL/DataShare/HSSE/APIHazardRegisterSyncService.cs
new file mode 100644
index 00000000..480f73a5
--- /dev/null
+++ b/SGGL/BLL/DataShare/HSSE/APIHazardRegisterSyncService.cs
@@ -0,0 +1,468 @@
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Configuration;
+using System.IO;
+using System.Net.Http;
+using System.Threading.Tasks;
+using Model;
+using Newtonsoft.Json;
+using RestSharp;
+using System.Net;
+
+
+namespace BLL
+{
+ public class APIHazardRegisterSyncService
+ {
+ #region 根据项目、单位获取安全检查列表分页
+
+ public static List GetHazardRegisterLitsByprojectIdUnitIdPage(string projectId,
+ string unitId, string dataId = "")
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var list = from x in db.HSSE_Hazard_HazardRegister where x.ProjectId == projectId select x;
+ if (!string.IsNullOrEmpty(unitId))
+ {
+ list = list.Where(x => x.ResponsibleUnit == unitId);
+ }
+
+ if (!string.IsNullOrEmpty(dataId))
+ {
+ list = list.Where(x => x.HazardRegisterId == dataId);
+ }
+
+ var dataList = (from x in list
+ join ht in db.HSSE_Hazard_HazardRegisterTypes on x.RegisterTypesId equals ht.RegisterTypesId into htTemp
+ from ht in htTemp.DefaultIfEmpty()
+ join uw in db.WBS_UnitWork on x.Place equals uw.UnitWorkId into uwTemp
+ from uw in uwTemp.DefaultIfEmpty()
+ join u1 in db.Person_Persons on x.ResponsibleMan equals u1.PersonId into u1Temp
+ from u1 in u1Temp.DefaultIfEmpty()
+ join u2 in db.Person_Persons on x.CheckManId equals u2.PersonId into u2Temp
+ from u2 in u2Temp.DefaultIfEmpty()
+ join u3 in db.Person_Persons on x.ConfirmMan equals u3.PersonId into u3Temp
+ from u3 in u3Temp.DefaultIfEmpty()
+ join u4 in db.Person_Persons on x.ResponsibleMan2 equals u4.PersonId into u4Temp
+ from u4 in u4Temp.DefaultIfEmpty()
+ select new HazardRegisterSyncItem
+ {
+ HazardRegisterId = x.HazardRegisterId,
+ HazardCode = x.HazardCode,
+ RegisterDate = x.RegisterDate,
+ RegisterDef = x.RegisterDef,
+ Rectification = x.Rectification,
+ Place = x.Place,
+ PlaceName = uw.UnitWorkName,
+ ResponsibleUnit = x.ResponsibleUnit,
+ Observer = x.Observer,
+ RectifiedDate = x.RectifiedDate,
+ AttachUrl = x.AttachUrl,
+ ProjectId = x.ProjectId,
+ States = x.States,
+ IsEffective = x.IsEffective,
+ ResponsibleMan = x.ResponsibleMan,
+ ResponsibleManName = u1.PersonName,
+ CheckManId = x.CheckManId,
+ CheckManName = u2.PersonName,
+ CheckTime = x.CheckTime,
+ RectificationPeriod = x.RectificationPeriod,
+ ImageUrl = x.ImageUrl,
+ RectificationImageUrl = x.RectificationImageUrl,
+ RectificationTime = x.RectificationTime,
+ ConfirmMan = x.ConfirmMan,
+ ConfirmManName = u3.PersonName,
+ ConfirmDate = x.ConfirmDate,
+ HandleIdea = x.HandleIdea,
+ CutPayment = x.CutPayment,
+ ProblemTypes = x.ProblemTypes,
+ RegisterTypesId = x.RegisterTypesId,
+ RegisterTypesName = ht.RegisterTypesName,
+ CheckCycle = x.CheckCycle,
+ CheckItemDetailId = x.CheckItemDetailId,
+ SupCheckItemSetId = x.SupCheckItemSetId,
+ CheckItemSetId = x.CheckItemSetId,
+ CheckSpecialId = x.CheckSpecialId,
+ InstallationId = x.InstallationId,
+ SafeSupervisionId = x.SafeSupervisionId,
+ ResponsibleMan2 = x.ResponsibleMan2,
+ ResponsibleMan2Name = u4.PersonName,
+ SafeSupervisionIsOK = x.SafeSupervisionIsOK,
+ GpsLocation = x.GpsLocation,
+ IsWx = x.IsWx,
+ DIC_ID = x.DIC_ID,
+ CCManIds = x.CCManIds,
+ ResultType = x.ResultType,
+ ResultId = x.ResultId,
+ Requirements = x.Requirements,
+ Risk_Level = x.HazardValue,
+ ControlId = x.ControlId,
+ DataSource = "1",
+ }).ToList();
+
+ return dataList;
+ }
+ }
+
+ #endregion
+
+
+ #region 拉取项目安全检查数据
+
+ public static string getHazardRegisterLists(string projectId = "")
+ {
+ int code = 0;
+ string message = "";
+ try
+ {
+ string CollCropCode = string.Empty;
+ string unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit(); //当前单位
+ if (thisUnit != null)
+ {
+ CollCropCode = thisUnit.CollCropCode; //社会统一信用代码
+ unitId = thisUnit.UnitId;
+ }
+
+ var ProjectList = (from x in Funs.DB.Base_Project
+ where x.SubjectUnit != null &&
+ x.SubjectProject != null
+ select x).ToList();
+
+ if (!string.IsNullOrEmpty(projectId))
+ {
+ ProjectList = ProjectList.Where(x => x.ProjectId == projectId).ToList();
+ }
+
+ if (ProjectList.Count > 0)
+ {
+ foreach (var project in ProjectList)
+ {
+ string SubjectUnitId = project.SubjectUnit; //集团的单位id
+ string SubjectProjectId = project.SubjectProject; //集团的项目id
+ //获取对应单位的apiurl地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(SubjectUnitId);
+ var ApiUrl = "";
+ var WebUrl = "";
+ if (!string.IsNullOrEmpty(Url))
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+
+ // CollCropCode = "91420000177570439L"; //三化建 测试使用
+ // SubjectProjectId = "c7ade79e-7646-4c59-a8fd-020a7e3138c6";//测试使用
+
+ string url =
+ "/api/HazardRegisterSync/getHazardRegisterListByProjectIdAndCollCropCode?projectId=" +
+ SubjectProjectId + "&collCropCode=" + CollCropCode;
+ string baseurl = ApiUrl + url;
+ string contenttype = "application/json;charset=unicode";
+ var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, null, null);
+ if (!string.IsNullOrEmpty(strJosn))
+ {
+ JObject obj = JObject.Parse(strJosn);
+ code = Funs.GetNewIntOrZero(obj["code"].ToString());
+ message = obj["message"].ToString();
+ if (code == 1)
+ {
+ var getData =
+ JsonConvert.DeserializeObject>(obj["data"].ToString());
+ if (getData.Count() > 0)
+ {
+ ProcessHazardRegisterData(getData, project.ProjectId, unitId, WebUrl, "pull");
+ }
+ message = "获取成功:同步安全检查数" + getData.Count().ToString() + "条";
+ }
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ message = "获取失败:" + ex.Message;
+ ErrLogInfo.WriteLog("安全检查获取!", ex);
+ }
+
+ return message;
+ }
+
+ #endregion
+
+
+ #region 推送安全检查数据
+
+ public static ReturnData pushHazardRegisterLists(string projectId, string dataId = "")
+ {
+ Model.ReturnData responeData = new Model.ReturnData();
+ responeData.code = 0;
+ responeData.message = string.Empty;
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == projectId);
+ try
+ {
+ if (project != null)
+ {
+ //获取安全检查数据
+ var items = GetHazardRegisterLitsByprojectIdUnitIdPage(projectId, "", dataId);
+ //总包地址推送
+ if (items.Count() > 0)
+ {
+ var thisUnit = CommonService.GetIsThisUnit(); //当前单位
+ var apiurl = "/api/HazardRegisterSync/SaveHazardRegisterSyncData";
+ //总包单位接口地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(project.SubjectUnit);
+ var ApiUrl = "";
+ var WebUrl = "";
+ if (!string.IsNullOrEmpty(Url))
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+ // thisUnit.CollCropCode = "913404001520228377Y";//测试使用
+ // project.SubjectProject = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
+
+ var pushData = new HazardRegisterSyncData
+ {
+ CollCropCode = thisUnit.CollCropCode, //分包单位社会统一信用码
+ // CollCropCode = "91420000177570439L", //分包单位社会统一信用码
+ // ProjectId = "c7ade79e-7646-4c59-a8fd-020a7e3138c6", //主包项目Id
+ ProjectId = project.SubjectProject, //主包项目Id
+ UnitDomain = Funs.SGGLUrl, //分包单位域名地址【文件存储地址】
+ Items = items //安全检查数据
+ };
+ var pushContent = JsonConvert.SerializeObject(pushData);
+ string baseurl = ApiUrl + apiurl;
+ string contenttype = "application/json;charset=unicode";
+ var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, null, pushContent);
+ if (!string.IsNullOrEmpty(returndata))
+ {
+ JObject obj = JObject.Parse(returndata);
+ string code = obj["code"].ToString();
+ string message = obj["message"].ToString();
+ responeData.code = int.Parse(code);
+ responeData.message = message;
+ }
+ }
+ else
+ {
+ responeData.code = 0;
+ responeData.message = "当前没有项目安全检查数据";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.message = "同步到总包单位失败!";
+ ErrLogInfo.WriteLog("【安全检查】同步到总包单位失败!", ex);
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 接收保存项目安全检查数据
+
+ public static string SaveHazardRegisterSyncData(Model.HazardRegisterSyncData items)
+ {
+ int code = 0;
+ string message = "";
+ try
+ {
+ if (items.Items.Count > 0 || items.Items.Count > 0)
+ {
+ var CollCropCode = items.CollCropCode; //分包单位社会统一信用码
+ var ProjectId = items.ProjectId; //总包项目Id
+ var UnitDomain = items.UnitDomain; //分包单位域名地址【文件存储地址】
+ var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == CollCropCode); //根据CollCropCode获取单位id
+ if (unit == null)
+ {
+ message = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
+ }
+ else
+ {
+ //2、判断主包项目是否存在
+ var porject = BLL.ProjectService.GetProjectByProjectId(ProjectId);
+ if (porject == null)
+ {
+ message = "总包单位不存在本项目,请检查总包项目关联是否正确!";
+ }
+ else
+ {
+ ProcessHazardRegisterData(items.Items, ProjectId, unit.UnitId, UnitDomain, "push");
+ message = "数据推送成功!";
+ }
+ }
+ }
+ else
+ {
+ message = "暂无项目安全检查数据!";
+ }
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+
+ return message;
+ }
+
+ #endregion
+
+
+ #region 处理单个安全检查数据的新增或更新逻辑
+
+ ///
+ /// 处理单个安全检查数据的新增或更新逻辑
+ ///
+ /// 安全检查数据项
+ /// 项目id
+ /// 单位ID
+ /// Web地址
+ private static void ProcessHazardRegisterData(List getData, string projectId,
+ string unitId, string WebUrl, string type)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ foreach (var item in getData)
+ {
+ Model.HSSE_Hazard_HazardRegister model =
+ db.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.HazardRegisterId == item.HazardRegisterId);
+ if (model == null)
+ {
+ Model.HSSE_Hazard_HazardRegister newModel = new Model.HSSE_Hazard_HazardRegister
+ {
+ HazardRegisterId = item.HazardRegisterId,
+ HazardCode = item.HazardCode,
+ RegisterDate = item.RegisterDate,
+ RegisterDef = item.RegisterDef,
+ Rectification = item.Rectification,
+ Place = APIDataShareSyncService.getUnitWorkId(item.PlaceName, projectId),
+ ResponsibleUnit = unitId,
+ Observer = item.Observer,
+ AttachUrl = item.AttachUrl,
+ ProjectId = projectId,
+ States = item.States,
+ IsEffective = item.IsEffective,
+ ResponsibleMan = APIDataShareSyncService.getUserId(item.ResponsibleManName),
+ CheckManId = APIDataShareSyncService.getUserId(item.CheckManName),
+ CheckTime = item.CheckTime,
+ RectificationPeriod = item.RectificationPeriod,
+ ImageUrl = item.ImageUrl,
+ RectificationImageUrl = item.RectificationImageUrl,
+ RectificationTime = item.RectificationTime,
+ ConfirmMan = APIDataShareSyncService.getUserId(item.ConfirmManName),
+ ConfirmDate = item.ConfirmDate,
+ HandleIdea = item.HandleIdea,
+ CutPayment = item.CutPayment,
+ ProblemTypes = item.ProblemTypes,
+ RegisterTypesId = APIDataShareSyncService.getRegisterTypesId(item.RegisterTypesName),
+ CheckCycle = item.CheckCycle,
+ CheckItemDetailId = item.CheckItemDetailId,
+ SupCheckItemSetId = item.SupCheckItemSetId,
+ CheckItemSetId = item.CheckItemSetId,
+ CheckSpecialId = item.CheckSpecialId,
+ InstallationId = item.InstallationId,
+ SafeSupervisionId = item.SafeSupervisionId,
+ ResponsibleMan2 = APIDataShareSyncService.getUserId(item.ResponsibleMan2Name),
+ SafeSupervisionIsOK = item.SafeSupervisionIsOK,
+ GpsLocation = item.GpsLocation,
+ IsWx = item.IsWx,
+ DIC_ID = item.DIC_ID,
+ CCManIds = item.CCManIds,
+ ResultType = item.ResultType,
+ ResultId = item.ResultId,
+ Requirements = item.Requirements,
+ HazardValue = item.Risk_Level,
+ ControlId = item.ControlId,
+ };
+ if (type == "pull")
+ {
+ newModel.DataSource = item.DataSource;
+ }
+ db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newModel);
+ db.SubmitChanges();
+ }
+ else
+ {
+ // model.HazardRegisterId = item.HazardRegisterId;
+ model.HazardCode = item.HazardCode;
+ model.RegisterDate = item.RegisterDate;
+ model.RegisterDef = item.RegisterDef;
+ model.Rectification = item.Rectification;
+ model.Place = APIDataShareSyncService.getUnitWorkId(item.PlaceName, projectId);
+ model.ResponsibleUnit = unitId;
+ model.Observer = item.Observer;
+ model.AttachUrl = item.AttachUrl;
+ model.ProjectId = projectId;
+ model.States = item.States;
+ model.IsEffective = item.IsEffective;
+ model.ResponsibleMan = APIDataShareSyncService.getUserId(item.ResponsibleManName);
+ model.CheckManId = APIDataShareSyncService.getUserId(item.CheckManName);
+ model.CheckTime = item.CheckTime;
+ model.RectificationPeriod = item.RectificationPeriod;
+ model.ImageUrl = item.ImageUrl;
+ model.RectificationImageUrl = item.RectificationImageUrl;
+ model.RectificationTime = item.RectificationTime;
+ model.ConfirmMan = APIDataShareSyncService.getUserId(item.ConfirmManName);
+ model.ConfirmDate = item.ConfirmDate;
+ model.HandleIdea = item.HandleIdea;
+ model.CutPayment = item.CutPayment;
+ model.ProblemTypes = item.ProblemTypes;
+ model.RegisterTypesId = APIDataShareSyncService.getRegisterTypesId(item.RegisterTypesName);
+ model.CheckCycle = item.CheckCycle;
+ model.CheckItemDetailId = item.CheckItemDetailId;
+ model.SupCheckItemSetId = item.SupCheckItemSetId;
+ model.CheckItemSetId = item.CheckItemSetId;
+ model.CheckSpecialId = item.CheckSpecialId;
+ model.InstallationId = item.InstallationId;
+ model.SafeSupervisionId = item.SafeSupervisionId;
+ model.ResponsibleMan2 = APIDataShareSyncService.getUserId(item.ResponsibleMan2Name);
+ model.SafeSupervisionIsOK = item.SafeSupervisionIsOK;
+ model.GpsLocation = item.GpsLocation;
+ model.IsWx = item.IsWx;
+ model.DIC_ID = item.DIC_ID;
+ model.CCManIds = item.CCManIds;
+ model.ResultType = item.ResultType;
+ model.ResultId = item.ResultId;
+ model.Requirements = item.Requirements;
+ model.HazardValue = item.Risk_Level;
+ model.ControlId = item.ControlId;
+ if (type == "pull")
+ {
+ model.DataSource = item.DataSource;
+ }
+
+ db.SubmitChanges();
+ }
+
+ if (!string.IsNullOrEmpty(item.ImageUrl))
+ {
+ APIDataShareSyncService.OperationAttachFile(WebUrl, item.HazardRegisterId,
+ BLL.Const.HSSE_HiddenRectificationListMenuId, item.ImageUrl);
+ }
+
+ if (!string.IsNullOrEmpty(item.RectificationImageUrl))
+ {
+ APIDataShareSyncService.OperationAttachFile(WebUrl, item.HazardRegisterId + "-R",
+ BLL.Const.HSSE_HiddenRectificationListMenuId, item.RectificationImageUrl);
+ }
+ }
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/DataShare/HSSE/APILicenseSyncService.cs b/SGGL/BLL/DataShare/HSSE/APILicenseSyncService.cs
new file mode 100644
index 00000000..bc441298
--- /dev/null
+++ b/SGGL/BLL/DataShare/HSSE/APILicenseSyncService.cs
@@ -0,0 +1,265 @@
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections;
+using System.Linq;
+using System.Runtime.InteropServices.ComTypes;
+
+namespace BLL
+{
+ ///
+ /// 作业票数据共享互通
+ ///
+ public class APILicenseSyncService
+ {
+ #region 分包单位推送数据到总包单位
+
+ ///
+ /// 推送分包作业票定稿数据
+ ///
+ /// 项目Id
+ /// 作业票定稿数据Id(为空的时候推送全部)
+ ///
+ public static ReturnData PushLicenseManagerLists(string projectId, string dataId = "")
+ {
+ Model.ReturnData responeData = new Model.ReturnData();
+ responeData.code = 0;
+ responeData.message = string.Empty;
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ try
+ {
+ var list = from x in db.View_License_LicenseManager where x.ProjectId == projectId select x;
+ if (!string.IsNullOrWhiteSpace(dataId))
+ {
+ list = list.Where(x => x.LicenseManagerId == dataId);
+ }
+ var dataList = (from x in list
+ join blt in db.Base_LicenseType on x.LicenseTypeId equals blt.LicenseTypeId into bltGroup
+ from blt in bltGroup.DefaultIfEmpty()
+ join su in db.Person_Persons on x.CompileMan equals su.PersonId into sUser
+ from su in sUser.DefaultIfEmpty()
+ //join uw in db.WBS_UnitWork on x.WorkAreaId equals uw.UnitWorkId into uwGroup
+ //from uw in uwGroup.DefaultIfEmpty()
+ join att in db.AttachFile on x.LicenseManagerId equals att.ToKeyId into attTemp
+ from att in attTemp.DefaultIfEmpty()
+ join att1 in db.AttachFile on (x.LicenseManagerId + "_GB") equals att1.ToKeyId into att1Temp
+ from att1 in att1Temp.DefaultIfEmpty()
+ orderby x.CompileDate descending
+ select new LicenseManagerItem
+ {
+ ProjectId = x.ProjectId,
+ UnitId = x.UnitId,
+ LicenseManagerId = x.LicenseManagerId,
+ LicenseManagerCode = x.LicenseManagerCode,
+ LicenseManageName = x.LicenseManageName,
+ LicenseTypeId = x.LicenseTypeId,
+ LicenseTypeCode = blt.LicenseTypeCode,
+ LicenseTypeName = blt.LicenseTypeName,
+ LicenseManageContents = x.LicenseManageContents,
+ CompileMan = x.CompileMan,
+ CompileManName = su.PersonName,
+ CompileDate = x.CompileDate,
+ States = x.States,
+ WorkAreaId = x.WorkAreaId,
+ //UnitWorkCode = uw.UnitWorkCode,
+ //UnitWorkName = uw.UnitWorkName,
+ UnitWorkName = x.WorkAreaName,
+ StartDate = x.StartDate,
+ EndDate = x.EndDate,
+ ApplicantMan = x.ApplicantMan,
+ WorkStates = x.WorkStates,
+ IsHighRisk = x.IsHighRisk,
+ LicenseCodes = x.LicenseCodes,
+ SourceDes = x.SourceDes,
+ //AttachUrl = AttachFileService.getFileUrl(x.LicenseManagerId),//附件
+ //AttachUrl1 = AttachFileService.getFileUrl(x.LicenseManagerId + "_GB"),//关闭附件
+ AttachFileId = att.AttachFileId,
+ ToKeyId = att.ToKeyId,
+ AttachSource = att.AttachSource,
+ AttachUrl = att.AttachUrl,
+ AttachFileId1 = att1.AttachFileId,
+ ToKeyId1 = att1.ToKeyId,
+ AttachSource1 = att1.AttachSource,
+ AttachUrl1 = att1.AttachUrl,
+ }).ToList();
+
+ if (dataList.Count() > 0)
+ {
+ var thisUnit = CommonService.GetIsThisUnit();
+ var porject = BLL.ProjectService.GetProjectByProjectId(projectId);
+ var pushData = new LicenseManagerData
+ {
+ CollCropCode = thisUnit.CollCropCode,//分包单位社会统一信用码
+ UnitId = thisUnit.UnitId,//分包单位Id
+ UnitName = thisUnit.UnitName,//分包单位名称
+ ShortUnitName = thisUnit.ShortUnitName,//分包单位简称
+ UnitDomain = Funs.SGGLUrl,//分包单位域名地址【文件存储地址】
+ SubjectUnit = porject.SubjectUnit,//主包单位Id
+ SubjectProject = porject.SubjectProject,//主包项目Id
+ Items = dataList//数据
+ };
+ var pushContent = JsonConvert.SerializeObject(pushData);
+
+ //获取总包单位接口apiurl地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(porject.SubjectUnit);
+ var ApiUrl = string.Empty;
+ var WebUrl = string.Empty;
+ if (Url != null)
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+ var baseurl = $"{ApiUrl}/api/LicenseSync/ReceiveSaveProjectLicenseManagerData";
+ string contenttype = "application/json;charset=unicode";
+ //Hashtable newToken = new Hashtable
+ //{
+ // { "token", ServerService.GetToken().Token }
+ //};
+
+ //ErrLogInfo.WriteLog($"【班前会推送数据】接口地址:{baseurl};{pushContent}");
+ var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, null, pushContent);
+ if (!string.IsNullOrEmpty(returndata))
+ {
+ ErrLogInfo.WriteLog($"【作业票返回结果】接口地址:{baseurl};{returndata}");
+ JObject obj = JObject.Parse(returndata);
+ string mess = obj["message"].ToString();
+ string code = obj["code"].ToString();
+ }
+ }
+ else
+ {
+ responeData.message = "当前项目没有作业票定稿数据";
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.message = "同步到总包单位失败!";
+ ErrLogInfo.WriteLog("【作业票定稿】同步到总包单位失败!", ex);
+ }
+ }
+ return responeData;
+ }
+
+ #endregion
+
+ #region 总包单位接收分包单位推送数据
+
+ ///
+ /// 总包单位接收保存分包单位推送的作业票定稿数据
+ ///
+ ///
+ ///
+ public static string ReceiveSaveProjectLicenseManagerData(LicenseManagerData data)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ string result = string.Empty;
+ if (data.Items.Count() > 0)
+ {
+ //var jsonData = JsonConvert.SerializeObject(data);
+ //ErrLogInfo.WriteLog($"【作业票定稿接收数据】{jsonData}");
+ //1、判断分包单位是否存在
+ var unit = UnitService.getUnitByCollCropCodeUnitName(data.CollCropCode, data.UnitName);
+ if (unit == null)
+ {
+ result = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
+ }
+ else
+ {
+ //2、判断主包项目是否存在
+ var porject = BLL.ProjectService.GetProjectByProjectId(data.SubjectProject);
+ if (porject == null)
+ {
+ result = "总包单位不存在本项目,请检查总包项目关联是否正确!";
+ }
+ else
+ {
+ int succ = 0;
+ //3、保存数据
+ foreach (var item in data.Items)
+ {
+ try
+ {
+ var model = db.License_LicenseManager.FirstOrDefault(e => e.LicenseManagerId == item.LicenseManagerId);
+ if (model != null)
+ {//编辑
+ model.ProjectId = data.SubjectProject;
+ model.UnitId = unit.UnitId;
+ model.LicenseManagerCode = item.LicenseManagerCode;
+ model.LicenseManageName = item.LicenseManageName;
+ //model.LicenseTypeId = item.LicenseTypeId;
+ model.LicenseTypeId = APIDataShareSyncService.GetLicenseTypeId(item.LicenseTypeId, item.LicenseTypeCode, item.LicenseTypeName);
+ //model.LicenseManageContents = HttpUtility.HtmlEncode(item.LicenseManageContents);
+ model.LicenseManageContents = item.LicenseManageContents;
+ model.States = item.States;
+ model.StartDate = item.StartDate;
+ model.EndDate = item.EndDate;
+ model.ApplicantMan = item.ApplicantMan;
+ model.IsHighRisk = item.IsHighRisk;
+ model.WorkStates = item.WorkStates;
+ model.SourceDes = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}#单位工程:{item.UnitWorkName}";
+ model.CompileDate = item.CompileDate;
+ //model.CompileMan = item.CompileMan;
+
+ db.SubmitChanges();
+ }
+ else
+ {//新增
+ Model.License_LicenseManager newModel = new Model.License_LicenseManager();
+ newModel.LicenseManagerId = item.LicenseManagerId;
+ newModel.ProjectId = data.SubjectProject;
+ newModel.UnitId = unit.UnitId;
+ newModel.LicenseManagerCode = item.LicenseManagerCode;
+ newModel.LicenseManageName = item.LicenseManageName;
+ //newModel.LicenseTypeId = item.LicenseTypeId;
+ newModel.LicenseTypeId = APIDataShareSyncService.GetLicenseTypeId(item.LicenseTypeId, item.LicenseTypeCode, item.LicenseTypeName);
+ //newModel.LicenseManageContents = HttpUtility.HtmlEncode(item.LicenseManageContents);
+ newModel.LicenseManageContents = item.LicenseManageContents;
+ newModel.States = item.States;
+ newModel.StartDate = item.StartDate;
+ newModel.EndDate = item.EndDate;
+ newModel.ApplicantMan = item.ApplicantMan;
+ newModel.IsHighRisk = item.IsHighRisk;
+ newModel.WorkStates = item.WorkStates;
+ newModel.SourceDes = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}#单位工程:{item.UnitWorkName}";
+ newModel.CompileDate = item.CompileDate;
+ //newModel.CompileMan = item.CompileMan;
+
+ db.License_LicenseManager.InsertOnSubmit(newModel);
+ db.SubmitChanges();
+ }
+ succ++;
+
+ //ErrLogInfo.WriteLog($"【作业票定稿接收数据——内容附件】UnitDomain:{data.UnitDomain};AttachFileId:{item.AttachFileId};ToKeyId:{item.ToKeyId};AttachSource:{item.AttachSource};AttachUrl:{item.AttachUrl}");
+ //附件处理:附件
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId, item.ToKeyId, item.AttachSource, item.AttachUrl);
+ //附件处理:关闭附件
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId1, item.ToKeyId1, item.AttachSource1, item.AttachUrl1);
+ }
+ catch (Exception ex)
+ {
+ BLL.ErrLogInfo.WriteLog($"【{porject.ProjectName}】作业票定稿数据推送总包失败", ex.Message);
+ continue;
+ }
+ }
+ result = $"推送成功:总数{data.Items.Count()}条,成功{succ}条";
+ }
+ }
+ }
+ else
+ {
+ result = "推送数据对象为空!";
+ }
+ return result;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs b/SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs
new file mode 100644
index 00000000..d01b5059
--- /dev/null
+++ b/SGGL/BLL/DataShare/HSSE/APIMeetingSyncService.cs
@@ -0,0 +1,277 @@
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections;
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 安全会议数据共享互通
+ ///
+ public class APIMeetingSyncService
+ {
+ #region 分包单位推送数据到总包单位
+
+ ///
+ /// 推送分包班前会数据
+ ///
+ /// 项目Id
+ /// 班前会数据Id(为空的时候推送全部)
+ ///
+ public static ReturnData PushClassMeetingLists(string projectId, string dataId = "")
+ {
+ Model.ReturnData responeData = new Model.ReturnData();
+ responeData.code = 0;
+ responeData.message = string.Empty;
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ try
+ {
+ var list = from x in db.Meeting_ClassMeeting where x.ProjectId == projectId select x;
+ if (!string.IsNullOrWhiteSpace(dataId))
+ {
+ list = list.Where(x => x.ClassMeetingId == dataId);
+ }
+ var dataList = (from x in list
+ join ptg in db.ProjectData_TeamGroup on x.TeamGroupId equals ptg.TeamGroupId into ptGroup
+ from ptg in ptGroup.DefaultIfEmpty()
+ join su in db.Person_Persons on x.CompileMan equals su.PersonId into sUser
+ from su in sUser.DefaultIfEmpty()
+ join att in db.AttachFile on x.ClassMeetingId equals att.ToKeyId into attTemp
+ from att in attTemp.DefaultIfEmpty()
+ join att1 in db.AttachFile on (x.ClassMeetingId + "#1") equals att1.ToKeyId into att1Temp
+ from att1 in att1Temp.DefaultIfEmpty()
+ join att2 in db.AttachFile on (x.ClassMeetingId + "#2") equals att2.ToKeyId into att2Temp
+ from att2 in att2Temp.DefaultIfEmpty()
+ orderby x.CompileDate descending
+ select new ClassMeetingItem
+ {
+ ProjectId = x.ProjectId,
+ UnitId = x.UnitId,
+ ClassMeetingId = x.ClassMeetingId,
+ ClassMeetingCode = x.ClassMeetingCode,
+ ClassMeetingName = x.ClassMeetingName,
+ ClassMeetingDate = x.ClassMeetingDate,
+ ClassMeetingContents = x.ClassMeetingContents,
+ CompileMan = x.CompileMan,
+ CompileManName = su.PersonName,
+ TeamGroupId = x.TeamGroupId,
+ TeamGroupName = ptg.TeamGroupName,
+ CompileDate = x.CompileDate,
+ States = x.States,
+ MeetingPlace = x.MeetingPlace,
+ MeetingHours = x.MeetingHours,
+ MeetingHostMan = x.MeetingHostMan,
+ AttentPerson = x.AttentPerson,
+ AttentPersonNum = x.AttentPersonNum,
+ //MeetingHostManOther = x.MeetingHostManOther,
+ MeetingHostManOther = string.Empty,
+ Remark = x.Remark,
+ //AttachUrl = AttachFileService.getFileUrl(x.ClassMeetingId),//内容
+ //AttachUrl1 = AttachFileService.getFileUrl(x.ClassMeetingId + "#1"),//签到表
+ //AttachUrl2 = AttachFileService.getFileUrl(x.ClassMeetingId + "#2"),//会议过程
+ AttachFileId = att.AttachFileId,
+ ToKeyId = att.ToKeyId,
+ AttachSource = att.AttachSource,
+ AttachUrl = att.AttachUrl,
+ AttachFileId1 = att1.AttachFileId,
+ ToKeyId1 = att1.ToKeyId,
+ AttachSource1 = att1.AttachSource,
+ AttachUrl1 = att1.AttachUrl,
+ AttachFileId2 = att2.AttachFileId,
+ ToKeyId2 = att2.ToKeyId,
+ AttachSource2 = att2.AttachSource,
+ AttachUrl2 = att2.AttachUrl,
+ }).ToList();
+
+ if (dataList.Count() > 0)
+ {
+ var thisUnit = CommonService.GetIsThisUnit();
+ var porject = BLL.ProjectService.GetProjectByProjectId(projectId);
+ var pushData = new ClassMeetingData
+ {
+ CollCropCode = thisUnit.CollCropCode,//分包单位社会统一信用码
+ UnitId = thisUnit.UnitId,//分包单位Id
+ UnitName = thisUnit.UnitName,//分包单位名称
+ ShortUnitName = thisUnit.ShortUnitName,//分包单位简称
+ UnitDomain = Funs.SGGLUrl,//分包单位域名地址【文件存储地址】
+ SubjectUnit = porject.SubjectUnit,//主包单位Id
+ SubjectProject = porject.SubjectProject,//主包项目Id
+ Items = dataList//会议数据
+ };
+ var pushContent = JsonConvert.SerializeObject(pushData);
+
+ //获取总包单位接口apiurl地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(porject.SubjectUnit);
+ var ApiUrl = string.Empty;
+ var WebUrl = string.Empty;
+ if (Url != null)
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+ var baseurl = $"{ApiUrl}/api/MeetingSync/ReceiveSaveProjectClassMeetingData";
+ string contenttype = "application/json;charset=unicode";
+ //Hashtable newToken = new Hashtable
+ //{
+ // { "token", ServerService.GetToken().Token }
+ //};
+ ErrLogInfo.WriteLog($"【班前会推送数据】接口地址:{baseurl};{pushContent}");
+ var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, null, pushContent);
+ if (!string.IsNullOrEmpty(returndata))
+ {
+ ErrLogInfo.WriteLog($"【班前会返回结果】接口地址:{baseurl};{returndata}");
+ JObject obj = JObject.Parse(returndata);
+ string code = obj["code"].ToString();
+ string message = obj["message"].ToString();
+ responeData.code = int.Parse(code);
+ responeData.message = message;
+ }
+ }
+ else
+ {
+ responeData.message = "当前项目没有班前会数据";
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.message = "同步到总包单位失败!";
+ ErrLogInfo.WriteLog("【班前会】同步到总包单位失败!", ex);
+ }
+ }
+ return responeData;
+ }
+
+ #endregion
+
+ #region 总包单位接收分包单位推送数据
+
+ ///
+ /// 总包单位接收保存分包单位推送的班前会数据
+ ///
+ ///
+ ///
+ public static string ReceiveSaveProjectClassMeetingData(ClassMeetingData data)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ string result = string.Empty;
+ if (data.Items.Count() > 0)
+ {
+ //1、判断分包单位是否存在
+ var unit = UnitService.getUnitByCollCropCodeUnitName(data.CollCropCode, data.UnitName);
+ if (unit == null)
+ {
+ result = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
+ }
+ else
+ {
+ //2、判断主包项目是否存在
+ var porject = BLL.ProjectService.GetProjectByProjectId(data.SubjectProject);
+ if (porject == null)
+ {
+ result = "总包单位不存在本项目,请检查总包项目关联是否正确!";
+ }
+ else
+ {
+ int succ = 0;
+ //3、保存数据
+ foreach (var item in data.Items)
+ {
+ try
+ {
+ var model = db.Meeting_ClassMeeting.FirstOrDefault(e => e.ClassMeetingId == item.ClassMeetingId);
+ if (model != null)
+ {//编辑
+ model.ProjectId = data.SubjectProject;
+ model.UnitId = unit.UnitId;
+ model.ClassMeetingCode = item.ClassMeetingCode;
+ model.ClassMeetingName = item.ClassMeetingName;
+ model.ClassMeetingDate = item.ClassMeetingDate;
+ model.AttentPersonNum = item.AttentPersonNum;
+ //model.TeamGroupId = item.TeamGroupId;
+ model.TeamGroupId = APIDataShareSyncService.GetTeamGroupId(item.TeamGroupName, data.SubjectProject, unit.UnitId);
+ model.AttentPersonNum = item.AttentPersonNum;
+ //model.ClassMeetingContents = HttpUtility.HtmlEncode(item.ClassMeetingContents);
+ model.ClassMeetingContents = item.ClassMeetingContents;
+ //model.States = item.States;
+ model.States = BLL.Const.State_2; ;//分包推送过来的班前会数据默认已完成
+ model.MeetingPlace = item.MeetingPlace;
+ model.MeetingHours = item.MeetingHours;
+ model.MeetingHostMan = item.MeetingHostMan;
+ model.AttentPerson = item.AttentPerson;
+ model.AttentPersonNum = item.AttentPersonNum;
+ //model.MeetingHostManOther = item.MeetingHostManOther;
+ //model.Remark = item.Remark;
+ model.Remark = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}";
+ model.CompileDate = item.CompileDate;
+ model.CompileMan = item.CompileMan;
+
+ db.SubmitChanges();
+ }
+ else
+ {//新增
+ Model.Meeting_ClassMeeting newModel = new Model.Meeting_ClassMeeting();
+ newModel.ClassMeetingId = item.ClassMeetingId;
+ newModel.ProjectId = data.SubjectProject;
+ newModel.UnitId = unit.UnitId;
+ newModel.ClassMeetingCode = item.ClassMeetingCode;
+ newModel.ClassMeetingName = item.ClassMeetingName;
+ newModel.ClassMeetingDate = item.ClassMeetingDate;
+ newModel.AttentPersonNum = item.AttentPersonNum;
+ //newModel.TeamGroupId = item.TeamGroupId;
+ newModel.TeamGroupId = APIDataShareSyncService.GetTeamGroupId(item.TeamGroupName, data.SubjectProject, unit.UnitId);
+ newModel.AttentPersonNum = item.AttentPersonNum;
+ //newModel.ClassMeetingContents = HttpUtility.HtmlEncode(item.ClassMeetingContents);
+ newModel.ClassMeetingContents = item.ClassMeetingContents;
+ //newModel.States = item.States;
+ newModel.States = BLL.Const.State_2; ;//分包推送过来的班前会数据默认已完成
+ newModel.MeetingPlace = item.MeetingPlace;
+ newModel.MeetingHours = item.MeetingHours;
+ newModel.MeetingHostMan = item.MeetingHostMan;
+ newModel.AttentPerson = item.AttentPerson;
+ newModel.AttentPersonNum = item.AttentPersonNum;
+ //newModel.MeetingHostManOther = item.MeetingHostManOther;
+ //newModel.Remark = item.Remark;
+ newModel.Remark = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}";
+ newModel.CompileDate = item.CompileDate;
+ newModel.CompileMan = item.CompileMan;
+
+ db.Meeting_ClassMeeting.InsertOnSubmit(newModel);
+ db.SubmitChanges();
+ }
+ succ++;
+ //附件处理:内容附件
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId, item.ToKeyId, item.AttachSource, item.AttachUrl);
+ //附件处理:签到表
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId1, item.ToKeyId1, item.AttachSource1, item.AttachUrl1);
+ //附件处理:会议过程
+ BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId2, item.ToKeyId2, item.AttachSource2, item.AttachUrl2);
+ }
+ catch (Exception ex)
+ {
+ BLL.ErrLogInfo.WriteLog($"【{porject.ProjectName}】班前会数据推送总包失败", ex.Message);
+ continue;
+ }
+ }
+ result = $"推送成功:总数{data.Items.Count()}条,成功{succ}条";
+ }
+ }
+ }
+ else
+ {
+ result = "推送数据对象为空!";
+ }
+ return result;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/DataShare/HSSE/APIPersonSyncService.cs b/SGGL/BLL/DataShare/HSSE/APIPersonSyncService.cs
new file mode 100644
index 00000000..9b57a64d
--- /dev/null
+++ b/SGGL/BLL/DataShare/HSSE/APIPersonSyncService.cs
@@ -0,0 +1,575 @@
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Configuration;
+using System.IO;
+using System.Net.Http;
+using System.Threading.Tasks;
+using Model;
+using Newtonsoft.Json;
+using RestSharp;
+using System.Net;
+
+namespace BLL
+{
+ public class APIPersonSyncService
+ {
+ #region 根据项目、单位获取人员列表分页
+
+ public static List GetPersonLitsByProjectIdAndUnitId(string projectId, string unitId,
+ string dataId = "")
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var list = from x in db.SitePerson_Person where x.ProjectId == projectId select x;
+ if (!string.IsNullOrEmpty(unitId))
+ {
+ list = list.Where(x => x.UnitId == unitId);
+ }
+
+ if (!string.IsNullOrEmpty(dataId))
+ {
+ list = list.Where(x => x.PersonId == dataId);
+ }
+
+ var personList = (from x in list
+ join wp in db.Base_WorkPost on x.WorkPostId equals wp.WorkPostId into wpTemp
+ from wp in wpTemp.DefaultIfEmpty()
+ join tg in db.ProjectData_TeamGroup on x.TeamGroupId equals tg.TeamGroupId into tgTemp
+ from tg in tgTemp.DefaultIfEmpty()
+ join c in db.Base_Certificate on x.CertificateId equals c.CertificateId into cTemp
+ from c in cTemp.DefaultIfEmpty()
+ join att1 in db.AttachFile on (x.PersonId + "#1") equals att1.ToKeyId into att1Temp
+ from att1 in att1Temp.DefaultIfEmpty()
+ join att2 in db.AttachFile on (x.PersonId + "#2") equals att2.ToKeyId into att2Temp
+ from att2 in att2Temp.DefaultIfEmpty()
+ join att3 in db.AttachFile on (x.PersonId + "#3") equals att3.ToKeyId into att3Temp
+ from att3 in att3Temp.DefaultIfEmpty()
+ join att4 in db.AttachFile on (x.PersonId + "#4") equals att4.ToKeyId into att4Temp
+ from att4 in att4Temp.DefaultIfEmpty()
+ join att5 in db.AttachFile on (x.PersonId + "#5") equals att5.ToKeyId into att5Temp
+ from att5 in att5Temp.DefaultIfEmpty()
+ select new Model.PersonSyncItem
+ {
+ PersonId = x.PersonId,
+ CardNo = x.CardNo,
+ PersonName = x.PersonName,
+ //Sex = x.Sex,
+ IdentityCard = x.IdentityCard,
+ //Address = x.Address,
+ ProjectId = x.ProjectId,
+ UnitId = x.UnitId,
+ TeamGroupId = x.TeamGroupId,
+ WorkAreaId = x.WorkAreaId,
+ WorkPostId = x.WorkPostId,
+ InTime = x.InTime,
+ OutTime = x.OutTime,
+ OutResult = x.OutResult,
+ //Telephone = x.Telephone,
+ // x.PositionId,//职务
+ // x.PostTitleId,//职称
+ //PhotoUrl = x.PhotoUrl,
+ //IsUsed = x.IsUsed,
+ //IsCardUsed = x.IsCardUsed,
+ //PersonIndex = x.PersonIndex,
+ // x.DepartId,//部门
+ CertificateId = x.CertificateId,
+ CertificateItem = APIDataShareSyncService.GetPersonQualityByPersonId(x.PersonId), //特岗证书
+ CertificateCode = x.CertificateCode,
+ CertificateName = c.CertificateName,
+ CertificateLimitTime = x.CertificateLimitTime,
+ //QualificationCertificateUrl = x.QualificationCertificateUrl,
+ //TrainingCertificateUrl = x.TrainingCertificateUrl,
+ //QRCodeAttachUrl = x.QRCodeAttachUrl,
+ //Password = x.Password,
+ //FromPersonId = x.FromPersonId,
+ // x.AuditorId,审核人
+ AuditorDate = x.AuditorDate,
+ ExchangeTime = x.ExchangeTime,
+ ExchangeTime2 = x.ExchangeTime2,
+ //IDCardUrl = x.IDCardUrl,
+ //IsForeign = x.IsForeign,
+ //IsOutside = x.IsOutside,
+ //EduLevel = x.EduLevel,
+ //MaritalStatus = x.MaritalStatus,
+ Isprint = x.Isprint,
+ //MainCNProfessionalId = x.MainCNProfessionalId,
+ //ViceCNProfessionalId = x.ViceCNProfessionalId,
+ //Birthday = x.Birthday,
+ //IdcardType = x.IdcardType,
+ //IdcardStartDate = x.IdcardStartDate,
+ //IdcardEndDate = x.IdcardEndDate,
+ //IdcardForever = x.IdcardForever,
+ //PoliticsStatus = x.PoliticsStatus,
+ //IdcardAddress = x.IdcardAddress,
+ //Nation = x.Nation,
+ //CountryCode = x.CountryCode,
+ IsSafetyMonitoring = x.IsSafetyMonitoring,
+ //ProvinceCode = x.ProvinceCode,
+ //IsCardNoOK = x.IsCardNoOK,
+ // AttachUrl1 = AttachFileService.getFileUrl(x.PersonId + "#1"),
+ // AttachUrl2 = AttachFileService.getFileUrl(x.PersonId + "#2"),
+ // AttachUrl3 = AttachFileService.getFileUrl(x.PersonId + "#3"),
+ // AttachUrl4 = AttachFileService.getFileUrl(x.PersonId + "#4"),
+ // AttachUrl5 = AttachFileService.getFileUrl(x.PersonId + "#5"),
+ AttachUrl1 = att1.AttachUrl,
+ AttachUrl2 = att2.AttachUrl,
+ AttachUrl3 = att3.AttachUrl,
+ AttachUrl4 = att4.AttachUrl,
+ AttachUrl5 = att5.AttachUrl,
+ WorkPostName = wp.WorkPostName, //岗位名称
+ PostType = wp.PostType, //岗位诶类型
+ IsHsse = wp.IsHsse, //岗位是否是安管人员
+ IsCQMS = wp.IsCQMS, //岗位是否是质量管理
+ TeamGroupName = tg.TeamGroupName,
+ WorkAreaName = APIDataShareSyncService.GetWorkAreaNames(x.WorkAreaId, projectId)
+ }).ToList();
+
+ return personList;
+ }
+ }
+
+ #endregion
+
+ #region 拉取项目人员数据
+
+ public static async Task getPersonLists()
+ {
+ int code = 0;
+ string message = "";
+ try
+ {
+ string CollCropCode = string.Empty;
+ string unitId = string.Empty;
+ var thisUnit = CommonService.GetIsThisUnit(); //当前单位
+ if (thisUnit != null)
+ {
+ CollCropCode = thisUnit.CollCropCode; //社会统一信用代码
+ unitId = thisUnit.UnitId;
+ }
+
+ var ProjectList = (from x in Funs.DB.Base_Project
+ where x.SubjectUnit != null &&
+ x.SubjectProject != null
+ select x).ToList();
+ if (ProjectList.Count > 0)
+ {
+ foreach (var project in ProjectList)
+ {
+ string SubjectUnitId = project.SubjectUnit; //集团的单位id
+ string SubjectProjectId = project.SubjectProject; //集团的单位id
+ //获取对应单位的apiurl地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(SubjectUnitId);
+ var ApiUrl = "";
+ var WebUrl = "";
+ if (!string.IsNullOrEmpty(Url))
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+
+ // CollCropCode = "913404001520228377Y";//测试使用
+ // SubjectProjectId = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
+ // unitId = "aaa9e72b-e3a6-441e-a7bb-afc008adebc9";//测试使用
+
+ string url = "/api/PersonSync/getPersonListByProjectIdAndCollCropCode?projectId=" +
+ SubjectProjectId + "&collCropCode=" + CollCropCode;
+ string baseurl = ApiUrl + url;
+
+ string contenttype = "application/json;charset=unicode";
+ var strJosn = "";
+ using (HttpClient client = new HttpClient())
+ {
+ client.Timeout = TimeSpan.FromMinutes(5); // 设置超时时间为5分钟
+ client.DefaultRequestHeaders.Add("token",
+ "AF17168B-87BD-4GLY-1111-F0A0A1158F9B"); // 前提是所有二级单位都有sysGLY账号且id是AF17168B-87BD-4GLY-1111-F0A0A1158F9B可作为token
+ strJosn = await client.GetStringAsync(baseurl);
+ }
+ // var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, null, null);
+ if (!string.IsNullOrEmpty(strJosn))
+ {
+ JObject obj = JObject.Parse(strJosn);
+ code = Funs.GetNewIntOrZero(obj["code"].ToString());
+ message = obj["message"].ToString();
+ if (code == 1)
+ {
+ var getData =
+ JsonConvert.DeserializeObject>(obj["data"].ToString());
+ if (getData.Count() > 0)
+ {
+ ProcessPersonData(getData, project.ProjectId, unitId, WebUrl);
+ }
+
+ message = "获取成功:同步人员数" + getData.Count().ToString() + "条";
+ }
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ message = "获取失败:" + ex.Message;
+ ErrLogInfo.WriteLog("人员获取!", ex);
+ }
+
+ return message;
+ }
+
+ #endregion
+
+ #region 推送人员数据
+
+ public static ReturnData pushPersonLists(string projectId, string dataId)
+ {
+ Model.ReturnData responeData = new Model.ReturnData();
+ responeData.code = 0;
+ responeData.message = string.Empty;
+ try
+ {
+ var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == projectId);
+ if (project != null)
+ {
+ //获取人员数据
+ var items = GetPersonLitsByProjectIdAndUnitId(projectId, "", dataId);
+ //总包地址推送
+ if (items.Count() > 0)
+ {
+ var thisUnit = CommonService.GetIsThisUnit(); //当前单位
+ var apiurl = "/api/PersonSync/SavePersonSyncData";
+ //总包单位接口地址
+ var Url = BLL.UnitService.getUnitApiUrlByUnitId(project.SubjectUnit);
+ var ApiUrl = "";
+ var WebUrl = "";
+ if (!string.IsNullOrEmpty(Url))
+ {
+ var urls = Url.Split(',');
+ ApiUrl = urls[0];
+ if (urls.Length > 1)
+ {
+ WebUrl = urls[1];
+ }
+ }
+
+ // thisUnit.CollCropCode = "913404001520228377Y"; //分包单位社会统一信用码 测试使用
+ // project.SubjectProject = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
+
+ var pushData = new PersonSyncData
+ {
+ CollCropCode = thisUnit.CollCropCode, //分包单位社会统一信用码
+ ProjectId = project.SubjectProject, //主包项目Id
+ UnitDomain = Funs.SGGLUrl, //分包单位域名地址【文件存储地址】
+ Items = items //人员数据
+ };
+ var pushContent = JsonConvert.SerializeObject(pushData);
+ string baseurl = ApiUrl + apiurl;
+ string contenttype = "application/json;charset=unicode";
+ var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, null, pushContent);
+ if (!string.IsNullOrEmpty(returndata))
+ {
+ JObject obj = JObject.Parse(returndata);
+ string code = obj["code"].ToString();
+ string message = obj["message"].ToString();
+ responeData.code = int.Parse(code);
+ responeData.message = message;
+ }
+ }
+ else
+ {
+ responeData.code = 0;
+ responeData.message = "当前没有项目人员数据";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.message = "同步到总包单位失败!";
+ ErrLogInfo.WriteLog("【项目人员】同步到总包单位失败!", ex);
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+ #region 接收保存项目人员数据
+
+ public static async Task SavePersonSyncData(Model.PersonSyncData items)
+ {
+ int code = 0;
+ string message = "";
+ try
+ {
+ if (items.Items.Count > 0)
+ {
+ //获取分包单位CollCropCode
+ var CollCropCode = items.CollCropCode;
+ var ProjectId = items.ProjectId;
+ var UnitDomain = items.UnitDomain; //分包单位域名地址【文件存储地址】
+ //1、判断分包单位是否存在
+ //根据分包单位CollCropCode获取单位id
+ var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == CollCropCode);
+ if (unit == null)
+ {
+ message = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
+ }
+ else
+ {
+ //2、判断主包项目是否存在
+ var porject = BLL.ProjectService.GetProjectByProjectId(ProjectId);
+ if (porject == null)
+ {
+ message = "总包单位不存在本项目,请检查总包项目关联是否正确!";
+ }
+ else
+ {
+ ProcessPersonData(items.Items, ProjectId, unit.UnitId, UnitDomain);
+ message = "数据推送成功!";
+ }
+ }
+ }
+ else
+ {
+ message = "暂无项目人员数据!";
+ }
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+
+ return message;
+ }
+
+ #endregion
+
+ #region 处理单项目人员数据的新增或更新逻辑
+
+ ///
+ /// 处理单项目人员数据的新增或更新逻辑
+ ///
+ /// 人员数据项
+ /// 项目id
+ /// 单位ID
+ /// Web地址
+ private static async void ProcessPersonData(List getData, string projectId, string unitId,
+ string WebUrl)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ foreach (var item in getData)
+ {
+ try
+ {
+ string IdentityCard = item.IdentityCard;
+ var model = db.SitePerson_Person.FirstOrDefault(e => e.IdentityCard == IdentityCard && e.ProjectId == projectId);
+ if (model == null)
+ {
+ Model.SitePerson_Person newModel = new Model.SitePerson_Person
+ {
+ PersonId = item.PersonId,
+ CardNo = item.CardNo,
+ PersonName = item.PersonName,
+ //Sex = item.Sex,
+ IdentityCard = item.IdentityCard,
+ //Address = item.Address,
+ ProjectId = projectId,
+ UnitId = unitId,
+ TeamGroupId = APIDataShareSyncService.GetTeamGroupId(item.TeamGroupName, projectId, unitId),
+ WorkAreaId = APIDataShareSyncService.getWorkAreaId(item.WorkAreaName, projectId),
+ WorkPostId = APIDataShareSyncService.getWorkPostId(item.WorkPostName, item.PostType,
+ item.IsHsse.ToString(), item.IsCQMS.ToString()),
+ InTime = item.InTime,
+ OutTime = item.OutTime,
+ OutResult = item.OutResult,
+ //Telephone = item.Telephone,
+ //PhotoUrl = item.PhotoUrl,
+ // 异步安全的头像下载
+ //HeadImage = await SafeDownloadHeadImageAsync(WebUrl, item.PhotoUrl),
+ //IsUsed = item.IsUsed,
+ //IsCardUsed = item.IsCardUsed,
+ //PersonIndex = item.PersonIndex,
+ CertificateId = item.CertificateId,
+ CertificateCode = item.CertificateCode,
+ CertificateLimitTime = item.CertificateLimitTime,
+ //QualificationCertificateUrl = item.QualificationCertificateUrl,
+ //TrainingCertificateUrl = item.TrainingCertificateUrl,
+ //QRCodeAttachUrl = item.QRCodeAttachUrl,
+ //Password = item.Password,
+ //FromPersonId = item.FromPersonId,
+ AuditorDate = item.AuditorDate,
+ ExchangeTime = item.ExchangeTime,
+ ExchangeTime2 = item.ExchangeTime2,
+ //IDCardUrl = item.IDCardUrl,
+ //IsForeign = item.IsForeign,
+ //IsOutside = item.IsOutside,
+ //EduLevel = item.EduLevel,
+ //MaritalStatus = item.MaritalStatus,
+ Isprint = item.Isprint,
+ //MainCNProfessionalId = item.MainCNProfessionalId,
+ //ViceCNProfessionalId = item.ViceCNProfessionalId,
+ //Birthday = item.Birthday,
+ //IdcardType = item.IdcardType,
+ //IdcardStartDate = item.IdcardStartDate,
+ //IdcardEndDate = item.IdcardEndDate,
+ //IdcardForever = item.IdcardForever,
+ //PoliticsStatus = item.PoliticsStatus,
+ //IdcardAddress = item.IdcardAddress,
+ //Nation = item.Nation,
+ //CountryCode = item.CountryCode,
+ IsSafetyMonitoring = item.IsSafetyMonitoring,
+ //ProvinceCode = item.ProvinceCode,
+ //IsCardNoOK = item.IsCardNoOK
+ };
+
+ db.SitePerson_Person.InsertOnSubmit(newModel);
+ db.SubmitChanges();
+ }
+ else
+ {
+ // 更新现有记录
+ UpdatePersonModel(model, item, projectId, unitId, WebUrl);
+ db.SubmitChanges();
+ }
+
+
+ // 异步安全的附件处理
+ await ProcessPersonAttachmentsAsync(WebUrl, item);
+
+ if (item.CertificateItem != null)
+ {
+ APIDataShareSyncService.ProcessPersonQualityData(item.CertificateItem, item.PersonId);
+ }
+ }
+ catch (Exception ex)
+ {
+ // 记录异常但不中断整个批处理
+ BLL.ErrLogInfo.WriteLog($"处理人员数据时出错 PersonId: {item?.PersonId}, 错误: {ex.Message}");
+ continue; // 继续处理下一个记录
+ }
+ }
+ }
+ }
+
+ // 安全的头像下载方法
+ public static async Task SafeDownloadHeadImageAsync(string webUrl, string photoUrl)
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(photoUrl))
+ return null;
+ return await APIDataShareSyncService.DownloadHeadImageAsync(webUrl, photoUrl);
+ }
+ catch (Exception ex)
+ {
+ BLL.ErrLogInfo.WriteLog($"下载头像失败: {photoUrl}, 错误: {ex.Message}");
+ return null;
+ }
+ }
+
+ // 更新人员模型的辅助方法
+ private static void UpdatePersonModel(Model.SitePerson_Person model, PersonSyncItem item, string projectId,
+ string unitId, string webUrl)
+ {
+ // model.PersonId = item.PersonId;
+ model.CardNo = item.CardNo;
+ model.PersonName = item.PersonName;
+ //model.Sex = item.Sex;
+ model.IdentityCard = item.IdentityCard;
+ //model.Address = item.Address;
+ model.ProjectId = projectId;
+ model.UnitId = unitId;
+ model.TeamGroupId = APIDataShareSyncService.GetTeamGroupId(item.TeamGroupName, projectId, unitId);
+ model.WorkAreaId = APIDataShareSyncService.getWorkAreaId(item.WorkAreaName, projectId);
+ model.WorkPostId = APIDataShareSyncService.getWorkPostId(item.WorkPostName, item.PostType,
+ item.IsHsse.ToString(), item.IsCQMS.ToString());
+ model.InTime = item.InTime;
+ model.OutTime = item.OutTime;
+ model.OutResult = item.OutResult;
+ //model.Telephone = item.Telephone;
+ //model.PhotoUrl = item.PhotoUrl;
+
+ // 异步操作需要特殊处理
+ Task.Run(async () =>
+ {
+ try
+ {
+ //model.HeadImage = await APIDataShareSyncService.DownloadHeadImageAsync(webUrl, item.PhotoUrl);
+ }
+ catch (Exception ex)
+ {
+ BLL.ErrLogInfo.WriteLog($"更新头像失败: {ex.Message}");
+ }
+ });
+
+ //model.IsUsed = item.IsUsed;
+ //model.IsCardUsed = item.IsCardUsed;
+ //model.PersonIndex = item.PersonIndex;
+ model.CertificateId = item.CertificateId;
+ model.CertificateCode = item.CertificateCode;
+ model.CertificateLimitTime = item.CertificateLimitTime;
+ //model.QualificationCertificateUrl = item.QualificationCertificateUrl;
+ //model.TrainingCertificateUrl = item.TrainingCertificateUrl;
+ //model.QRCodeAttachUrl = item.QRCodeAttachUrl;
+ //model.Password = item.Password;
+ //model.FromPersonId = item.FromPersonId;
+ model.AuditorDate = item.AuditorDate;
+ model.ExchangeTime = item.ExchangeTime;
+ model.ExchangeTime2 = item.ExchangeTime2;
+ //model.IDCardUrl = item.IDCardUrl;
+ //model.IsForeign = item.IsForeign;
+ //model.IsOutside = item.IsOutside;
+ //model.EduLevel = item.EduLevel;
+ //model.MaritalStatus = item.MaritalStatus;
+ model.Isprint = item.Isprint;
+ //model.MainCNProfessionalId = item.MainCNProfessionalId;
+ //model.ViceCNProfessionalId = item.ViceCNProfessionalId;
+ //model.Birthday = item.Birthday;
+ //model.IdcardType = item.IdcardType;
+ //model.IdcardStartDate = item.IdcardStartDate;
+ //model.IdcardEndDate = item.IdcardEndDate;
+ //model.IdcardForever = item.IdcardForever;
+ //model.PoliticsStatus = item.PoliticsStatus;
+ //model.IdcardAddress = item.IdcardAddress;
+ //model.Nation = item.Nation;
+ //model.CountryCode = item.CountryCode;
+ model.IsSafetyMonitoring = item.IsSafetyMonitoring;
+ //model.ProvinceCode = item.ProvinceCode;
+ //model.IsCardNoOK = item.IsCardNoOK;
+ }
+
+ // 异步安全的附件处理
+ private static async Task ProcessPersonAttachmentsAsync(string webUrl, PersonSyncItem item)
+ {
+ try
+ {
+ var attachmentTasks = new List
+ {
+ APIDataShareSyncService.OperationAttachFile(webUrl, item.PersonId + "#1", BLL.Const.PersonListMenuId,
+ item.AttachUrl1),
+ APIDataShareSyncService.OperationAttachFile(webUrl, item.PersonId + "#2", BLL.Const.PersonListMenuId,
+ item.AttachUrl2),
+ APIDataShareSyncService.OperationAttachFile(webUrl, item.PersonId + "#3", BLL.Const.PersonListMenuId,
+ item.AttachUrl3),
+ APIDataShareSyncService.OperationAttachFile(webUrl, item.PersonId + "#4", BLL.Const.PersonListMenuId,
+ item.AttachUrl4),
+ APIDataShareSyncService.OperationAttachFile(webUrl, item.PersonId + "#5", BLL.Const.PersonListMenuId,
+ item.AttachUrl5)
+ };
+
+ await Task.WhenAll(attachmentTasks);
+ }
+ catch (Exception ex)
+ {
+ BLL.ErrLogInfo.WriteLog($"处理人员附件失败 PersonId: {item.PersonId}, 错误: {ex.Message}");
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs b/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs
index 1e48080a..c0bd1c34 100644
--- a/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs
+++ b/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs
@@ -200,5 +200,15 @@ namespace BLL
db.SubmitChanges();
}
}
+
+ ///
+ /// 根据主键获取特殊岗位人员资质
+ ///
+ ///
+ ///
+ public static Model.QualityAudit_PersonQuality GetPersonQualityByPersonId(string personId)
+ {
+ return Funs.DB.QualityAudit_PersonQuality.FirstOrDefault(e => e.PersonId == personId);
+ }
}
}
diff --git a/SGGL/BLL/HSSE/Solution/TemporaryElectricityService.cs b/SGGL/BLL/HSSE/Solution/TemporaryElectricityService.cs
new file mode 100644
index 00000000..f98a5fbc
--- /dev/null
+++ b/SGGL/BLL/HSSE/Solution/TemporaryElectricityService.cs
@@ -0,0 +1,72 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+
+namespace BLL
+{
+ public class TemporaryElectricityService
+ {
+ ///
+ /// 获取临时用电方案信息
+ ///
+ ///
+ ///
+ public static Model.Solution_TemporaryElectricity GetTemporaryElectricityByTemporaryElectricityId(string TemporaryElectricityId)
+ {
+ return Funs.DB.Solution_TemporaryElectricity.FirstOrDefault(e => e.TemporaryElectricityId == TemporaryElectricityId);
+ }
+ ///
+ /// 添加临时用电方案信息
+ ///
+ ///
+ public static void AddTemporaryElectricity(Model.Solution_TemporaryElectricity TemporaryElectricity)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Solution_TemporaryElectricity newTemporaryElectricity = new Model.Solution_TemporaryElectricity();
+ newTemporaryElectricity.TemporaryElectricityId = TemporaryElectricity.TemporaryElectricityId;
+ newTemporaryElectricity.ProjectId = TemporaryElectricity.ProjectId;
+ newTemporaryElectricity.Code = TemporaryElectricity.Code;
+ newTemporaryElectricity.Name = TemporaryElectricity.Name;
+ newTemporaryElectricity.Content = TemporaryElectricity.Content;
+ newTemporaryElectricity.Remark = TemporaryElectricity.Remark;
+ newTemporaryElectricity.CompileMan = TemporaryElectricity.CompileMan;
+ newTemporaryElectricity.CompileDate = TemporaryElectricity.CompileDate;
+ db.Solution_TemporaryElectricity.InsertOnSubmit(newTemporaryElectricity);
+ db.SubmitChanges();
+ }
+
+ ///
+ /// 修改临时用电方案信息
+ ///
+ ///
+ public static void UpdateTemporaryElectricity(Model.Solution_TemporaryElectricity TemporaryElectricity)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Solution_TemporaryElectricity newTemporaryElectricity = db.Solution_TemporaryElectricity.FirstOrDefault(e => e.TemporaryElectricityId == TemporaryElectricity.TemporaryElectricityId);
+ if (newTemporaryElectricity != null)
+ {
+ newTemporaryElectricity.Code = TemporaryElectricity.Code;
+ newTemporaryElectricity.Name = TemporaryElectricity.Name;
+ newTemporaryElectricity.Content = TemporaryElectricity.Content;
+ newTemporaryElectricity.Remark = TemporaryElectricity.Remark;
+ newTemporaryElectricity.CompileMan = TemporaryElectricity.CompileMan;
+ newTemporaryElectricity.CompileDate = TemporaryElectricity.CompileDate;
+ db.SubmitChanges();
+ }
+ }
+ ///
+ /// 根据主键删除临时用电方案信息
+ ///
+ ///
+ public static void DeleteTemporaryElectricityById(string TemporaryElectricityId)
+ {
+ Model.SGGLDB db = Funs.DB;
+ Model.Solution_TemporaryElectricity TemporaryElectricity = db.Solution_TemporaryElectricity.FirstOrDefault(e => e.TemporaryElectricityId == TemporaryElectricityId);
+ if (TemporaryElectricity != null)
+ {
+ db.Solution_TemporaryElectricity.DeleteOnSubmit(TemporaryElectricity);
+ db.SubmitChanges();
+ }
+ }
+ }
+}
diff --git a/SGGL/BLL/OpenService/FileInsertService.cs b/SGGL/BLL/OpenService/FileInsertService.cs
index bf427c54..ddc5321f 100644
--- a/SGGL/BLL/OpenService/FileInsertService.cs
+++ b/SGGL/BLL/OpenService/FileInsertService.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
@@ -19,35 +20,45 @@ namespace BLL
{
List bytes = new List();
var strs = attachUrl.Trim().Split(',');
-
try
{
foreach (var fileUrl in strs)
{
- string filepath = $"{fileHost}{fileUrl}";
- // 创建WebClient实例
- using (WebClient webClient = new WebClient())
+ string path = ConfigurationManager.AppSettings["localRoot"] + fileUrl;
+ if (!File.Exists(path))
{
- // 下载图片并保存到内存流
- using (MemoryStream ms = new MemoryStream(webClient.DownloadData(filepath)))
+ //BLL.ErrLogInfo.WriteLog($"不存在则新增,附件地址:{path}");
+ string filepath = $"{fileHost}{fileUrl}";
+ //BLL.ErrLogInfo.WriteLog($"不存在则新增,责任单位附件地址:{filepath}");
+ // 创建WebClient实例
+ using (WebClient webClient = new WebClient())
{
- // 将MemoryStream转换为byte数组
- byte[] imageBytes = ms.ToArray();
- bytes.Add(imageBytes);
- //// 使用byte数组(例如,保存到文件或进行其他处理)
- //File.WriteAllBytes("localImage.jpg", imageBytes);
+ // 下载图片并保存到内存流
+ using (MemoryStream ms = new MemoryStream(webClient.DownloadData(filepath)))
+ {
+ // 将MemoryStream转换为byte数组
+ byte[] imageBytes = ms.ToArray();
+ bytes.Add(imageBytes);
+ //// 使用byte数组(例如,保存到文件或进行其他处理)
+ //File.WriteAllBytes("localImage.jpg", imageBytes);
+ }
}
}
+ //else
+ //{
+ // BLL.ErrLogInfo.WriteLog($"已存在附件地址:{path}");
+ //}
}
}
catch (Exception ex)
{
- Console.WriteLine("Error: " + ex.Message);
+ BLL.ErrLogInfo.WriteLog($"服务器图片转换异常:{fileHost};图片地址:{attachUrl}", ex.Message);
}
return bytes;
}
+
///
/// 获取附件数据流类
///
@@ -89,55 +100,38 @@ namespace BLL
///
public static void FileMoreInsert(List fileContextList, string attachUrl)
{
- if (fileContextList != null && fileContextList.Count() > 0)
+ if (fileContextList.Count > 0)
{
- if (fileContextList.Count > 0)
+ string[] strs = attachUrl.Trim().Split(',');
+ int i = 0;
+ string physicalpath = ConfigurationManager.AppSettings["localRoot"];
+ foreach (var item in fileContextList)
{
- string[] strs = attachUrl.Trim().Split(',');
- int i = 0;
- foreach (var item in fileContextList)
+ //HttpContext.Current.Request.PhysicalApplicationPath;
+ string fullPath = (physicalpath + strs[i]).Replace('/', '\\');
+ if (!File.Exists(fullPath))
{
- if (strs.Count() > i)
+ byte[] fileContext = item;
+ int index = fullPath.LastIndexOf("\\");
+ string filePath = fullPath.Substring(0, index);
+
+ if (!Directory.Exists(filePath))
{
- string physicalpath = Funs.AttachRootPath;
- string fpath = strs[i];
- string fullPath = physicalpath + fpath;
- if (!File.Exists(fullPath))
- {
- byte[] fileContext = item;
- string fileName = Regex.Match(fullPath, @"[^/\\?]+(\?.*)?$").Value;
- string filePath = fullPath.Replace(fileName, "");
- //int index = fullPath.LastIndexOf("\\");
- //string filePath = fullPath.Substring(0, index) ;
- //string filePath = index > 0 ? fullPath.Substring(0, index) : fullPath;
+ Directory.CreateDirectory(filePath);
+ }
+ //string savePath = fullPath + fileName;
- try
- {
- if (!Directory.Exists(filePath))
- {
- Directory.CreateDirectory(filePath);
- }
- }
- catch (Exception ex)
- {
- ErrLogInfo.WriteLog($"附件【{filePath}】获取异常!");
- //continue;
- }
- //string savePath = fullPath + fileName;
+ //文件读写模式
+ System.IO.FileMode fileMode = System.IO.FileMode.Create;
- //文件读写模式
- System.IO.FileMode fileMode = System.IO.FileMode.Create;
-
- //写入文件
- using (System.IO.FileStream fs = new System.IO.FileStream(fullPath, fileMode, System.IO.FileAccess.Write))
- {
- fs.Write(fileContext, 0, fileContext.Length);
- }
- }
-
- i++;
+ //写入文件
+ using (System.IO.FileStream fs = new System.IO.FileStream(fullPath, fileMode, System.IO.FileAccess.Write))
+ {
+ fs.Write(fileContext, 0, fileContext.Length);
}
}
+
+ i++;
}
}
}
@@ -223,5 +217,66 @@ namespace BLL
}
}
+ ///
+ /// 保存其他单位附件同步处理
+ ///
+ /// 单位域名地址
+ /// 附件id
+ /// 附件keyid
+ /// 附件json信息
+ /// 附件地址
+ public static void SaveAttachFileRecords(string domain, string attachFileId, string tokeyId, string attachSource, string attachUrl)
+ {
+ if (!string.IsNullOrEmpty(attachFileId) && !string.IsNullOrEmpty(attachSource) && !string.IsNullOrEmpty(attachUrl))
+ {
+ List FileContext = new List();
+ if (!string.IsNullOrWhiteSpace(domain) && !string.IsNullOrWhiteSpace(attachUrl))
+ {
+ FileContext = FilePathTransStream(domain, attachUrl);
+ }
+ InsertAttachFilesRecord(attachFileId, tokeyId, attachSource, attachUrl, FileContext);
+ }
+ }
+
+ ///
+ /// 数据和附件插入到多附件表
+ ///
+ public static void InsertAttachFilesRecord(string attachFileId, string dataId, string attachSource, string attachUrl, List fileContext)
+ {
+ if (!string.IsNullOrEmpty(attachFileId))
+ {
+ //多附件
+ var attachFile = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
+ if (attachFile == null)
+ {
+ ////插入附件文件
+ BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
+
+ Model.AttachFile newAttachFile = new Model.AttachFile
+ {
+ AttachFileId = attachFileId,
+ ToKeyId = dataId,
+ AttachSource = attachSource,
+ AttachUrl = attachUrl
+ };
+ Funs.DB.AttachFile.InsertOnSubmit(newAttachFile);
+ Funs.DB.SubmitChanges();
+ }
+ else
+ {
+ if (attachFile.AttachUrl != attachUrl)
+ {
+ /////删除附件文件
+ //BLL.UploadAttachmentService.DeleteFile(ConfigurationManager.AppSettings["localRoot"], attachFile.AttachUrl);
+ ////插入附件文件
+ BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
+ attachFile.AttachSource = attachSource;
+ attachFile.AttachUrl = attachUrl;
+ Funs.DB.SubmitChanges();
+ }
+ }
+ }
+ }
+
}
}
diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs
index ac4848fe..ed165f4b 100644
--- a/SGGL/BLL/Person/Person_PersonsService.cs
+++ b/SGGL/BLL/Person/Person_PersonsService.cs
@@ -1482,5 +1482,90 @@ namespace BLL
return list;
}
}
+
+ ///
+ /// 用户下拉框
+ ///
+ /// 下拉框名字
+ /// 项目id
+ /// 是否显示请选择
+ public static void InitUserDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease, string UnitId)
+ {
+ dropName.DataValueField = "Value";
+ dropName.DataTextField = "Text";
+ if (!string.IsNullOrWhiteSpace(UnitId))
+ {
+ dropName.DataSource = GetUserByUnitId(projectId, UnitId);
+ }
+ else
+ {
+ dropName.DataSource = GetMainUserList(projectId);
+ }
+
+ dropName.DataBind();
+ if (isShowPlease)
+ {
+ Funs.FineUIPleaseSelect(dropName);
+ }
+ }
+
+ ///
+ /// 获取项目总包用户
+ ///
+ ///
+ ///
+ public static ListItem[] GetMainUserList(string projectId)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ //var user = (from x in db.Sys_User
+ // join y in db.Project_ProjectUser on x.UserId equals y.UserId
+ // join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
+ // where x.IsPost == true && y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == Const.ProjectUnitType_1
+ // orderby x.UserId
+ // select x).ToList();
+ var user = (from x in db.SitePerson_Person
+ join y in db.Person_Persons on x.PersonId equals y.PersonId
+ join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
+ where y.IsPost == true && x.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == Const.ProjectUnitType_1 && x.RoleIds != null && x.RoleIds != string.Empty
+ orderby x.PersonId
+ select new
+ {
+ UserName = y.PersonName,
+ UserId = x.PersonId
+ }).Distinct().ToList();
+ ListItem[] lis = new ListItem[user.Count()];
+ for (int i = 0; i < user.Count(); i++)
+ {
+ lis[i] = new ListItem(user[i].UserName ?? "", user[i].UserId.ToString());
+ }
+ return lis;
+ }
+ }
+
+ ///
+ /// 获取在岗用户下拉选项
+ ///
+ ///
+ public static List GetProjectUserListByProjectId(string projectId)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var users = (from x in db.Person_Persons
+ where x.IsPost == true && x.PersonId != Const.hfnbdId && x.PersonId != Const.sedinId && x.RoleIds != null && x.RoleIds != string.Empty
+ orderby x.PersonName
+ select x).ToList();
+ if (!string.IsNullOrEmpty(projectId))
+ {
+ users = (from x in users
+ join y in db.SitePerson_Person on x.PersonId equals y.PersonId
+ where y.ProjectId == projectId
+ orderby x.PersonName
+ select x).ToList();
+ }
+
+ return users;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/ProjectData/ProjectService.cs b/SGGL/BLL/ProjectData/ProjectService.cs
index 604285d7..da99e6db 100644
--- a/SGGL/BLL/ProjectData/ProjectService.cs
+++ b/SGGL/BLL/ProjectData/ProjectService.cs
@@ -127,6 +127,9 @@
ProjectRealCode = project.ProjectRealCode,
IsCNCECShow = project.IsCNCECShow,
MasterSysId = project.MasterSysId,
+ SubjectUnit = project.SubjectUnit,
+ SubjectProject = project.SubjectProject,
+
};
db.Base_Project.InsertOnSubmit(newProject);
db.SubmitChanges();
@@ -174,6 +177,8 @@
newProject.ProjectRealCode = project.ProjectRealCode;
newProject.IsCNCECShow = project.IsCNCECShow;
newProject.MasterSysId = project.MasterSysId;
+ newProject.SubjectUnit = project.SubjectUnit;
+ newProject.SubjectProject = project.SubjectProject;
db.SubmitChanges();
HSEDataCollectService.ProjectHSEDataCollectSubmission(newProject);
@@ -731,5 +736,55 @@
Funs.FineUIPleaseSelect(dropName);
}
}
+
+ ///
+ /// 项目表下拉框
+ ///
+ /// 下拉框名字
+ /// 是否显示请选择
+ public static void InitProjectDropDownList(FineUIPro.DropDownList dropName, string unitId, bool isShowPlease)
+ {
+ var IsThisUnit = BLL.Const.UnitId_SEDIN == unitId ? true : false;
+ dropName.DataValueField = "ProjectId";
+ dropName.DataTextField = "ProjectName";
+ if (IsThisUnit)
+ {
+ dropName.DataSource = BLL.ProjectService.GetProjectWorkList();
+
+ }
+ else
+ {
+ dropName.DataSource = BLL.ProjectService.GetProjectWorkList(unitId);
+
+ }
+ dropName.DataBind();
+ if (isShowPlease)
+ {
+ Funs.FineUIPleaseSelect(dropName);
+ }
+ }
+
+ ///
+ /// 获取施工中项目集合
+ ///
+ ///
+ public static List GetProjectWorkList(string unitId)
+ {
+ var getDatas = from x in Funs.DB.Base_Project
+ where (x.ProjectState == null || x.ProjectState == BLL.Const.ProjectState_1)
+ select x;
+
+ if (unitId == BLL.Const.UnitId_SEDIN)
+ {
+ getDatas = getDatas.Where(x => x.UnitId == unitId || x.UnitId == null);
+ }
+ else
+ {
+ getDatas = getDatas.Where(x => x.UnitId == unitId);
+ }
+ var list = getDatas.OrderBy(x => x.ProjectName).ToList();
+
+ return list;
+ }
}
}
\ No newline at end of file
diff --git a/SGGL/BLL/SQLHelper.cs b/SGGL/BLL/SQLHelper.cs
index 2df3da35..76c6908f 100644
--- a/SGGL/BLL/SQLHelper.cs
+++ b/SGGL/BLL/SQLHelper.cs
@@ -422,6 +422,40 @@ namespace BLL
}
}
+ ///
+ /// ִSQL
+ ///
+ /// sql
+ public static bool ExecuteSql(string sql)
+ {
+ bool result = false;
+ using (SqlConnection Connection = new SqlConnection(connectionString))
+ {
+ try
+ {
+ result = true;
+ Connection.Open();
+ SqlCommand command = new SqlCommand(sql, Connection)
+ {
+ CommandTimeout = 0,
+ CommandType = CommandType.Text
+ };
+ command.ExecuteNonQuery();
+ }
+ catch (Exception ex)
+ {
+ result = false;
+ ErrLogInfo.WriteLog($"ִSQL䱨{sql}Ϣ{ex.Message}");
+ }
+ finally
+ {
+ Connection.Close();
+ }
+ return result;
+ }
+ }
+
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// Creates a DataSet by running the stored procedure and placing the results
diff --git a/SGGL/BLL/SysManage/UnitService.cs b/SGGL/BLL/SysManage/UnitService.cs
index b40fcef1..beb28306 100644
--- a/SGGL/BLL/SysManage/UnitService.cs
+++ b/SGGL/BLL/SysManage/UnitService.cs
@@ -1,5 +1,7 @@
using Model;
+using Newtonsoft.Json.Linq;
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
@@ -825,5 +827,188 @@ namespace BLL
Funs.FineUIPleaseSelect(dropName);
}
}
+
+ #region 获取集团单位列表
+
+ ///
+ /// 获取集团单位列表
+ ///
+ ///
+ public static List getUnitLists()
+ {
+ var responeData = new Model.ResponeData();
+ List list = new List();
+ try
+ {
+ string baseurl = $"{SysConstSetService.CNCECPath}/api/Unit/getUnitLists";
+ // string baseurl = "http://localhost:7143/api/Unit/getUnitLists";
+ string contenttype = "application/json;charset=unicode";
+ Hashtable newToken = new Hashtable
+ {
+ { "token", ServerService.GetToken().Token }
+ };
+ var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, newToken, null);
+ if (!string.IsNullOrEmpty(strJosn))
+ {
+ JObject obj = JObject.Parse(strJosn);
+ responeData.code = Funs.GetNewIntOrZero(obj["code"].ToString());
+ responeData.message = obj["message"].ToString();
+ if (responeData.code == 1)
+ {
+ JArray getData = JArray.Parse(obj["data"].ToString());
+ if (getData.Count() > 0)
+ {
+ foreach (var item in getData)
+ {
+ var q = new Model.BaseInfoItem();
+ q.BaseInfoId = item["BaseInfoId"].ToString();
+ q.BaseInfoName = item["BaseInfoName"].ToString();
+ q.BaseInfoCode = item["BaseInfoCode"].ToString();
+ list.Add(q);
+ }
+ }
+ responeData.message = "获取成功:集团单位数" + getData.Count().ToString() + "条";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = "获取失败:" + ex.Message;
+ ErrLogInfo.WriteLog("获取集团单位列表!", ex);
+ }
+
+ return list;
+ }
+
+ #endregion
+
+
+ #region 根据单位获取项目列表
+
+ ///
+ /// 获取集团单位列表
+ ///
+ ///
+ public static List getProjectListByUnitId(string userId)
+ {
+ var responeData = new Model.ResponeData();
+ List list = new List();
+ try
+ {
+ string baseurl = $"{SysConstSetService.CNCECPath}/api/Unit/getProjectListByUnitId?unitId=" + userId + "&projectName=" + "&pageIndex=0";
+ // string baseurl = "http://localhost:7143/api/Unit/getProjectListByUnitId?unitId=" + userId + "&projectName=" + "&pageIndex=0" ;
+ string contenttype = "application/json;charset=unicode";
+ Hashtable newToken = new Hashtable
+ {
+ { "token", ServerService.GetToken().Token }
+ };
+ var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, newToken, null);
+ if (!string.IsNullOrEmpty(strJosn))
+ {
+ JObject obj = JObject.Parse(strJosn);
+ responeData.code = Funs.GetNewIntOrZero(obj["code"].ToString());
+ responeData.message = obj["message"].ToString();
+ if (responeData.code == 1)
+ {
+ JArray getData = JArray.Parse(obj["data"].ToString());
+ if (getData.Count() > 0)
+ {
+ foreach (var item in getData)
+ {
+ var q = new Model.BaseInfoItem();
+ q.BaseInfoId = item["BaseInfoId"].ToString();
+ q.BaseInfoName = item["BaseInfoName"].ToString();
+ q.BaseInfoCode = item["BaseInfoCode"].ToString();
+ list.Add(q);
+ }
+ }
+ responeData.message = "获取成功:集团项目数" + getData.Count().ToString() + "条";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = "获取失败:" + ex.Message;
+ ErrLogInfo.WriteLog("获取集团项目数!", ex);
+ }
+
+ return list;
+ }
+
+ #endregion
+
+
+ #region 根据单位id获取单位信息列表
+
+ ///
+ /// 获取集团单位列表
+ ///
+ ///
+ public static string getUnitApiUrlByUnitId(string userId)
+ {
+ string url = "";
+ try
+ {
+ string baseurl = $"{SysConstSetService.CNCECPath}/api/Unit/getUnitApiUrlByUnitId?unitId=" + userId;
+ // string baseurl = "http://localhost:7143/api/Unit/getUnitApiUrlByUnitId?unitId=" + userId;
+ string contenttype = "application/json;charset=unicode";
+ Hashtable newToken = new Hashtable
+ {
+ { "token", ServerService.GetToken().Token }
+ };
+ var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, newToken, null);
+ if (!string.IsNullOrEmpty(strJosn))
+ {
+ JObject obj = JObject.Parse(strJosn);
+ if (Funs.GetNewIntOrZero(obj["code"].ToString()) == 1)
+ {
+ if (obj["data"] != null)
+ {
+ JObject dataObj = obj["data"] as JObject;
+ if (dataObj != null && dataObj["BaseInfoCode"] != null)
+ {
+ url = dataObj["BaseInfoCode"].ToString();
+ }
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ ErrLogInfo.WriteLog("获取失败!", ex);
+ }
+
+ return url;
+ }
+
+ #endregion
+
+ ///
+ /// 获取分公司表下拉框
+ ///
+ ///
+ ///
+ public static void InitBranchUnitDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
+ {
+ dropName.DataValueField = "UnitId";
+ dropName.DataTextField = "UnitName";
+ dropName.DataSource = BLL.UnitService.GetMainAndSubUnitList();
+ dropName.DataBind();
+ if (isShowPlease)
+ {
+ Funs.FineUIPleaseSelect(dropName);
+ }
+ }
+
+ ///
+ /// 获取当前单位下分公司拉选项
+ ///
+ ///
+ public static List GetMainAndSubUnitList()
+ {
+ return (from x in Funs.DB.Base_Unit where x.UnitId == BLL.Const.UnitId_SEDIN || x.IsBranch == true select x).ToList();
+ }
}
}
diff --git a/SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterItemService.cs b/SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterItemService.cs
new file mode 100644
index 00000000..79d81776
--- /dev/null
+++ b/SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterItemService.cs
@@ -0,0 +1,338 @@
+using System;
+using Model;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 企业级检查明细服务
+ ///
+ public static class UnitHazardRegisterItemService
+ {
+ #region Methods
+
+ ///
+ /// 添加明细记录
+ ///
+ /// 明细记录
+ public static void AddUnitHazardRegisterItem(Model.Supervise_UnitHazardRegisterItem item)
+ {
+ Funs.DB.Supervise_UnitHazardRegisterItem.InsertOnSubmit(item);
+ Funs.DB.SubmitChanges();
+ }
+
+ ///
+ /// 根据主表ID删除所有明细
+ ///
+ /// 主表ID
+ public static void DeleteItemsByRegisterId(string registerId)
+ {
+ var items = (from x in Funs.DB.Supervise_UnitHazardRegisterItem
+ where x.UnitHazardRegisterId == registerId
+ select x).ToList();
+ if (items.Count > 0)
+ {
+ Funs.DB.Supervise_UnitHazardRegisterItem.DeleteAllOnSubmit(items);
+ Funs.DB.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 删除明细记录
+ ///
+ /// 明细ID
+ public static void DeleteUnitHazardRegisterItemById(string itemId)
+ {
+ Model.Supervise_UnitHazardRegisterItem item =
+ Funs.DB.Supervise_UnitHazardRegisterItem.FirstOrDefault(e => e.UnitHazardRegisterItemId == itemId);
+ if (item != null)
+ {
+ Funs.DB.Supervise_UnitHazardRegisterItem.DeleteOnSubmit(item);
+ Funs.DB.SubmitChanges();
+ }
+ }
+
+ ///
+ /// 根据风险级别获取明细数量
+ ///
+ /// 主表ID
+ /// 风险级别
+ /// 明细数量
+ public static int GetCountByRiskLevel(string registerId, string riskLevel)
+ {
+ return (from x in Funs.DB.Supervise_UnitHazardRegisterItem
+ where x.UnitHazardRegisterId == registerId && x.RiskLevel == riskLevel
+ select x).Count();
+ }
+
+ ///
+ /// 获取已完成的明细数量
+ ///
+ /// 主表ID
+ /// 已完成数量
+ public static int GetFinishedCount(string registerId)
+ {
+ return (from x in Funs.DB.Supervise_UnitHazardRegisterItem
+ where x.UnitHazardRegisterId == registerId && x.CompleteStatus == 1
+ select x).Count();
+ }
+
+ ///
+ /// 根据主表ID获取明细列表
+ ///
+ /// 主表ID
+ /// 明细列表
+ public static List GetItemsByRegisterId(string registerId)
+ {
+ return (from x in Funs.DB.Supervise_UnitHazardRegisterItem
+ where x.UnitHazardRegisterId == registerId
+ orderby x.SortIndex
+ select x).ToList();
+ }
+
+ ///
+ /// 获取主单的整改状态
+ ///
+ /// 主单ID
+ /// 整改状态:0=全部未整改,1=部分整改,2=全部整改
+ public static int GetRectifyStatus(string registerId)
+ {
+ var items = GetItemsByRegisterId(registerId);
+
+ if (items.Count == 0)
+ {
+ return 0; // 无明细,视为全部未整改
+ }
+
+ int finishedCount = items.Count(x => x.CompleteStatus == 1);
+ int totalCount = items.Count;
+
+ if (finishedCount == 0)
+ {
+ return 0; // 全部未整改
+ }
+ else if (finishedCount < totalCount)
+ {
+ return 1; // 部分整改
+ }
+ else
+ {
+ return 2; // 全部整改
+ }
+ }
+
+ ///
+ /// 获取整改状态文本
+ ///
+ /// 主单ID
+ /// 状态文本
+ public static string GetRectifyStatusText(string registerId)
+ {
+ int status = GetRectifyStatus(registerId);
+ switch (status)
+ {
+ case 0:
+ return "全部未整改";
+
+ case 1:
+ return "部分整改";
+
+ case 2:
+ return "全部整改";
+
+ default:
+ return "未知";
+ }
+ }
+
+ ///
+ /// 获取未完成的明细数量
+ ///
+ /// 主表ID
+ /// 未完成数量
+ public static int GetUnfinishedCount(string registerId)
+ {
+ return (from x in Funs.DB.Supervise_UnitHazardRegisterItem
+ where x.UnitHazardRegisterId == registerId && (x.CompleteStatus == null || x.CompleteStatus == 0)
+ select x).Count();
+ }
+
+ ///
+ /// 根据明细ID获取明细记录
+ ///
+ /// 明细ID
+ /// 明细记录
+ public static Model.Supervise_UnitHazardRegisterItem GetUnitHazardRegisterItemById(string itemId)
+ {
+ return Funs.DB.Supervise_UnitHazardRegisterItem.FirstOrDefault(e => e.UnitHazardRegisterItemId == itemId);
+ }
+
+
+ ///
+ /// 获取企业级检查明细列表(使用input对象,返回总数)
+ ///
+ /// 查询条件
+ /// 页码(从0开始)
+ /// 每页大小
+ /// 是否返回所有数据(不分页)
+ /// 总记录数
+ /// 检查明细列表
+ public static List GetUnitHazardRegisterItems(
+ UnitHazardRegisterItemInput input,
+ int pageIndex,
+ int pageSize,
+ bool returnAll,
+ out int totalCount)
+ {
+ var db = Funs.DB;
+ var query = from i in db.Supervise_UnitHazardRegisterItem
+ join r in db.Supervise_UnitHazardRegister
+ on i.UnitHazardRegisterId equals r.UnitHazardRegisterId
+ join ct in db.Base_SuperviseCheckType
+ on new { MainType = r.CheckMainType, TypeCode = r.CheckType }
+ equals new { MainType = ct.CheckMainType, TypeCode = ct.CheckTypeCode } into ctGroup
+ from ct in ctGroup.DefaultIfEmpty()
+ join u in db.Base_Unit
+ on r.CheckUnitId equals u.UnitId into uGroup
+ from u in uGroup.DefaultIfEmpty()
+ join user in db.Person_Persons on r.InsResponsibleUserId equals user.PersonId into userGroup
+ from user in userGroup.DefaultIfEmpty()
+ select new UnitHazardRegisterItemOutput
+ {
+ UnitHazardRegisterItemId = i.UnitHazardRegisterItemId,
+ UnitHazardRegisterCode = r.UnitHazardRegisterCode,
+ CheckDate = r.CheckDate,
+ CheckMainTypeName = r.CheckMainType == "0" ? "安全" : "质量",
+ CheckTypeName = ct.CheckTypeName,
+ ProblemDescription = i.ProblemDescription,
+ ProblemType = i.ProblemType,
+ RiskLevel = i.RiskLevel,
+ RectifyRequirement = i.RectifyRequirement,
+ StatesName = UnitHazardRegisterService.ConvertState(r.States.Value),
+ CheckTeam = r.CheckTeam,
+ ProjectId = r.ProjectId,
+ CheckUnitName = u.UnitName,
+ States = r.States,
+ ProblemStatesName = i.CompleteStatus==1 ? "已整改":"未整改",
+ ProblemStates = i.CompleteStatus,
+ InsResponsibleUserId = r.InsResponsibleUserId,
+ InsResponsibleUserName= user.PersonName
+ };
+
+ // 应用检查大类过滤
+ if (input != null && !string.IsNullOrEmpty(input.CheckMainType))
+ {
+ query = query.Where(x => x.CheckMainTypeName.Contains(input.CheckMainType == "0" ? "安全" : "质量"));
+ }
+ // 项目id过滤
+ if (input != null && !string.IsNullOrEmpty(input.ProjectId))
+ {
+ query = query.Where(x => x.ProjectId.Contains(input.ProjectId));
+ }
+ // 检查组/人搜索
+ if (input != null && !string.IsNullOrEmpty(input.CheckTeam))
+ {
+ query = query.Where(x => x.CheckTeam.Contains(input.CheckTeam));
+ }
+
+ // 检查类别搜索
+ if (input != null && !string.IsNullOrEmpty(input.CheckType))
+ {
+ query = query.Where(x => x.CheckTypeName != null && x.CheckTypeName.Contains(input.CheckType));
+ }
+
+ // 问题描述搜索
+ if (input != null && !string.IsNullOrEmpty(input.Problem))
+ {
+ query = query.Where(x => x.ProblemDescription.Contains(input.Problem));
+ }
+
+ // 检查时间范围
+ if (input != null && input.StartTime.HasValue)
+ {
+ query = query.Where(x => x.CheckDate >= input.StartTime.Value);
+ }
+
+ if (input != null && input.EndTime.HasValue)
+ {
+ query = query.Where(x => x.CheckDate <= input.EndTime.Value);
+ }
+
+ // 风险级别过滤
+ if (input != null && !string.IsNullOrEmpty(input.RiskLevel) && input.RiskLevel != "null")
+ {
+ query = query.Where(x => x.RiskLevel == input.RiskLevel);
+ }
+
+ // 状态过滤
+ if (input != null && input.States != null)
+ {
+ query = query.Where(x => x.States == input.States);
+ }
+ // 问题整改状态过滤
+ if (input != null && input.ProblemStates != null)
+ {
+ query = query.Where(x => x.ProblemStates == input.ProblemStates);
+ }
+ // 单位权限过滤
+ if (input != null && !string.IsNullOrEmpty(input.UnitId))
+ {
+ var thisUnit = BLL.CommonService.GetIsThisUnit();
+ if (thisUnit.UnitId != input.UnitId)
+ {
+ // 先获取用户有权限的项目ID列表
+ var projectIds = (from p in Funs.DB.Base_Project
+ where p.UnitId == input.UnitId
+ select p.ProjectId).ToList();
+
+ // 过滤查询结果
+ query = query.Where(x => Funs.DB.Supervise_UnitHazardRegister
+ .Any(r => Funs.DB.Supervise_UnitHazardRegisterItem
+ .Any(i => i.UnitHazardRegisterItemId == x.UnitHazardRegisterItemId &&
+ i.UnitHazardRegisterId == r.UnitHazardRegisterId &&
+ projectIds.Contains(r.ProjectId))));
+ }
+ }
+
+ // 获取总数
+ totalCount = query.Count();
+
+ // 排序和分页
+ var orderedQuery = query.OrderByDescending(x => x.CheckDate);
+
+ if (returnAll)
+ {
+ return orderedQuery.ToList();
+ }
+
+ return orderedQuery
+ .Skip(pageIndex * pageSize)
+ .Take(pageSize)
+ .ToList();
+ }
+
+ ///
+ /// 更新明细记录
+ ///
+ /// 明细记录
+ public static void UpdateUnitHazardRegisterItem(Model.Supervise_UnitHazardRegisterItem item)
+ {
+ Model.Supervise_UnitHazardRegisterItem oldItem =
+ Funs.DB.Supervise_UnitHazardRegisterItem.FirstOrDefault(e => e.UnitHazardRegisterItemId == item.UnitHazardRegisterItemId);
+ if (oldItem != null)
+ {
+ oldItem.ProblemDescription = item.ProblemDescription;
+ oldItem.ProblemType = item.ProblemType;
+ oldItem.RiskLevel = item.RiskLevel;
+ oldItem.RectifyRequirement = item.RectifyRequirement;
+ oldItem.CompleteStatus = item.CompleteStatus;
+ oldItem.CompletedDate = item.CompletedDate;
+ oldItem.SortIndex = item.SortIndex;
+ Funs.DB.SubmitChanges();
+ }
+ }
+
+ #endregion Methods
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterService.cs b/SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterService.cs
new file mode 100644
index 00000000..e9178e85
--- /dev/null
+++ b/SGGL/BLL/ZHGL/Supervise/UnitHazardRegisterService.cs
@@ -0,0 +1,301 @@
+using System;
+using Model;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 企业级检查主表服务
+ ///
+ public static class UnitHazardRegisterService
+ {
+ #region Fields
+
+ public static Dictionary StateMap = new Dictionary
+ {
+ { "待提交" ,(int)StateInt.待提交},
+ { "待整改" ,(int)StateInt.待整改},
+ { "部分整改" ,(int)StateInt.部分整改},
+ { "已闭环" ,(int)StateInt.已闭环},
+ };
+
+ #endregion Fields
+
+ #region Enums
+
+ public enum StateInt : int
+ {
+ 待提交 = 0,
+ 待整改= 1,
+ 部分整改 = 2,
+ 已闭环 = 3,
+ }
+
+ #endregion Enums
+
+ #region Methods
+
+ ///
+ /// 添加企业级检查记录
+ ///
+ /// 企业级检查记录
+ public static void AddUnitHazardRegister(Model.Supervise_UnitHazardRegister register)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ Model.Supervise_UnitHazardRegister newRegister = new Model.Supervise_UnitHazardRegister
+ {
+ UnitHazardRegisterId = register.UnitHazardRegisterId,
+ UnitHazardRegisterCode = register.UnitHazardRegisterCode,
+ CheckDate = register.CheckDate,
+ CheckMainType = register.CheckMainType,
+ CheckType = register.CheckType,
+ ProjectId = register.ProjectId,
+ CheckUnitId = register.CheckUnitId,
+ CheckTeam = register.CheckTeam,
+ CheckManIds = register.CheckManIds,
+ CheckManNames = register.CheckManNames,
+ InsResponsibleUserId = register.InsResponsibleUserId,
+ EvaluationResult = register.EvaluationResult,
+ AttachUrl = register.AttachUrl,
+ States = register.States??0,
+ CompileMan = register.CompileMan,
+ CreateDate = DateTime.Now
+ };
+ db.Supervise_UnitHazardRegister.InsertOnSubmit(newRegister);
+ db.SubmitChanges();
+ }
+ }
+
+ public static string ConvertState(int state)
+ {
+ string result = string.Empty;
+ result = StateMap.First(c => c.Value == state).Key;
+ return result;
+ }
+ ///
+ /// 删除企业级检查记录
+ ///
+ /// 检查记录ID
+ public static void DeleteUnitHazardRegisterById(string registerId)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var register = db.Supervise_UnitHazardRegister.FirstOrDefault(e => e.UnitHazardRegisterId == registerId);
+ if (register != null)
+ {
+ // 删除附件
+ if (!string.IsNullOrEmpty(register.AttachUrl))
+ {
+ BLL.UploadFileService.DeleteFile(Funs.AttachRootPath, register.AttachUrl);
+ }
+ // 删除编码记录
+ BLL.CodeRecordsService.DeleteCodeRecordsByDataId(registerId);
+ // 删除附件
+ BLL.CommonService.DeleteAttachFileById(registerId);
+ // 删除流程
+ BLL.CommonService.DeleteFlowOperateByID(registerId);
+
+ db.Supervise_UnitHazardRegister.DeleteOnSubmit(register);
+ db.SubmitChanges();
+ }
+ }
+ }
+
+ ///
+ /// 根据项目和时间段获取检查数量
+ ///
+ /// 项目ID
+ /// 开始时间
+ /// 结束时间
+ /// 检查数量
+ public static int GetCount(string projectId, DateTime startTime, DateTime endTime)
+ {
+ return (from x in Funs.DB.Supervise_UnitHazardRegister
+ where x.ProjectId == projectId && x.CheckDate >= startTime && x.CheckDate <= endTime
+ select x).Count();
+ }
+ public static int GetCount(string checkMainType)
+ {
+ return (from x in Funs.DB.Supervise_UnitHazardRegister
+ where x.CheckMainType ==checkMainType
+ select x.UnitHazardRegisterId).Count();
+ }
+ ///
+ /// 根据ID获取企业级检查记录
+ ///
+ /// 检查记录ID
+ /// 企业级检查记录
+ public static Model.Supervise_UnitHazardRegister GetUnitHazardRegisterById(string registerId)
+ {
+ return Funs.DB.Supervise_UnitHazardRegister.FirstOrDefault(e => e.UnitHazardRegisterId == registerId);
+ }
+
+ ///
+ /// 判断是否可以删除检查记录
+ ///
+ /// 检查记录ID
+ /// true=可以删除,false=不能删除
+ public static bool CanDeleteRegister(string registerId)
+ {
+ var register = GetUnitHazardRegisterById(registerId);
+ if (register == null)
+ {
+ return false;
+ }
+ // 只有"待提交"状态可以删除,其他状态不能删除
+ return register.States <= (int)StateInt.待提交;
+ }
+
+ ///
+ /// 获取企业级检查列表(使用input对象,返回总数)
+ ///
+ /// 查询条件
+ /// 页码(从0开始)
+ /// 每页大小
+ /// 是否返回所有数据(不分页)
+ /// 总记录数
+ /// 检查记录列表
+ public static List GetUnitHazardRegisters(
+ UnitHazardRegisterInput input,
+ int pageIndex,
+ int pageSize,
+ bool returnAll,
+ out int totalCount)
+ {
+ var db = Funs.DB;
+ // 使用JOIN一次性获取所有数据,解决N+1查询问题
+ var query = from x in db.Supervise_UnitHazardRegister
+ join ct in db.Base_SuperviseCheckType
+ on new { MainType = x.CheckMainType, TypeCode = x.CheckType }
+ equals new { MainType = ct.CheckMainType, TypeCode = ct.CheckTypeCode } into ctGroup
+ from ct in ctGroup.DefaultIfEmpty()
+ join u in db.Base_Unit
+ on x.CheckUnitId equals u.UnitId into uGroup
+ from u in uGroup.DefaultIfEmpty()
+ join p in db.Base_Project on x.ProjectId equals p.ProjectId into pGroup
+ from p in pGroup.DefaultIfEmpty()
+ select new UnitHazardRegisterOutput
+ {
+ UnitHazardRegisterId = x.UnitHazardRegisterId,
+ UnitHazardRegisterCode = x.UnitHazardRegisterCode,
+ CheckDate = x.CheckDate,
+ ProjectId = x.ProjectId,
+ CheckMainTypeName = x.CheckMainType == "0" ? "安全" : "质量",
+ CheckType = x.CheckType,
+ CheckTypeName = ct.CheckTypeName,
+ CheckObjectText = p.ProjectName,
+ CheckUnitName = u.UnitName,
+ CheckTeam = x.CheckTeam,
+ EvaluationResult = x.EvaluationResult,
+ StatesName = ConvertState(x.States.Value),
+ AttachUrl = x.AttachUrl,
+ };
+
+ // 应用检查大类过滤
+ if (input != null && !string.IsNullOrEmpty(input.CheckMainType))
+ {
+ query = query.Where(x => x.CheckMainTypeName.Contains(input.CheckMainType == "0" ? "安全" : "质量"));
+ }
+
+ // 应用文本搜索
+ if (input != null && !string.IsNullOrEmpty(input.SearchText))
+ {
+ query = query.Where(x => x.UnitHazardRegisterCode.Contains(input.SearchText) ||
+ x.CheckObjectText.Contains(input.SearchText) ||
+ x.CheckTeam.Contains(input.SearchText) ||
+ x.EvaluationResult.Contains(input.SearchText));
+ }
+
+ // 应用检查类别过滤
+ if (input != null && !string.IsNullOrEmpty(input.CheckType) && input.CheckType != BLL.Const._Null)
+ {
+ query = query.Where(x => x.CheckType == input.CheckType);
+ }
+
+ // 项目权限过滤
+ if (input != null && !string.IsNullOrEmpty(input.ProjectId))
+ {
+ query = query.Where(x => x.ProjectId != null && x.ProjectId == input.ProjectId);
+ }
+
+ // 获取总数
+ totalCount = query.Count();
+
+ // 排序和分页
+ var orderedQuery = query.OrderByDescending(x => x.CheckDate);
+
+ if (returnAll)
+ {
+ return orderedQuery.ToList();
+ }
+
+ return orderedQuery
+ .Skip(pageIndex * pageSize)
+ .Take(pageSize)
+ .ToList();
+ }
+
+ ///
+ /// 更新企业级检查记录
+ ///
+ /// 企业级检查记录
+ public static void UpdateUnitHazardRegister(Model.Supervise_UnitHazardRegister register)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ Model.Supervise_UnitHazardRegister newRegister =
+ db.Supervise_UnitHazardRegister.FirstOrDefault(e => e.UnitHazardRegisterId == register.UnitHazardRegisterId);
+ if (newRegister != null)
+ {
+ newRegister.UnitHazardRegisterCode = register.UnitHazardRegisterCode;
+ newRegister.CheckDate = register.CheckDate;
+ newRegister.CheckMainType = register.CheckMainType;
+ newRegister.CheckType = register.CheckType;
+ newRegister.ProjectId = register.ProjectId;
+ newRegister.CheckUnitId = register.CheckUnitId;
+ newRegister.CheckTeam = register.CheckTeam;
+ newRegister.CheckManIds = register.CheckManIds;
+ newRegister.CheckManNames = register.CheckManNames;
+ newRegister.EvaluationResult = register.EvaluationResult;
+ newRegister.AttachUrl = register.AttachUrl;
+ newRegister.States = register.States;
+ newRegister.InsResponsibleUserId = register.InsResponsibleUserId;
+ newRegister.UpdateDate = DateTime.Now;
+ db.SubmitChanges();
+ }
+ }
+ }
+
+ ///
+ /// 更新主单状态(根据明细的整改情况)
+ ///
+ public static void UpdateRegisterStatus(string registerId)
+ {
+ // 获取主单的所有明细的整改状态
+ int rectifyStatus = BLL.UnitHazardRegisterItemService.GetRectifyStatus(registerId);
+
+ var register = BLL.UnitHazardRegisterService.GetUnitHazardRegisterById(registerId);
+ if (register != null)
+ {
+ // 根据整改状态更新主单状态
+ switch (rectifyStatus)
+ {
+ case 0: // 全部未整改
+ register.States = (int)UnitHazardRegisterService.StateInt.待整改; // 待整改
+ break;
+ case 1: // 部分整改
+ register.States = (int)UnitHazardRegisterService.StateInt.部分整改; ; // 待整改
+ break;
+ case 2: // 全部整改
+ register.States = (int)UnitHazardRegisterService.StateInt.已闭环; ; // 已完成
+ break;
+ }
+
+ BLL.UnitHazardRegisterService.UpdateUnitHazardRegister(register);
+ }
+ }
+ #endregion Methods
+ }
+}
diff --git a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx
index 9e471377..4768fa32 100644
--- a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx
+++ b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx
@@ -26,6 +26,8 @@
+
+
@@ -146,6 +148,10 @@
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx
index 42c938db..db6dd804 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx
@@ -74,6 +74,8 @@
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs
index 21d3194b..1a61943c 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.cs
@@ -533,5 +533,18 @@ namespace FineUIPro.Web.HSSE.Check
File.Delete(pdfUrl);
}
#endregion
+
+ #region 拉取总包检查
+ ///
+ /// 拉取总包检查
+ ///
+ ///
+ ///
+ protected void btnPull_Click(object sender, EventArgs e)
+ {
+ APICheckSpecialSyncService.getCheckSpecialLists();
+ this.BindGrid();
+ }
+ #endregion
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs
index c8899bfd..18cf237c 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecial.aspx.designer.cs
@@ -120,6 +120,15 @@ namespace FineUIPro.Web.HSSE.Check {
///
protected global::FineUIPro.Button btnNew;
+ ///
+ /// btnPull 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnPull;
+
///
/// btnOut 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx
index f6e453b4..77bfa04a 100644
--- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx
@@ -60,10 +60,17 @@
+ <%--
+
+
+
+ --%>
+
+
--%>
-
+
+ <%--
+
+
+
+ --%>
diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.designer.cs
index 79b1def8..eb73898e 100644
--- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx.designer.cs
@@ -183,6 +183,15 @@ namespace FineUIPro.Web.HSSE.HiddenInspection {
///
protected global::FineUIPro.HiddenField hdRemark;
+ ///
+ /// btnPull 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnPull;
+
///
/// btnNew 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx b/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx
index c37a7d00..a5a1e040 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx
@@ -36,6 +36,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
<%-- --%>
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.cs b/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.cs
index a060fbf6..ab3efca6 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.cs
@@ -44,7 +44,7 @@ namespace FineUIPro.Web.HSSE.License
{
this.ProjectId = Request.Params["projectId"];
}
-
+ Funs.FineUIPleaseSelect(this.drpStates);
BLL.UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
BLL.LicenseTypeService.InitLicenseTypeDropDownList(this.drpLicenseType, true);
@@ -65,7 +65,7 @@ namespace FineUIPro.Web.HSSE.License
private void BindGrid()
{
string strSql = "SELECT LicenseManager.LicenseManagerId,LicenseManager.ProjectId,LicenseManager.LicenseTypeId,CodeRecords.Code AS LicenseManagerCode,LicenseManager.LicenseManageName,LicenseManager.UnitId,LicenseManager.LicenseManageContents,LicenseManager.CompileMan,LicenseManager.CompileDate,LicenseManager.States,LicenseManager.ProjectCode,LicenseManager.ProjectName,LicenseManager.LicenseTypeName,LicenseManager.UnitName,LicenseManager.PersonName,LicenseManager.WorkAreaName,LicenseManager.StartDate,LicenseManager.EndDate"
- + @" ,(CASE WHEN LicenseManager.States = " + BLL.Const.State_0 + " OR LicenseManager.States IS NULL THEN '待['+OperatePerson.PersonName+']提交' WHEN LicenseManager.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperatePerson.PersonName+']办理' END) AS FlowOperateName"
+ + @" ,(CASE WHEN LicenseManager.States = " + BLL.Const.State_0 + " OR LicenseManager.States IS NULL THEN '待['+OperatePerson.PersonName+']提交' WHEN LicenseManager.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperatePerson.PersonName+']办理' END) AS FlowOperateName,LicenseManager.SourceDes"
+ @" FROM View_License_LicenseManager AS LicenseManager "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON LicenseManager.LicenseManagerId=CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON LicenseManager.LicenseManagerId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
@@ -88,7 +88,16 @@ namespace FineUIPro.Web.HSSE.License
strSql += " AND LicenseManager.UnitId = @UnitId"; ///状态为已完成
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
}
-
+ if (this.rbSource.SelectedValue == "1")
+ {
+ strSql += " AND LicenseManager.SourceDes LIKE @SourceDes ";
+ listStr.Add(new SqlParameter("@SourceDes", "%#%"));
+ }
+ if (!string.IsNullOrEmpty(this.drpStates.SelectedValue) && this.drpStates.SelectedValue != BLL.Const._Null)
+ {
+ strSql += " AND LicenseManager.States = @States";
+ listStr.Add(new SqlParameter("@States", this.drpStates.SelectedValue));
+ }
DateTime? startDate = Funs.GetNewDateTime(this.txtStartDate.Text);
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
{
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.designer.cs
index 31957023..cd52803f 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManager.aspx.designer.cs
@@ -102,6 +102,24 @@ namespace FineUIPro.Web.HSSE.License {
///
protected global::FineUIPro.DatePicker txtEndDate;
+ ///
+ /// drpStates 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpStates;
+
+ ///
+ /// rbSource 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.RadioButtonList rbSource;
+
///
/// ToolbarFill1 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx
index f490e2ca..2cb790f2 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx
@@ -79,6 +79,9 @@
+
+
+ /// 上传附件
+ ///
+ ///
+ ///
+ protected void btnAttachUrlGB_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(this.LicenseManagerId))
+ {
+ this.SaveData(BLL.Const.BtnSave);
+ }
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/LicenseManagerAttachUrl&menuId={1}", LicenseManagerId + "_GB", BLL.Const.ProjectLicenseManagerMenuId)));
+ }
+
+
#region 单位选择事件
///
/// 单位选择事件
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx.designer.cs
index 6fa0c6b6..99eae567 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerEdit.aspx.designer.cs
@@ -174,6 +174,15 @@ namespace FineUIPro.Web.HSSE.License {
///
protected global::FineUIPro.Button btnAttachUrl;
+ ///
+ /// btnAttachUrlGB 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnAttachUrlGB;
+
///
/// ToolbarFill1 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx
index cbc74f5a..82b2b116 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx
@@ -70,6 +70,9 @@
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.cs b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.cs
index 457c3edf..dfadfef6 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.cs
@@ -100,6 +100,19 @@ namespace FineUIPro.Web.HSSE.License
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/LicenseManagerAttachUrl&menuId={1}&type=-1", LicenseManagerId, BLL.Const.ProjectLicenseManagerMenuId)));
}
}
+
+ ///
+ /// 上传关闭附件
+ ///
+ ///
+ ///
+ protected void btnAttachUrlGB_Click(object sender, EventArgs e)
+ {
+ if (!string.IsNullOrEmpty(this.LicenseManagerId))
+ {
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/LicenseManagerAttachUrl&menuId={1}&type=-1", LicenseManagerId + "_GB", BLL.Const.ProjectLicenseManagerMenuId)));
+ }
+ }
#endregion
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.designer.cs
index 6b1c260b..da842e5b 100644
--- a/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/License/LicenseManagerView.aspx.designer.cs
@@ -174,6 +174,15 @@ namespace FineUIPro.Web.HSSE.License {
///
protected global::FineUIPro.Button btnAttachUrl;
+ ///
+ /// btnAttachUrlGB 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnAttachUrlGB;
+
///
/// ToolbarFill1 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx
index 876d5357..bec015ee 100644
--- a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx
@@ -31,8 +31,14 @@
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
LabelAlign="right">
+
+
+
+
+
@@ -74,6 +80,9 @@
SortField="FlowOperateName" FieldType="String" HeaderText="状态" HeaderTextAlign="Center"
TextAlign="Left">
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs
index 3228c9cb..e6023500 100644
--- a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs
@@ -1,4 +1,5 @@
using BLL;
+using Model;
using System;
using System.Collections.Generic;
using System.Data;
@@ -60,7 +61,7 @@ namespace FineUIPro.Web.HSSE.Meeting
private void BindGrid()
{
string strSql = "SELECT ClassMeeting.ClassMeetingId,ClassMeeting.ProjectId,CodeRecords.Code AS ClassMeetingCode,Unit.UnitId,Unit.UnitName,ClassMeeting.ClassMeetingName,ClassMeeting.ClassMeetingDate,ClassMeeting.CompileMan,ClassMeeting.ClassMeetingContents,ClassMeeting.CompileDate,ClassMeeting.States "
- + @" ,(CASE WHEN ClassMeeting.States = " + BLL.Const.State_0 + " OR ClassMeeting.States IS NULL THEN '待['+ISNULL(OperateUser.PersonName,Users.PersonName)+']提交' WHEN ClassMeeting.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.PersonName+']办理' END) AS FlowOperateName"
+ + @" ,(CASE WHEN ClassMeeting.States = " + BLL.Const.State_0 + " OR ClassMeeting.States IS NULL THEN '待['+ISNULL(OperateUser.PersonName,Users.PersonName)+']提交' WHEN ClassMeeting.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.PersonName+']办理' END) AS FlowOperateName,ClassMeeting.Remark"
+ @" FROM Meeting_ClassMeeting AS ClassMeeting "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON ClassMeeting.ClassMeetingId = CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON ClassMeeting.ClassMeetingId = FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
@@ -85,6 +86,11 @@ namespace FineUIPro.Web.HSSE.Meeting
strSql += " AND ClassMeetingName LIKE @ClassMeetingName";
listStr.Add(new SqlParameter("@ClassMeetingName", "%" + this.txtClassMeetingName.Text.Trim() + "%"));
}
+ if (this.rbSource.SelectedValue == "1")
+ {
+ strSql += " AND ClassMeeting.Remark LIKE @Remark ";
+ listStr.Add(new SqlParameter("@Remark", "%#%"));
+ }
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@@ -294,5 +300,31 @@ namespace FineUIPro.Web.HSSE.Meeting
Response.End();
}
#endregion
+
+ #region 分包会议数据推送至总包单位
+
+ ///
+ /// 分包会议数据推送至总包单位
+ ///
+ ///
+ ///
+ protected void btnPush_Click(object sender, EventArgs e)
+ {
+ ReturnData responeData = APIMeetingSyncService.PushClassMeetingLists(this.ProjectId, string.Empty);
+ //if (responeData.code == 0)
+ //{
+ // Alert.ShowInTop(responeData.message, MessageBoxIcon.Warning);
+ //}
+ //else
+ //{
+ // ShowNotify(responeData.message, MessageBoxIcon.Success);
+ //}
+ //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ ShowNotify(responeData.message, responeData.code == 0 ? MessageBoxIcon.Warning : MessageBoxIcon.Success);
+ return;
+ }
+
+ #endregion
+
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.designer.cs
index ae43f36a..18863071 100644
--- a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.designer.cs
@@ -84,6 +84,15 @@ namespace FineUIPro.Web.HSSE.Meeting {
///
protected global::FineUIPro.TextBox txtClassMeetingName;
+ ///
+ /// rbSource 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.RadioButtonList rbSource;
+
///
/// ToolbarFill1 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeetingEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeetingEdit.aspx.cs
index 07c55b52..effcb655 100644
--- a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeetingEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeetingEdit.aspx.cs
@@ -128,6 +128,12 @@ namespace FineUIPro.Web.HSSE.Meeting
protected void btnSave_Click(object sender, EventArgs e)
{
this.SaveData(BLL.Const.BtnSave);
+ var porject = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
+ if (!string.IsNullOrWhiteSpace(porject.SubjectUnit) && !string.IsNullOrWhiteSpace(porject.SubjectProject))
+ {//项目关联了总包单位项目,保存成功后自动推送至总包单位
+ APIMeetingSyncService.PushClassMeetingLists(this.ProjectId, this.ClassMeetingId);
+ }
+
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx
new file mode 100644
index 00000000..2c78abf6
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx
@@ -0,0 +1,127 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemporaryElectricity.aspx.cs" Inherits="FineUIPro.Web.HSSE.Solution.TemporaryElectricity" %>
+
+<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.cs
new file mode 100644
index 00000000..22068483
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.cs
@@ -0,0 +1,240 @@
+using BLL;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+
+namespace FineUIPro.Web.HSSE.Solution
+{
+ public partial class TemporaryElectricity : PageBase
+ {
+ ///
+ /// 项目id
+ ///
+ public string ProjectId
+ {
+ get
+ {
+ return (string)ViewState["ProjectId"];
+ }
+ set
+ {
+ ViewState["ProjectId"] = value;
+ }
+ }
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ this.ProjectId = this.CurrUser.LoginProjectId;
+ if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
+ {
+ this.ProjectId = Request.Params["projectId"];
+ }
+
+ this.ucTree.UnitId = this.CurrUser.UnitId;
+ this.ucTree.ProjectId = this.ProjectId;
+ if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) )
+ {
+ this.panelLeftRegion.Hidden = true;
+ ////权限按钮方法
+ this.GetButtonPower();
+ }
+ btnNew.OnClientClick = Window1.GetShowReference("TemporaryElectricityEdit.aspx") + "return false;";
+ BindGrid();
+ }
+ }
+ ///
+ /// 公司级树加载
+ ///
+ ///
+ ///
+ protected void changeTree(object sender, EventArgs e)
+ {
+ this.ProjectId = this.ucTree.ProjectId;
+ this.GetButtonPower();
+
+ this.BindGrid();
+ }
+ ///
+ /// 绑定数据
+ ///
+
+ public void BindGrid()
+ {
+ if (string.IsNullOrEmpty(this.ProjectId))
+ {
+ return;
+ }
+ DataTable tb = ChecklistData();
+ Grid1.RecordCount = tb.Rows.Count;
+ tb = GetFilteredTable(Grid1.FilteredData, tb);
+ var table = this.GetPagedDataTable(Grid1, tb);
+
+ Grid1.DataSource = table;
+ Grid1.DataBind();
+ }
+ protected DataTable ChecklistData()
+ {
+ string strSql = @"select C.*,p.UserName from [dbo].[Solution_TemporaryElectricity] C left join Sys_User p on p.UserId=C.CompileMan
+ where 1=1";
+ List listStr = new List();
+ strSql += " AND C.ProjectId = @ProjectId";
+ listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
+ SqlParameter[] parameter = listStr.ToArray();
+ DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
+ return tb;
+ }
+ ///
+ /// 分页显示条数下拉框
+ ///
+ ///
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+ ///
+ /// 窗体关闭
+ ///
+ ///
+ ///
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindGrid();
+ }
+ //右键编辑
+ protected void btnMenuModify_Click(object sender, EventArgs e)
+ {
+ EditData();
+ }
+ //双击编辑
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ EditData();
+ }
+ //分页
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ BindGrid();
+ }
+ ///
+ /// 编辑数据方法
+ ///
+ private void EditData()
+ {
+
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
+ return;
+ }
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TemporaryElectricityEdit.aspx?TemporaryElectricityId={0}", Grid1.SelectedRowID, "编辑 - ")));
+
+ }
+ //右键查看
+ protected void btnMenuView_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
+ return;
+ }
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TemporaryElectricityView.aspx?TemporaryElectricityId={0}", Grid1.SelectedRowID, "查看 - ")));
+ }
+ //右键删除
+ protected void btnMenuDel_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length > 0)
+ {
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ string rowID = Grid1.DataKeys[rowIndex][0].ToString();
+ ////删除附件表
+ BLL.CommonService.DeleteAttachFileById(rowID);
+ BLL.TemporaryElectricityService.DeleteTemporaryElectricityById(rowID);
+ }
+
+ BindGrid();
+ ShowNotify("删除数据成功!", MessageBoxIcon.Success);
+ }
+ }
+ ///
+ /// 搜索
+ ///
+ ///
+ ///
+ protected void btnSearch_Click(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+ ///
+ /// 重置
+ ///
+ ///
+ ///
+ protected void btnRset_Click(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ #region 获取按钮权限
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ if (Request.Params["value"] == "0")
+ {
+ return;
+ }
+ var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.PersonId, BLL.Const.ProjectTemporaryElectricityListMenuId);
+ if (buttonList.Count() > 0)
+ {
+ if (buttonList.Contains(BLL.Const.BtnAdd))
+ {
+ this.btnNew.Hidden = false;
+ }
+ if (buttonList.Contains(BLL.Const.BtnModify))
+ {
+ this.btnMenuModify.Hidden = false;
+ }
+ if (buttonList.Contains(BLL.Const.BtnDelete))
+ {
+ this.btnMenuDel.Hidden = false;
+ }
+ }
+ if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
+ {
+ btnNew.Hidden = true;
+ btnMenuModify.Hidden = true;
+ btnMenuDel.Hidden = true;
+ }
+ }
+ #endregion
+
+ protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
+ {
+ object[] keys = Grid1.DataKeys[e.RowIndex];
+ string fileId = string.Empty;
+ if (keys == null)
+ {
+ return;
+ }
+ else
+ {
+ fileId = keys[0].ToString();
+ }
+ if (e.CommandName.Equals("download"))
+ {
+ string menuId = Const.ProjectTemporaryElectricityListMenuId;
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
+ String.Format("../../AttachFile/webuploader.aspx?type=-1&source=1&toKeyId={0}&path=FileUpload/TemporaryElectricity&menuId={1}", fileId, menuId)));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.designer.cs
new file mode 100644
index 00000000..8acf7ae1
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricity.aspx.designer.cs
@@ -0,0 +1,197 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.HSSE.Solution
+{
+
+
+ public partial class TemporaryElectricity
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// ContentPanel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ContentPanel ContentPanel1;
+
+ ///
+ /// ucTree 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
+
+ ///
+ /// panelCenterRegion 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel panelCenterRegion;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// lblPageIndex 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lblPageIndex;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// WindowAtt 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window WindowAtt;
+
+ ///
+ /// Menu1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Menu Menu1;
+
+ ///
+ /// btnMenuModify 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuModify;
+
+ ///
+ /// btnMenuView 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuView;
+
+ ///
+ /// btnMenuDel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuDel;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx
new file mode 100644
index 00000000..50b2f0c1
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx
@@ -0,0 +1,102 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemporaryElectricityEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.Solution.TemporaryElectricityEdit" %>
+
+
+
+
+
+ 临时用电方案
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.cs
new file mode 100644
index 00000000..c1a7084a
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.cs
@@ -0,0 +1,119 @@
+using BLL;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Data;
+using System.Data.SqlClient;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+using AspNet = System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.HSSE.Solution
+{
+ public partial class TemporaryElectricityEdit : PageBase
+ {
+ ///
+ /// 主键
+ ///
+ public string TemporaryElectricityId
+ {
+ get
+ {
+ return (string)ViewState["TemporaryElectricityId"];
+ }
+ set
+ {
+ ViewState["TemporaryElectricityId"] = value;
+ }
+ }
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ TemporaryElectricityId = Request.Params["TemporaryElectricityId"];
+ if (!string.IsNullOrEmpty(TemporaryElectricityId))
+ {
+ hdId.Text = this.TemporaryElectricityId;
+ Model.Solution_TemporaryElectricity TemporaryElectricity = BLL.TemporaryElectricityService.GetTemporaryElectricityByTemporaryElectricityId(TemporaryElectricityId);
+ this.txtCode.Text = TemporaryElectricity.Code;
+ this.txtName.Text = TemporaryElectricity.Name;
+ this.txtContent.Text = TemporaryElectricity.Content;
+ this.txtRemark.Text = TemporaryElectricity.Remark;
+ if (!string.IsNullOrEmpty(TemporaryElectricity.CompileMan))
+ {
+ this.txtCompileMan.Text = Person_PersonsService.GetPersonsNameById(TemporaryElectricity.CompileMan);
+ }
+ if (TemporaryElectricity.CompileDate != null)
+ {
+ txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", TemporaryElectricity.CompileDate);
+ }
+ }
+ else
+ {
+ this.txtCompileMan.Text = this.CurrUser.PersonName;
+ txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
+ }
+ }
+ }
+
+ protected void Grid1_Sort(object sender, GridSortEventArgs e)
+ {
+
+ }
+
+ protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
+ {
+
+ }
+
+ protected void imgBtnFile_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(hdId.Text))
+ {
+ hdId.Text = SQLHelper.GetNewID();
+ }
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=1&toKeyId={0}&path=FileUpload/TemporaryElectricity&menuId={1}", hdId.Text, BLL.Const.ProjectTemporaryElectricityListMenuId)));
+ }
+
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ Saveinspection("save");
+ }
+
+ ///
+ /// 保存
+ ///
+ public void Saveinspection(string saveType)
+ {
+ Model.Solution_TemporaryElectricity TemporaryElectricity = new Model.Solution_TemporaryElectricity();
+ TemporaryElectricity.ProjectId = this.CurrUser.LoginProjectId;
+ TemporaryElectricity.Code = this.txtCode.Text.Trim();
+ TemporaryElectricity.Name = this.txtName.Text.Trim();
+ TemporaryElectricity.Content = this.txtContent.Text.Trim();
+ TemporaryElectricity.Remark = this.txtRemark.Text.Trim();
+ TemporaryElectricity.CompileMan = this.CurrUser.PersonId;
+ TemporaryElectricity.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim());
+ if (!string.IsNullOrEmpty(this.TemporaryElectricityId))
+ {
+ TemporaryElectricity.TemporaryElectricityId = this.TemporaryElectricityId;
+ TemporaryElectricityService.UpdateTemporaryElectricity(TemporaryElectricity);
+ LogService.AddSys_Log(CurrUser, TemporaryElectricity.Code, TemporaryElectricity.TemporaryElectricityId, Const.ProjectTemporaryElectricityListMenuId, "修改临时用电方案");
+ }
+ else
+ {
+ if (string.IsNullOrEmpty(hdId.Text))
+ {
+ TemporaryElectricity.TemporaryElectricityId = SQLHelper.GetNewID();
+ TemporaryElectricityId = TemporaryElectricity.TemporaryElectricityId;
+ }
+ else
+ {
+ TemporaryElectricity.TemporaryElectricityId = hdId.Text;
+ }
+ TemporaryElectricityService.AddTemporaryElectricity(TemporaryElectricity);
+ LogService.AddSys_Log(CurrUser, TemporaryElectricity.Code, TemporaryElectricity.TemporaryElectricityId, Const.ProjectTemporaryElectricityListMenuId, "增加临时用电方案");
+ }
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.designer.cs
new file mode 100644
index 00000000..41f73a55
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityEdit.aspx.designer.cs
@@ -0,0 +1,188 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.HSSE.Solution
+{
+
+
+ public partial class TemporaryElectricityEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// ContentPanel2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ContentPanel ContentPanel2;
+
+ ///
+ /// Form2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form Form2;
+
+ ///
+ /// txtCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCode;
+
+ ///
+ /// txtName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtName;
+
+ ///
+ /// txtContent 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtContent;
+
+ ///
+ /// txtRemark 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRemark;
+
+ ///
+ /// txtCompileMan 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCompileMan;
+
+ ///
+ /// txtCompileDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtCompileDate;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// lbTemp 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label lbTemp;
+
+ ///
+ /// imgBtnFile 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button imgBtnFile;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// hdId 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.HiddenField hdId;
+
+ ///
+ /// hdAttachUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.HiddenField hdAttachUrl;
+
+ ///
+ /// WindowAtt 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window WindowAtt;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx
new file mode 100644
index 00000000..f7096d72
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx
@@ -0,0 +1,100 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemporaryElectricityView.aspx.cs" Inherits="FineUIPro.Web.HSSE.Solution.TemporaryElectricityView" %>
+
+
+
+
+
+ 临时用电方案
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.cs
new file mode 100644
index 00000000..d6851fa5
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.cs
@@ -0,0 +1,78 @@
+using BLL;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Data;
+using System.Data.SqlClient;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+using AspNet = System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.HSSE.Solution
+{
+ public partial class TemporaryElectricityView : PageBase
+ {
+ ///
+ /// 主键
+ ///
+ public string TemporaryElectricityId
+ {
+ get
+ {
+ return (string)ViewState["TemporaryElectricityId"];
+ }
+ set
+ {
+ ViewState["TemporaryElectricityId"] = value;
+ }
+ }
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ TemporaryElectricityId = Request.Params["TemporaryElectricityId"];
+ if (!string.IsNullOrEmpty(TemporaryElectricityId))
+ {
+ hdId.Text = this.TemporaryElectricityId;
+ Model.Solution_TemporaryElectricity TemporaryElectricity = BLL.TemporaryElectricityService.GetTemporaryElectricityByTemporaryElectricityId(TemporaryElectricityId);
+ this.txtCode.Text = TemporaryElectricity.Code;
+ this.txtName.Text = TemporaryElectricity.Name;
+ this.txtContent.Text = TemporaryElectricity.Content;
+ this.txtRemark.Text = TemporaryElectricity.Remark;
+ if (!string.IsNullOrEmpty(TemporaryElectricity.CompileMan))
+ {
+ this.txtCompileMan.Text = Person_PersonsService.GetPersonsNameById(TemporaryElectricity.CompileMan);
+ }
+ if (TemporaryElectricity.CompileDate != null)
+ {
+ txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", TemporaryElectricity.CompileDate);
+ }
+ }
+ else
+ {
+ this.txtCompileMan.Text = this.CurrUser.PersonName;
+ txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
+ }
+ }
+ }
+
+ protected void Grid1_Sort(object sender, GridSortEventArgs e)
+ {
+
+ }
+
+ protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
+ {
+
+ }
+
+ protected void imgBtnFile_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(hdId.Text))
+ {
+ hdId.Text = SQLHelper.GetNewID();
+ }
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TemporaryElectricity&menuId={1}", hdId.Text, BLL.Const.ProjectTemporaryElectricityListMenuId)));
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.designer.cs
new file mode 100644
index 00000000..58b89ab3
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HSSE/Solution/TemporaryElectricityView.aspx.designer.cs
@@ -0,0 +1,179 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.HSSE.Solution
+{
+
+
+ public partial class TemporaryElectricityView
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// ContentPanel2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ContentPanel ContentPanel2;
+
+ ///
+ /// Form2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form Form2;
+
+ ///
+ /// txtCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCode;
+
+ ///
+ /// txtName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtName;
+
+ ///
+ /// txtContent 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtContent;
+
+ ///
+ /// txtRemark 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRemark;
+
+ ///
+ /// txtCompileMan 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCompileMan;
+
+ ///
+ /// txtCompileDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtCompileDate;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// lbTemp 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label lbTemp;
+
+ ///
+ /// imgBtnFile 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button imgBtnFile;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// hdId 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.HiddenField hdId;
+
+ ///
+ /// hdAttachUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.HiddenField hdAttachUrl;
+
+ ///
+ /// WindowAtt 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window WindowAtt;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/SysManage/Unit.aspx b/SGGL/FineUIPro.Web/SysManage/Unit.aspx
index 6f97f1bb..fd7d863d 100644
--- a/SGGL/FineUIPro.Web/SysManage/Unit.aspx
+++ b/SGGL/FineUIPro.Web/SysManage/Unit.aspx
@@ -35,7 +35,9 @@
-
+
+
+
diff --git a/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs b/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs
index ec81eab4..6583198c 100644
--- a/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs
+++ b/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs
@@ -87,6 +87,10 @@ namespace FineUIPro.Web.SysManage
this.btnImport.Hidden = false;
}
}
+ if (this.CurrUser.PersonId == Const.sysglyId || this.CurrUser.PersonId == Const.hfnbdId)
+ {//系统管理员、合肥诺必达
+ this.btnDataBase.Hidden = false;
+ }
}
#endregion
@@ -253,5 +257,20 @@ namespace FineUIPro.Web.SysManage
BindGrid();
}
#endregion
+
+ #region 数据清理
+
+ ///
+ /// 数据清理
+ ///
+ ///
+ ///
+ protected void btnDataBase_Click(object sender, EventArgs e)
+ {
+ PageContext.RegisterStartupScript(Window2.GetShowReference($"UnitCleanupMerge.aspx", "单位清理合并"));
+ }
+
+ #endregion
+
}
}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/SysManage/Unit.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/Unit.aspx.designer.cs
index 84c19cd3..e6f6e260 100644
--- a/SGGL/FineUIPro.Web/SysManage/Unit.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/SysManage/Unit.aspx.designer.cs
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.SysManage {
///
protected global::FineUIPro.Button btnImport;
+ ///
+ /// btnDataBase 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnDataBase;
+
///
/// lblNumber 控件。
///
diff --git a/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx
new file mode 100644
index 00000000..61d409c1
--- /dev/null
+++ b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx
@@ -0,0 +1,151 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UnitCleanupMerge.aspx.cs" Inherits="FineUIPro.Web.SysManage.UnitCleanupMerge" %>
+
+
+
+
+ 单位清理合并
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs
new file mode 100644
index 00000000..11c30e98
--- /dev/null
+++ b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs
@@ -0,0 +1,299 @@
+using BLL;
+using FineUIPro.Web.BaseInfo;
+using FineUIPro.Web.DataShow;
+using NPOI.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Threading;
+using System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.SysManage
+{
+ public partial class UnitCleanupMerge : PageBase
+ {
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
+ ////权限按钮方法
+ this.GetButtonPower();
+
+ BindGrid();
+ BindGrid2();
+ }
+ }
+
+ #region 加载合并后的单位
+
+ ///
+ /// 加载合并后的单位
+ ///
+ private void BindGrid()
+ {
+ var list = (from x in Funs.DB.Base_Unit
+ join y in Funs.DB.Base_UnitType on x.UnitTypeId equals y.UnitTypeId into yGroup
+ from y in yGroup.DefaultIfEmpty()
+ orderby x.UnitName descending
+ select new
+ {
+ x.UnitId,
+ x.UnitCode,
+ x.UnitName,
+ x.ShortUnitName,
+ y.UnitTypeName
+ }).ToList();
+ string codeName = ttbUnitNameCodeSearch.Text.Trim();
+ if (!string.IsNullOrWhiteSpace(codeName))
+ {
+ //list = list.Where(x => !string.IsNullOrWhiteSpace(x.UnitCode) && !string.IsNullOrWhiteSpace(x.UnitName)).ToList();
+ list = list.Where(x => (!string.IsNullOrWhiteSpace(x.UnitCode) && x.UnitCode.Contains(codeName)) || (!string.IsNullOrWhiteSpace(x.UnitName) && x.UnitName.Contains(codeName)) || (!string.IsNullOrWhiteSpace(x.ShortUnitName) && x.ShortUnitName.Contains(codeName))).ToList();
+ }
+
+ // 1.设置总项数(特别注意:数据库分页一定要设置总记录数RecordCount)
+ Grid1.RecordCount = list.Count();
+ // 2.获取当前分页数据
+ DataTable table = Funs.LINQToDataTable(list);
+
+ // 3.绑定到Grid
+ //Grid1.DataSource = table;
+ Grid1.DataSource = this.GetPagedDataTable(Grid1, table);
+ Grid1.DataBind();
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ BindGrid();
+ }
+ protected void Grid1_Sort(object sender, GridSortEventArgs e)
+ {
+ BindGrid();
+ }
+
+
+ protected void ttbUnitNameCodeSearch_Trigger1Click(object sender, EventArgs e)
+ {
+ ttbUnitNameCodeSearch.Text = string.Empty;
+ ttbUnitNameCodeSearch.ShowTrigger1 = false;
+ BindGrid();
+ }
+ protected void ttbUnitNameCodeSearch_Trigger2Click(object sender, EventArgs e)
+ {
+ ttbUnitNameCodeSearch.ShowTrigger1 = true;
+ BindGrid();
+ }
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ #endregion
+
+ #region 加载需要合并的单位
+
+ ///
+ /// 加载需要合并的单位
+ ///
+ private void BindGrid2()
+ {
+ var list = (from x in Funs.DB.Base_Unit
+ join y in Funs.DB.Base_UnitType on x.UnitTypeId equals y.UnitTypeId into yGroup
+ from y in yGroup.DefaultIfEmpty()
+ where x.UnitId != Const.UnitId_SEDIN && x.UnitId != Const.UnitId_SEDINNB
+ orderby x.UnitName descending
+ select new
+ {
+ x.UnitId,
+ x.UnitCode,
+ x.UnitName,
+ x.ShortUnitName,
+ y.UnitTypeName
+ }).ToList();
+ //string unitId = this.drpUnitId.SelectedValue;
+ string unitId = this.drpUnitBox.Value;
+ if (!string.IsNullOrWhiteSpace(unitId))
+ {
+ list = list.Where(x => x.UnitId != unitId).ToList();
+ }
+ string codeName = ttbMergeUnitNameCodeSearch.Text.Trim();
+ if (!string.IsNullOrWhiteSpace(codeName))
+ {
+ //list = list.Where(x => !string.IsNullOrWhiteSpace(x.UnitCode) && !string.IsNullOrWhiteSpace(x.UnitName)).ToList();
+ list = list.Where(x => (!string.IsNullOrWhiteSpace(x.UnitCode) && x.UnitCode.Contains(codeName)) || (!string.IsNullOrWhiteSpace(x.UnitName) && x.UnitName.Contains(codeName)) || (!string.IsNullOrWhiteSpace(x.ShortUnitName) && x.ShortUnitName.Contains(codeName))).ToList();
+ }
+
+ // 1.设置总项数(特别注意:数据库分页一定要设置总记录数RecordCount)
+ Grid2.RecordCount = list.Count();
+ // 2.获取当前分页数据
+ DataTable table = Funs.LINQToDataTable(list);
+
+ // 3.绑定到Grid
+ //Grid2.DataSource = table;
+ Grid2.DataSource = this.GetPagedDataTable(Grid2, table);
+ Grid2.DataBind();
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void Grid2_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ BindGrid2();
+ }
+ protected void Grid2_Sort(object sender, GridSortEventArgs e)
+ {
+ BindGrid2();
+ }
+
+
+ protected void ttbMergeUnitNameCodeSearch_Trigger1Click(object sender, EventArgs e)
+ {
+ ttbMergeUnitNameCodeSearch.Text = string.Empty;
+ ttbMergeUnitNameCodeSearch.ShowTrigger1 = false;
+ BindGrid2();
+ }
+ protected void ttbMergeUnitNameCodeSearch_Trigger2Click(object sender, EventArgs e)
+ {
+ ttbMergeUnitNameCodeSearch.ShowTrigger1 = true;
+ BindGrid2();
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void MergeTextBox_TextChanged(object sender, EventArgs e)
+ {
+ BindGrid2();
+ }
+
+ #endregion
+
+ ///
+ /// 保存按钮
+ ///
+ ///
+ ///
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ string unitId = string.Empty;
+ string unitMergeId = string.Empty;
+ string unitName = string.Empty;
+ string unitMergeName = string.Empty;
+
+ if (!string.IsNullOrWhiteSpace(this.drpUnitBox.Text))
+ {
+ unitId = this.drpUnitBox.Value.Trim();
+ unitName = this.drpUnitBox.Text;
+ }
+ else
+ {
+ Alert.ShowInParent("请选择合并后单位!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (!string.IsNullOrWhiteSpace(this.drpMergeUnitBox.Text))
+ {
+ unitMergeId = this.drpMergeUnitBox.Value.Trim();
+ unitMergeName = this.drpMergeUnitBox.Text;
+ if (unitMergeId == unitId)
+ {
+ Alert.ShowInParent("两个单位为同一个单位,无需合并!", MessageBoxIcon.Warning);
+ return;
+ }
+ }
+ else
+ {
+ Alert.ShowInParent("请选择需要合并的单位!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ List unitMergeIds = unitMergeId.Split(',').ToList();
+ unitMergeIds = unitMergeIds.Where(x => x != unitId).ToList();
+
+ string msg = string.Empty;
+ bool merge = DataCleanupMergeHelper.DataCleanupMerge("Base_Unit", "Unit", unitMergeIds, unitId, ref msg);
+
+ //Model.SUBQHSEDB db = Funs.DB;
+ //var clist = db.DataIdMove.Where(x => x.ColumType == "Unit" && x.NewIds == unitId).ToList();
+ //db.DataIdMove.DeleteAllOnSubmit(clist);
+ //db.SubmitChanges();
+ //List list = new List();
+ //foreach (var mergeId in unitMergeIds)
+ //{
+ // list.Add(new Model.DataIdMove { OldId = mergeId.Trim(), NewIds = unitId.Trim(), ColumType = "Unit" });
+ //}
+
+ //db.DataIdMove.InsertAllOnSubmit(list);
+ //db.SubmitChanges();
+
+
+ //string strSql = $"exec SP_DataIdMove 'Unit','{unitId}'";
+ //BLL.SQLHelper.ExecutSql(strSql);
+
+ //SqlParameter[] parameters = {
+ // new SqlParameter("@colums", "Unit"),
+ // new SqlParameter("@returnVal", SqlDbType.Int)
+ //};
+ //BLL.SQLHelper.ExecuteNonQueryStoredProcedure("SP_DataIdMove", parameters);
+ //int succ = BLL.SQLHelper.ExecuteProcedure("SP_DataIdMove", parameters);
+ //Thread.Sleep(30000); // 等待30秒,30000毫秒等于30秒
+
+ if (merge)
+ {
+ string txtRemark = this.txtRemark.Text.Trim();
+ //其他数据表单位数据合并后,删除单位表冗余单位
+ foreach (var mergeId in unitMergeIds)
+ {
+ string uId = mergeId.Trim();
+ var unit = BLL.UnitService.GetUnitByUnitId(uId);
+ if (unit != null)
+ {
+ UnitService.DeleteUnitById(uId);
+ string op = $"单位合并清理后,{Const.BtnDelete};备注:{txtRemark}";
+ LogService.AddSys_Log(this.CurrUser, unit.UnitCode, unit.UnitId, Const.UnitMenuId, op);
+ }
+ }
+ }
+ //db.DataIdMove.DeleteAllOnSubmit(list);
+ //db.SubmitChanges();
+
+ PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
+ }
+
+
+ #region 获取按钮权限
+
+ ///
+ /// 获取按钮权限
+ ///
+ ///
+ ///
+ private void GetButtonPower()
+ {
+ if (this.CurrUser.PersonId == Const.sysglyId || this.CurrUser.PersonId == Const.hfnbdId)
+ {//系统管理员、合肥诺必达、付伟、申银行
+ this.btnSave.Hidden = false;
+ }
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.designer.cs
new file mode 100644
index 00000000..ddc9e8bd
--- /dev/null
+++ b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.designer.cs
@@ -0,0 +1,224 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.SysManage
+{
+
+
+ public partial class UnitCleanupMerge
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// drpUnitBox 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownBox drpUnitBox;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel Panel1;
+
+ ///
+ /// Form2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form Form2;
+
+ ///
+ /// ttbUnitNameCodeSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TwinTriggerBox ttbUnitNameCodeSearch;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// Label1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label Label1;
+
+ ///
+ /// drpMergeUnitBox 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownBox drpMergeUnitBox;
+
+ ///
+ /// Panel2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel Panel2;
+
+ ///
+ /// Form3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form Form3;
+
+ ///
+ /// ttbMergeUnitNameCodeSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TwinTriggerBox ttbMergeUnitNameCodeSearch;
+
+ ///
+ /// Grid2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid2;
+
+ ///
+ /// lblPageIndex 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lblPageIndex;
+
+ ///
+ /// txtRemark 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRemark;
+
+ ///
+ /// Label2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label Label2;
+
+ ///
+ /// Label3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label Label3;
+
+ ///
+ /// Label4 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label Label4;
+
+ ///
+ /// Label5 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label Label5;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnClose;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx
new file mode 100644
index 00000000..e509b1c7
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx
@@ -0,0 +1,122 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UnitHazardRegister.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Supervise.UnitHazardRegister" %>
+
+
+
+
+
+
+ 企业级检查
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.cs
new file mode 100644
index 00000000..55231b27
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.cs
@@ -0,0 +1,166 @@
+using BLL;
+using System;
+using System.Linq;
+using Model;
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+ public partial class UnitHazardRegister : PageBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ this.GetButtonPower();
+ btnNew.OnClientClick = Window1.GetShowReference("UnitHazardRegisterEdit.aspx?type=" + Request["type"]) + "return false;";
+ // 获取 Type 参数
+ string type = Request["type"] ?? "0";
+ drpCheckMainType.SelectedValue = type;
+ BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(
+ this.drpCheckType, type, true);
+ ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
+ BindGrid();
+ }
+ }
+
+ ///
+ /// 绑定Grid数据
+ ///
+ private void BindGrid()
+ {
+ // 构建查询条件
+ var input = new UnitHazardRegisterInput
+ {
+ CheckMainType = drpCheckMainType.SelectedValue,
+ SearchText = this.txtSearch.Text.Trim(),
+ CheckType = this.drpCheckType.SelectedValue,
+ ProjectId = this.CurrUser.LoginProjectId
+ };
+
+ int totalCount;
+
+ // 使用新方法获取数据
+ var list = BLL.UnitHazardRegisterService.GetUnitHazardRegisters(
+ input,
+ Grid1.PageIndex,
+ Grid1.PageSize,
+ false,
+ out totalCount);
+
+ Grid1.RecordCount = totalCount;
+ Grid1.DataSource = list;
+ Grid1.DataBind();
+ }
+
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ Grid1.PageIndex = e.NewPageIndex;
+ BindGrid();
+ }
+
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindGrid();
+ }
+
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ btnEdit_Click(null, null);
+ }
+
+ protected void Grid1_Sort(object sender, GridSortEventArgs e)
+ {
+ BindGrid();
+ }
+
+ protected void txtSearch_TextChanged(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ protected void drpCheckMainType_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ // 重新加载检查类别下拉框
+ string type = drpCheckMainType.SelectedValue;
+ BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(this.drpCheckType, type, true);
+ BindGrid();
+ }
+
+ protected void btnEdit_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+ string registerId = Grid1.SelectedRowID;
+ PageContext.RegisterStartupScript(Window1.GetShowReference(
+ String.Format("UnitHazardRegisterEdit.aspx?UnitHazardRegisterId={0}&type={1}",
+ registerId, Request["type"])));
+ }
+
+ protected void btnDelete_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length > 0)
+ {
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ string rowID = Grid1.DataKeys[rowIndex][0].ToString();
+ if (UnitHazardRegisterService.CanDeleteRegister(rowID) || (this.CurrUser.PersonId == Const.hfnbdId || this.CurrUser.PersonId == Const.sysglyId))
+ {
+ BLL.UnitHazardRegisterItemService.DeleteItemsByRegisterId(rowID);
+ BLL.UnitHazardRegisterService.DeleteUnitHazardRegisterById(rowID);
+
+ }
+ else
+ {
+ ShowNotify("该检查已进入整改流程不允许删除!", MessageBoxIcon.Warning);
+ return;
+
+ }
+ }
+ BindGrid();
+ ShowNotify("删除成功!", MessageBoxIcon.Success);
+ }
+ }
+
+ protected void btnOut_Click(object sender, EventArgs e)
+ {
+ string type = Request["type"] ?? "0";
+ string typeText = type == "0" ? "安全" : "质量";
+
+ Response.ClearContent();
+ Response.ContentType = "application/octet-stream";
+ Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("企业" + typeText + "检查.xls", System.Text.Encoding.UTF8));
+ Response.Charset = "UTF-8";
+
+ Grid1.PageSize = 100000;
+ BindGrid();
+
+ Response.Write(GetGridTableHtml(Grid1));
+ Response.End();
+ }
+
+ private void GetButtonPower()
+ {
+ string menuId = Request["type"] == "0" ?
+ BLL.Const.UnitHazardRegisterMenu_Safety :
+ BLL.Const.UnitHazardRegisterMenu_Quality;
+
+ var buttonList = BLL.CommonService.GetAllButtonList(
+ this.CurrUser.LoginProjectId, this.CurrUser.PersonId, menuId);
+ if (buttonList.Count > 0)
+ {
+ if (buttonList.Contains(BLL.Const.BtnAdd)) btnNew.Hidden = false;
+ if (buttonList.Contains(BLL.Const.BtnModify)) btnEdit.Hidden = false;
+ if (buttonList.Contains(BLL.Const.BtnDelete)) btnDelete.Hidden = false;
+ }
+ }
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.designer.cs
new file mode 100644
index 00000000..020c74bf
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegister.aspx.designer.cs
@@ -0,0 +1,170 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+
+
+ public partial class UnitHazardRegister
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// txtSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtSearch;
+
+ ///
+ /// drpCheckMainType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpCheckMainType;
+
+ ///
+ /// drpCheckType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpCheckType;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// btnEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnEdit;
+
+ ///
+ /// btnDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnDelete;
+
+ ///
+ /// btnOut 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnOut;
+
+ ///
+ /// lblNumber 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lblNumber;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx
new file mode 100644
index 00000000..ffbc7278
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx
@@ -0,0 +1,169 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UnitHazardRegisterEdit.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Supervise.UnitHazardRegisterEdit" %>
+
+
+
+
+
+
+ 编辑企业级检查
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.cs
new file mode 100644
index 00000000..13b0888f
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.cs
@@ -0,0 +1,425 @@
+using BLL;
+using FineUIPro.Web.BaseInfo;
+using FineUIPro.Web.SysManage;
+using Microsoft.Win32;
+using Model;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+ public partial class UnitHazardRegisterEdit : PageBase
+ {
+ #region Fields
+
+ private List items = new List();
+
+ #endregion Fields
+
+ #region Properties
+
+ public string UnitHazardRegisterId
+ {
+ get { return (string)ViewState["UnitHazardRegisterId"]; }
+ set { ViewState["UnitHazardRegisterId"] = value; }
+ }
+ public string type
+ {
+ get { return (string)ViewState["type"]; }
+ set { ViewState["type"] = value; }
+ }
+ #endregion Properties
+
+ #region Methods
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ // 获取 Type 参数
+ type = Request["type"] ?? "0";
+ btnClose.OnClientClick = ActiveWindow.GetHideReference();
+
+ InitDropList();
+
+ this.UnitHazardRegisterId = Request.Params["UnitHazardRegisterId"];
+ var register = BLL.UnitHazardRegisterService.GetUnitHazardRegisterById(this.UnitHazardRegisterId);
+
+ if (register != null)
+ {
+ // 编辑模式 - 加载数据
+ this.txtUnitHazardRegisterCode.Text = register.UnitHazardRegisterCode;
+ if (register.CheckDate != null)
+ {
+ this.dpkCheckDate.Text = string.Format("{0:yyyy-MM-dd}", register.CheckDate);
+ }
+ this.drpCheckMainType.SelectedValue = register.CheckMainType;
+
+ if (!string.IsNullOrWhiteSpace(register.CheckType))
+ {
+ BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(
+ this.drpCheckType, register.CheckMainType, false);
+ this.drpCheckType.SelectedValue = register.CheckType;
+ }
+
+ if (!string.IsNullOrWhiteSpace(register.ProjectId))
+ {
+ this.ddlProjectId.SelectedValue = register.ProjectId;
+ this.ddlInsResponsibleUserId.Items.Clear();
+ BLL.Person_PersonsService.InitUserDropDownList(this.ddlInsResponsibleUserId, this.ddlProjectId.SelectedValue, true, null);
+ if (!string.IsNullOrWhiteSpace(register.InsResponsibleUserId))
+ {
+ this.ddlInsResponsibleUserId.SelectedValue = register.InsResponsibleUserId;
+ }
+ }
+
+ if (!string.IsNullOrWhiteSpace(register.CheckUnitId))
+ {
+ this.ddlCheckUnitId.SelectedValue = register.CheckUnitId;
+ }
+
+ this.txtCheckTeam.Text = register.CheckTeam;
+
+ // 加载明细
+ items = BLL.UnitHazardRegisterItemService.GetItemsByRegisterId(this.UnitHazardRegisterId)
+ .Select(x => new View_UnitHazardRegisterItem
+ {
+ UnitHazardRegisterItemId = x.UnitHazardRegisterItemId,
+ ProblemDescription = x.ProblemDescription,
+ ProblemType = x.ProblemType,
+ RiskLevel = x.RiskLevel,
+ RectifyRequirement = x.RectifyRequirement,
+ CompleteStatus = x.CompleteStatus,
+ CompletedDate = x.CompletedDate
+ }).ToList();
+
+ if (register.States> (int)UnitHazardRegisterService.StateInt.待提交)
+ {
+ btnAdd.Hidden = true;
+ btnSave.Hidden = true;
+ btnSubmit.Hidden = true;
+ }
+ }
+ else
+ {
+ // 新增模式
+ var unitModel = UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
+ if (unitModel?.IsBranch == true)
+ {
+ this.ddlCheckUnitId.SelectedValue = this.CurrUser.UnitId;
+ }
+ else
+ {
+ var thisUnit = BLL.CommonService.GetIsThisUnit();
+ this.ddlCheckUnitId.SelectedValue = thisUnit.UnitId;
+ }
+ this.txtCheckTeam.Text = BLL.UnitService.GetUnitNameByUnitId(this.CurrUser.UnitId) + " " + this.CurrUser.PersonName;
+ this.dpkCheckDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
+
+ // 自动生成编号
+ int newCount= UnitHazardRegisterService.GetCount(type)+1;
+ this.txtUnitHazardRegisterCode.Text = newCount.ToString().PadLeft(5,'0');
+ }
+
+ Grid1.DataSource = items;
+ Grid1.DataBind();
+ }
+ }
+
+ protected void InitDropList()
+ {
+ drpCheckMainType.SelectedValue = type;
+ // 初始化下拉框
+ BLL.UnitService.InitBranchUnitDropDownList(this.ddlCheckUnitId, false);
+ BLL.ProjectService.InitProjectDropDownList(this.ddlProjectId, ddlCheckUnitId.SelectedValue, true);
+ BLL.Person_PersonsService.InitUserDropDownList(this.ddlInsResponsibleUserId, this.ddlProjectId.SelectedValue, true, null);
+ BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(
+ this.drpCheckType, type, false);
+
+ if (type=="0")
+ {
+ this.drpProblemType.DataTextField = "RegisterTypesName";
+ this.drpProblemType.DataValueField = "RegisterTypesName";
+ this.drpProblemType.DataSource = BLL.HSSE_Hazard_HazardRegisterTypesService.GetHazardRegisterTypesList("1"); //安全巡检类型
+ this.drpProblemType.DataBind();
+ }
+ else
+ {
+ QualityQuestionTypeService.InitQualityQuestionType(drpProblemType, false);
+ }
+
+
+
+ }
+ protected void btnAdd_Click(object sender, EventArgs e)
+ {
+ JArray teamGroupData = Grid1.GetMergedData();
+ List list = new List();
+ foreach (JObject teamGroupRow in teamGroupData)
+ {
+ JObject values = teamGroupRow.Value("values");
+ values.Add("UnitHazardRegisterItemId", teamGroupRow.Value("id"));
+ list.Add(values);
+ }
+ JObject defaultObj = new JObject
+ { { "UnitHazardRegisterItemId",Guid.NewGuid() },
+ { "ProblemDescription", "" },
+ { "ProblemType", "" },
+ { "RiskLevel","一般"},
+ { "RectifyRequirement", "" },
+ { "Delete", String.Format("
", GetDeleteScript(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
+ };
+ list.Add(defaultObj);
+ Grid1.DataSource = list;
+ Grid1.DataBind();
+ }
+
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ if (this.drpCheckMainType.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查大类!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (this.drpCheckType.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查类别!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (this.ddlProjectId.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查对象!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (this.ddlCheckUnitId.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查单位!", MessageBoxIcon.Warning);
+ return;
+ }
+ SaveNew();
+ SaveItem();
+
+ ShowNotify("保存成功!", MessageBoxIcon.Success);
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+ protected void btnSubmit_Click(object sender, EventArgs e)
+ {
+ if (this.drpCheckMainType.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查大类!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (this.drpCheckType.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查类别!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (this.ddlProjectId.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查对象!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (this.ddlCheckUnitId.SelectedValue == BLL.Const._Null)
+ {
+ Alert.ShowInTop("请选择检查单位!", MessageBoxIcon.Warning);
+ return;
+ }
+ SaveNew(Const.BtnSubmit);
+ SaveItem();
+
+ ShowNotify("提交成功!", MessageBoxIcon.Success);
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+ protected void ddlCheckUnitId_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.ddlProjectId.Items.Clear();
+ this.ddlInsResponsibleUserId.Items.Clear();
+ BLL.ProjectService.InitProjectDropDownList(this.ddlProjectId,ddlCheckUnitId.SelectedValue, true);
+
+ }
+ protected void ddlProjectId_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ this.ddlInsResponsibleUserId.Items.Clear();
+ //BLL.UnitService.InitUnitNameByProjectIdUnitTypeDropDownList(this.ddlUnitId, this.ddlProjectId.SelectedValue, Const.ProjectUnitType_1, true);
+ BLL.Person_PersonsService.InitUserDropDownList(this.ddlInsResponsibleUserId, this.ddlProjectId.SelectedValue, true, null);
+
+ }
+
+ protected void drpCheckMainType_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(
+ this.drpCheckType, this.drpCheckMainType.SelectedValue, false);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ protected void Grid1_PreDataBound(object sender, EventArgs e)
+ {
+ // 设置LinkButtonField的点击客户端事件
+ LinkButtonField deleteField = Grid1.FindColumn("Delete") as LinkButtonField;
+ deleteField.OnClientClick = GetDeleteScript();
+ var register = BLL.UnitHazardRegisterService.GetUnitHazardRegisterById(this.UnitHazardRegisterId);
+
+ if (register!=null&& register.States > (int)UnitHazardRegisterService.StateInt.待提交)
+ {
+ LinkButtonField lbUpload = Grid1.FindColumn(6) as LinkButtonField;
+ LinkButtonField lbDelete = Grid1.FindColumn(7) as LinkButtonField;
+
+ lbUpload.Enabled = false;
+ lbDelete.Enabled = false;
+ }
+
+
+ }
+
+ protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
+ {
+ string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
+ string menuId = Request["type"] == "0" ?
+ BLL.Const.UnitHazardRegisterMenu_Safety :
+ BLL.Const.UnitHazardRegisterMenu_Quality;
+ if (e.CommandName == "attchUrl")
+ {
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/UnitHazardRegister&menuId={1}&edit=1", itemId, menuId)));
+ }
+ }
+
+ protected void SaveItem()
+ {
+ JArray teamGroupData = Grid1.GetMergedData();
+ foreach (JObject teamGroupRow in teamGroupData)
+ {
+ JObject values = teamGroupRow.Value("values");
+
+ Model.Supervise_UnitHazardRegisterItem registerItem = new Model.Supervise_UnitHazardRegisterItem
+ {
+ UnitHazardRegisterItemId = teamGroupRow.Value("id"),
+ UnitHazardRegisterId = this.UnitHazardRegisterId,
+ ProblemDescription = values.Value("ProblemDescription"),
+ ProblemType = values.Value("ProblemType"),
+ RiskLevel = values.Value("RiskLevel"),
+ RectifyRequirement = values.Value("RectifyRequirement"),
+ CompleteStatus = 0
+ };
+ if (UnitHazardRegisterItemService.GetUnitHazardRegisterItemById(registerItem.UnitHazardRegisterItemId) != null)
+ {
+ UnitHazardRegisterItemService.UpdateUnitHazardRegisterItem(registerItem);
+ }
+ else
+ {
+ BLL.UnitHazardRegisterItemService.AddUnitHazardRegisterItem(registerItem);
+ }
+ }
+ }
+
+ protected void SaveNew(string type="")
+ {
+ Supervise_UnitHazardRegister register = new Supervise_UnitHazardRegister
+ {
+ UnitHazardRegisterCode = this.txtUnitHazardRegisterCode.Text.Trim(),
+ CheckDate = Funs.GetNewDateTime(this.dpkCheckDate.Text.Trim()),
+ CheckMainType = this.drpCheckMainType.SelectedValue,
+ CheckType = this.drpCheckType.SelectedValue,
+ ProjectId = this.ddlProjectId.SelectedValue,
+ CheckUnitId = this.ddlCheckUnitId.SelectedValue,
+ InsResponsibleUserId = this.ddlInsResponsibleUserId.SelectedValue,
+ CheckTeam = this.txtCheckTeam.Text.Trim(),
+ CompileMan = this.CurrUser.PersonId,
+ States = (int)UnitHazardRegisterService.StateInt.待提交
+ };
+ if (!string.IsNullOrEmpty(type))
+ {
+
+ register.States = (int)UnitHazardRegisterService.StateInt.待整改;
+ }
+ if (string.IsNullOrWhiteSpace(this.UnitHazardRegisterId))
+ {
+ // 新增
+ register.UnitHazardRegisterId = SQLHelper.GetNewID(typeof(Supervise_UnitHazardRegister));
+ this.UnitHazardRegisterId = register.UnitHazardRegisterId;
+ BLL.UnitHazardRegisterService.AddUnitHazardRegister(register);
+
+ // 增加一条编码记录
+ BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(
+ BLL.Const.UnitHazardRegisterMenu_Safety, register.ProjectId, null,
+ register.UnitHazardRegisterId, register.CheckDate);
+ }
+ else
+ {
+ // 更新
+ register.UnitHazardRegisterId = this.UnitHazardRegisterId;
+ BLL.UnitHazardRegisterService.UpdateUnitHazardRegister(register);
+ }
+ }
+
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ // 刷新Grid数据
+ items = BLL.UnitHazardRegisterItemService.GetItemsByRegisterId(this.UnitHazardRegisterId)
+ .Select(x => new View_UnitHazardRegisterItem
+ {
+ UnitHazardRegisterItemId = x.UnitHazardRegisterItemId,
+ ProblemDescription = x.ProblemDescription,
+ ProblemType = x.ProblemType,
+ RiskLevel = x.RiskLevel,
+ RectifyRequirement = x.RectifyRequirement,
+ CompleteStatus = x.CompleteStatus,
+ CompletedDate = x.CompletedDate
+ }).ToList();
+
+ Grid1.DataSource = items;
+ Grid1.DataBind();
+ }
+
+ protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
+ {
+ // 刷新Grid数据
+ JArray teamGroupData = Grid1.GetMergedData();
+ List list = new List();
+ foreach (JObject teamGroupRow in teamGroupData)
+ {
+ JObject values = teamGroupRow.Value("values");
+ values.Add("UnitHazardRegisterItemId", teamGroupRow.Value("id"));
+ list.Add(values);
+ }
+ Grid1.DataSource = list;
+ Grid1.DataBind();
+ }
+
+ ///
+ /// 删除提示
+ ///
+ ///
+ private string GetDeleteScript()
+ {
+ return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, Grid1.GetDeleteSelectedRowsReference(), String.Empty);
+ }
+
+ #endregion Methods
+
+
+ }
+
+ ///
+ /// 企业级检查明细视图类
+ ///
+ public class View_UnitHazardRegisterItem
+ {
+ #region Properties
+
+ public DateTime? CompletedDate { get; set; }
+ public int? CompleteStatus { get; set; }
+ public string ProblemDescription { get; set; }
+ public string ProblemImageUrl { get; set; }
+ public string ProblemType { get; set; }
+ public string RectifyRequirement { get; set; }
+ public string RiskLevel { get; set; }
+ public string UnitHazardRegisterItemId { get; set; }
+
+ #endregion Properties
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.designer.cs
new file mode 100644
index 00000000..e07a75c0
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterEdit.aspx.designer.cs
@@ -0,0 +1,287 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+
+
+ public partial class UnitHazardRegisterEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// txtUnitHazardRegisterCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtUnitHazardRegisterCode;
+
+ ///
+ /// dpkCheckDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker dpkCheckDate;
+
+ ///
+ /// drpCheckMainType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpCheckMainType;
+
+ ///
+ /// drpCheckType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpCheckType;
+
+ ///
+ /// ddlCheckUnitId 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlCheckUnitId;
+
+ ///
+ /// ddlProjectId 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlProjectId;
+
+ ///
+ /// ddlInsResponsibleUserId 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlInsResponsibleUserId;
+
+ ///
+ /// txtCheckTeam 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCheckTeam;
+
+ ///
+ /// ContentPanel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ContentPanel ContentPanel1;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// btnAdd 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnAdd;
+
+ ///
+ /// txtProblemDescription 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtProblemDescription;
+
+ ///
+ /// lbImageUrl1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lbImageUrl1;
+
+ ///
+ /// drpProblemType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpProblemType;
+
+ ///
+ /// drpRiskLevel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpRiskLevel;
+
+ ///
+ /// txtRectifyRequirement 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtRectifyRequirement;
+
+ ///
+ /// lbUpload 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.LinkButtonField lbUpload;
+
+ ///
+ /// lbDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.LinkButtonField lbDelete;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnSubmit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSubmit;
+
+ ///
+ /// btnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnClose;
+
+ ///
+ /// hdId 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox hdId;
+
+ ///
+ /// hdAttachUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox hdAttachUrl;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// WindowAtt 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window WindowAtt;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx
new file mode 100644
index 00000000..e222ae0b
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx
@@ -0,0 +1,225 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UnitHazardRegisterRecord.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Supervise.UnitHazardRegisterRecord" %>
+
+
+
+
+
+
+ 企业级检查记录
+
+
+
+
+
+
+
+
+

+
+
+
+
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.cs
new file mode 100644
index 00000000..d9552243
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.cs
@@ -0,0 +1,285 @@
+using BLL;
+using Model;
+using System;
+using System.Linq;
+using System.Text;
+using AspNet = System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+ public partial class UnitHazardRegisterRecord : PageBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ Funs.DropDownPageSize(this.ddlPageSize);
+
+
+ this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
+
+ // 绑定表格
+ this.BindGrid();
+ }
+ }
+
+ ///
+ /// 绑定数据
+ ///
+ private void BindGrid()
+ {
+ // 获取 Type 参数 (0=安全, 1=质量)
+ string type = Request["type"] ?? "0";
+
+ // 解析时间参数
+ DateTime? startTime = null;
+ DateTime? endTime = null;
+ if (!string.IsNullOrEmpty(txtStartTime.Text.Trim()))
+ {
+ startTime = Funs.GetNewDateTime(txtStartTime.Text.Trim());
+ }
+ if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
+ {
+ endTime = Funs.GetNewDateTime(txtEndTime.Text.Trim());
+ }
+
+ // 解析状态参数
+ int? problemStates = null;
+ if (!string.IsNullOrEmpty(this.drpProblemStates.SelectedValue))
+ {
+ problemStates = Convert.ToInt32(this.drpProblemStates.SelectedValue);
+ }
+
+ // 构建查询条件
+ var input = new UnitHazardRegisterItemInput
+ {
+ CheckMainType = type,
+ CheckTeam = this.txtCheckTeam.Text.Trim(),
+ CheckType = this.txtCheckType.Text.Trim(),
+ Problem = this.txtProblem.Text.Trim(),
+ StartTime = startTime,
+ EndTime = endTime,
+ RiskLevel = this.drpRiskLevel.SelectedValue,
+ ProblemStates = problemStates,
+ UnitId = this.CurrUser.UnitId
+ };
+ if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
+ {
+ input.ProjectId = this.CurrUser.LoginProjectId;
+ }
+ int totalCount;
+
+ // 使用新方法获取数据
+ var list = BLL.UnitHazardRegisterItemService.GetUnitHazardRegisterItems(
+ input,
+ Grid1.PageIndex,
+ Grid1.PageSize,
+ false,
+ out totalCount);
+
+ Grid1.RecordCount = totalCount;
+ Grid1.DataSource = list;
+ Grid1.DataBind();
+ }
+
+ ///
+ /// 分页
+ ///
+ protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ Grid1.PageIndex = e.NewPageIndex;
+ BindGrid();
+ }
+
+ ///
+ /// 排序
+ ///
+ protected void Grid1_Sort(object sender,GridSortEventArgs e)
+ {
+ BindGrid();
+ }
+
+ ///
+ /// 分页显示条数下拉框
+ ///
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ BindGrid();
+ }
+
+ ///
+ /// 查询
+ ///
+ protected void TextBox_TextChanged(object sender, EventArgs e)
+ {
+ if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
+ {
+ if (Funs.GetNewDateTime(this.txtStartTime.Text.Trim()) > Funs.GetNewDateTime(this.txtEndTime.Text.Trim()))
+ {
+ Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
+ return;
+ }
+ }
+ this.BindGrid();
+ }
+
+ ///
+ /// 关闭弹出窗
+ ///
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindGrid();
+ }
+
+ ///
+ /// Grid行双击事件
+ ///
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ string itemId = Grid1.SelectedRowID;
+ // 打开单个问题记录整改编辑界面
+ var item = BLL.UnitHazardRegisterItemService.GetUnitHazardRegisterItemById(itemId);
+ if (item != null)
+ {
+ PageContext.RegisterStartupScript(Window1.GetShowReference(
+ String.Format("UnitHazardRegisterRecordEdit.aspx?ItemId={0}&RegisterId={1}&type={2}",
+ itemId, item.UnitHazardRegisterId, Request["type"])));
+ }
+ }
+
+ ///
+ /// Grid行命令事件
+ ///
+ protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
+ {
+ string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
+
+ if (e.CommandName == "attchUrl")
+ {
+ // 查看问题图片
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
+ String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/UnitHazardRegister&menuId={1}&edit=1&type=-1",
+ itemId, Request["type"] == "0" ? BLL.Const.UnitHazardRegisterMenu_Safety : BLL.Const.UnitHazardRegisterMenu_Quality)));
+ }
+ }
+
+ ///
+ /// 导出按钮
+ ///
+ protected void btnOut_Click(object sender, EventArgs e)
+ {
+ string type = Request["type"] ?? "0";
+ string typeText = type == "0" ? "安全" : "质量";
+
+ Response.ClearContent();
+ Response.ContentType = "application/octet-stream";
+ Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("企业" + typeText + "检查记录.xls", System.Text.Encoding.UTF8));
+ Response.Charset = "UTF-8";
+
+ Grid1.PageSize = 100000;
+ BindGrid();
+
+ Response.Write(GetGridTableHtml(Grid1));
+ Response.End();
+ }
+
+#pragma warning disable CS0108 // “HiddenRectificationList.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
+ ///
+ /// 导出方法
+ ///
+ ///
+ ///
+ private string GetGridTableHtml(Grid grid)
+#pragma warning restore CS0108 // “HiddenRectificationList.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append("");
+ sb.Append("");
+ sb.Append("");
+ foreach (GridColumn column in grid.Columns)
+ {
+ if (column.ColumnID != "ckbIsSelected" && column.ColumnID != "Punish" && column.ColumnID != "Del")
+ {
+ sb.AppendFormat("| {0} | ", column.HeaderText);
+ }
+ }
+ sb.Append("
");
+ foreach (GridRow row in grid.Rows)
+ {
+ sb.Append("");
+ foreach (GridColumn column in grid.Columns)
+ {
+ if (column.ColumnID != "ckbIsSelected" && column.ColumnID != "Punish" && column.ColumnID != "Del")
+ {
+ string html = row.Values[column.ColumnIndex].ToString();
+ if (column.ColumnID == "tfPageIndex")
+ {
+ html = (row.FindControl("lblPageIndex") as AspNet.Label).Text;
+ }
+ if (column.ColumnID == "tfImageUrl")
+ {
+ html = (row.FindControl("lbtnImageUrl") as AspNet.LinkButton).Text;
+ }
+ if (column.ColumnID == "tfRectificationImageUrl")
+ {
+ html = (row.FindControl("lbtnRectificationImageUrl") as AspNet.LinkButton).Text;
+ }
+ if (column.ColumnID == "ProblemTypes")
+ {
+ html = (row.FindControl("lbProblemTypes") as AspNet.Label).Text;
+ }
+ if (column.ColumnID == "tfImageUrl1")
+ {
+ html = (row.FindControl("lbImageUrl1") as AspNet.Label).Text;
+
+ }
+ if (column.ColumnID == "tfImageUrl2")
+ {
+ html = (row.FindControl("lbImageUrl2") as AspNet.Label).Text;
+
+ }
+ if (column.ColumnID == "CheckCycle")
+ {
+ html = (row.FindControl("Label2") as AspNet.Label).Text;
+ }
+ //if (column.ColumnID == "tfCutPayment")
+ //{
+ // html = (row.FindControl("lbtnCutPayment") as AspNet.LinkButton).Text;
+ //}
+ sb.AppendFormat("| {0} | ", html);
+ }
+ }
+ sb.Append("
");
+ }
+ sb.Append("
");
+
+ return sb.ToString();
+ }
+
+ protected void btnEdit_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ string itemId = Grid1.SelectedRowID;
+ // 打开单个问题记录整改编辑界面
+ var item = BLL.UnitHazardRegisterItemService.GetUnitHazardRegisterItemById(itemId);
+ if (item != null)
+ {
+ PageContext.RegisterStartupScript(Window1.GetShowReference(
+ String.Format("UnitHazardRegisterRecordEdit.aspx?ItemId={0}&RegisterId={1}&type={2}",
+ itemId, item.UnitHazardRegisterId, Request["type"])));
+ }
+ }
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.designer.cs
new file mode 100644
index 00000000..3fa0216a
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecord.aspx.designer.cs
@@ -0,0 +1,242 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+
+
+ public partial class UnitHazardRegisterRecord
+ {
+
+ ///
+ /// 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;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// txtCheckTeam 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCheckTeam;
+
+ ///
+ /// txtCheckType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCheckType;
+
+ ///
+ /// txtProblem 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtProblem;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// txtStartTime 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtStartTime;
+
+ ///
+ /// Label3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label Label3;
+
+ ///
+ /// txtEndTime 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtEndTime;
+
+ ///
+ /// drpRiskLevel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpRiskLevel;
+
+ ///
+ /// drpProblemStates 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpProblemStates;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnEdit;
+
+ ///
+ /// btnOut 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnOut;
+
+ ///
+ /// labNumber 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label labNumber;
+
+ ///
+ /// lbImageUrl1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lbImageUrl1;
+
+ ///
+ /// lbImageUrl2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lbImageUrl2;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// WindowAtt 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window WindowAtt;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx
new file mode 100644
index 00000000..59a2d646
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx
@@ -0,0 +1,113 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UnitHazardRegisterRecordEdit.aspx.cs"
+ Inherits="FineUIPro.Web.ZHGL.Supervise.UnitHazardRegisterRecordEdit" %>
+
+
+
+
+
+ 问题整改
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.cs
new file mode 100644
index 00000000..4298ccd9
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.cs
@@ -0,0 +1,255 @@
+using BLL;
+using FineUIPro.Web.BaseInfo;
+using Model;
+using System;
+using System.Web.UI.WebControls;
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+ public partial class UnitHazardRegisterRecordEdit : PageBase
+ {
+ #region 定义项
+
+ ///
+ /// 问题明细ID
+ ///
+ private string ItemId
+ {
+ get { return (string)ViewState["ItemId"]; }
+ set { ViewState["ItemId"] = value; }
+ }
+
+ ///
+ /// 主单ID
+ ///
+ private string RegisterId
+ {
+ get { return (string)ViewState["RegisterId"]; }
+ set { ViewState["RegisterId"] = value; }
+ }
+
+ ///
+ /// 检查大类(0=安全,1=质量)
+ ///
+ private string CheckMainType
+ {
+ get { return (string)ViewState["CheckMainType"]; }
+ set { ViewState["CheckMainType"] = value; }
+ }
+
+ #endregion
+
+ #region 页面加载
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
+
+ // 获取参数
+ this.ItemId = Request.Params["ItemId"];
+ this.RegisterId = Request.Params["RegisterId"];
+ this.CheckMainType = Request["type"] ?? "0";
+
+ // 加载数据
+ if (!string.IsNullOrEmpty(this.ItemId))
+ {
+ LoadData();
+ }
+ }
+ }
+
+ ///
+ /// 加载数据
+ ///
+ private void LoadData()
+ {
+ // 获取明细记录
+ var item = BLL.UnitHazardRegisterItemService.GetUnitHazardRegisterItemById(this.ItemId);
+ if (item == null)
+ {
+ Alert.ShowInTop("问题记录不存在!", MessageBoxIcon.Error);
+ return;
+ }
+
+ // 获取主单记录
+ var register = BLL.UnitHazardRegisterService.GetUnitHazardRegisterById(this.RegisterId);
+ if (register == null)
+ {
+ Alert.ShowInTop("检查记录不存在!", MessageBoxIcon.Error);
+ return;
+ }
+
+ // 填充只读字段
+ this.txtCheckType.Text = BLL.SuperviseCheckTypeService.GetCheckTypeName(
+ register.CheckMainType, register.CheckType);
+ this.txtProblemType.Text = item.ProblemType;
+ this.txtRiskLevel.Text = item.RiskLevel;
+
+ if (register.CheckDate != null)
+ {
+ this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", register.CheckDate);
+ }
+
+ this.txtCheckTeam.Text = register.CheckTeam;
+ this.txtCheckUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(register.CheckUnitId);
+ this.txtProblemDescription.Text = item.ProblemDescription;
+ this.txtRectifyRequirement.Text = item.RectifyRequirement;
+ this.txtInsResponsibleUserName.Text = Person_PersonsService.GetPersonsNameById(register.InsResponsibleUserId);
+
+ // 填充可编辑字段
+ this.txtRectificationMeasures.Text = item.RectificationMeasures;
+
+ if (item.CompletedDate != null)
+ {
+ this.dpkCompletedDate.Text = string.Format("{0:yyyy-MM-dd}", item.CompletedDate);
+ }
+ else
+ {
+ this.dpkCompletedDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
+ }
+ bool isPowerEdit= (this.CurrUser.PersonId == Const.sysglyId|| this.CurrUser.PersonId == Const.hfnbdId || this.CurrUser.PersonId == register.InsResponsibleUserId) ? true: false;
+ // 判断是否已整改,如果已整改则隐藏保存和提交按钮
+ if (item.CompleteStatus == 1 || !isPowerEdit)
+ {
+ this.btnSave.Hidden = true;
+ this.btnSubmit.Hidden = true;
+ this.txtRectificationMeasures.Readonly = true;
+ this.dpkCompletedDate.Readonly = true;
+ // this.btnAfterImage.Enabled = false;
+ if (item.CompleteStatus != 1 && !isPowerEdit)
+ {
+ ShowNotify("您不是整改责任人,不允许修改!", MessageBoxIcon.Information);
+
+ }
+ }
+ }
+
+ #endregion
+
+ #region 保存和提交
+
+ ///
+ /// 保存按钮
+ ///
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ SaveData(false);
+ }
+
+ ///
+ /// 提交按钮
+ ///
+ protected void btnSubmit_Click(object sender, EventArgs e)
+ {
+ SaveData(true);
+ }
+
+ ///
+ /// 保存数据
+ ///
+ /// 是否提交
+ private void SaveData(bool isSubmit)
+ {
+ var item = BLL.UnitHazardRegisterItemService.GetUnitHazardRegisterItemById(this.ItemId);
+ if (item == null)
+ {
+ Alert.ShowInTop("问题记录不存在!", MessageBoxIcon.Error);
+ return;
+ }
+
+ // 验证:如果已整改,不允许修改
+ if (item.CompleteStatus == 1)
+ {
+ Alert.ShowInTop("该问题已整改完成,不允许修改!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ // 更新明细字段
+ item.RectificationMeasures = this.txtRectificationMeasures.Text.Trim();
+ item.CompletedDate = Funs.GetNewDateTime(this.dpkCompletedDate.Text.Trim());
+
+ // 如果提交,确保标记为已完成
+ if (isSubmit)
+ {
+ item.CompleteStatus = 1;
+ if (!item.CompletedDate.HasValue)
+ {
+ item.CompletedDate = DateTime.Now;
+ }
+ }
+
+ // 更新数据库
+ BLL.UnitHazardRegisterItemService.UpdateUnitHazardRegisterItem(item);
+
+ if (isSubmit)
+ {
+ // 更新主单状态
+ UnitHazardRegisterService.UpdateRegisterStatus(this.RegisterId);
+
+ }
+
+ // 记录日志
+ string menuId = this.CheckMainType == "0" ?
+ BLL.Const.UnitHazardRegisterMenu_Safety :
+ BLL.Const.UnitHazardRegisterMenu_Quality;
+
+ BLL.LogService.AddSys_Log(this.CurrUser, item.UnitHazardRegisterItemId,
+ this.ItemId, menuId, BLL.Const.BtnModify);
+
+ ShowNotify(isSubmit ? "提交成功!" : "保存成功!", MessageBoxIcon.Success);
+
+ // 关闭窗口
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+
+
+
+ #endregion
+
+ #region 附件操作
+
+ ///
+ /// 查看整改前照片
+ ///
+ protected void btnBeforeImage_Click(object sender, EventArgs e)
+ {
+ string menuId = this.CheckMainType == "0" ?
+ BLL.Const.UnitHazardRegisterMenu_Safety :
+ BLL.Const.UnitHazardRegisterMenu_Quality;
+
+ PageContext.RegisterStartupScript(Window1.GetShowReference(
+ String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/UnitHazardRegister&menuId={1}&edit=0&type=-1",
+ this.ItemId, menuId)));
+ }
+
+ ///
+ /// 上传和查看整改后照片
+ ///
+ protected void btnAfterImage_Click(object sender, EventArgs e)
+ {
+ string menuId = this.CheckMainType == "0" ?
+ BLL.Const.UnitHazardRegisterMenu_Safety :
+ BLL.Const.UnitHazardRegisterMenu_Quality;
+
+
+ var item = BLL.UnitHazardRegisterItemService.GetUnitHazardRegisterItemById(this.ItemId);
+ if (item != null && item.CompleteStatus == 1) //已整改不允许上传
+ {
+ PageContext.RegisterStartupScript(Window1.GetShowReference(
+ String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/UnitHazardRegister/&menuId={1}&edit=1&type=-1 ",
+ this.ItemId + "-R", menuId)));
+ }
+ else
+ {
+ PageContext.RegisterStartupScript(Window1.GetShowReference(
+ String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/UnitHazardRegister/&menuId={1}&edit=1 ",
+ this.ItemId + "-R", menuId)));
+
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.designer.cs
new file mode 100644
index 00000000..fe309518
--- /dev/null
+++ b/SGGL/FineUIPro.Web/ZHGL/Supervise/UnitHazardRegisterRecordEdit.aspx.designer.cs
@@ -0,0 +1,215 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.ZHGL.Supervise
+{
+
+
+ public partial class UnitHazardRegisterRecordEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// txtCheckType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCheckType;
+
+ ///
+ /// txtProblemType 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtProblemType;
+
+ ///
+ /// txtRiskLevel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtRiskLevel;
+
+ ///
+ /// txtCheckDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCheckDate;
+
+ ///
+ /// txtCheckTeam 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCheckTeam;
+
+ ///
+ /// txtCheckUnitName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtCheckUnitName;
+
+ ///
+ /// txtProblemDescription 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtProblemDescription;
+
+ ///
+ /// txtRectifyRequirement 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRectifyRequirement;
+
+ ///
+ /// btnBeforeImage 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.LinkButton btnBeforeImage;
+
+ ///
+ /// txtRectificationMeasures 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextArea txtRectificationMeasures;
+
+ ///
+ /// txtInsResponsibleUserName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtInsResponsibleUserName;
+
+ ///
+ /// dpkCompletedDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker dpkCompletedDate;
+
+ ///
+ /// btnAfterImage 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.LinkButton btnAfterImage;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnSubmit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSubmit;
+
+ ///
+ /// btnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnClose;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+ }
+}
diff --git a/SGGL/Model/APIItem/DataShare/CheckSpecialSyncData.cs b/SGGL/Model/APIItem/DataShare/CheckSpecialSyncData.cs
new file mode 100644
index 00000000..cd4ecc7d
--- /dev/null
+++ b/SGGL/Model/APIItem/DataShare/CheckSpecialSyncData.cs
@@ -0,0 +1,97 @@
+using System.Collections.Generic;
+using System;
+
+namespace Model
+{
+ public class CheckSpecialSyncData
+ {
+ ///
+ /// 公司社会统一信用代码
+ ///
+ public string CollCropCode { get; set; }
+
+ ///
+ /// 项目id
+ ///
+ public string ProjectId { get; set; }
+
+ ///
+ /// 分包单位程序访问地址
+ ///
+ public string UnitDomain { get; set; }
+
+ ///
+ /// 项目安全隐患数据
+ ///
+ public List Items { get; set; }
+ }
+
+ public class CheckSpecialSyncItem
+ {
+ public string CheckSpecialId { get; set; }
+ public string CheckSpecialCode { get; set; }
+ public string ProjectId { get; set; }
+ public string CheckPerson { get; set; }
+ public DateTime? CheckTime { get; set; }
+ public string ScanUrl { get; set; }
+ public string DaySummary { get; set; }
+ public string PartInUnits { get; set; }
+ public string PartInPersons { get; set; }
+ public string CheckAreas { get; set; }
+ public string States { get; set; }
+ public string CompileMan { get; set; }
+ public string CheckType { get; set; }
+ public string PartInPersonIds { get; set; }
+ public string PartInPersonNames { get; set; }
+ public string CheckItemSetId { get; set; }
+ public string CheckItemName { get; set; }
+ public string AttachFileId1 { get; set; }
+ public string ToKeyId1 { get; set; }
+ public string AttachSource1 { get; set; }
+ public string AttachUrl1 { get; set; }
+ public List CheckSpecialDetails { get; set; }
+ }
+
+
+ public class CheckSpecialDetailSyncItem
+ {
+ public string CheckSpecialDetailId { get; set; }
+ public string CheckSpecialId { get; set; }
+ public string CheckItem { get; set; }
+ public string CheckItemName { get; set; }
+ public string CheckItemType { get; set; }
+ public string Unqualified { get; set; }
+ public string CheckArea { get; set; }
+ public string CheckAreaName { get; set; }
+ public string UnitId { get; set; }
+ public bool? CompleteStatus { get; set; }
+ public DateTime? LimitedDate { get; set; }
+ public DateTime? CompletedDate { get; set; }
+ public string Suggestions { get; set; }
+ public string HandleStep { get; set; }
+ public string RectifyNoticeId { get; set; }
+ public string CheckContent { get; set; }
+ public string WorkArea { get; set; }
+ public string DataId { get; set; }
+ public string DataType { get; set; }
+ public int? SortIndex { get; set; }
+ public string HiddenHazardType { get; set; }
+ public string HSEManage { get; set; }
+ public string HSEManageName { get; set; }
+ public string RiskLevel { get; set; }
+ public DateTime? LimitDate { get; set; }
+ public string AttachUrl { get; set; }
+ public string HandleWay { get; set; }
+ public string RectifyOpinion { get; set; }
+ public DateTime? RectifyDate { get; set; }
+ public string ReAttachUrl { get; set; }
+ public string State { get; set; }
+ public string ProposeUnitId { get; set; }
+ public string SaveHandleMan { get; set; }
+
+ public string AttachFileId1 { get; set; }
+ public string ToKeyId1 { get; set; }
+ public string AttachSource1 { get; set; }
+ public string AttachUrl1 { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/Model/APIItem/DataShare/ClassMeetingData.cs b/SGGL/Model/APIItem/DataShare/ClassMeetingData.cs
new file mode 100644
index 00000000..a6648abb
--- /dev/null
+++ b/SGGL/Model/APIItem/DataShare/ClassMeetingData.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+
+namespace Model
+{
+ ///
+ /// 班前会接收数据
+ ///
+ public class ClassMeetingData
+ {
+ ///
+ /// 分包单位社会统一信用码
+ ///
+ public string CollCropCode { get; set; }
+ ///
+ /// 分包单位Id
+ ///
+ public string UnitId { get; set; }
+ ///
+ /// 分包单位名称
+ ///
+ public string UnitName { get; set; }
+ ///
+ /// 分包单位简称
+ ///
+ public string ShortUnitName { get; set; }
+ ///
+ /// 分包单位域名
+ ///
+ public string UnitDomain { get; set; }
+ ///
+ /// 总包单位Id
+ ///
+ public string SubjectUnit { get; set; }
+ ///
+ /// 总包单位项目Id
+ ///
+ public string SubjectProject { get; set; }
+
+ ///
+ /// 班前会数据集合
+ ///
+ public List Items { get; set; }
+ }
+
+ ///
+ /// 班前会数据
+ ///
+ public class ClassMeetingItem
+ {
+ public string ProjectId { get; set; }
+ public string UnitId { get; set; }
+ public string ClassMeetingId { get; set; }
+ public string ClassMeetingCode { get; set; }
+ public string ClassMeetingName { get; set; }
+ public DateTime? ClassMeetingDate { get; set; }
+ public string ClassMeetingContents { get; set; }
+ public string CompileMan { get; set; }
+ public string CompileManName { get; set; }
+ public string TeamGroupId { get; set; }
+ public string TeamGroupName { get; set; }
+ public DateTime? CompileDate { get; set; }
+ public string States { get; set; }
+ public string MeetingPlace { get; set; }
+ public decimal? MeetingHours { get; set; }
+ public string MeetingHostMan { get; set; }
+ public string AttentPerson { get; set; }
+ public int? AttentPersonNum { get; set; }
+ public string MeetingHostManOther { get; set; }
+ public string Remark { get; set; }
+ ///
+ /// 内容附件
+ ///
+ public string AttachFileId { get; set; }
+ public string ToKeyId { get; set; }
+ public string AttachSource { get; set; }
+ public string AttachUrl { get; set; }
+ ///
+ /// 签到表
+ ///
+ public string AttachFileId1 { get; set; }
+ public string ToKeyId1 { get; set; }
+ public string AttachSource1 { get; set; }
+ public string AttachUrl1 { get; set; }
+ ///
+ /// 会议过程
+ ///
+ public string AttachFileId2 { get; set; }
+ public string ToKeyId2 { get; set; }
+ public string AttachSource2 { get; set; }
+ public string AttachUrl2 { get; set; }
+ }
+}
diff --git a/SGGL/Model/APIItem/DataShare/HazardRegisterSyncData.cs b/SGGL/Model/APIItem/DataShare/HazardRegisterSyncData.cs
new file mode 100644
index 00000000..7ff54dfc
--- /dev/null
+++ b/SGGL/Model/APIItem/DataShare/HazardRegisterSyncData.cs
@@ -0,0 +1,89 @@
+using System.Collections.Generic;
+using System;
+namespace Model
+{
+ public class HazardRegisterSyncData
+ {
+
+ ///
+ /// 公司社会统一信用代码
+ ///
+ public string CollCropCode { get; set; }
+
+ ///
+ /// 项目id
+ ///
+ public string ProjectId { get; set; }
+
+ ///
+ /// 分包单位程序访问地址
+ ///
+ public string UnitDomain { get; set; }
+
+ ///
+ /// 项目安全隐患数据
+ ///
+ public List Items
+ {
+ get;
+ set;
+ }
+
+ }
+
+ public class HazardRegisterSyncItem
+ {
+ public string HazardRegisterId { get; set; } // 主键
+ public string HazardCode { get; set; } // 隐患编码
+ public DateTime? RegisterDate { get; set; } // 观察日期
+ public string RegisterDef { get; set; } // 观察说明
+ public string Rectification { get; set; } // 整改措施
+ public string Place { get; set; } // 地点id
+ public string PlaceName { get; set; } // 地点名称
+ public string ResponsibleUnit { get; set; } // 负责方(单位)
+ public string Observer { get; set; } // 观察员
+ public DateTime? RectifiedDate { get; set; } // 整改日期
+ public string AttachUrl { get; set; } // 附件URL
+ public string ProjectId { get; set; } // 项目ID
+ public string States { get; set; } // 状态 1:待整改;2:已整改,待确认;3:已确认,即已闭环;4:已作废
+ public string IsEffective { get; set; } // 是否审核 0:待审核;1:审核通过,待整改;
+ public string ResponsibleMan { get; set; } // 负责人
+ public string ResponsibleManName { get; set; } // 负责人
+ public string CheckManId { get; set; } // 巡检员
+ public string CheckManName { get; set; } // 巡检员
+ public DateTime? CheckTime { get; set; } // 巡检时间
+ public DateTime? RectificationPeriod { get; set; } // 整改期限
+ public string ImageUrl { get; set; } // 整改前图片路径
+ public string RectificationImageUrl { get; set; } // 整改后图片路径
+ public DateTime? RectificationTime { get; set; } // 整改时间
+ public string ConfirmMan { get; set; } // 确认人
+ public string ConfirmManName { get; set; } // 确认人
+ public DateTime? ConfirmDate { get; set; } // 确认时间
+ public string HandleIdea { get; set; } // 整改意见
+ public int CutPayment { get; set; } // 扣款金额
+ public string ProblemTypes { get; set; } // 问题类型 0:安全;1:质量
+ public string RegisterTypesId { get; set; } // 巡检隐患类型id
+ public string RegisterTypesName { get; set; } // 巡检隐患类型名称
+ public string CheckCycle { get; set; } // 检查周期
+ public string CheckItemDetailId { get; set; } // 详细Id
+ public string SupCheckItemSetId { get; set; } // 上级检查项集合Id
+ public string CheckItemSetId { get; set; } // 检查项id
+ public string CheckSpecialId { get; set; } // 特殊检查项Id
+ public string InstallationId { get; set; } // 装置Id
+ public string SafeSupervisionId { get; set; } // 安全监督Id
+ public string ResponsibleMan2 { get; set; } // 第二责任人
+ public string ResponsibleMan2Name { get; set; } // 第二责任人
+ public bool? SafeSupervisionIsOK { get; set; } // 安全监督是否合格
+ public string GpsLocation { get; set; } // GPS位置
+ public string IsWx { get; set; } // 是否微信
+ public string DIC_ID { get; set; } // 质量巡检问题类型id
+ public string CCManIds { get; set; } // 抄送人员IDs
+ public string ResultType { get; set; } // 相关联单据类型
+ public string ResultId { get; set; } // 项关联单据ID
+ public string Requirements { get; set; } // 整改要求
+ public string Risk_Level { get; set; } // 风险等级
+ public string ControlId { get; set; } // 控制措施Id
+ public string DataSource { get; set; } // 数据来源
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/Model/APIItem/DataShare/LicenseManagerData.cs b/SGGL/Model/APIItem/DataShare/LicenseManagerData.cs
new file mode 100644
index 00000000..15cc0602
--- /dev/null
+++ b/SGGL/Model/APIItem/DataShare/LicenseManagerData.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+
+namespace Model
+{
+ ///
+ /// 作业票定稿接收数据
+ ///
+ public class LicenseManagerData
+ {
+ ///
+ /// 分包单位社会统一信用码
+ ///
+ public string CollCropCode { get; set; }
+ ///
+ /// 分包单位Id
+ ///
+ public string UnitId { get; set; }
+ ///
+ /// 分包单位名称
+ ///
+ public string UnitName { get; set; }
+ ///
+ /// 分包单位简称
+ ///
+ public string ShortUnitName { get; set; }
+ ///
+ /// 分包单位域名
+ ///
+ public string UnitDomain { get; set; }
+ ///
+ /// 总包单位Id
+ ///
+ public string SubjectUnit { get; set; }
+ ///
+ /// 总包单位项目Id
+ ///
+ public string SubjectProject { get; set; }
+
+ ///
+ /// 作业票定稿数据集合
+ ///
+ public List Items { get; set; }
+ }
+
+ ///
+ /// 作业票定稿数据
+ ///
+ public class LicenseManagerItem
+ {
+ public string ProjectId { get; set; }
+ public string UnitId { get; set; }
+ public string LicenseManagerId { get; set; }
+ public string LicenseManagerCode { get; set; }
+ public string LicenseManageName { get; set; }
+ public string LicenseTypeId { get; set; }
+ public string LicenseTypeCode { get; set; }
+ public string LicenseTypeName { get; set; }
+ public string LicenseManageContents { get; set; }
+ public string CompileMan { get; set; }
+ public string CompileManName { get; set; }
+ public DateTime? CompileDate { get; set; }
+ public string States { get; set; }
+ public string WorkAreaId { get; set; }
+ public string UnitWorkCode { get; set; }
+ public string UnitWorkName { get; set; }
+ public DateTime? StartDate { get; set; }
+ public DateTime? EndDate { get; set; }
+ public string ApplicantMan { get; set; }
+ public string WorkStates { get; set; }
+ public bool? IsHighRisk { get; set; }
+ public string LicenseCodes { get; set; }
+
+ ///
+ /// 来源说明
+ ///
+ public string SourceDes { get; set; }
+
+ ///
+ /// 附件
+ ///
+ public string AttachFileId { get; set; }
+ public string ToKeyId { get; set; }
+ public string AttachSource { get; set; }
+ public string AttachUrl { get; set; }
+ ///
+ /// 关闭附件
+ ///
+ public string AttachFileId1 { get; set; }
+ public string ToKeyId1 { get; set; }
+ public string AttachSource1 { get; set; }
+ public string AttachUrl1 { get; set; }
+ }
+}
diff --git a/SGGL/Model/APIItem/DataShare/PersonSyncData.cs b/SGGL/Model/APIItem/DataShare/PersonSyncData.cs
new file mode 100644
index 00000000..25dbbc37
--- /dev/null
+++ b/SGGL/Model/APIItem/DataShare/PersonSyncData.cs
@@ -0,0 +1,118 @@
+using System.Collections.Generic;
+using System;
+namespace Model
+{
+ public class PersonSyncData
+ {
+ ///
+ /// 公司社会统一信用代码
+ ///
+ public string CollCropCode { get; set; }
+
+ ///
+ /// 项目id
+ ///
+ public string ProjectId { get; set; }
+
+ ///
+ /// 分包单位程序访问地址
+ ///
+ public string UnitDomain { get; set; }
+
+
+ ///
+ /// 项目安全隐患数据
+ ///
+ public List Items
+ {
+ get;
+ set;
+ }
+ }
+
+
+
+ public class PersonSyncItem
+ {
+ public string PersonId { get; set; }
+ public string CardNo { get; set; }
+ public string PersonName { get; set; }
+ public string Sex { get; set; }
+ public string IdentityCard { get; set; }
+ public string Address { get; set; }
+ public string ProjectId { get; set; } // 注释掉的字段
+ public string UnitId { get; set; } // 注释掉的字段
+ public string TeamGroupId { get; set; }
+ public string WorkAreaId { get; set; }
+ public string WorkPostId { get; set; }
+ public DateTime? InTime { get; set; }
+ public DateTime? OutTime { get; set; }
+ public string OutResult { get; set; }
+ public string Telephone { get; set; }
+ public string PositionId { get; set; } // 职务(注释掉的字段)
+ public string PostTitleId { get; set; } // 职称(注释掉的字段)
+ public string PhotoUrl { get; set; }
+ public bool IsUsed { get; set; }
+ public bool IsCardUsed { get; set; }
+ public int? PersonIndex { get; set; }
+ public string DepartId { get; set; } // 部门(注释掉的字段)
+ public string CertificateId { get; set; }
+ public string CertificateCode { get; set; }
+ public string CertificateName { get; set; }
+ public DateTime? CertificateLimitTime { get; set; }
+
+ public CertificateItem CertificateItem { get; set; }
+ public string QualificationCertificateUrl { get; set; }
+ public string TrainingCertificateUrl { get; set; }
+ public string QRCodeAttachUrl { get; set; }
+ public string Password { get; set; }
+ public string FromPersonId { get; set; }
+ public string AuditorId { get; set; } // 审核人(注释掉的字段)
+ public DateTime? AuditorDate { get; set; }
+ public DateTime? ExchangeTime { get; set; }
+ public DateTime? ExchangeTime2 { get; set; }
+ public string IDCardUrl { get; set; }
+ public bool? IsForeign { get; set; }
+ public bool? IsOutside { get; set; }
+ public string EduLevel { get; set; }
+ public string MaritalStatus { get; set; }
+ public string Isprint { get; set; }
+ public string MainCNProfessionalId { get; set; }
+ public string ViceCNProfessionalId { get; set; }
+ public DateTime? Birthday { get; set; }
+ public string IdcardType { get; set; }
+ public DateTime? IdcardStartDate { get; set; }
+ public DateTime? IdcardEndDate { get; set; }
+ public string IdcardForever { get; set; }
+ public string PoliticsStatus { get; set; }
+ public string IdcardAddress { get; set; }
+ public string Nation { get; set; }
+ public string CountryCode { get; set; }
+ public bool? IsSafetyMonitoring { get; set; }
+ public string ProvinceCode { get; set; }
+ public bool? IsCardNoOK { get; set; }
+ public string AttachUrl1 { get; set; }
+ public string AttachUrl2 { get; set; }
+ public string AttachUrl3 { get; set; }
+ public string AttachUrl4 { get; set; }
+ public string AttachUrl5 { get; set; }
+ public string WorkPostName { get; set; }
+ public string PostType { get; set; }
+ public bool? IsHsse { get; set; }
+ public bool? IsCQMS { get; set; }
+ public string TeamGroupName { get; set; }
+ public string WorkAreaName { get; set; }
+ }
+
+
+ public class CertificateItem
+ {
+ public string PersonQualityId { get; set; }
+ public string CertificateId { get; set; }
+ public string CertificateNo { get; set; }
+ public string CertificateName { get; set; }
+ public DateTime? CertificateLimitDate { get; set; }
+ }
+
+
+}
\ No newline at end of file
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index a5658a95..6759edb4 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -452,6 +452,9 @@ namespace Model
partial void InsertCQMSData_CQMS(CQMSData_CQMS instance);
partial void UpdateCQMSData_CQMS(CQMSData_CQMS instance);
partial void DeleteCQMSData_CQMS(CQMSData_CQMS instance);
+ partial void InsertDataIdMove(DataIdMove instance);
+ partial void UpdateDataIdMove(DataIdMove instance);
+ partial void DeleteDataIdMove(DataIdMove instance);
partial void InsertDCGL_Check_CheckInfo(DCGL_Check_CheckInfo instance);
partial void UpdateDCGL_Check_CheckInfo(DCGL_Check_CheckInfo instance);
partial void DeleteDCGL_Check_CheckInfo(DCGL_Check_CheckInfo instance);
@@ -1565,6 +1568,9 @@ namespace Model
partial void InsertSolution_SolutionTemplate(Solution_SolutionTemplate instance);
partial void UpdateSolution_SolutionTemplate(Solution_SolutionTemplate instance);
partial void DeleteSolution_SolutionTemplate(Solution_SolutionTemplate instance);
+ partial void InsertSolution_TemporaryElectricity(Solution_TemporaryElectricity instance);
+ partial void UpdateSolution_TemporaryElectricity(Solution_TemporaryElectricity instance);
+ partial void DeleteSolution_TemporaryElectricity(Solution_TemporaryElectricity instance);
partial void InsertSupervise_SubUnitCheckRectify(Supervise_SubUnitCheckRectify instance);
partial void UpdateSupervise_SubUnitCheckRectify(Supervise_SubUnitCheckRectify instance);
partial void DeleteSupervise_SubUnitCheckRectify(Supervise_SubUnitCheckRectify instance);
@@ -1583,6 +1589,12 @@ namespace Model
partial void InsertSupervise_SuperviseCheckReportItem(Supervise_SuperviseCheckReportItem instance);
partial void UpdateSupervise_SuperviseCheckReportItem(Supervise_SuperviseCheckReportItem instance);
partial void DeleteSupervise_SuperviseCheckReportItem(Supervise_SuperviseCheckReportItem instance);
+ partial void InsertSupervise_UnitHazardRegister(Supervise_UnitHazardRegister instance);
+ partial void UpdateSupervise_UnitHazardRegister(Supervise_UnitHazardRegister instance);
+ partial void DeleteSupervise_UnitHazardRegister(Supervise_UnitHazardRegister instance);
+ partial void InsertSupervise_UnitHazardRegisterItem(Supervise_UnitHazardRegisterItem instance);
+ partial void UpdateSupervise_UnitHazardRegisterItem(Supervise_UnitHazardRegisterItem instance);
+ partial void DeleteSupervise_UnitHazardRegisterItem(Supervise_UnitHazardRegisterItem instance);
partial void InsertSYHSEData_Data(SYHSEData_Data instance);
partial void UpdateSYHSEData_Data(SYHSEData_Data instance);
partial void DeleteSYHSEData_Data(SYHSEData_Data instance);
@@ -3067,6 +3079,14 @@ namespace Model
}
}
+ public System.Data.Linq.Table DataIdMove
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
public System.Data.Linq.Table DCGL_Check_CheckInfo
{
get
@@ -6051,6 +6071,14 @@ namespace Model
}
}
+ public System.Data.Linq.Table Solution_TemporaryElectricity
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
public System.Data.Linq.Table Supervise_SubUnitCheckRectify
{
get
@@ -6099,6 +6127,22 @@ namespace Model
}
}
+ public System.Data.Linq.Table Supervise_UnitHazardRegister
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
+ public System.Data.Linq.Table Supervise_UnitHazardRegisterItem
+ {
+ get
+ {
+ return this.GetTable();
+ }
+ }
+
public System.Data.Linq.Table SYHSEData_Data
{
get
@@ -24678,6 +24722,10 @@ namespace Model
private string _YunMouGroupId;
+ private string _SubjectUnit;
+
+ private string _SubjectProject;
+
private EntitySet _Accident_AccidentHandle;
private EntitySet _Accident_AccidentPersonRecord;
@@ -25012,6 +25060,8 @@ namespace Model
private EntitySet _Training_TestRecord;
+ private EntitySet _Supervise_UnitHazardRegister;
+
private EntitySet _Unqualified_WorkContact;
private EntitySet _WBS_BreakdownProject;
@@ -25112,6 +25162,10 @@ namespace Model
partial void OnIsYunMouChanged();
partial void OnYunMouGroupIdChanging(string value);
partial void OnYunMouGroupIdChanged();
+ partial void OnSubjectUnitChanging(string value);
+ partial void OnSubjectUnitChanged();
+ partial void OnSubjectProjectChanging(string value);
+ partial void OnSubjectProjectChanged();
#endregion
public Base_Project()
@@ -25283,6 +25337,7 @@ namespace Model
this._Training_Task = new EntitySet(new Action(this.attach_Training_Task), new Action(this.detach_Training_Task));
this._Training_TestPlan = new EntitySet(new Action(this.attach_Training_TestPlan), new Action(this.detach_Training_TestPlan));
this._Training_TestRecord = new EntitySet(new Action(this.attach_Training_TestRecord), new Action(this.detach_Training_TestRecord));
+ this._Supervise_UnitHazardRegister = new EntitySet(new Action(this.attach_Supervise_UnitHazardRegister), new Action(this.detach_Supervise_UnitHazardRegister));
this._Unqualified_WorkContact = new EntitySet(new Action(this.attach_Unqualified_WorkContact), new Action(this.detach_Unqualified_WorkContact));
this._WBS_BreakdownProject = new EntitySet(new Action(this.attach_WBS_BreakdownProject), new Action(this.detach_WBS_BreakdownProject));
this._WBS_DivisionProject = new EntitySet(new Action(this.attach_WBS_DivisionProject), new Action(this.detach_WBS_DivisionProject));
@@ -25969,6 +26024,46 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubjectUnit", DbType="NVarChar(50)")]
+ public string SubjectUnit
+ {
+ get
+ {
+ return this._SubjectUnit;
+ }
+ set
+ {
+ if ((this._SubjectUnit != value))
+ {
+ this.OnSubjectUnitChanging(value);
+ this.SendPropertyChanging();
+ this._SubjectUnit = value;
+ this.SendPropertyChanged("SubjectUnit");
+ this.OnSubjectUnitChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubjectProject", DbType="NVarChar(50)")]
+ public string SubjectProject
+ {
+ get
+ {
+ return this._SubjectProject;
+ }
+ set
+ {
+ if ((this._SubjectProject != value))
+ {
+ this.OnSubjectProjectChanging(value);
+ this.SendPropertyChanging();
+ this._SubjectProject = value;
+ this.SendPropertyChanged("SubjectProject");
+ this.OnSubjectProjectChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Accident_AccidentHandle_Base_Project", Storage="_Accident_AccidentHandle", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet Accident_AccidentHandle
{
@@ -28182,6 +28277,19 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_UnitHazardRegister_Project", Storage="_Supervise_UnitHazardRegister", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
+ public EntitySet Supervise_UnitHazardRegister
+ {
+ get
+ {
+ return this._Supervise_UnitHazardRegister;
+ }
+ set
+ {
+ this._Supervise_UnitHazardRegister.Assign(value);
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Unqualified_WorkContact_Base_Project", Storage="_Unqualified_WorkContact", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet Unqualified_WorkContact
{
@@ -30377,6 +30485,18 @@ namespace Model
entity.Base_Project = null;
}
+ private void attach_Supervise_UnitHazardRegister(Supervise_UnitHazardRegister entity)
+ {
+ this.SendPropertyChanging();
+ entity.Base_Project = this;
+ }
+
+ private void detach_Supervise_UnitHazardRegister(Supervise_UnitHazardRegister entity)
+ {
+ this.SendPropertyChanging();
+ entity.Base_Project = null;
+ }
+
private void attach_Unqualified_WorkContact(Unqualified_WorkContact entity)
{
this.SendPropertyChanging();
@@ -34757,6 +34877,8 @@ namespace Model
private EntitySet _Test_TestRecord;
+ private EntitySet _Supervise_UnitHazardRegister;
+
private EntitySet _Unqualified_WorkContact;
private EntitySet _WBS_UnitWork;
@@ -34944,6 +35066,7 @@ namespace Model
this._Technical_TechnicalDisclose = new EntitySet(new Action(this.attach_Technical_TechnicalDisclose), new Action(this.detach_Technical_TechnicalDisclose));
this._Technique_SpecialScheme = new EntitySet(new Action(this.attach_Technique_SpecialScheme), new Action(this.detach_Technique_SpecialScheme));
this._Test_TestRecord = new EntitySet(new Action(this.attach_Test_TestRecord), new Action(this.detach_Test_TestRecord));
+ this._Supervise_UnitHazardRegister = new EntitySet(new Action(this.attach_Supervise_UnitHazardRegister), new Action(this.detach_Supervise_UnitHazardRegister));
this._Unqualified_WorkContact = new EntitySet(new Action(this.attach_Unqualified_WorkContact), new Action(this.detach_Unqualified_WorkContact));
this._WBS_UnitWork = new EntitySet(new Action(this.attach_WBS_UnitWork), new Action(this.detach_WBS_UnitWork));
this._WBS_UnitWork_Base_Unit_SupervisorUnit = new EntitySet(new Action(this.attach_WBS_UnitWork_Base_Unit_SupervisorUnit), new Action(this.detach_WBS_UnitWork_Base_Unit_SupervisorUnit));
@@ -37030,6 +37153,19 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_UnitHazardRegister_CheckUnit", Storage="_Supervise_UnitHazardRegister", ThisKey="UnitId", OtherKey="CheckUnitId", DeleteRule="NO ACTION")]
+ public EntitySet Supervise_UnitHazardRegister
+ {
+ get
+ {
+ return this._Supervise_UnitHazardRegister;
+ }
+ set
+ {
+ this._Supervise_UnitHazardRegister.Assign(value);
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Unqualified_WorkContact_Base_Unit", Storage="_Unqualified_WorkContact", ThisKey="UnitId", OtherKey="ProposedUnitId", DeleteRule="NO ACTION")]
public EntitySet Unqualified_WorkContact
{
@@ -38578,6 +38714,18 @@ namespace Model
entity.Base_Unit = null;
}
+ private void attach_Supervise_UnitHazardRegister(Supervise_UnitHazardRegister entity)
+ {
+ this.SendPropertyChanging();
+ entity.Base_Unit = this;
+ }
+
+ private void detach_Supervise_UnitHazardRegister(Supervise_UnitHazardRegister entity)
+ {
+ this.SendPropertyChanging();
+ entity.Base_Unit = null;
+ }
+
private void attach_Unqualified_WorkContact(Unqualified_WorkContact entity)
{
this.SendPropertyChanging();
@@ -68248,6 +68396,116 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.DataIdMove")]
+ public partial class DataIdMove : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private string _OldId;
+
+ private string _NewIds;
+
+ private string _ColumType;
+
+ #region 可扩展性方法定义
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnOldIdChanging(string value);
+ partial void OnOldIdChanged();
+ partial void OnNewIdsChanging(string value);
+ partial void OnNewIdsChanged();
+ partial void OnColumTypeChanging(string value);
+ partial void OnColumTypeChanged();
+ #endregion
+
+ public DataIdMove()
+ {
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OldId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
+ public string OldId
+ {
+ get
+ {
+ return this._OldId;
+ }
+ set
+ {
+ if ((this._OldId != value))
+ {
+ this.OnOldIdChanging(value);
+ this.SendPropertyChanging();
+ this._OldId = value;
+ this.SendPropertyChanged("OldId");
+ this.OnOldIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NewIds", DbType="NVarChar(50)")]
+ public string NewIds
+ {
+ get
+ {
+ return this._NewIds;
+ }
+ set
+ {
+ if ((this._NewIds != value))
+ {
+ this.OnNewIdsChanging(value);
+ this.SendPropertyChanging();
+ this._NewIds = value;
+ this.SendPropertyChanged("NewIds");
+ this.OnNewIdsChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ColumType", DbType="NVarChar(50)")]
+ public string ColumType
+ {
+ get
+ {
+ return this._ColumType;
+ }
+ set
+ {
+ if ((this._ColumType != value))
+ {
+ this.OnColumTypeChanging(value);
+ this.SendPropertyChanging();
+ this._ColumType = value;
+ this.SendPropertyChanged("ColumType");
+ this.OnColumTypeChanged();
+ }
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.DCGL_Check_CheckInfo")]
public partial class DCGL_Check_CheckInfo : INotifyPropertyChanging, INotifyPropertyChanged
{
@@ -112051,6 +112309,8 @@ namespace Model
private System.Nullable _IsUpdate;
+ private string _DataSource;
+
private EntityRef _Base_Unit;
private EntityRef _HSSE_Hazard_HazardRegisterTypes;
@@ -112159,6 +112419,8 @@ namespace Model
partial void OnControlIdChanged();
partial void OnIsUpdateChanging(System.Nullable value);
partial void OnIsUpdateChanged();
+ partial void OnDataSourceChanging(string value);
+ partial void OnDataSourceChanged();
#endregion
public HSSE_Hazard_HazardRegister()
@@ -113176,6 +113438,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DataSource", DbType="Char(1)")]
+ public string DataSource
+ {
+ get
+ {
+ return this._DataSource;
+ }
+ set
+ {
+ if ((this._DataSource != value))
+ {
+ this.OnDataSourceChanging(value);
+ this.SendPropertyChanging();
+ this._DataSource = value;
+ this.SendPropertyChanged("DataSource");
+ this.OnDataSourceChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HSSE_Hazard_HazardRegister_Base_Unit", Storage="_Base_Unit", ThisKey="ResponsibleUnit", OtherKey="UnitId", IsForeignKey=true)]
public Base_Unit Base_Unit
{
@@ -154467,6 +154749,8 @@ namespace Model
private System.Nullable _IsUpdate;
+ private string _SourceDes;
+
private EntityRef _Base_LicenseType;
private EntityRef _Base_Project;
@@ -154513,6 +154797,8 @@ namespace Model
partial void OnIsHighRiskChanged();
partial void OnIsUpdateChanging(System.Nullable value);
partial void OnIsUpdateChanged();
+ partial void OnSourceDesChanging(string value);
+ partial void OnSourceDesChanged();
#endregion
public License_LicenseManager()
@@ -154880,6 +155166,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SourceDes", DbType="NVarChar(500)")]
+ public string SourceDes
+ {
+ get
+ {
+ return this._SourceDes;
+ }
+ set
+ {
+ if ((this._SourceDes != value))
+ {
+ this.OnSourceDesChanging(value);
+ this.SendPropertyChanging();
+ this._SourceDes = value;
+ this.SendPropertyChanged("SourceDes");
+ this.OnSourceDesChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_License_LicenseManager_Base_LicenseType", Storage="_Base_LicenseType", ThisKey="LicenseTypeId", OtherKey="LicenseTypeId", IsForeignKey=true)]
public Base_LicenseType Base_LicenseType
{
@@ -163250,6 +163556,8 @@ namespace Model
private System.Nullable _AttentPersonNum;
+ private string _Remark;
+
private EntityRef _Base_Project;
private EntityRef _Base_Unit;
@@ -163294,6 +163602,8 @@ namespace Model
partial void OnTeamGroupIdChanged();
partial void OnAttentPersonNumChanging(System.Nullable value);
partial void OnAttentPersonNumChanged();
+ partial void OnRemarkChanging(string value);
+ partial void OnRemarkChanged();
#endregion
public Meeting_ClassMeeting()
@@ -163641,6 +163951,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")]
+ public string Remark
+ {
+ get
+ {
+ return this._Remark;
+ }
+ set
+ {
+ if ((this._Remark != value))
+ {
+ this.OnRemarkChanging(value);
+ this.SendPropertyChanging();
+ this._Remark = value;
+ this.SendPropertyChanged("Remark");
+ this.OnRemarkChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Meeting_ClassMeeting_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{
@@ -241921,6 +242251,8 @@ namespace Model
private System.Nullable _IsCQMSCheck;
+ private System.Nullable _IsSyncWelder;
+
private EntityRef _Base_Project;
private EntityRef _Base_Unit;
@@ -242001,6 +242333,8 @@ namespace Model
partial void OnIsSafetyMonitoringChanged();
partial void OnIsCQMSCheckChanging(System.Nullable value);
partial void OnIsCQMSCheckChanged();
+ partial void OnIsSyncWelderChanging(System.Nullable value);
+ partial void OnIsSyncWelderChanged();
#endregion
public SitePerson_Person()
@@ -242678,6 +243012,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsSyncWelder", DbType="Bit")]
+ public System.Nullable IsSyncWelder
+ {
+ get
+ {
+ return this._IsSyncWelder;
+ }
+ set
+ {
+ if ((this._IsSyncWelder != value))
+ {
+ this.OnIsSyncWelderChanging(value);
+ this.SendPropertyChanging();
+ this._IsSyncWelder = value;
+ this.SendPropertyChanged("IsSyncWelder");
+ this.OnIsSyncWelderChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SitePerson_Person_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{
@@ -249340,6 +249694,236 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Solution_TemporaryElectricity")]
+ public partial class Solution_TemporaryElectricity : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private string _TemporaryElectricityId;
+
+ private string _ProjectId;
+
+ private string _Code;
+
+ private string _Name;
+
+ private string _Content;
+
+ private string _Remark;
+
+ private string _CompileMan;
+
+ private System.Nullable _CompileDate;
+
+ #region 可扩展性方法定义
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnTemporaryElectricityIdChanging(string value);
+ partial void OnTemporaryElectricityIdChanged();
+ partial void OnProjectIdChanging(string value);
+ partial void OnProjectIdChanged();
+ partial void OnCodeChanging(string value);
+ partial void OnCodeChanged();
+ partial void OnNameChanging(string value);
+ partial void OnNameChanged();
+ partial void OnContentChanging(string value);
+ partial void OnContentChanged();
+ partial void OnRemarkChanging(string value);
+ partial void OnRemarkChanged();
+ partial void OnCompileManChanging(string value);
+ partial void OnCompileManChanged();
+ partial void OnCompileDateChanging(System.Nullable value);
+ partial void OnCompileDateChanged();
+ #endregion
+
+ public Solution_TemporaryElectricity()
+ {
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TemporaryElectricityId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
+ public string TemporaryElectricityId
+ {
+ get
+ {
+ return this._TemporaryElectricityId;
+ }
+ set
+ {
+ if ((this._TemporaryElectricityId != value))
+ {
+ this.OnTemporaryElectricityIdChanging(value);
+ this.SendPropertyChanging();
+ this._TemporaryElectricityId = value;
+ this.SendPropertyChanged("TemporaryElectricityId");
+ this.OnTemporaryElectricityIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
+ public string ProjectId
+ {
+ get
+ {
+ return this._ProjectId;
+ }
+ set
+ {
+ if ((this._ProjectId != value))
+ {
+ this.OnProjectIdChanging(value);
+ this.SendPropertyChanging();
+ this._ProjectId = value;
+ this.SendPropertyChanged("ProjectId");
+ this.OnProjectIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Code", DbType="NVarChar(100)")]
+ public string Code
+ {
+ get
+ {
+ return this._Code;
+ }
+ set
+ {
+ if ((this._Code != value))
+ {
+ this.OnCodeChanging(value);
+ this.SendPropertyChanging();
+ this._Code = value;
+ this.SendPropertyChanged("Code");
+ this.OnCodeChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(200)")]
+ public string Name
+ {
+ get
+ {
+ return this._Name;
+ }
+ set
+ {
+ if ((this._Name != value))
+ {
+ this.OnNameChanging(value);
+ this.SendPropertyChanging();
+ this._Name = value;
+ this.SendPropertyChanged("Name");
+ this.OnNameChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Content", DbType="NVarChar(2000)")]
+ public string Content
+ {
+ get
+ {
+ return this._Content;
+ }
+ set
+ {
+ if ((this._Content != value))
+ {
+ this.OnContentChanging(value);
+ this.SendPropertyChanging();
+ this._Content = value;
+ this.SendPropertyChanged("Content");
+ this.OnContentChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")]
+ public string Remark
+ {
+ get
+ {
+ return this._Remark;
+ }
+ set
+ {
+ if ((this._Remark != value))
+ {
+ this.OnRemarkChanging(value);
+ this.SendPropertyChanging();
+ this._Remark = value;
+ this.SendPropertyChanged("Remark");
+ this.OnRemarkChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")]
+ public string CompileMan
+ {
+ get
+ {
+ return this._CompileMan;
+ }
+ set
+ {
+ if ((this._CompileMan != value))
+ {
+ this.OnCompileManChanging(value);
+ this.SendPropertyChanging();
+ this._CompileMan = value;
+ this.SendPropertyChanged("CompileMan");
+ this.OnCompileManChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")]
+ public System.Nullable CompileDate
+ {
+ get
+ {
+ return this._CompileDate;
+ }
+ set
+ {
+ if ((this._CompileDate != value))
+ {
+ this.OnCompileDateChanging(value);
+ this.SendPropertyChanging();
+ this._CompileDate = value;
+ this.SendPropertyChanged("CompileDate");
+ this.OnCompileDateChanged();
+ }
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Supervise_SubUnitCheckRectify")]
public partial class Supervise_SubUnitCheckRectify : INotifyPropertyChanging, INotifyPropertyChanged
{
@@ -251626,6 +252210,929 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Supervise_UnitHazardRegister")]
+ public partial class Supervise_UnitHazardRegister : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private string _UnitHazardRegisterId;
+
+ private string _UnitHazardRegisterCode;
+
+ private System.Nullable _CheckDate;
+
+ private string _CheckMainType;
+
+ private string _CheckType;
+
+ private string _ProjectId;
+
+ private string _CheckUnitId;
+
+ private string _CheckTeam;
+
+ private string _CheckManIds;
+
+ private string _CheckManNames;
+
+ private string _EvaluationResult;
+
+ private string _AttachUrl;
+
+ private System.Nullable _States;
+
+ private string _CompileMan;
+
+ private System.Nullable _CreateDate;
+
+ private System.Nullable _UpdateDate;
+
+ private System.Nullable _IsUpdate;
+
+ private string _InsResponsibleUserId;
+
+ private EntityRef _Base_Unit;
+
+ private EntityRef _Base_Project;
+
+ private EntitySet _Supervise_UnitHazardRegisterItem;
+
+ #region 可扩展性方法定义
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnUnitHazardRegisterIdChanging(string value);
+ partial void OnUnitHazardRegisterIdChanged();
+ partial void OnUnitHazardRegisterCodeChanging(string value);
+ partial void OnUnitHazardRegisterCodeChanged();
+ partial void OnCheckDateChanging(System.Nullable value);
+ partial void OnCheckDateChanged();
+ partial void OnCheckMainTypeChanging(string value);
+ partial void OnCheckMainTypeChanged();
+ partial void OnCheckTypeChanging(string value);
+ partial void OnCheckTypeChanged();
+ partial void OnProjectIdChanging(string value);
+ partial void OnProjectIdChanged();
+ partial void OnCheckUnitIdChanging(string value);
+ partial void OnCheckUnitIdChanged();
+ partial void OnCheckTeamChanging(string value);
+ partial void OnCheckTeamChanged();
+ partial void OnCheckManIdsChanging(string value);
+ partial void OnCheckManIdsChanged();
+ partial void OnCheckManNamesChanging(string value);
+ partial void OnCheckManNamesChanged();
+ partial void OnEvaluationResultChanging(string value);
+ partial void OnEvaluationResultChanged();
+ partial void OnAttachUrlChanging(string value);
+ partial void OnAttachUrlChanged();
+ partial void OnStatesChanging(System.Nullable value);
+ partial void OnStatesChanged();
+ partial void OnCompileManChanging(string value);
+ partial void OnCompileManChanged();
+ partial void OnCreateDateChanging(System.Nullable value);
+ partial void OnCreateDateChanged();
+ partial void OnUpdateDateChanging(System.Nullable value);
+ partial void OnUpdateDateChanged();
+ partial void OnIsUpdateChanging(System.Nullable value);
+ partial void OnIsUpdateChanged();
+ partial void OnInsResponsibleUserIdChanging(string value);
+ partial void OnInsResponsibleUserIdChanged();
+ #endregion
+
+ public Supervise_UnitHazardRegister()
+ {
+ this._Base_Unit = default(EntityRef);
+ this._Base_Project = default(EntityRef);
+ this._Supervise_UnitHazardRegisterItem = new EntitySet(new Action(this.attach_Supervise_UnitHazardRegisterItem), new Action(this.detach_Supervise_UnitHazardRegisterItem));
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitHazardRegisterId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
+ public string UnitHazardRegisterId
+ {
+ get
+ {
+ return this._UnitHazardRegisterId;
+ }
+ set
+ {
+ if ((this._UnitHazardRegisterId != value))
+ {
+ this.OnUnitHazardRegisterIdChanging(value);
+ this.SendPropertyChanging();
+ this._UnitHazardRegisterId = value;
+ this.SendPropertyChanged("UnitHazardRegisterId");
+ this.OnUnitHazardRegisterIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitHazardRegisterCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
+ public string UnitHazardRegisterCode
+ {
+ get
+ {
+ return this._UnitHazardRegisterCode;
+ }
+ set
+ {
+ if ((this._UnitHazardRegisterCode != value))
+ {
+ this.OnUnitHazardRegisterCodeChanging(value);
+ this.SendPropertyChanging();
+ this._UnitHazardRegisterCode = value;
+ this.SendPropertyChanged("UnitHazardRegisterCode");
+ this.OnUnitHazardRegisterCodeChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckDate", DbType="DateTime")]
+ public System.Nullable CheckDate
+ {
+ get
+ {
+ return this._CheckDate;
+ }
+ set
+ {
+ if ((this._CheckDate != value))
+ {
+ this.OnCheckDateChanging(value);
+ this.SendPropertyChanging();
+ this._CheckDate = value;
+ this.SendPropertyChanged("CheckDate");
+ this.OnCheckDateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckMainType", DbType="NVarChar(2)")]
+ public string CheckMainType
+ {
+ get
+ {
+ return this._CheckMainType;
+ }
+ set
+ {
+ if ((this._CheckMainType != value))
+ {
+ this.OnCheckMainTypeChanging(value);
+ this.SendPropertyChanging();
+ this._CheckMainType = value;
+ this.SendPropertyChanged("CheckMainType");
+ this.OnCheckMainTypeChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckType", DbType="NVarChar(50)")]
+ public string CheckType
+ {
+ get
+ {
+ return this._CheckType;
+ }
+ set
+ {
+ if ((this._CheckType != value))
+ {
+ this.OnCheckTypeChanging(value);
+ this.SendPropertyChanging();
+ this._CheckType = value;
+ this.SendPropertyChanged("CheckType");
+ this.OnCheckTypeChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
+ public string ProjectId
+ {
+ get
+ {
+ return this._ProjectId;
+ }
+ set
+ {
+ if ((this._ProjectId != value))
+ {
+ if (this._Base_Project.HasLoadedOrAssignedValue)
+ {
+ throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+ }
+ this.OnProjectIdChanging(value);
+ this.SendPropertyChanging();
+ this._ProjectId = value;
+ this.SendPropertyChanged("ProjectId");
+ this.OnProjectIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckUnitId", DbType="NVarChar(50)")]
+ public string CheckUnitId
+ {
+ get
+ {
+ return this._CheckUnitId;
+ }
+ set
+ {
+ if ((this._CheckUnitId != value))
+ {
+ if (this._Base_Unit.HasLoadedOrAssignedValue)
+ {
+ throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+ }
+ this.OnCheckUnitIdChanging(value);
+ this.SendPropertyChanging();
+ this._CheckUnitId = value;
+ this.SendPropertyChanged("CheckUnitId");
+ this.OnCheckUnitIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckTeam", DbType="NVarChar(200)")]
+ public string CheckTeam
+ {
+ get
+ {
+ return this._CheckTeam;
+ }
+ set
+ {
+ if ((this._CheckTeam != value))
+ {
+ this.OnCheckTeamChanging(value);
+ this.SendPropertyChanging();
+ this._CheckTeam = value;
+ this.SendPropertyChanged("CheckTeam");
+ this.OnCheckTeamChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckManIds", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string CheckManIds
+ {
+ get
+ {
+ return this._CheckManIds;
+ }
+ set
+ {
+ if ((this._CheckManIds != value))
+ {
+ this.OnCheckManIdsChanging(value);
+ this.SendPropertyChanging();
+ this._CheckManIds = value;
+ this.SendPropertyChanged("CheckManIds");
+ this.OnCheckManIdsChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckManNames", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string CheckManNames
+ {
+ get
+ {
+ return this._CheckManNames;
+ }
+ set
+ {
+ if ((this._CheckManNames != value))
+ {
+ this.OnCheckManNamesChanging(value);
+ this.SendPropertyChanging();
+ this._CheckManNames = value;
+ this.SendPropertyChanged("CheckManNames");
+ this.OnCheckManNamesChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EvaluationResult", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string EvaluationResult
+ {
+ get
+ {
+ return this._EvaluationResult;
+ }
+ set
+ {
+ if ((this._EvaluationResult != value))
+ {
+ this.OnEvaluationResultChanging(value);
+ this.SendPropertyChanging();
+ this._EvaluationResult = value;
+ this.SendPropertyChanged("EvaluationResult");
+ this.OnEvaluationResultChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttachUrl", DbType="NVarChar(2000)")]
+ public string AttachUrl
+ {
+ get
+ {
+ return this._AttachUrl;
+ }
+ set
+ {
+ if ((this._AttachUrl != value))
+ {
+ this.OnAttachUrlChanging(value);
+ this.SendPropertyChanging();
+ this._AttachUrl = value;
+ this.SendPropertyChanged("AttachUrl");
+ this.OnAttachUrlChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_States", DbType="Int")]
+ public System.Nullable States
+ {
+ get
+ {
+ return this._States;
+ }
+ set
+ {
+ if ((this._States != value))
+ {
+ this.OnStatesChanging(value);
+ this.SendPropertyChanging();
+ this._States = value;
+ this.SendPropertyChanged("States");
+ this.OnStatesChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")]
+ public string CompileMan
+ {
+ get
+ {
+ return this._CompileMan;
+ }
+ set
+ {
+ if ((this._CompileMan != value))
+ {
+ this.OnCompileManChanging(value);
+ this.SendPropertyChanging();
+ this._CompileMan = value;
+ this.SendPropertyChanged("CompileMan");
+ this.OnCompileManChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateDate", DbType="DateTime")]
+ public System.Nullable CreateDate
+ {
+ get
+ {
+ return this._CreateDate;
+ }
+ set
+ {
+ if ((this._CreateDate != value))
+ {
+ this.OnCreateDateChanging(value);
+ this.SendPropertyChanging();
+ this._CreateDate = value;
+ this.SendPropertyChanged("CreateDate");
+ this.OnCreateDateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpdateDate", DbType="DateTime")]
+ public System.Nullable UpdateDate
+ {
+ get
+ {
+ return this._UpdateDate;
+ }
+ set
+ {
+ if ((this._UpdateDate != value))
+ {
+ this.OnUpdateDateChanging(value);
+ this.SendPropertyChanging();
+ this._UpdateDate = value;
+ this.SendPropertyChanged("UpdateDate");
+ this.OnUpdateDateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUpdate", DbType="Bit")]
+ public System.Nullable IsUpdate
+ {
+ get
+ {
+ return this._IsUpdate;
+ }
+ set
+ {
+ if ((this._IsUpdate != value))
+ {
+ this.OnIsUpdateChanging(value);
+ this.SendPropertyChanging();
+ this._IsUpdate = value;
+ this.SendPropertyChanged("IsUpdate");
+ this.OnIsUpdateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InsResponsibleUserId", DbType="NVarChar(50)")]
+ public string InsResponsibleUserId
+ {
+ get
+ {
+ return this._InsResponsibleUserId;
+ }
+ set
+ {
+ if ((this._InsResponsibleUserId != value))
+ {
+ this.OnInsResponsibleUserIdChanging(value);
+ this.SendPropertyChanging();
+ this._InsResponsibleUserId = value;
+ this.SendPropertyChanged("InsResponsibleUserId");
+ this.OnInsResponsibleUserIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_UnitHazardRegister_CheckUnit", Storage="_Base_Unit", ThisKey="CheckUnitId", OtherKey="UnitId", IsForeignKey=true)]
+ public Base_Unit Base_Unit
+ {
+ get
+ {
+ return this._Base_Unit.Entity;
+ }
+ set
+ {
+ Base_Unit previousValue = this._Base_Unit.Entity;
+ if (((previousValue != value)
+ || (this._Base_Unit.HasLoadedOrAssignedValue == false)))
+ {
+ this.SendPropertyChanging();
+ if ((previousValue != null))
+ {
+ this._Base_Unit.Entity = null;
+ previousValue.Supervise_UnitHazardRegister.Remove(this);
+ }
+ this._Base_Unit.Entity = value;
+ if ((value != null))
+ {
+ value.Supervise_UnitHazardRegister.Add(this);
+ this._CheckUnitId = value.UnitId;
+ }
+ else
+ {
+ this._CheckUnitId = default(string);
+ }
+ this.SendPropertyChanged("Base_Unit");
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_UnitHazardRegister_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
+ public Base_Project Base_Project
+ {
+ get
+ {
+ return this._Base_Project.Entity;
+ }
+ set
+ {
+ Base_Project previousValue = this._Base_Project.Entity;
+ if (((previousValue != value)
+ || (this._Base_Project.HasLoadedOrAssignedValue == false)))
+ {
+ this.SendPropertyChanging();
+ if ((previousValue != null))
+ {
+ this._Base_Project.Entity = null;
+ previousValue.Supervise_UnitHazardRegister.Remove(this);
+ }
+ this._Base_Project.Entity = value;
+ if ((value != null))
+ {
+ value.Supervise_UnitHazardRegister.Add(this);
+ this._ProjectId = value.ProjectId;
+ }
+ else
+ {
+ this._ProjectId = default(string);
+ }
+ this.SendPropertyChanged("Base_Project");
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_UnitHazardRegisterItem_Register", Storage="_Supervise_UnitHazardRegisterItem", ThisKey="UnitHazardRegisterId", OtherKey="UnitHazardRegisterId", DeleteRule="CASCADE")]
+ public EntitySet Supervise_UnitHazardRegisterItem
+ {
+ get
+ {
+ return this._Supervise_UnitHazardRegisterItem;
+ }
+ set
+ {
+ this._Supervise_UnitHazardRegisterItem.Assign(value);
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+
+ private void attach_Supervise_UnitHazardRegisterItem(Supervise_UnitHazardRegisterItem entity)
+ {
+ this.SendPropertyChanging();
+ entity.Supervise_UnitHazardRegister = this;
+ }
+
+ private void detach_Supervise_UnitHazardRegisterItem(Supervise_UnitHazardRegisterItem entity)
+ {
+ this.SendPropertyChanging();
+ entity.Supervise_UnitHazardRegister = null;
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Supervise_UnitHazardRegisterItem")]
+ public partial class Supervise_UnitHazardRegisterItem : INotifyPropertyChanging, INotifyPropertyChanged
+ {
+
+ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+
+ private string _UnitHazardRegisterItemId;
+
+ private string _UnitHazardRegisterId;
+
+ private string _ProblemDescription;
+
+ private string _ProblemType;
+
+ private string _RiskLevel;
+
+ private string _RectifyRequirement;
+
+ private System.Nullable _CompleteStatus;
+
+ private System.Nullable _CompletedDate;
+
+ private System.Nullable _SortIndex;
+
+ private string _RectificationMeasures;
+
+ private System.Nullable _IsUpdate;
+
+ private EntityRef _Supervise_UnitHazardRegister;
+
+ #region 可扩展性方法定义
+ partial void OnLoaded();
+ partial void OnValidate(System.Data.Linq.ChangeAction action);
+ partial void OnCreated();
+ partial void OnUnitHazardRegisterItemIdChanging(string value);
+ partial void OnUnitHazardRegisterItemIdChanged();
+ partial void OnUnitHazardRegisterIdChanging(string value);
+ partial void OnUnitHazardRegisterIdChanged();
+ partial void OnProblemDescriptionChanging(string value);
+ partial void OnProblemDescriptionChanged();
+ partial void OnProblemTypeChanging(string value);
+ partial void OnProblemTypeChanged();
+ partial void OnRiskLevelChanging(string value);
+ partial void OnRiskLevelChanged();
+ partial void OnRectifyRequirementChanging(string value);
+ partial void OnRectifyRequirementChanged();
+ partial void OnCompleteStatusChanging(System.Nullable value);
+ partial void OnCompleteStatusChanged();
+ partial void OnCompletedDateChanging(System.Nullable value);
+ partial void OnCompletedDateChanged();
+ partial void OnSortIndexChanging(System.Nullable value);
+ partial void OnSortIndexChanged();
+ partial void OnRectificationMeasuresChanging(string value);
+ partial void OnRectificationMeasuresChanged();
+ partial void OnIsUpdateChanging(System.Nullable value);
+ partial void OnIsUpdateChanged();
+ #endregion
+
+ public Supervise_UnitHazardRegisterItem()
+ {
+ this._Supervise_UnitHazardRegister = default(EntityRef);
+ OnCreated();
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitHazardRegisterItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
+ public string UnitHazardRegisterItemId
+ {
+ get
+ {
+ return this._UnitHazardRegisterItemId;
+ }
+ set
+ {
+ if ((this._UnitHazardRegisterItemId != value))
+ {
+ this.OnUnitHazardRegisterItemIdChanging(value);
+ this.SendPropertyChanging();
+ this._UnitHazardRegisterItemId = value;
+ this.SendPropertyChanged("UnitHazardRegisterItemId");
+ this.OnUnitHazardRegisterItemIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitHazardRegisterId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
+ public string UnitHazardRegisterId
+ {
+ get
+ {
+ return this._UnitHazardRegisterId;
+ }
+ set
+ {
+ if ((this._UnitHazardRegisterId != value))
+ {
+ if (this._Supervise_UnitHazardRegister.HasLoadedOrAssignedValue)
+ {
+ throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+ }
+ this.OnUnitHazardRegisterIdChanging(value);
+ this.SendPropertyChanging();
+ this._UnitHazardRegisterId = value;
+ this.SendPropertyChanged("UnitHazardRegisterId");
+ this.OnUnitHazardRegisterIdChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProblemDescription", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string ProblemDescription
+ {
+ get
+ {
+ return this._ProblemDescription;
+ }
+ set
+ {
+ if ((this._ProblemDescription != value))
+ {
+ this.OnProblemDescriptionChanging(value);
+ this.SendPropertyChanging();
+ this._ProblemDescription = value;
+ this.SendPropertyChanged("ProblemDescription");
+ this.OnProblemDescriptionChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProblemType", DbType="NVarChar(50)")]
+ public string ProblemType
+ {
+ get
+ {
+ return this._ProblemType;
+ }
+ set
+ {
+ if ((this._ProblemType != value))
+ {
+ this.OnProblemTypeChanging(value);
+ this.SendPropertyChanging();
+ this._ProblemType = value;
+ this.SendPropertyChanged("ProblemType");
+ this.OnProblemTypeChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RiskLevel", DbType="NVarChar(50)")]
+ public string RiskLevel
+ {
+ get
+ {
+ return this._RiskLevel;
+ }
+ set
+ {
+ if ((this._RiskLevel != value))
+ {
+ this.OnRiskLevelChanging(value);
+ this.SendPropertyChanging();
+ this._RiskLevel = value;
+ this.SendPropertyChanged("RiskLevel");
+ this.OnRiskLevelChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectifyRequirement", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string RectifyRequirement
+ {
+ get
+ {
+ return this._RectifyRequirement;
+ }
+ set
+ {
+ if ((this._RectifyRequirement != value))
+ {
+ this.OnRectifyRequirementChanging(value);
+ this.SendPropertyChanging();
+ this._RectifyRequirement = value;
+ this.SendPropertyChanged("RectifyRequirement");
+ this.OnRectifyRequirementChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompleteStatus", DbType="Int")]
+ public System.Nullable CompleteStatus
+ {
+ get
+ {
+ return this._CompleteStatus;
+ }
+ set
+ {
+ if ((this._CompleteStatus != value))
+ {
+ this.OnCompleteStatusChanging(value);
+ this.SendPropertyChanging();
+ this._CompleteStatus = value;
+ this.SendPropertyChanged("CompleteStatus");
+ this.OnCompleteStatusChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompletedDate", DbType="DateTime")]
+ public System.Nullable CompletedDate
+ {
+ get
+ {
+ return this._CompletedDate;
+ }
+ set
+ {
+ if ((this._CompletedDate != value))
+ {
+ this.OnCompletedDateChanging(value);
+ this.SendPropertyChanging();
+ this._CompletedDate = value;
+ this.SendPropertyChanged("CompletedDate");
+ this.OnCompletedDateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")]
+ public System.Nullable SortIndex
+ {
+ get
+ {
+ return this._SortIndex;
+ }
+ set
+ {
+ if ((this._SortIndex != value))
+ {
+ this.OnSortIndexChanging(value);
+ this.SendPropertyChanging();
+ this._SortIndex = value;
+ this.SendPropertyChanged("SortIndex");
+ this.OnSortIndexChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationMeasures", DbType="NVarChar(100)")]
+ public string RectificationMeasures
+ {
+ get
+ {
+ return this._RectificationMeasures;
+ }
+ set
+ {
+ if ((this._RectificationMeasures != value))
+ {
+ this.OnRectificationMeasuresChanging(value);
+ this.SendPropertyChanging();
+ this._RectificationMeasures = value;
+ this.SendPropertyChanged("RectificationMeasures");
+ this.OnRectificationMeasuresChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUpdate", DbType="Bit")]
+ public System.Nullable IsUpdate
+ {
+ get
+ {
+ return this._IsUpdate;
+ }
+ set
+ {
+ if ((this._IsUpdate != value))
+ {
+ this.OnIsUpdateChanging(value);
+ this.SendPropertyChanging();
+ this._IsUpdate = value;
+ this.SendPropertyChanged("IsUpdate");
+ this.OnIsUpdateChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_UnitHazardRegisterItem_Register", Storage="_Supervise_UnitHazardRegister", ThisKey="UnitHazardRegisterId", OtherKey="UnitHazardRegisterId", IsForeignKey=true, DeleteOnNull=true)]
+ public Supervise_UnitHazardRegister Supervise_UnitHazardRegister
+ {
+ get
+ {
+ return this._Supervise_UnitHazardRegister.Entity;
+ }
+ set
+ {
+ Supervise_UnitHazardRegister previousValue = this._Supervise_UnitHazardRegister.Entity;
+ if (((previousValue != value)
+ || (this._Supervise_UnitHazardRegister.HasLoadedOrAssignedValue == false)))
+ {
+ this.SendPropertyChanging();
+ if ((previousValue != null))
+ {
+ this._Supervise_UnitHazardRegister.Entity = null;
+ previousValue.Supervise_UnitHazardRegisterItem.Remove(this);
+ }
+ this._Supervise_UnitHazardRegister.Entity = value;
+ if ((value != null))
+ {
+ value.Supervise_UnitHazardRegisterItem.Add(this);
+ this._UnitHazardRegisterId = value.UnitHazardRegisterId;
+ }
+ else
+ {
+ this._UnitHazardRegisterId = default(string);
+ }
+ this.SendPropertyChanged("Supervise_UnitHazardRegister");
+ }
+ }
+ }
+
+ public event PropertyChangingEventHandler PropertyChanging;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void SendPropertyChanging()
+ {
+ if ((this.PropertyChanging != null))
+ {
+ this.PropertyChanging(this, emptyChangingEventArgs);
+ }
+ }
+
+ protected virtual void SendPropertyChanged(String propertyName)
+ {
+ if ((this.PropertyChanged != null))
+ {
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SYHSEData_Data")]
public partial class SYHSEData_Data : INotifyPropertyChanging, INotifyPropertyChanged
{
@@ -281338,6 +282845,14 @@ namespace Model
private string _CheckArea;
+ private string _HandleWay;
+
+ private string _Suggestions;
+
+ private string _RectifyOpinion;
+
+ private string _ProposeUnitId;
+
private string _CheckAreaName;
private string _DataId;
@@ -281350,7 +282865,9 @@ namespace Model
private string _HandleStepLink;
- private string _HiddenHazardType;
+ private string _RiskLevel;
+
+ private string _HSEManage;
private string _HiddenHazardTypeName;
@@ -281582,6 +283099,70 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HandleWay", DbType="VarChar(1) NOT NULL", CanBeNull=false)]
+ public string HandleWay
+ {
+ get
+ {
+ return this._HandleWay;
+ }
+ set
+ {
+ if ((this._HandleWay != value))
+ {
+ this._HandleWay = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Suggestions", DbType="NVarChar(3000)")]
+ public string Suggestions
+ {
+ get
+ {
+ return this._Suggestions;
+ }
+ set
+ {
+ if ((this._Suggestions != value))
+ {
+ this._Suggestions = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectifyOpinion", DbType="NVarChar(3000)")]
+ public string RectifyOpinion
+ {
+ get
+ {
+ return this._RectifyOpinion;
+ }
+ set
+ {
+ if ((this._RectifyOpinion != value))
+ {
+ this._RectifyOpinion = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProposeUnitId", DbType="VarChar(36) NOT NULL", CanBeNull=false)]
+ public string ProposeUnitId
+ {
+ get
+ {
+ return this._ProposeUnitId;
+ }
+ set
+ {
+ if ((this._ProposeUnitId != value))
+ {
+ this._ProposeUnitId = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckAreaName", DbType="NVarChar(36)")]
public string CheckAreaName
{
@@ -281678,18 +283259,34 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HiddenHazardType", DbType="NVarChar(50)")]
- public string HiddenHazardType
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Name="riskLevel", Storage="_RiskLevel", DbType="VarChar(4) NOT NULL", CanBeNull=false)]
+ public string RiskLevel
{
get
{
- return this._HiddenHazardType;
+ return this._RiskLevel;
}
set
{
- if ((this._HiddenHazardType != value))
+ if ((this._RiskLevel != value))
{
- this._HiddenHazardType = value;
+ this._RiskLevel = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HSEManage", DbType="VarChar(1) NOT NULL", CanBeNull=false)]
+ public string HSEManage
+ {
+ get
+ {
+ return this._HSEManage;
+ }
+ set
+ {
+ if ((this._HSEManage != value))
+ {
+ this._HSEManage = value;
}
}
}
@@ -289856,20 +291453,34 @@ namespace Model
private string _ResponsibleUnit;
- private string _ProjectState;
-
private string _Observer;
+ private string _HazardValue;
+
+ private string _Risk_Level;
+
private System.Nullable _RectifiedDate;
private string _ProjectId;
+ private string _PUnitId;
+
+ private string _ProjectState;
+
+ private System.Nullable _IsDelete;
+
+ private string _PUnitName;
+
+ private int _IsThisUnit;
+
+ private System.Nullable _IsBranch;
+
+ private string _ProjectAddress;
+
private string _States;
private string _IsEffective;
- private System.Nullable _IsUpdate;
-
private string _ResponsibleMan;
private string _CheckManId;
@@ -289906,6 +291517,12 @@ namespace Model
private System.Nullable _SafeSupervisionIsOK;
+ private string _WorkPackageId;
+
+ private string _WorkPackageName;
+
+ private System.Nullable _IsUpdate;
+
private string _ProjectName;
private string _CheckCycle;
@@ -289932,6 +291549,8 @@ namespace Model
private string _ResponsibilityManName2;
+ private string _CCManNames;
+
private string _ResponsibilityMan2Tel;
private string _StatesStr;
@@ -289944,11 +291563,7 @@ namespace Model
private string _CCManIds;
- private string _CCManNames;
-
- private string _Requirements;
-
- private string _HazardValue;
+ private string _DataSource;
private string _RegisterTypes2Id;
@@ -289962,9 +291577,7 @@ namespace Model
private string _RegisterTypes4Name;
- private string _WorkPackageId;
-
- private string _WorkPackageName;
+ private string _Requirements;
public View_Hazard_HazardRegister()
{
@@ -290082,22 +291695,6 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectState", DbType="Char(1)")]
- public string ProjectState
- {
- get
- {
- return this._ProjectState;
- }
- set
- {
- if ((this._ProjectState != value))
- {
- this._ProjectState = value;
- }
- }
- }
-
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Observer", DbType="NVarChar(20)")]
public string Observer
{
@@ -290114,6 +291711,38 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HazardValue", DbType="NVarChar(50)")]
+ public string HazardValue
+ {
+ get
+ {
+ return this._HazardValue;
+ }
+ set
+ {
+ if ((this._HazardValue != value))
+ {
+ this._HazardValue = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Risk_Level", DbType="VarChar(4) NOT NULL", CanBeNull=false)]
+ public string Risk_Level
+ {
+ get
+ {
+ return this._Risk_Level;
+ }
+ set
+ {
+ if ((this._Risk_Level != value))
+ {
+ this._Risk_Level = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectifiedDate", DbType="DateTime")]
public System.Nullable RectifiedDate
{
@@ -290146,6 +291775,118 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PUnitId", DbType="NVarChar(50)")]
+ public string PUnitId
+ {
+ get
+ {
+ return this._PUnitId;
+ }
+ set
+ {
+ if ((this._PUnitId != value))
+ {
+ this._PUnitId = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectState", DbType="Char(1)")]
+ public string ProjectState
+ {
+ get
+ {
+ return this._ProjectState;
+ }
+ set
+ {
+ if ((this._ProjectState != value))
+ {
+ this._ProjectState = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Name="isDelete", Storage="_IsDelete", DbType="Int")]
+ public System.Nullable IsDelete
+ {
+ get
+ {
+ return this._IsDelete;
+ }
+ set
+ {
+ if ((this._IsDelete != value))
+ {
+ this._IsDelete = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PUnitName", DbType="NVarChar(200)")]
+ public string PUnitName
+ {
+ get
+ {
+ return this._PUnitName;
+ }
+ set
+ {
+ if ((this._PUnitName != value))
+ {
+ this._PUnitName = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsThisUnit", DbType="Int NOT NULL")]
+ public int IsThisUnit
+ {
+ get
+ {
+ return this._IsThisUnit;
+ }
+ set
+ {
+ if ((this._IsThisUnit != value))
+ {
+ this._IsThisUnit = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsBranch", DbType="Bit")]
+ public System.Nullable IsBranch
+ {
+ get
+ {
+ return this._IsBranch;
+ }
+ set
+ {
+ if ((this._IsBranch != value))
+ {
+ this._IsBranch = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectAddress", DbType="NVarChar(500)")]
+ public string ProjectAddress
+ {
+ get
+ {
+ return this._ProjectAddress;
+ }
+ set
+ {
+ if ((this._ProjectAddress != value))
+ {
+ this._ProjectAddress = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="states", Storage="_States", DbType="Char(1)")]
public string States
{
@@ -290178,22 +291919,6 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUpdate", DbType="Bit")]
- public System.Nullable IsUpdate
- {
- get
- {
- return this._IsUpdate;
- }
- set
- {
- if ((this._IsUpdate != value))
- {
- this._IsUpdate = value;
- }
- }
- }
-
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResponsibleMan", DbType="NVarChar(50)")]
public string ResponsibleMan
{
@@ -290258,7 +291983,7 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ImageUrl", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ImageUrl", DbType="NVarChar(2000)")]
public string ImageUrl
{
get
@@ -290274,7 +291999,7 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationImageUrl", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationImageUrl", DbType="NVarChar(2000)")]
public string RectificationImageUrl
{
get
@@ -290482,6 +292207,54 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageId", DbType="NVarChar(2000)")]
+ public string WorkPackageId
+ {
+ get
+ {
+ return this._WorkPackageId;
+ }
+ set
+ {
+ if ((this._WorkPackageId != value))
+ {
+ this._WorkPackageId = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageName", DbType="NVarChar(2000)")]
+ public string WorkPackageName
+ {
+ get
+ {
+ return this._WorkPackageName;
+ }
+ set
+ {
+ if ((this._WorkPackageName != value))
+ {
+ this._WorkPackageName = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUpdate", DbType="Bit")]
+ public System.Nullable IsUpdate
+ {
+ get
+ {
+ return this._IsUpdate;
+ }
+ set
+ {
+ if ((this._IsUpdate != value))
+ {
+ this._IsUpdate = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectName", DbType="NVarChar(200)")]
public string ProjectName
{
@@ -290690,6 +292463,22 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CCManNames", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
+ public string CCManNames
+ {
+ get
+ {
+ return this._CCManNames;
+ }
+ set
+ {
+ if ((this._CCManNames != value))
+ {
+ this._CCManNames = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResponsibilityMan2Tel", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
public string ResponsibilityMan2Tel
{
@@ -290706,7 +292495,7 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatesStr", DbType="VarChar(6) NOT NULL", CanBeNull=false)]
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatesStr", DbType="VarChar(17) NOT NULL", CanBeNull=false)]
public string StatesStr
{
get
@@ -290786,50 +292575,18 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CCManNames", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
- public string CCManNames
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DataSource", DbType="Char(1)")]
+ public string DataSource
{
get
{
- return this._CCManNames;
+ return this._DataSource;
}
set
{
- if ((this._CCManNames != value))
+ if ((this._DataSource != value))
{
- this._CCManNames = value;
- }
- }
- }
-
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Requirements", DbType="NVarChar(400)")]
- public string Requirements
- {
- get
- {
- return this._Requirements;
- }
- set
- {
- if ((this._Requirements != value))
- {
- this._Requirements = value;
- }
- }
- }
-
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HazardValue", DbType="NVarChar(50)")]
- public string HazardValue
- {
- get
- {
- return this._HazardValue;
- }
- set
- {
- if ((this._HazardValue != value))
- {
- this._HazardValue = value;
+ this._DataSource = value;
}
}
}
@@ -290930,34 +292687,18 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageId", DbType="NVarChar(2000)")]
- public string WorkPackageId
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Requirements", DbType="NVarChar(400)")]
+ public string Requirements
{
get
{
- return this._WorkPackageId;
+ return this._Requirements;
}
set
{
- if ((this._WorkPackageId != value))
+ if ((this._Requirements != value))
{
- this._WorkPackageId = value;
- }
- }
- }
-
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageName", DbType="NVarChar(2000)")]
- public string WorkPackageName
- {
- get
- {
- return this._WorkPackageName;
- }
- set
- {
- if ((this._WorkPackageName != value))
- {
- this._WorkPackageName = value;
+ this._Requirements = value;
}
}
}
@@ -307682,23 +309423,19 @@ namespace Model
private string _States;
- private System.Nullable _IsHighRisk;
-
private string _ProjectCode;
private string _ProjectName;
- private System.Nullable _IsCNCECShow;
-
private string _LicenseTypeName;
private string _UnitName;
- private System.Nullable _IsUpdate;
+ private string _UnitTypeId;
private string _UnitTypeName;
- private string _PersonName;
+ private string _UserName;
private string _WorkAreaId;
@@ -307708,6 +309445,16 @@ namespace Model
private string _ApplicantMan;
+ private System.Nullable _IsHighRisk;
+
+ private string _WorkStates;
+
+ private System.Nullable _IsUpdate;
+
+ private string _SourceDes;
+
+ private string _LicenseCodes;
+
private string _WorkStatesStr;
private string _WorkAreaName;
@@ -307876,22 +309623,6 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsHighRisk", DbType="Bit")]
- public System.Nullable IsHighRisk
- {
- get
- {
- return this._IsHighRisk;
- }
- set
- {
- if ((this._IsHighRisk != value))
- {
- this._IsHighRisk = value;
- }
- }
- }
-
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectCode", DbType="NVarChar(50)")]
public string ProjectCode
{
@@ -307924,22 +309655,6 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsCNCECShow", DbType="Bit")]
- public System.Nullable IsCNCECShow
- {
- get
- {
- return this._IsCNCECShow;
- }
- set
- {
- if ((this._IsCNCECShow != value))
- {
- this._IsCNCECShow = value;
- }
- }
- }
-
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LicenseTypeName", DbType="NVarChar(50)")]
public string LicenseTypeName
{
@@ -307972,18 +309687,18 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUpdate", DbType="Bit")]
- public System.Nullable IsUpdate
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitTypeId", DbType="NVarChar(50)")]
+ public string UnitTypeId
{
get
{
- return this._IsUpdate;
+ return this._UnitTypeId;
}
set
{
- if ((this._IsUpdate != value))
+ if ((this._UnitTypeId != value))
{
- this._IsUpdate = value;
+ this._UnitTypeId = value;
}
}
}
@@ -308004,18 +309719,18 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PersonName", DbType="NVarChar(200)")]
- public string PersonName
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserName", DbType="NVarChar(200)")]
+ public string UserName
{
get
{
- return this._PersonName;
+ return this._UserName;
}
set
{
- if ((this._PersonName != value))
+ if ((this._UserName != value))
{
- this._PersonName = value;
+ this._UserName = value;
}
}
}
@@ -308084,6 +309799,86 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsHighRisk", DbType="Bit")]
+ public System.Nullable IsHighRisk
+ {
+ get
+ {
+ return this._IsHighRisk;
+ }
+ set
+ {
+ if ((this._IsHighRisk != value))
+ {
+ this._IsHighRisk = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkStates", DbType="VarChar(2)")]
+ public string WorkStates
+ {
+ get
+ {
+ return this._WorkStates;
+ }
+ set
+ {
+ if ((this._WorkStates != value))
+ {
+ this._WorkStates = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUpdate", DbType="Bit")]
+ public System.Nullable IsUpdate
+ {
+ get
+ {
+ return this._IsUpdate;
+ }
+ set
+ {
+ if ((this._IsUpdate != value))
+ {
+ this._IsUpdate = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SourceDes", DbType="VarChar(1) NOT NULL", CanBeNull=false)]
+ public string SourceDes
+ {
+ get
+ {
+ return this._SourceDes;
+ }
+ set
+ {
+ if ((this._SourceDes != value))
+ {
+ this._SourceDes = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LicenseCodes", DbType="VarChar(1) NOT NULL", CanBeNull=false)]
+ public string LicenseCodes
+ {
+ get
+ {
+ return this._LicenseCodes;
+ }
+ set
+ {
+ if ((this._LicenseCodes != value))
+ {
+ this._LicenseCodes = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkStatesStr", DbType="VarChar(6) NOT NULL", CanBeNull=false)]
public string WorkStatesStr
{
diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj
index a1b83dcc..5f3fd621 100644
--- a/SGGL/Model/Model.csproj
+++ b/SGGL/Model/Model.csproj
@@ -79,6 +79,11 @@
+
+
+
+
+
@@ -301,6 +306,10 @@
+
+
+
+
diff --git a/SGGL/Model/ZHGL/UnitHazardRegisterInput.cs b/SGGL/Model/ZHGL/UnitHazardRegisterInput.cs
new file mode 100644
index 00000000..28677c19
--- /dev/null
+++ b/SGGL/Model/ZHGL/UnitHazardRegisterInput.cs
@@ -0,0 +1,30 @@
+using System;
+
+namespace Model
+{
+ ///
+ /// 企业级检查查询条件
+ ///
+ public class UnitHazardRegisterInput
+ {
+ ///
+ /// 检查大类(0=安全,1=质量)
+ ///
+ public string CheckMainType { get; set; }
+
+ ///
+ /// 搜索文本
+ ///
+ public string SearchText { get; set; }
+
+ ///
+ /// 检查类别
+ ///
+ public string CheckType { get; set; }
+
+ ///
+ /// 项目ID(权限过滤)
+ ///
+ public string ProjectId { get; set; }
+ }
+}
diff --git a/SGGL/Model/ZHGL/UnitHazardRegisterItemInput.cs b/SGGL/Model/ZHGL/UnitHazardRegisterItemInput.cs
new file mode 100644
index 00000000..e7f18692
--- /dev/null
+++ b/SGGL/Model/ZHGL/UnitHazardRegisterItemInput.cs
@@ -0,0 +1,63 @@
+using System;
+
+namespace Model
+{
+ ///
+ /// 企业级检查明细查询条件
+ ///
+ public class UnitHazardRegisterItemInput
+ {
+ ///
+ /// 检查大类(0=安全,1=质量)
+ ///
+ public string CheckMainType { get; set; }
+
+ ///
+ /// 检查组/人
+ ///
+ public string CheckTeam { get; set; }
+
+ ///
+ /// 检查类别
+ ///
+ public string CheckType { get; set; }
+
+ ///
+ /// 问题描述
+ ///
+ public string Problem { get; set; }
+
+ ///
+ /// 开始时间
+ ///
+ public DateTime? StartTime { get; set; }
+
+ ///
+ /// 结束时间
+ ///
+ public DateTime? EndTime { get; set; }
+
+ ///
+ /// 风险级别
+ ///
+ public string RiskLevel { get; set; }
+
+ ///
+ /// 状态
+ ///
+ public int? States { get; set; }
+ ///
+ /// 问题整改状态
+ ///
+ public int? ProblemStates { get; set; }
+
+ ///
+ /// 单位ID(权限过滤)
+ ///
+ public string UnitId { get; set; }
+ ///
+ /// 项目id
+ ///
+ public string ProjectId { get; set; }
+ }
+}
diff --git a/SGGL/Model/ZHGL/UnitHazardRegisterItemOutput.cs b/SGGL/Model/ZHGL/UnitHazardRegisterItemOutput.cs
new file mode 100644
index 00000000..f6176c33
--- /dev/null
+++ b/SGGL/Model/ZHGL/UnitHazardRegisterItemOutput.cs
@@ -0,0 +1,96 @@
+using System;
+
+namespace Model
+{
+ ///
+ /// 企业级检查明细输出实体
+ ///
+ public class UnitHazardRegisterItemOutput
+ {
+ ///
+ /// 明细ID
+ ///
+ public string UnitHazardRegisterItemId { get; set; }
+
+ ///
+ /// 检查编号
+ ///
+ public string UnitHazardRegisterCode { get; set; }
+
+ ///
+ /// 检查日期
+ ///
+ public DateTime? CheckDate { get; set; }
+
+ ///
+ /// 检查大类名称
+ ///
+ public string CheckMainTypeName { get; set; }
+
+ ///
+ /// 检查类别名称
+ ///
+ public string CheckTypeName { get; set; }
+
+ ///
+ /// 问题描述
+ ///
+ public string ProblemDescription { get; set; }
+
+ ///
+ /// 问题类型
+ ///
+ public string ProblemType { get; set; }
+
+ ///
+ /// 风险级别
+ ///
+ public string RiskLevel { get; set; }
+
+ ///
+ /// 整改要求
+ ///
+ public string RectifyRequirement { get; set; }
+
+ ///
+ /// 状态名称
+ ///
+ public string StatesName { get; set; }
+
+ ///
+ /// 检查组/人
+ ///
+ public string CheckTeam { get; set; }
+
+ ///
+ /// 检查项目ID
+ ///
+ public string ProjectId { get; set; }
+
+ ///
+ /// 检查单位名称
+ ///
+ public string CheckUnitName { get; set; }
+
+ ///
+ /// 状态
+ ///
+ public int? States { get; set; }
+ ///
+ /// 问题整改状态
+ ///
+ public int? ProblemStates { get; set; }
+ ///
+ /// 问题整改状态名称
+ ///
+ public string ProblemStatesName { get; set; }
+ ///
+ /// 受检负责人名称
+ ///
+ public string InsResponsibleUserName { get; set; }
+ ///
+ /// 受检负责人Id
+ ///
+ public string InsResponsibleUserId { get; set; }
+ }
+}
diff --git a/SGGL/Model/ZHGL/UnitHazardRegisterOutput.cs b/SGGL/Model/ZHGL/UnitHazardRegisterOutput.cs
new file mode 100644
index 00000000..a3bc92bf
--- /dev/null
+++ b/SGGL/Model/ZHGL/UnitHazardRegisterOutput.cs
@@ -0,0 +1,75 @@
+using System;
+
+namespace Model
+{
+ ///
+ /// 企业级检查输出实体
+ ///
+ public class UnitHazardRegisterOutput
+ {
+ ///
+ /// 检查记录ID
+ ///
+ public string UnitHazardRegisterId { get; set; }
+
+ ///
+ /// 检查编号
+ ///
+ public string UnitHazardRegisterCode { get; set; }
+
+ ///
+ /// 检查日期
+ ///
+ public DateTime? CheckDate { get; set; }
+
+ ///
+ /// 项目ID
+ ///
+ public string ProjectId { get; set; }
+
+ ///
+ /// 检查大类名称
+ ///
+ public string CheckMainTypeName { get; set; }
+
+ ///
+ /// 检查类别代码
+ ///
+ public string CheckType { get; set; }
+
+ ///
+ /// 检查类别名称
+ ///
+ public string CheckTypeName { get; set; }
+
+ ///
+ /// 检查对象名称
+ ///
+ public string CheckObjectText { get; set; }
+
+ ///
+ /// 检查单位名称
+ ///
+ public string CheckUnitName { get; set; }
+
+ ///
+ /// 检查组/人
+ ///
+ public string CheckTeam { get; set; }
+
+ ///
+ /// 评价结果
+ ///
+ public string EvaluationResult { get; set; }
+
+ ///
+ /// 状态名称
+ ///
+ public string StatesName { get; set; }
+
+ ///
+ /// 附件URL
+ ///
+ public string AttachUrl { get; set; }
+ }
+}
diff --git a/SGGL/WebAPI/Controllers/DataShare/HSSE/CheckSpecialSyncController.cs b/SGGL/WebAPI/Controllers/DataShare/HSSE/CheckSpecialSyncController.cs
new file mode 100644
index 00000000..1266f1c5
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/DataShare/HSSE/CheckSpecialSyncController.cs
@@ -0,0 +1,119 @@
+using BLL;
+using System;
+using System.Linq;
+using System.Web.Http;
+using System.Threading.Tasks;
+
+namespace WebAPI.Controllers
+{
+ public class CheckSpecialSyncController : ApiController
+ {
+ #region 从分包拉取总包上的项目专项检查数据
+
+ ///
+ /// 从分包拉取总包上的项目专项检查数据
+ ///
+ ///
+ public async Task getCheckSpecialLists()
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.code = 1;
+ responeData.data = APICheckSpecialSyncService.getCheckSpecialLists();
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 根据项目id和单位统一社会代码获取项目专项检查
+
+ ///
+ /// 根据项目id和单位统一社会代码获取项目专项检查
+ ///
+ ///
+ public Model.ResponeData getCheckSpecialListByProjectIdAndCollCropCode(string projectId, string collCropCode)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.code = 1;
+ var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
+ responeData.data =
+ APICheckSpecialSyncService.GetCheckSpecialLitsByprojectIdUnitId(projectId, unit.UnitId);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 分包推送项目专项检查数据到总包
+
+ ///
+ /// 分包推送项目专项检查数据到总包
+ ///
+ ///
+ [HttpPost]
+ public async Task pushCheckSpecialLists(string projectId, string dataId)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var returndata = APICheckSpecialSyncService.pushCheckSpecialLists(projectId,dataId);
+ responeData.code = returndata.code;
+ responeData.message = returndata.message;
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 接收保存分包单位推送到总包的项目专项检查数据
+
+ ///
+ /// 接收保存分包单位推送到总包的项目专项检查数据
+ ///
+ /// HSSE数据
+ ///
+ [HttpPost]
+ public async Task SaveCheckSpecialSyncData([FromBody] Model.CheckSpecialSyncData newItem)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.message = await APICheckSpecialSyncService.SaveCheckSpecialSyncData(newItem);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/WebAPI/Controllers/DataShare/HSSE/HazardRegisterSyncController.cs b/SGGL/WebAPI/Controllers/DataShare/HSSE/HazardRegisterSyncController.cs
new file mode 100644
index 00000000..73f8ef8a
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/DataShare/HSSE/HazardRegisterSyncController.cs
@@ -0,0 +1,119 @@
+using BLL;
+using System;
+using System.Linq;
+using System.Web.Http;
+using System.Threading.Tasks;
+
+namespace WebAPI.Controllers
+{
+ public class HazardRegisterSyncController : ApiController
+ {
+ #region 拉取项目安全检查数据
+
+ ///
+ /// 拉取项目安全检查数据
+ ///
+ ///
+ public Model.ResponeData getHazardRegisterLists()
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.code = 1;
+ responeData.data = APIHazardRegisterSyncService.getHazardRegisterLists();
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 获取项目安全检查根据项目id和单位统一社会代码
+
+ ///
+ /// 获取所有单位
+ ///
+ ///
+ public Model.ResponeData getHazardRegisterListByProjectIdAndCollCropCode(string projectId, string collCropCode)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.code = 1;
+ var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
+ responeData.data =
+ APIHazardRegisterSyncService.GetHazardRegisterLitsByprojectIdUnitIdPage(projectId, unit.UnitId);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 推送项目安全检查数据
+
+ ///
+ /// 推送项目安全检查数据
+ ///
+ ///
+ [HttpPost]
+ public Model.ResponeData pushHazardRegisterLists(string projectId, string dataId)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var returndata = APIHazardRegisterSyncService.pushHazardRegisterLists(projectId, dataId);
+ responeData.code = returndata.code;
+ responeData.message = returndata.message;
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 接收保存项目安全检查数据
+
+ ///
+ /// 接收保存项目安全检查数据
+ ///
+ /// HSSE数据
+ ///
+ [HttpPost]
+ public Model.ResponeData SaveHazardRegisterSyncData([FromBody] Model.HazardRegisterSyncData newItem)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.message = APIHazardRegisterSyncService.SaveHazardRegisterSyncData(newItem);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/WebAPI/Controllers/DataShare/HSSE/LicenseSyncController.cs b/SGGL/WebAPI/Controllers/DataShare/HSSE/LicenseSyncController.cs
new file mode 100644
index 00000000..cfd0f180
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/DataShare/HSSE/LicenseSyncController.cs
@@ -0,0 +1,64 @@
+using BLL;
+using Model;
+using System;
+using System.Threading.Tasks;
+using System.Web.Http;
+
+namespace WebAPI.Controllers
+{
+ ///
+ /// 作业票定稿
+ ///
+ public class LicenseSyncController : ApiController
+ {
+ #region 分包单位推送数据到总包单位
+
+ ///
+ /// 推送项目作业票定稿数据
+ ///
+ ///
+ [HttpPost]
+ public async Task PushLicenseManagerLists()
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var returndata = APILicenseSyncService.PushLicenseManagerLists("");
+ responeData.code = returndata.code;
+ responeData.message = returndata.message;
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+ return responeData;
+ }
+
+ #endregion
+
+ #region 总包单位接收分包单位推送数据
+
+ ///
+ /// 总包单位接收分包单位推送的作业票定稿数据
+ ///
+ /// 作业票定稿数据
+ ///
+ [HttpPost]
+ public Model.ResponeData ReceiveSaveProjectLicenseManagerData([FromBody] LicenseManagerData data)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.message = APILicenseSyncService.ReceiveSaveProjectLicenseManagerData(data);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+ return responeData;
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/WebAPI/Controllers/DataShare/HSSE/MeetingSyncController.cs b/SGGL/WebAPI/Controllers/DataShare/HSSE/MeetingSyncController.cs
new file mode 100644
index 00000000..40424b01
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/DataShare/HSSE/MeetingSyncController.cs
@@ -0,0 +1,64 @@
+using BLL;
+using Model;
+using System;
+using System.Threading.Tasks;
+using System.Web.Http;
+
+namespace WebAPI.Controllers
+{
+ ///
+ /// 安全会议
+ ///
+ public class MeetingSyncController : ApiController
+ {
+ #region 分包单位推送数据到总包单位
+
+ ///
+ /// 推送项目班前会数据
+ ///
+ ///
+ [HttpPost]
+ public async Task PushClassMeetingLists()
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var returndata = APIMeetingSyncService.PushClassMeetingLists("");
+ responeData.code = returndata.code;
+ responeData.message = returndata.message;
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+ return responeData;
+ }
+
+ #endregion
+
+ #region 总包单位接收分包单位推送数据
+
+ ///
+ /// 总包单位接收分包单位推送的班前会数据
+ ///
+ /// 班前会数据
+ ///
+ [HttpPost]
+ public Model.ResponeData ReceiveSaveProjectClassMeetingData([FromBody] ClassMeetingData data)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.message = APIMeetingSyncService.ReceiveSaveProjectClassMeetingData(data);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+ return responeData;
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SGGL/WebAPI/Controllers/DataShare/HSSE/PersonSyncController.cs b/SGGL/WebAPI/Controllers/DataShare/HSSE/PersonSyncController.cs
new file mode 100644
index 00000000..5b08526a
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/DataShare/HSSE/PersonSyncController.cs
@@ -0,0 +1,120 @@
+using BLL;
+using System;
+using System.Linq;
+using System.Web.Http;
+using System.Threading.Tasks;
+
+
+namespace WebAPI.Controllers
+{
+ public class PersonSyncController : ApiController
+ {
+ #region 从分包拉取总包上的项目人员数据
+
+ ///
+ /// 从分包拉取总包上的项目人员数据
+ ///
+ ///
+ public async Task getPersonLists()
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.code = 1;
+ responeData.data = APIPersonSyncService.getPersonLists();
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 根据项目id和单位统一社会代码获取项目人员
+
+ ///
+ /// 根据项目id和单位统一社会代码获取项目人员
+ ///
+ ///
+ public Model.ResponeData getPersonListByProjectIdAndCollCropCode(string projectId, string collCropCode)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.code = 1;
+ var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
+ responeData.data = APIPersonSyncService.GetPersonLitsByProjectIdAndUnitId(projectId, unit.UnitId);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 分包推送项目人员数据到总包
+
+ ///
+ /// 分包推送项目人员数据到总包
+ ///
+ ///
+ [HttpPost]
+ public async Task pushPersonLists(string projectId, string dataId)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var returndata = APIPersonSyncService.pushPersonLists(projectId, dataId);
+ responeData.code = returndata.code;
+ responeData.message = returndata.message;
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+
+ #region 接收保存分包单位推送到总包的项目人员数据
+
+ ///
+ /// 接收保存分包单位推送到总包的项目人员数据
+ ///
+ /// HSSE数据
+ ///
+ [HttpPost]
+ public async Task SavePersonSyncData([FromBody] Model.PersonSyncData newItem)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ responeData.message = await APIPersonSyncService.SavePersonSyncData(newItem);
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/WebAPI/Filter/TestPermissionAttribute.cs b/SGGL/WebAPI/Filter/TestPermissionAttribute.cs
index 1c1c700e..f0baa379 100644
--- a/SGGL/WebAPI/Filter/TestPermissionAttribute.cs
+++ b/SGGL/WebAPI/Filter/TestPermissionAttribute.cs
@@ -77,7 +77,20 @@ namespace WebAPI.Filter
///
///
///
- public static List lists = new List { "User*postLoginOn", "HazardRegister*getHazardRegisterCount", "HazardRegister*getHazardRegisterByProjectIdStates" };
+ public static List lists = new List { "User*postLoginOn", "HazardRegister*getHazardRegisterCount", "HazardRegister*getHazardRegisterByProjectIdStates" ,"MeetingSync*ReceiveSaveProjectClassMeetingData"
+ , "LicenseSync*ReceiveSaveProjectLicenseManagerData"
+,"PersonSync*getPersonLists"
+ ,"PersonSync*pushPersonLists"
+ ,"HazardRegisterSync*getHazardRegisterLists"
+ ,"HazardRegisterSync*pushHazardRegisterLists"
+ ,"CheckSpecialSync*getCheckSpecialLists"
+ ,"CheckSpecialSync*pushCheckSpecialLists"
+ ,"HazardRegisterSync*getHazardRegisterListByProjectIdAndCollCropCode"
+ ,"HazardRegisterSync*SaveHazardRegisterSyncData"
+ ,"PersonSync*getPersonListByProjectIdAndCollCropCode"
+ ,"PersonSync*SavePersonSyncData"
+ ,"CheckSpecialSync*getCheckSpecialListByProjectIdAndCollCropCode"
+ ,"CheckSpecialSync*SaveCheckSpecialSyncData" };
///
///
diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj
index 181d6a89..beb894ed 100644
--- a/SGGL/WebAPI/WebAPI.csproj
+++ b/SGGL/WebAPI/WebAPI.csproj
@@ -184,6 +184,11 @@
+
+
+
+
+