1
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
-- 质量管理-计量设备管理
|
||||
INSERT INTO [dbo].[Sys_Menu] ( [MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed] )
|
||||
VALUES
|
||||
( N'B01EC58D-8E89-4433-A7B7-0D792D13E1A5', N'计量设备管理', NULL, '', 65, N'0', N'Menu_System_Qwms_P_Cqms', '0', '0', '0' );
|
||||
INSERT INTO [dbo].[Sys_Menu] ( [MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed] )
|
||||
VALUES
|
||||
( N'24A5D009-4972-43F8-BE87-6F392D000FDC', N'计量器具配备计划表', '','CQMS/Comprehensive/InspectionMachinePlan.aspx', 10, N'B01EC58D-8E89-4433-A7B7-0D792D13E1A5', N'Menu_System_Qwms_P_Cqms', '0', '1', '0' );
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('505E3016-1459-44ED-A1C2-299EC82D64C0','24A5D009-4972-43F8-BE87-6F392D000FDC','增加',1)
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('B2966530-03FE-4E77-BA31-AF3EF5335711','24A5D009-4972-43F8-BE87-6F392D000FDC','修改',2)
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('C7898E06-53E8-4D8A-8440-25C451B5CFAE','24A5D009-4972-43F8-BE87-6F392D000FDC','删除',3)
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('23659438-D8CA-4451-810C-BD0130BE1ED4','24A5D009-4972-43F8-BE87-6F392D000FDC','保存',4)
|
||||
GO
|
||||
|
||||
INSERT INTO [dbo].[Sys_Menu] ( [MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed] )
|
||||
VALUES
|
||||
( N'2C0E4E25-DB0D-441A-ABAB-3F0A68C5A6CB', N'计量设备管理', NULL, '', 65, N'0', N'Menu_System_Qwms_S_Cqms', '1', '0', '1' );
|
||||
INSERT INTO [dbo].[Sys_Menu] ( [MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed] )
|
||||
VALUES
|
||||
( N'7FDC5937-226B-4C96-9854-D7CD77507479', N'计量器具配备计划表', '','CQMS/Comprehensive/InspectionMachinePlan.aspx', 10, N'2C0E4E25-DB0D-441A-ABAB-3F0A68C5A6CB', N'Menu_System_Qwms_S_Cqms', '1', '1', '0' );
|
||||
|
||||
CREATE TABLE [dbo].[Comprehensive_InspectionMachinePlan](
|
||||
[InspectionMachinePlanId] [nvarchar](50) NOT NULL,
|
||||
[ProjectId] [nvarchar](50) NULL,
|
||||
[UnitId] [nvarchar](50) NULL,
|
||||
[InspectionMachineCode] [nvarchar](50) NULL,
|
||||
[InspectionMachineName] [nvarchar](200) NULL,
|
||||
[SpecificationModel] [nvarchar](50) NULL,
|
||||
[Precision] [nvarchar](50) NULL,
|
||||
[Unit] [nvarchar](50) NULL,
|
||||
[UnitsCount] [int] NULL,
|
||||
[NeedTime] [datetime] NULL,
|
||||
[NeedRef] [nvarchar](500) NULL,
|
||||
[CompileMan] [nvarchar](50) NULL,
|
||||
[CompileDate] [datetime] NULL,
|
||||
CONSTRAINT [PK_Comprehensive_InspectionMachinePlan] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[InspectionMachinePlanId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'InspectionMachinePlanId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'ProjectId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属单位id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'UnitId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'InspectionMachineCode'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计量设备名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'InspectionMachineName'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'规格型号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'SpecificationModel'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'精度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'Precision'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'Unit'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'UnitsCount'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'需要时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'NeedTime'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'简要说明(使用场景)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'NeedRef'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'CompileMan'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan', @level2type=N'COLUMN',@level2name=N'CompileDate'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计量器具配备计划表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Comprehensive_InspectionMachinePlan'
|
||||
GO
|
||||
|
||||
update Sys_Menu set MenuName='计量器具登记表',SuperMenu='B01EC58D-8E89-4433-A7B7-0D792D13E1A5',SortIndex=20 where MenuId='70194C2C-0DD8-4B96-A80A-59AE818A0007'
|
||||
GO
|
||||
|
||||
alter table Comprehensive_InspectionMachine add MeasurementRange nvarchar(50) null
|
||||
alter table Comprehensive_InspectionMachine add Precision nvarchar(50) null
|
||||
alter table Comprehensive_InspectionMachine add FactoryNumber nvarchar(50) null
|
||||
alter table Comprehensive_InspectionMachine add FactoryDate datetime null
|
||||
alter table Comprehensive_InspectionMachine add ManagementLevel nvarchar(50) null
|
||||
alter table Comprehensive_InspectionMachine add UseDate datetime null
|
||||
alter table Comprehensive_InspectionMachine add IsSpecialCycle bit null
|
||||
alter table Comprehensive_InspectionMachine add CalibrationCycle int null
|
||||
alter table Comprehensive_InspectionMachine add SpecialCalibrationCycle nvarchar(50) null
|
||||
alter table Comprehensive_InspectionMachine add CalibrationDate datetime null
|
||||
alter table Comprehensive_InspectionMachine add NextCalibrationDate datetime null
|
||||
alter table Comprehensive_InspectionMachine add CalibrationWarning datetime null
|
||||
alter table Comprehensive_InspectionMachine add Remark nvarchar(500) null
|
||||
GO
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
-- 总包单位接口地址
|
||||
alter table Base_Project add SubjectUnitApiUrl nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL;
|
||||
-- 总包单位服务地址
|
||||
alter table Base_Project add SubjectUnitWebUrl nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL;
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
|
||||
---修改安全检查视图(添加数据来源字段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
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
alter table Check_CheckControl add DataSource char(1) COLLATE Chinese_PRC_CI_AS NULL;
|
||||
EXEC sp_addextendedproperty
|
||||
'MS_Description', N'数据来源(1总包,0本单位)',
|
||||
'SCHEMA', N'dbo',
|
||||
'TABLE', N'Check_CheckControl',
|
||||
'COLUMN', N'DataSource'
|
||||
GO
|
||||
@@ -0,0 +1,88 @@
|
||||
|
||||
--危大工程方案补充字段【审批状态 0:待审核、1:审核中、2:已完成】
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Solution_LargerHazard' AND COLUMN_NAME = 'ApprovalState')
|
||||
BEGIN
|
||||
ALTER TABLE Solution_LargerHazard ADD ApprovalState char(1);
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'审批状态(0:待审核、1:审核中、2:已完成)','SCHEMA', N'dbo','TABLE', N'Solution_LargerHazard','COLUMN', N'ApprovalState'
|
||||
END
|
||||
GO
|
||||
|
||||
--危大工程方案历史数据【审批状态】处理逻辑:
|
||||
--作业状态为未开始,审批状态默认为待审核;作业状态为作业中和已完工,审批状态默认为已完成
|
||||
update Solution_LargerHazard set ApprovalState='0' where ApprovalState is null and States = '1'
|
||||
GO
|
||||
update Solution_LargerHazard set ApprovalState='2' where ApprovalState is null and States in ('2','3')
|
||||
GO
|
||||
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'HSSEData_HSSE' AND COLUMN_NAME = 'AwaitApprovalNum')
|
||||
BEGIN
|
||||
ALTER TABLE HSSEData_HSSE ADD AwaitApprovalNum int;
|
||||
ALTER TABLE HSSEData_HSSE ADD PendingApprovalNum int;
|
||||
ALTER TABLE HSSEData_HSSE ADD CompletedApprovalNum int;
|
||||
ALTER TABLE HSSEData_HSSE ADD SuperAwaitApprovalNum int;
|
||||
ALTER TABLE HSSEData_HSSE ADD SuperPendingApprovalNum int;
|
||||
ALTER TABLE HSSEData_HSSE ADD SuperCompletedApprovalNum int;
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'危大工程待审核个数','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'AwaitApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'危大工程审核中个数','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'PendingApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'危大工程已完成个数','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'CompletedApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'超危大工程待审核个数','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'SuperAwaitApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'超危大工程审核中个数','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'SuperPendingApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'超危大工程已完成个数','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'SuperCompletedApprovalNum';
|
||||
END
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Project_HSSEData_HSSE' AND COLUMN_NAME = 'AwaitApprovalNum')
|
||||
BEGIN
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD AwaitApprovalNum int;
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD PendingApprovalNum int;
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD CompletedApprovalNum int;
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD SuperAwaitApprovalNum int;
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD SuperPendingApprovalNum int;
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD SuperCompletedApprovalNum int;
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'危大工程待审核个数','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'AwaitApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'危大工程审核中个数','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'PendingApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'危大工程已完成个数','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'CompletedApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'超危大工程待审核个数','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'SuperAwaitApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'超危大工程审核中个数','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'SuperPendingApprovalNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'超危大工程已完成个数','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'SuperCompletedApprovalNum';
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'HSSEData_HSSE' AND COLUMN_NAME = 'LargerClosedNum')
|
||||
BEGIN
|
||||
ALTER TABLE HSSEData_HSSE ADD LargerClosedNum int;
|
||||
ALTER TABLE HSSEData_HSSE ADD LargerNotClosedNum int;
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'较大隐患整改闭环项','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'LargerClosedNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'较大隐患未整改完成项','SCHEMA', N'dbo','TABLE', N'HSSEData_HSSE','COLUMN', N'LargerNotClosedNum';
|
||||
END
|
||||
GO
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Project_HSSEData_HSSE' AND COLUMN_NAME = 'LargerClosedNum')
|
||||
BEGIN
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD LargerClosedNum int;
|
||||
ALTER TABLE Project_HSSEData_HSSE ADD LargerNotClosedNum int;
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'较大隐患整改闭环项','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'LargerClosedNum';
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'较大隐患未整改完成项','SCHEMA', N'dbo','TABLE', N'Project_HSSEData_HSSE','COLUMN', N'LargerNotClosedNum';
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--去除企业检查项目外键
|
||||
ALTER TABLE [Supervise_UnitHazardRegister]
|
||||
DROP CONSTRAINT [FK_UnitHazardRegister_Project];
|
||||
GO
|
||||
--企业检查补充字段【检查单位】
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Supervise_UnitHazardRegister' AND COLUMN_NAME = 'InspectionUnit')
|
||||
BEGIN
|
||||
ALTER TABLE Supervise_UnitHazardRegister ADD InspectionUnit nvarchar(50);
|
||||
EXEC sp_addextendedproperty 'MS_Description', N'检查单位','SCHEMA', N'dbo','TABLE', N'Supervise_UnitHazardRegister','COLUMN', N'InspectionUnit'
|
||||
END
|
||||
GO
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
-----定制版根据菜单id进行删除
|
||||
----删除奖励通知单菜单
|
||||
--delete Sys_Menu where MenuId ='96F21A83-6871-4CC4-8901-1B99C376395C' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='E20357C9-F43A-4ACC-8A50-C735A3A6B438' and MenuType ='Menu_System_Hsse_S_Hsse'
|
||||
--go
|
||||
----删除奖励统计菜单
|
||||
--delete Sys_Menu where MenuId ='C13F1CE7-DAEF-4604-A13F-192621D28DF5' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='2DFAF96D-92B5-47E1-9138-EEE4595D9DEE' and MenuType ='Menu_System_Hsse_S_Hsse'
|
||||
--go
|
||||
----删除处罚通知单菜单
|
||||
--delete Sys_Menu where MenuId ='755F1C1D-2178-47D8-9F82-A501B53A2436' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='4EA8BBE5-B9BC-414E-961E-77CEA9E485F0' and MenuType ='Menu_System_Hsse_S_Hsse'
|
||||
--go
|
||||
----删除处罚统计菜单
|
||||
--delete Sys_Menu where MenuId ='CCD0E55B-300A-454B-8559-155ADAD386AE' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='C1093C81-F231-405B-9E40-8C409D84024A' and MenuType ='Menu_System_Hsse_S_Hsse'
|
||||
--go
|
||||
----删除违规人员记录菜单
|
||||
--delete Sys_Menu where MenuId ='06958288-96F4-4291-909A-FFC2FC76814D' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='D6DB64E8-1FE8-47BB-81D7-70AEFB05E7A9' and MenuType ='Menu_System_Hsse_S_Hsse'
|
||||
--go
|
||||
----删除评优评奖加分项菜单
|
||||
--delete Sys_Menu where MenuId ='9682053F-597E-4E10-B130-93624541387A' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='1590207E-8C5C-4D82-AF34-BFB832FB526E' and MenuType ='Menu_System_Hsse_S_Hsse'
|
||||
--go
|
||||
----删除安全隐患报告数据菜单
|
||||
--delete Sys_Menu where MenuId ='04B0774F-FEEF-421D-8964-D9CF6582AEAF' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='167B9D7C-BD96-4F19-9035-D98527C2DCF5' and MenuType ='Menu_System_Hsse_S_Hsse'
|
||||
--go
|
||||
|
||||
----删除获奖证书或奖杯、安全质量环保奖项菜单
|
||||
--delete Sys_Menu where MenuId ='9A034CAD-C7D5-4DE4-9FF5-828D35FFEE28' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--delete Sys_Menu where MenuId ='13DDC402-D72E-49C0-A170-41B75E43D9F3' and MenuType ='Menu_System_Hsse_P_Hsse'
|
||||
--go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--这个菜单放到质量的人员报验下
|
||||
--IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '67C53963-91E5-4892-8286-B646A6E339CC' and MenuType = 'Menu_System_Qwms_P_Cqms')
|
||||
--BEGIN
|
||||
--INSERT INTO [dbo].[Sys_Menu] ( [MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed] )
|
||||
--VALUES
|
||||
-- ( N'67C53963-91E5-4892-8286-B646A6E339CC', N'质量人员报验(通用)', NULL, N'CQMS/Comprehensive/CqmsPerson.aspx', 50, N'672F4FE4-7E6A-4D47-8DD9-1FA4535C835C', N'Menu_System_Qwms_P_Cqms', '0', '1', '1' );
|
||||
--END
|
||||
--GO
|
||||
--IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '0908A5FD-0865-4747-AA2D-4186B5EEC9F8' and MenuType = 'Menu_System_Qwms_S_Cqms')
|
||||
--BEGIN
|
||||
--INSERT INTO [dbo].[Sys_Menu] ( [MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed] )
|
||||
--VALUES
|
||||
-- ( N'0908A5FD-0865-4747-AA2D-4186B5EEC9F8', N'质量人员报验(通用)', NULL, N'CQMS/Comprehensive/CqmsPerson.aspx', 50, N'53C28E81-09F7-4F26-B17D-12DDA1764A74', N'Menu_System_Qwms_S_Cqms', '0', '1', '1' );
|
||||
--END
|
||||
--GO
|
||||
|
||||
|
||||
|
||||
|
||||
--alter table SitePerson_Person add [IsTrain] bit NULL;
|
||||
--EXEC sp_addextendedproperty
|
||||
--'MS_Description', N'质量是否培训',
|
||||
--'SCHEMA', N'dbo',
|
||||
--'TABLE', N'SitePerson_Person',
|
||||
--'COLUMN', N'IsTrain'
|
||||
--GO
|
||||
@@ -0,0 +1,130 @@
|
||||
alter table Base_WorkPost add IsCQMSCheck bit null
|
||||
GO
|
||||
alter table SitePerson_Person add Major nvarchar(50) null
|
||||
GO
|
||||
--风险信息库:危险级别为空数据处理
|
||||
update Hazard_HazardSelectedItem
|
||||
set HazardLevel='84e1d680-5bfe-48d2-a255-59f43aa3615a'
|
||||
where HazardLevel is null and HazardJudge_D<=120
|
||||
GO
|
||||
update Hazard_HazardSelectedItem
|
||||
set HazardLevel='01537cc5-e8d2-497c-ba53-1faca1faf495'
|
||||
where HazardLevel is null and HazardJudge_D<=170 and HazardJudge_D>120
|
||||
GO
|
||||
update Hazard_HazardSelectedItem
|
||||
set HazardLevel='6baaf2bb-ee7c-410c-9a32-13208626c467'
|
||||
where HazardLevel is null and HazardJudge_D<=320 and HazardJudge_D>170
|
||||
GO
|
||||
update Hazard_HazardSelectedItem
|
||||
set HazardLevel='c9e6285c-2da3-4997-8dc9-fb6ab404346e'
|
||||
where HazardLevel is null and HazardJudge_D>320
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
--质量计量器具补充字段:来源说明
|
||||
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Comprehensive_InspectionMachine' AND COLUMN_NAME = 'SourceDes')
|
||||
BEGIN
|
||||
ALTER TABLE Comprehensive_InspectionMachine ADD SourceDes nvarchar(500);
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE [dbo].[Base_MaterialUnit](
|
||||
[MaterialUnitId] [nvarchar](50) NOT NULL,
|
||||
[MaterialUnitName] [nvarchar](100) NULL,
|
||||
[MaterialUnitCode] [nvarchar](50) NULL,
|
||||
[Remark] [nvarchar](200) NULL,
|
||||
CONSTRAINT [PK_Base_MaterialUnit] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[MaterialUnitId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'MaterialUnitId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'MaterialUnitName'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'MaterialUnitCode'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit', @level2type=N'COLUMN',@level2name=N'Remark'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物质单位表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_MaterialUnit'
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE [dbo].[MaterialInAndOutRecord](
|
||||
[Id] [nvarchar](50) NOT NULL,
|
||||
[ProjectId] [nvarchar](50) NULL,
|
||||
[GoodsCategoryId] [nvarchar](50) NULL,
|
||||
[GoodsCategoryName] [nvarchar](100) NULL,
|
||||
[MaterialModel] [nvarchar](100) NULL,
|
||||
[InOutDate] [datetime] NULL,
|
||||
[UnitId] [nvarchar](50) NULL,
|
||||
[InOrOut] [nvarchar](10) NULL,
|
||||
[Number] [decimal](18, 2) NULL,
|
||||
[MaterialUnitId] [nvarchar](50) NULL,
|
||||
[Remark] [nvarchar](200) NULL,
|
||||
[CompileMan] [nvarchar](50) NULL,
|
||||
[CompileDate] [datetime] NULL,
|
||||
CONSTRAINT [PK_MaterialInAndOutRecord] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[Id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'Id'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物资id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'GoodsCategoryId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物资名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'GoodsCategoryName'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'型号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'MaterialModel'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'进出时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'InOutDate'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'UnitId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'进/出' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'InOrOut'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'Number'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物资单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'MaterialUnitId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'Remark'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'CompileMan'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord', @level2type=N'COLUMN',@level2name=N'CompileDate'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物质单位表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MaterialInAndOutRecord'
|
||||
GO
|
||||
|
||||
|
||||
@@ -387,5 +387,116 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 新保存Check_CheckSpecial
|
||||
|
||||
/// <summary>
|
||||
/// 新保存Check_CheckSpecial
|
||||
/// </summary>
|
||||
/// <param name="newItem">处罚通知单</param>
|
||||
/// <returns></returns>
|
||||
public static string SaveCheckSpecialNew(Model.CheckSpecialItem newItem)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string message = string.Empty;
|
||||
Model.Check_CheckSpecial newCheckSpecial = new Model.Check_CheckSpecial
|
||||
{
|
||||
CheckSpecialId = newItem.CheckSpecialId,
|
||||
CheckSpecialCode = newItem.CheckSpecialCode,
|
||||
CheckType = newItem.CheckType,
|
||||
ProjectId = newItem.ProjectId,
|
||||
CheckPerson = newItem.CheckPersonId,
|
||||
CheckTime = Funs.GetNewDateTime(newItem.CheckTime),
|
||||
DaySummary = System.Web.HttpUtility.HtmlEncode(newItem.DaySummary),
|
||||
PartInUnits = newItem.PartInUnitIds,
|
||||
PartInPersonIds = newItem.PartInPersonIds,
|
||||
PartInPersons = Person_PersonsService.getPersonsNamesPersonIds(newItem.PartInPersonIds),
|
||||
PartInPersonNames = newItem.PartInPersonNames2,
|
||||
CompileMan = newItem.CompileManId,
|
||||
States = Const.State_0,
|
||||
};
|
||||
if (newItem.CheckType == "0")
|
||||
{
|
||||
newCheckSpecial.CheckItemSetId = newItem.CheckItemSetId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(newItem.States))
|
||||
{
|
||||
newCheckSpecial.States = newItem.States;
|
||||
}
|
||||
if (newItem.CheckSpecialDetailItems == null || newItem.CheckSpecialDetailItems.Count() == 0)
|
||||
{
|
||||
if (newItem.States == Const.State_1)
|
||||
{
|
||||
newCheckSpecial.States = Const.State_2;
|
||||
}
|
||||
}
|
||||
var updateCheckSpecial =
|
||||
db.Check_CheckSpecial.FirstOrDefault(x => x.CheckSpecialId == newItem.CheckSpecialId);
|
||||
if (updateCheckSpecial == null)
|
||||
{
|
||||
newCheckSpecial.CheckSpecialId = SQLHelper.GetNewID();
|
||||
newCheckSpecial.CheckSpecialCode =
|
||||
CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectCheckSpecialMenuId,
|
||||
newCheckSpecial.ProjectId, string.Empty);
|
||||
db.Check_CheckSpecial.InsertOnSubmit(newCheckSpecial);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectCheckSpecialMenuId,
|
||||
newCheckSpecial.ProjectId, null, newCheckSpecial.CheckSpecialId, newCheckSpecial.CheckTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
|
||||
}
|
||||
|
||||
////保存附件
|
||||
if (!string.IsNullOrEmpty(newItem.AttachUrl1))
|
||||
{
|
||||
UploadFileService.SaveAttachUrl(
|
||||
UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl1, 10, null), newItem.AttachUrl1,
|
||||
Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId);
|
||||
}
|
||||
else
|
||||
{
|
||||
CommonService.DeleteAttachFileById(Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId);
|
||||
}
|
||||
|
||||
///// 新增检查项
|
||||
if (newItem.CheckSpecialDetailItems != null && newItem.CheckSpecialDetailItems.Count() > 0)
|
||||
{
|
||||
foreach (var item in newItem.CheckSpecialDetailItems)
|
||||
{
|
||||
item.CheckSpecialId = newCheckSpecial.CheckSpecialId;
|
||||
SaveCheckSpecialDetail(item);
|
||||
}
|
||||
|
||||
//// 单据完成后 系统自动按照单位 整改要求生成隐患整改单
|
||||
if (newItem.States == Const.State_1)
|
||||
{
|
||||
var getC = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false);
|
||||
if (getC == null)
|
||||
{
|
||||
newCheckSpecial.States = Const.State_2;
|
||||
Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
|
||||
}
|
||||
else
|
||||
{
|
||||
var detailLists = db.Check_CheckSpecialDetail.Where(x =>
|
||||
x.CheckSpecialId == newCheckSpecial.CheckSpecialId && x.CompleteStatus == false);
|
||||
if (detailLists.Count() > 0)
|
||||
{
|
||||
message = Check_CheckSpecialService.IssueRectification(detailLists.ToList(),
|
||||
newCheckSpecial);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,6 +279,8 @@
|
||||
<Compile Include="Common\DataCleanupMergeHelper.cs" />
|
||||
<Compile Include="CQMS\ProjectHighlightsSite\ProjectHighlightsSiteService.cs" />
|
||||
<Compile Include="DataShare\APIDataShareSyncService.cs" />
|
||||
<Compile Include="DataShare\CQMS\APICheckControlSyncService.cs" />
|
||||
<Compile Include="DataShare\CQMS\APIInspectionMachineSyncService.cs" />
|
||||
<Compile Include="DataShare\HSSE\APICheckSpecialSyncService.cs" />
|
||||
<Compile Include="DataShare\HSSE\APIHazardRegisterSyncService.cs" />
|
||||
<Compile Include="DataShare\HSSE\APILicenseSyncService.cs" />
|
||||
|
||||
@@ -5314,5 +5314,45 @@ namespace BLL
|
||||
public const string UnitHazardRegisterMenuRecord_Quality = "15511354-9822-4A21-AB24-2483D889FDB8";
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 现场车辆管理导入模板
|
||||
/// </summary>
|
||||
public const string CarManagerTemplateUrl = "File\\Excel\\DataIn\\现场车辆管理导入模板.xls";
|
||||
|
||||
/// <summary>
|
||||
/// 企业大检查明细导入模板
|
||||
/// </summary>
|
||||
public const string UnitHazardRegisterDetailTemplateUrl = "File\\Excel\\DataIn\\企业大检查明细导入模板.xls";
|
||||
|
||||
/// <summary>
|
||||
/// 活动类型
|
||||
/// </summary>
|
||||
public const string ActivityTypeMenuId = "79116536-BE80-4323-A46F-10222601D5B5";
|
||||
|
||||
/// <summary>
|
||||
/// 货物单位类型
|
||||
/// </summary>
|
||||
public const string MaterialUnitMenuId = "3DD3F0E8-D3EA-41AA-BA1F-CA3168657D67";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 物资进出记录
|
||||
/// </summary>
|
||||
public const string MaterialInAndOutRecordMenuId = "5DAB5F9A-097A-46D4-8EB1-F60D1D65E812";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 奖励与惩罚
|
||||
/// </summary>
|
||||
public const string RewardAndPunishManagerMenuId = "621A9295-DD82-425A-863D-310AD319752B";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 质量会议
|
||||
/// </summary>
|
||||
public const string CQMS_MeetingMenuId = "30754DF1-CB18-4F53-BB66-2B2A398D7180";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using System.Net;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -611,5 +611,46 @@ namespace BLL
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 下载并保存文件
|
||||
/// </summary>
|
||||
/// <param name="webUrl"></param>
|
||||
/// <param name="fileUrl"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] SafeDownloadHeadImageAsync(string webUrl, string fileUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(fileUrl))
|
||||
return null;
|
||||
|
||||
// 构造完整的远程文件 URL
|
||||
string fullRemoteUrl = $"{webUrl.TrimEnd('/')}/{fileUrl.TrimStart('/')}";
|
||||
|
||||
// 构造本地文件路径
|
||||
string localFilePath = Path.Combine(ConfigurationManager.AppSettings["localRoot"], fileUrl);
|
||||
|
||||
// 确保本地目录存在
|
||||
string directoryPath = Path.GetDirectoryName(localFilePath);
|
||||
if (!string.IsNullOrEmpty(directoryPath) && !Directory.Exists(directoryPath))
|
||||
{
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
}
|
||||
//下载文件到本地
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
byte[] fileData = client.DownloadData(fullRemoteUrl);
|
||||
// 将文件数据写入本地文件
|
||||
File.WriteAllBytes(localFilePath, fileData);
|
||||
return fileData;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog($"下载头像失败: {fileUrl}, 错误: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,543 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量巡检同步服务
|
||||
/// </summary>
|
||||
public class APICheckControlSyncService
|
||||
{
|
||||
#region 根据项目、单位获取质量巡检列表
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目、单位获取质量巡检列表
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="unitId">单位ID</param>
|
||||
/// <param name="dataId">数据ID(可选,用于单条数据同步)</param>
|
||||
/// <returns>质量巡检数据列表</returns>
|
||||
public static List<Model.CheckControlSyncItem> GetCheckControlListsByProjectIdUnitIdPage(
|
||||
string projectId, string unitId, string dataId = "")
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var list = from x in db.Check_CheckControl
|
||||
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.CheckControlCode == dataId);
|
||||
}
|
||||
|
||||
var dataList = (from x in list
|
||||
join unit in db.Base_Unit on x.UnitId equals unit.UnitId into unitTemp
|
||||
from unit in unitTemp.DefaultIfEmpty()
|
||||
join pro in db.Base_CNProfessional on x.CNProfessionalCode equals pro.CNProfessionalId into proTemp
|
||||
from pro in proTemp.DefaultIfEmpty()
|
||||
join uw in db.WBS_UnitWork on x.UnitWorkId equals uw.UnitWorkId into uwTemp
|
||||
from uw in uwTemp.DefaultIfEmpty()
|
||||
join qqt in db.Base_QualityQuestionType on x.QuestionType equals qqt.QualityQuestionTypeId into qqtTemp
|
||||
from qqt in qqtTemp.DefaultIfEmpty()
|
||||
join u1 in db.Person_Persons on x.CheckMan equals u1.PersonId into u1Temp
|
||||
from u1 in u1Temp.DefaultIfEmpty()
|
||||
join u2 in db.Person_Persons on x.SubmitMan equals u2.PersonId into u2Temp
|
||||
from u2 in u2Temp.DefaultIfEmpty()
|
||||
join pu in db.Base_Unit on x.ProposeUnitId equals pu.UnitId into puTemp
|
||||
from pu in puTemp.DefaultIfEmpty()
|
||||
join att in db.AttachFile on x.CheckControlCode equals att.ToKeyId into attTemp
|
||||
from att in attTemp.DefaultIfEmpty()
|
||||
join attRe in db.AttachFile on x.CheckControlCode+"r" equals attRe.ToKeyId into attReTemp
|
||||
from attRe in attReTemp.DefaultIfEmpty()
|
||||
select new CheckControlSyncItem
|
||||
{
|
||||
CheckControlCode = x.CheckControlCode,
|
||||
ProjectId = x.ProjectId,
|
||||
UnitWorkId = x.UnitWorkId,
|
||||
UnitWorkName = uw.UnitWorkName,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = unit.UnitName,
|
||||
CheckDate = x.CheckDate,
|
||||
CheckMan = x.CheckMan,
|
||||
CheckManName = u1.PersonName,
|
||||
CheckSite = x.CheckSite,
|
||||
DocCode = x.DocCode,
|
||||
CNProfessionalCode = x.CNProfessionalCode,
|
||||
CNProfessionalName = pro.ProfessionalName,
|
||||
QuestionType = x.QuestionType,
|
||||
QuestionTypeName = qqt.QualityQuestionType,
|
||||
QuestionDef = x.QuestionDef,
|
||||
RectifyOpinion = x.RectifyOpinion,
|
||||
LimitDate = x.LimitDate,
|
||||
AttachUrl = att.AttachUrl,
|
||||
HandleWay = x.HandleWay,
|
||||
RectifyDate = x.RectifyDate,
|
||||
ReAttachUrl = attRe.AttachUrl,
|
||||
State = x.State,
|
||||
IsSubmit = x.IsSubmit,
|
||||
SubmitMan = x.SubmitMan,
|
||||
SubmitManName = u2.PersonName,
|
||||
IsOK = x.IsOK,
|
||||
ProposeUnitId = x.ProposeUnitId,
|
||||
ProposeUnitName = pu.UnitName,
|
||||
SaveHandleMan = x.SaveHandleMan,
|
||||
DataSource = "1"
|
||||
}).ToList();
|
||||
|
||||
return dataList;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 拉取质量巡检数据
|
||||
|
||||
/// <summary>
|
||||
/// 拉取质量巡检数据
|
||||
/// </summary>
|
||||
/// <returns>处理结果消息</returns>
|
||||
public static string getCheckControlLists(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 Url = "http://localhost:14957/,http://localhost:8579/";
|
||||
|
||||
var ApiUrl = "";
|
||||
var WebUrl = "";
|
||||
if (!string.IsNullOrEmpty(Url))
|
||||
{
|
||||
var urls = Url.Split(',');
|
||||
ApiUrl = urls[0];
|
||||
if (urls.Length > 1)
|
||||
{
|
||||
WebUrl = urls[1];
|
||||
}
|
||||
}
|
||||
|
||||
string url = "/api/CheckControlSync/getCheckControlListByProjectIdAndCollCropCode?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<List<CheckControlSyncItem>>(obj["data"].ToString());
|
||||
if (getData.Count() > 0)
|
||||
{
|
||||
ProcessCheckControlData(getData, project.ProjectId, unitId, WebUrl, "pull");
|
||||
}
|
||||
message = "获取成功:同步质量巡检数" + getData.Count().ToString() + "条";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
message = "获取失败:" + ex.Message;
|
||||
ErrLogInfo.WriteLog("质量巡检获取!", ex);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 推送质量巡检数据
|
||||
|
||||
/// <summary>
|
||||
/// 推送质量巡检数据
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="dataId">数据ID(可选,用于单条数据推送)</param>
|
||||
/// <returns>推送结果</returns>
|
||||
public static ReturnData pushCheckControlLists(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 = GetCheckControlListsByProjectIdUnitIdPage(projectId, "", dataId);
|
||||
|
||||
if (items.Count() > 0)
|
||||
{
|
||||
var thisUnit = CommonService.GetIsThisUnit(); //当前单位
|
||||
var apiurl = "/api/CheckControlSync/SaveCheckControlSyncData";
|
||||
|
||||
//总包单位接口地址
|
||||
var Url = BLL.UnitService.getUnitApiUrlByUnitId(project.SubjectUnit);
|
||||
//var Url = "http://localhost:14957/";
|
||||
var ApiUrl = "";
|
||||
var WebUrl = "";
|
||||
|
||||
if (!string.IsNullOrEmpty(Url))
|
||||
{
|
||||
var urls = Url.Split(',');
|
||||
ApiUrl = urls[0];
|
||||
if (urls.Length > 1)
|
||||
{
|
||||
WebUrl = urls[1];
|
||||
}
|
||||
}
|
||||
|
||||
var pushData = new CheckControlSyncData
|
||||
{
|
||||
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 接收保存质量巡检数据
|
||||
|
||||
/// <summary>
|
||||
/// 接收保存质量巡检数据
|
||||
/// </summary>
|
||||
/// <param name="items">质量巡检同步数据</param>
|
||||
/// <returns>处理结果消息</returns>
|
||||
public static string SaveCheckControlSyncData(Model.CheckControlSyncData 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
|
||||
{
|
||||
//判断主包项目是否存在
|
||||
var porject = BLL.ProjectService.GetProjectByProjectId(ProjectId);
|
||||
if (porject == null)
|
||||
{
|
||||
message = "总包单位不存在本项目,请检查总包项目关联是否正确!";
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessCheckControlData(items.Items, ProjectId, unit.UnitId, UnitDomain, "push");
|
||||
message = "数据推送成功!";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "暂无质量巡检数据!";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 处理质量巡检数据的新增或更新逻辑
|
||||
|
||||
/// <summary>
|
||||
/// 处理质量巡检数据的新增或更新逻辑
|
||||
/// </summary>
|
||||
/// <param name="getData">质量巡检数据列表</param>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="unitId">单位ID</param>
|
||||
/// <param name="WebUrl">Web地址</param>
|
||||
///
|
||||
private static void ProcessCheckControlData(
|
||||
List<Model.CheckControlSyncItem> getData,
|
||||
string projectId,
|
||||
string unitId,
|
||||
string WebUrl, string type)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
foreach (var item in getData)
|
||||
{
|
||||
Model.Check_CheckControl model = db.Check_CheckControl.FirstOrDefault(x => x.CheckControlCode == item.CheckControlCode);
|
||||
|
||||
if (model == null)
|
||||
{
|
||||
//新增
|
||||
Model.Check_CheckControl newModel = new Model.Check_CheckControl
|
||||
{
|
||||
CheckControlCode = item.CheckControlCode,
|
||||
ProjectId = projectId,
|
||||
UnitWorkId = APIDataShareSyncService.getUnitWorkId(item.UnitWorkName, projectId),
|
||||
UnitId = getUnitIdByUnitName(item.UnitName) ?? unitId,
|
||||
CheckDate = item.CheckDate,
|
||||
CheckMan = APIDataShareSyncService.getUserId(item.CheckManName),
|
||||
CheckSite = item.CheckSite,
|
||||
DocCode = item.DocCode,
|
||||
CNProfessionalCode = getCNProfessionalId(item.CNProfessionalName),
|
||||
QuestionType = getQualityQuestionTypeId(item.QuestionTypeName, projectId),
|
||||
QuestionDef = item.QuestionDef,
|
||||
RectifyOpinion = item.RectifyOpinion,
|
||||
LimitDate = item.LimitDate,
|
||||
AttachUrl = item.AttachUrl,
|
||||
HandleWay = item.HandleWay,
|
||||
RectifyDate = item.RectifyDate,
|
||||
ReAttachUrl = item.ReAttachUrl,
|
||||
State = item.State,
|
||||
IsSubmit = item.IsSubmit,
|
||||
SubmitMan = APIDataShareSyncService.getUserId(item.SubmitManName),
|
||||
IsOK = item.IsOK,
|
||||
ProposeUnitId = getUnitIdByUnitName(item.ProposeUnitName),
|
||||
SaveHandleMan = item.SaveHandleMan
|
||||
};
|
||||
if (type == "pull")
|
||||
{
|
||||
newModel.DataSource = item.DataSource;
|
||||
}
|
||||
db.Check_CheckControl.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
//更新
|
||||
model.ProjectId = projectId;
|
||||
model.UnitWorkId = APIDataShareSyncService.getUnitWorkId(item.UnitWorkName, projectId);
|
||||
model.UnitId = getUnitIdByUnitName(item.UnitName) ?? unitId;
|
||||
model.CheckDate = item.CheckDate;
|
||||
model.CheckMan = APIDataShareSyncService.getUserId(item.CheckManName);
|
||||
model.CheckSite = item.CheckSite;
|
||||
model.DocCode = item.DocCode;
|
||||
model.CNProfessionalCode = getCNProfessionalId(item.CNProfessionalName);
|
||||
model.QuestionType = getQualityQuestionTypeId(item.QuestionTypeName, projectId);
|
||||
model.QuestionDef = item.QuestionDef;
|
||||
model.RectifyOpinion = item.RectifyOpinion;
|
||||
model.LimitDate = item.LimitDate;
|
||||
model.AttachUrl = item.AttachUrl;
|
||||
model.HandleWay = item.HandleWay;
|
||||
model.RectifyDate = item.RectifyDate;
|
||||
model.ReAttachUrl = item.ReAttachUrl;
|
||||
model.State = item.State;
|
||||
model.IsSubmit = item.IsSubmit;
|
||||
model.SubmitMan = APIDataShareSyncService.getUserId(item.SubmitManName);
|
||||
model.IsOK = item.IsOK;
|
||||
model.ProposeUnitId = getUnitIdByUnitName(item.ProposeUnitName);
|
||||
model.SaveHandleMan = item.SaveHandleMan;
|
||||
if (type == "pull")
|
||||
{
|
||||
model.DataSource = item.DataSource;
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
//处理整改前附件
|
||||
if (!string.IsNullOrEmpty(item.AttachUrl))
|
||||
{
|
||||
APIDataShareSyncService.OperationAttachFile(WebUrl, item.CheckControlCode,
|
||||
BLL.Const.CheckListMenuId, item.AttachUrl);
|
||||
}
|
||||
|
||||
//处理整改后附件
|
||||
if (!string.IsNullOrEmpty(item.ReAttachUrl))
|
||||
{
|
||||
APIDataShareSyncService.OperationAttachFile(WebUrl, item.CheckControlCode + "R",
|
||||
BLL.Const.CheckListMenuId, item.ReAttachUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 辅助映射方法
|
||||
|
||||
/// <summary>
|
||||
/// 获取质量问题类型ID(不存在则创建)
|
||||
/// </summary>
|
||||
/// <param name="questionTypeName">问题类型名称</param>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <returns>问题类型ID</returns>
|
||||
private static string getQualityQuestionTypeId(string questionTypeName, string projectId)
|
||||
{
|
||||
string questionTypeId = null;
|
||||
if (!string.IsNullOrEmpty(questionTypeName))
|
||||
{
|
||||
var qqt = Funs.DB.Base_QualityQuestionType.FirstOrDefault(x => x.QualityQuestionType == questionTypeName);
|
||||
if (qqt == null)
|
||||
{
|
||||
//不存在则创建
|
||||
Model.Base_QualityQuestionType newQqt = new Model.Base_QualityQuestionType
|
||||
{
|
||||
QualityQuestionTypeId = SQLHelper.GetNewID(typeof(Model.Base_QualityQuestionType)),
|
||||
QualityQuestionType = questionTypeName
|
||||
};
|
||||
QualityQuestionTypeService.AddQualityQuestionType(newQqt);
|
||||
questionTypeId = newQqt.QualityQuestionTypeId;
|
||||
}
|
||||
else
|
||||
{
|
||||
questionTypeId = qqt.QualityQuestionTypeId;
|
||||
}
|
||||
}
|
||||
return questionTypeId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取专业ID(不存在则创建)
|
||||
/// </summary>
|
||||
/// <param name="ProfessionalName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
private static string getCNProfessionalId(string ProfessionalName)
|
||||
{
|
||||
string Id = null;
|
||||
if (!string.IsNullOrEmpty(ProfessionalName))
|
||||
{
|
||||
var names = ProfessionalName.Split(',');
|
||||
List<string> IdList = new List<string>();
|
||||
foreach (var name in names)
|
||||
{
|
||||
var cnProfessional = Funs.DB.Base_CNProfessional.Where(x =>
|
||||
x.ProfessionalName == name).ToList();
|
||||
if (cnProfessional.Count == 0)
|
||||
{
|
||||
Model.Base_CNProfessional newCnProfessional = new Model.Base_CNProfessional
|
||||
{
|
||||
CNProfessionalId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork)),
|
||||
ProfessionalName = name,
|
||||
};
|
||||
CNProfessionalService.AddCNProfessional(newCnProfessional);
|
||||
IdList.Add(newCnProfessional.CNProfessionalId);
|
||||
}
|
||||
else
|
||||
{
|
||||
IdList.Add(cnProfessional.FirstOrDefault().CNProfessionalId);
|
||||
}
|
||||
}
|
||||
|
||||
Id = string.Join(",", IdList);
|
||||
}
|
||||
|
||||
return Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单位ID(根据名称)
|
||||
/// </summary>
|
||||
/// <param name="unitName">单位名称</param>
|
||||
/// <returns>单位ID</returns>
|
||||
private static string getUnitIdByUnitName(string unitName)
|
||||
{
|
||||
string unitId = null;
|
||||
if (!string.IsNullOrEmpty(unitName))
|
||||
{
|
||||
var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitName == unitName);
|
||||
if (unit != null)
|
||||
{
|
||||
unitId = unit.UnitId;
|
||||
}
|
||||
}
|
||||
return unitId;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量计量器具同步服务
|
||||
/// </summary>
|
||||
public class APIInspectionMachineSyncService
|
||||
{
|
||||
#region 分包单位推送数据到总包单位
|
||||
|
||||
/// <summary>
|
||||
/// 分包单位推送数据到总包单位
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="dataId">数据ID(可选,用于单条数据推送)</param>
|
||||
/// <returns>推送结果</returns>
|
||||
public static ReturnData PushInspectionMachineLists(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 project = db.Base_Project.FirstOrDefault(x => x.ProjectId == projectId);
|
||||
if (project != null)
|
||||
{
|
||||
//获取质量计量器具数据
|
||||
var list = from x in db.Comprehensive_InspectionMachine where x.ProjectId == projectId select x;
|
||||
|
||||
if (!string.IsNullOrEmpty(dataId))
|
||||
{
|
||||
list = list.Where(x => x.InspectionMachineId == dataId);
|
||||
}
|
||||
|
||||
var dataList = (from x in list
|
||||
join unit in db.Base_Unit on x.UnitId equals unit.UnitId into unitTemp
|
||||
from unit in unitTemp.DefaultIfEmpty()
|
||||
join pro in db.Base_CNProfessional on x.CNProfessionalId equals pro.CNProfessionalId into proTemp
|
||||
from pro in proTemp.DefaultIfEmpty()
|
||||
join u1 in db.Person_Persons on x.CompileMan equals u1.PersonId into u1Temp
|
||||
from u1 in u1Temp.DefaultIfEmpty()
|
||||
join att in db.AttachFile on x.InspectionMachineId equals att.ToKeyId into attTemp
|
||||
from att in attTemp.DefaultIfEmpty()
|
||||
select new InspectionMachineSyncItem
|
||||
{
|
||||
InspectionMachineId = x.InspectionMachineId,
|
||||
InspectionMachineCode = x.InspectionMachineCode,
|
||||
InspectionMachineName = x.InspectionMachineName,
|
||||
SpecificationModel = x.SpecificationModel,
|
||||
UnitsCount = x.UnitsCount,
|
||||
SType = x.SType,
|
||||
InspectionType = x.InspectionType,
|
||||
InspectionDate = x.InspectionDate,
|
||||
NextTestDate = x.NextTestDate,
|
||||
TestCycle = x.TestCycle,
|
||||
IsCheckOK = x.IsCheckOK,
|
||||
IsVerification = x.IsVerification,
|
||||
Status = x.Status,
|
||||
IsOnSite = x.IsOnSite,
|
||||
LeaveDate = x.LeaveDate,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = unit.UnitName,
|
||||
CNProfessionalId = x.CNProfessionalId,
|
||||
CNProfessionalName = pro.ProfessionalName,
|
||||
CompileMan = x.CompileMan,
|
||||
CompileManName = u1.PersonName,
|
||||
CompileDate = x.CompileDate,
|
||||
ProjectId = x.ProjectId,
|
||||
AttachFileId = att.AttachFileId,
|
||||
ToKeyId = att.ToKeyId,
|
||||
AttachSource = att.AttachSource,
|
||||
AttachUrl = att.AttachUrl,
|
||||
}).ToList();
|
||||
|
||||
if (dataList.Count() > 0)
|
||||
{
|
||||
var thisUnit = CommonService.GetIsThisUnit(); //当前单位
|
||||
var apiurl = "/api/InspectionMachineSync/SaveInspectionMachineSyncData";
|
||||
|
||||
//总包单位接口地址
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
var pushData = new InspectionMachineSyncData
|
||||
{
|
||||
CollCropCode = thisUnit.CollCropCode,//分包单位社会统一信用码
|
||||
UnitId = thisUnit.UnitId,//分包单位Id
|
||||
UnitName = thisUnit.UnitName,//分包单位名称
|
||||
ShortUnitName = thisUnit.ShortUnitName,//分包单位简称
|
||||
UnitDomain = Funs.SGGLUrl,//分包单位域名地址【文件存储地址】
|
||||
SubjectUnit = project.SubjectUnit,//主包单位Id
|
||||
SubjectProject = project.SubjectProject,//主包项目Id
|
||||
Items = dataList//质量计量器具数据
|
||||
};
|
||||
|
||||
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 总包单位接收分包单位推送数据
|
||||
|
||||
/// <summary>
|
||||
/// 总包单位接收分包单位推送数据
|
||||
/// </summary>
|
||||
/// <param name="items">质量计量器具同步数据</param>
|
||||
/// <returns>处理结果消息</returns>
|
||||
public static string SaveInspectionMachineSyncData(Model.InspectionMachineSyncData data)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string result = string.Empty;
|
||||
|
||||
if (data.Items.Count > 0 || data.Items.Count > 0)
|
||||
{
|
||||
var CollCropCode = data.CollCropCode; //分包单位社会统一信用码
|
||||
var ProjectId = data.SubjectProject; //总包项目Id
|
||||
var UnitDomain = data.UnitDomain; //分包单位域名地址【文件存储地址】
|
||||
|
||||
//1、判断分包单位是否存在
|
||||
var unit = UnitService.getUnitByCollCropCodeUnitName(CollCropCode, data.UnitName);
|
||||
if (unit == null)
|
||||
{
|
||||
result = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
|
||||
}
|
||||
else
|
||||
{
|
||||
//判断主包项目是否存在
|
||||
var porject = BLL.ProjectService.GetProjectByProjectId(ProjectId);
|
||||
if (porject == null)
|
||||
{
|
||||
result = "总包单位不存在本项目,请检查总包项目关联是否正确!";
|
||||
}
|
||||
else
|
||||
{
|
||||
int succ = 0;
|
||||
foreach (var item in data.Items)
|
||||
{
|
||||
try
|
||||
{
|
||||
Model.Comprehensive_InspectionMachine model = db.Comprehensive_InspectionMachine.FirstOrDefault(x => x.InspectionMachineId == item.InspectionMachineId);
|
||||
if (model == null)
|
||||
{
|
||||
//新增
|
||||
Model.Comprehensive_InspectionMachine newModel = new Model.Comprehensive_InspectionMachine
|
||||
{
|
||||
ProjectId = ProjectId,
|
||||
UnitId = unit.UnitId,
|
||||
InspectionMachineId = item.InspectionMachineId,
|
||||
InspectionMachineCode = item.InspectionMachineCode,
|
||||
InspectionMachineName = item.InspectionMachineName,
|
||||
SpecificationModel = item.SpecificationModel,
|
||||
NextTestDate = item.NextTestDate,
|
||||
TestCycle = item.TestCycle,
|
||||
IsVerification = item.IsVerification,
|
||||
InspectionDate = item.InspectionDate,
|
||||
AttachUrl = item.AttachUrl,
|
||||
CNProfessionalId = getCNProfessionalId(item.CNProfessionalName),
|
||||
//CompileMan = APIDataShareSyncService.getUserId(item.CompileManName),
|
||||
CompileDate = item.CompileDate,
|
||||
IsOnSite = item.IsOnSite,
|
||||
InspectionType = item.InspectionType,
|
||||
LeaveDate = item.LeaveDate,
|
||||
UnitsCount = item.UnitsCount,
|
||||
//AuditMan = item.AuditMan,
|
||||
Status = item.Status,
|
||||
IsCheckOK = item.IsCheckOK,
|
||||
SType = item.SType,
|
||||
SourceDes = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}#专业名称:{item.CNProfessionalName}",
|
||||
};
|
||||
|
||||
db.Comprehensive_InspectionMachine.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
|
||||
//保存编码
|
||||
if (!string.IsNullOrEmpty(item.InspectionMachineCode))
|
||||
{
|
||||
Model.Sys_CodeRecords codeRecords = new Model.Sys_CodeRecords
|
||||
{
|
||||
CodeRecordId = SQLHelper.GetNewID(typeof(Model.Sys_CodeRecords)),
|
||||
DataId = item.InspectionMachineId,
|
||||
Code = item.InspectionMachineCode
|
||||
};
|
||||
db.Sys_CodeRecords.InsertOnSubmit(codeRecords);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//更新
|
||||
model.ProjectId = ProjectId;
|
||||
model.UnitId = unit.UnitId;
|
||||
model.InspectionMachineCode = item.InspectionMachineCode;
|
||||
model.InspectionMachineName = item.InspectionMachineName;
|
||||
model.SpecificationModel = item.SpecificationModel;
|
||||
model.NextTestDate = item.NextTestDate;
|
||||
model.TestCycle = item.TestCycle;
|
||||
model.IsVerification = item.IsVerification;
|
||||
model.InspectionDate = item.InspectionDate;
|
||||
model.AttachUrl = item.AttachUrl;
|
||||
model.CNProfessionalId = getCNProfessionalId(item.CNProfessionalName);
|
||||
//model.CompileMan = APIDataShareSyncService.getUserId(item.CompileManName);
|
||||
model.CompileDate = item.CompileDate;
|
||||
model.IsOnSite = item.IsOnSite;
|
||||
model.InspectionType = item.InspectionType;
|
||||
model.LeaveDate = item.LeaveDate;
|
||||
model.UnitsCount = item.UnitsCount;
|
||||
//model.AuditMan = item.AuditMan;
|
||||
model.Status = item.Status;
|
||||
model.IsCheckOK = item.IsCheckOK;
|
||||
model.SType = item.SType;
|
||||
model.SourceDes = $"{(!string.IsNullOrWhiteSpace(data.ShortUnitName) ? data.ShortUnitName : data.UnitName)}#{item.CompileManName}#专业名称:{item.CNProfessionalName}";
|
||||
|
||||
db.SubmitChanges();
|
||||
//更新编码
|
||||
if (!string.IsNullOrEmpty(item.InspectionMachineCode))
|
||||
{
|
||||
var codeRecords = db.Sys_CodeRecords.FirstOrDefault(x => x.DataId == item.InspectionMachineId);
|
||||
if (codeRecords != null)
|
||||
{
|
||||
codeRecords.Code = item.InspectionMachineCode;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
succ++;
|
||||
//附件处理:附件
|
||||
BLL.FileInsertService.SaveAttachFileRecords(data.UnitDomain, item.AttachFileId, item.ToKeyId, item.AttachSource, item.AttachUrl);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog($"【{porject.ProjectName}】计量器具数据推送总包失败", ex.Message);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
result = "数据推送成功!";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "暂无质量计量器具数据!";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 辅助映射方法
|
||||
|
||||
/// <summary>
|
||||
/// 获取专业ID(根据名称)
|
||||
/// </summary>
|
||||
/// <param name="professionalName">专业名称</param>
|
||||
/// <returns>专业ID</returns>
|
||||
private static string getCNProfessionalId(string professionalName)
|
||||
{
|
||||
string professionalId = null;
|
||||
if (!string.IsNullOrEmpty(professionalName))
|
||||
{
|
||||
var pro = Funs.DB.Base_CNProfessional.FirstOrDefault(x => x.ProfessionalName == professionalName);
|
||||
if (pro != null)
|
||||
{
|
||||
professionalId = pro.CNProfessionalId;
|
||||
}
|
||||
}
|
||||
return professionalId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -173,19 +173,20 @@ namespace BLL
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
//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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
// CollCropCode = "913404001520228377Y"; //三化建 测试使用
|
||||
// SubjectProjectId = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
|
||||
|
||||
@@ -246,19 +247,20 @@ namespace BLL
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
//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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
// thisUnit.CollCropCode = "913404001520228377Y";//测试使用
|
||||
// project.SubjectProject = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
|
||||
|
||||
|
||||
@@ -144,19 +144,20 @@ namespace BLL
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
//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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
// CollCropCode = "91420000177570439L"; //三化建 测试使用
|
||||
// SubjectProjectId = "c7ade79e-7646-4c59-a8fd-020a7e3138c6";//测试使用
|
||||
|
||||
@@ -217,18 +218,20 @@ namespace BLL
|
||||
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];
|
||||
}
|
||||
}
|
||||
//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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
// thisUnit.CollCropCode = "913404001520228377Y";//测试使用
|
||||
// project.SubjectProject = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace BLL
|
||||
if (dataList.Count() > 0)
|
||||
{
|
||||
var thisUnit = CommonService.GetIsThisUnit();
|
||||
var porject = BLL.ProjectService.GetProjectByProjectId(projectId);
|
||||
var project = BLL.ProjectService.GetProjectByProjectId(projectId);
|
||||
var pushData = new LicenseManagerData
|
||||
{
|
||||
CollCropCode = thisUnit.CollCropCode,//分包单位社会统一信用码
|
||||
@@ -96,25 +96,27 @@ namespace BLL
|
||||
UnitName = thisUnit.UnitName,//分包单位名称
|
||||
ShortUnitName = thisUnit.ShortUnitName,//分包单位简称
|
||||
UnitDomain = Funs.SGGLUrl,//分包单位域名地址【文件存储地址】
|
||||
SubjectUnit = porject.SubjectUnit,//主包单位Id
|
||||
SubjectProject = porject.SubjectProject,//主包项目Id
|
||||
SubjectUnit = project.SubjectUnit,//主包单位Id
|
||||
SubjectProject = project.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 Url = BLL.UnitService.getUnitApiUrlByUnitId(project.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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
var baseurl = $"{ApiUrl}/api/LicenseSync/ReceiveSaveProjectLicenseManagerData";
|
||||
string contenttype = "application/json;charset=unicode";
|
||||
//Hashtable newToken = new Hashtable
|
||||
@@ -126,7 +128,7 @@ namespace BLL
|
||||
var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, null, pushContent);
|
||||
if (!string.IsNullOrEmpty(returndata))
|
||||
{
|
||||
ErrLogInfo.WriteLog($"【作业票返回结果】接口地址:{baseurl};{returndata}");
|
||||
//ErrLogInfo.WriteLog($"【作业票返回结果】接口地址:{baseurl};{returndata}");
|
||||
JObject obj = JObject.Parse(returndata);
|
||||
string mess = obj["message"].ToString();
|
||||
string code = obj["code"].ToString();
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace BLL
|
||||
if (dataList.Count() > 0)
|
||||
{
|
||||
var thisUnit = CommonService.GetIsThisUnit();
|
||||
var porject = BLL.ProjectService.GetProjectByProjectId(projectId);
|
||||
var project = BLL.ProjectService.GetProjectByProjectId(projectId);
|
||||
var pushData = new ClassMeetingData
|
||||
{
|
||||
CollCropCode = thisUnit.CollCropCode,//分包单位社会统一信用码
|
||||
@@ -97,25 +97,27 @@ namespace BLL
|
||||
UnitName = thisUnit.UnitName,//分包单位名称
|
||||
ShortUnitName = thisUnit.ShortUnitName,//分包单位简称
|
||||
UnitDomain = Funs.SGGLUrl,//分包单位域名地址【文件存储地址】
|
||||
SubjectUnit = porject.SubjectUnit,//主包单位Id
|
||||
SubjectProject = porject.SubjectProject,//主包项目Id
|
||||
SubjectUnit = project.SubjectUnit,//主包单位Id
|
||||
SubjectProject = project.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 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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
var baseurl = $"{ApiUrl}/api/MeetingSync/ReceiveSaveProjectClassMeetingData";
|
||||
string contenttype = "application/json;charset=unicode";
|
||||
//Hashtable newToken = new Hashtable
|
||||
|
||||
@@ -161,19 +161,20 @@ namespace BLL
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
//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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
// CollCropCode = "913404001520228377Y";//测试使用
|
||||
// SubjectProjectId = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
|
||||
// unitId = "aaa9e72b-e3a6-441e-a7bb-afc008adebc9";//测试使用
|
||||
@@ -243,19 +244,20 @@ namespace BLL
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
//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];
|
||||
// }
|
||||
//}
|
||||
string ApiUrl = project.SubjectUnitApiUrl;
|
||||
string WebUrl = project.SubjectUnitWebUrl;
|
||||
// thisUnit.CollCropCode = "913404001520228377Y"; //分包单位社会统一信用码 测试使用
|
||||
// project.SubjectProject = "B409A8D7-48C7-486E-84C7-E3E7B2C0E5B7";//测试使用
|
||||
|
||||
|
||||
@@ -321,5 +321,28 @@ namespace BLL
|
||||
handleSteps.Add(handleStep4);
|
||||
return handleSteps;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据危险观察登记主键删除一个危险观察登记信息
|
||||
/// </summary>
|
||||
/// <param name="hazardRegisterId">危险观察登记主键</param>
|
||||
public static void DeleteHazardRegisterByCheckSpecialId(string checkSpecialId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
List<Model.HSSE_Hazard_HazardRegister> hazardRegisters = db.HSSE_Hazard_HazardRegister.Where(e => e.CheckSpecialId == checkSpecialId).ToList();
|
||||
if (hazardRegisters.Count > 0)
|
||||
{
|
||||
foreach (var hazardRegister in hazardRegisters)
|
||||
{
|
||||
if (hazardRegister.IsUpdate != true)
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.ImageUrl);//删除整改前图片
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.RectificationImageUrl);//删除整改后图片
|
||||
db.HSSE_Hazard_HazardRegister.DeleteOnSubmit(hazardRegister);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1390,5 +1390,26 @@ namespace BLL
|
||||
return str;
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据UserId主键获取人员信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static void UpdatePersonTypeByProjectIdAndIdentityCard(string projectId, string identityCard)
|
||||
{
|
||||
|
||||
var persons = Funs.DB.SitePerson_Person.Where(x => x.IdentityCard == identityCard).ToList();
|
||||
|
||||
foreach (var item in persons)
|
||||
{
|
||||
if (item.ProjectId != projectId && item.States == Const.ProjectPersonStates_1)
|
||||
{
|
||||
item.States = Const.ProjectPersonStates_2;
|
||||
item.OutTime = DateTime.Now;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ namespace BLL
|
||||
TrainPersonNum = largerHazard.TrainPersonNum,
|
||||
IsSuperLargerHazard = largerHazard.IsSuperLargerHazard,
|
||||
Descriptions = largerHazard.Descriptions,
|
||||
ApprovalState = largerHazard.ApprovalState,
|
||||
OperativesNum = largerHazard.OperativesNum
|
||||
};
|
||||
|
||||
@@ -73,6 +74,7 @@ namespace BLL
|
||||
newLargerHazard.IsSuperLargerHazard = largerHazard.IsSuperLargerHazard;
|
||||
newLargerHazard.Descriptions = largerHazard.Descriptions;
|
||||
newLargerHazard.RecordTime = largerHazard.RecordTime;
|
||||
newLargerHazard.ApprovalState = largerHazard.ApprovalState;
|
||||
newLargerHazard.IsUpdate = null;
|
||||
newLargerHazard.OperativesNum = largerHazard.OperativesNum;
|
||||
db.SubmitChanges();
|
||||
|
||||
@@ -1567,5 +1567,56 @@ namespace BLL
|
||||
return users;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取用户下拉选项【单位本部在职人员】
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Person_Persons> GetIsOfficeUserListByUnitId(string unitId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.Person_Persons> list = new List<Model.Person_Persons>();
|
||||
list = (from x in db.Person_Persons
|
||||
where x.UnitId == unitId && x.IsOffice == true && x.IsPost == true
|
||||
orderby x.PersonName
|
||||
select x).ToList();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitIsOfficeUserUnitIdDropDownList(FineUIPro.DropDownList dropName, string unitId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "PersonId";
|
||||
dropName.DataTextField = "PersonName";
|
||||
dropName.DataSource = GetIsOfficeUserListByUnitId(unitId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据用户获取用户名称
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetUserNameByUserId(string userId)
|
||||
{
|
||||
string userName = string.Empty;
|
||||
Model.Person_Persons user = Funs.DB.Person_Persons.FirstOrDefault(e => e.PersonId == userId);
|
||||
if (user != null)
|
||||
{
|
||||
userName = user.PersonName;
|
||||
}
|
||||
|
||||
return userName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,6 +126,8 @@
|
||||
EnglishRemark = project.EnglishRemark,
|
||||
ProjectRealCode = project.ProjectRealCode,
|
||||
IsCNCECShow = project.IsCNCECShow,
|
||||
SubjectUnitApiUrl = project.SubjectUnitApiUrl,
|
||||
SubjectUnitWebUrl = project.SubjectUnitWebUrl,
|
||||
MasterSysId = project.MasterSysId,
|
||||
SubjectUnit = project.SubjectUnit,
|
||||
SubjectProject = project.SubjectProject,
|
||||
@@ -177,6 +179,8 @@
|
||||
newProject.ProjectRealCode = project.ProjectRealCode;
|
||||
newProject.IsCNCECShow = project.IsCNCECShow;
|
||||
newProject.MasterSysId = project.MasterSysId;
|
||||
newProject.SubjectUnitApiUrl = project.SubjectUnitApiUrl;
|
||||
newProject.SubjectUnitWebUrl = project.SubjectUnitWebUrl;
|
||||
newProject.SubjectUnit = project.SubjectUnit;
|
||||
newProject.SubjectProject = project.SubjectProject;
|
||||
|
||||
|
||||
@@ -43,6 +43,15 @@ namespace BLL
|
||||
NewWaterConsumption = newtable.NewWaterConsumption,
|
||||
HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum,
|
||||
HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum,
|
||||
LargerClosedNum = newtable.LargerClosedNum,
|
||||
LargerNotClosedNum = newtable.LargerNotClosedNum,
|
||||
|
||||
AwaitApprovalNum = newtable.AwaitApprovalNum,
|
||||
PendingApprovalNum = newtable.PendingApprovalNum,
|
||||
CompletedApprovalNum = newtable.CompletedApprovalNum,
|
||||
SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum,
|
||||
SuperPendingApprovalNum = newtable.SuperPendingApprovalNum,
|
||||
SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum,
|
||||
BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum,
|
||||
BranchFullTimeNum = newtable.BranchFullTimeNum,
|
||||
ProjectInspectorGeneralNum = newtable.ProjectInspectorGeneralNum,
|
||||
@@ -182,6 +191,17 @@ namespace BLL
|
||||
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
||||
item.FinishedNum = dataHsse.FinishedNum;
|
||||
item.ArgumentNum = dataHsse.ArgumentNum;
|
||||
item.LargerClosedNum = dataHsse.LargerClosedNum;
|
||||
item.LargerNotClosedNum = dataHsse.LargerNotClosedNum;
|
||||
item.LargerRate = "";
|
||||
|
||||
item.AwaitApprovalNum = dataHsse.AwaitApprovalNum;
|
||||
item.PendingApprovalNum = dataHsse.PendingApprovalNum;
|
||||
item.CompletedApprovalNum = dataHsse.CompletedApprovalNum;
|
||||
item.SuperAwaitApprovalNum = dataHsse.SuperAwaitApprovalNum;
|
||||
item.SuperPendingApprovalNum = dataHsse.SuperPendingApprovalNum;
|
||||
item.SuperCompletedApprovalNum = dataHsse.SuperCompletedApprovalNum;
|
||||
|
||||
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
||||
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
||||
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
||||
@@ -492,6 +512,15 @@ namespace BLL
|
||||
CertificateANum = projectData.Sum(x => x.CertificateANum),
|
||||
CertificateBNum = projectData.Sum(x => x.CertificateBNum),
|
||||
CertificateCNum = projectData.Sum(x => x.CertificateCNum),
|
||||
LargerClosedNum = projectData.Sum(x => x.LargerClosedNum),
|
||||
LargerNotClosedNum = projectData.Sum(x => x.LargerNotClosedNum),
|
||||
|
||||
AwaitApprovalNum = projectData.Sum(x => x.AwaitApprovalNum),
|
||||
PendingApprovalNum = projectData.Sum(x => x.PendingApprovalNum),
|
||||
CompletedApprovalNum = projectData.Sum(x => x.CompletedApprovalNum),
|
||||
SuperAwaitApprovalNum = projectData.Sum(x => x.SuperAwaitApprovalNum),
|
||||
SuperPendingApprovalNum = projectData.Sum(x => x.SuperPendingApprovalNum),
|
||||
SuperCompletedApprovalNum = projectData.Sum(x => x.SuperCompletedApprovalNum),
|
||||
SafetyCommitteeMeetingNum = GetSafetyCommitteeMeeting().Count,
|
||||
EnterpriseTopicsMeetingNum = GetEnterpriseTopicsMeetingNum(),
|
||||
ProjectSafetyLeadingGroupMeetingNum = projectData.Sum(x => x.ProjectSafetyLeadingGroupMeetingNum),
|
||||
@@ -668,7 +697,7 @@ namespace BLL
|
||||
var newWaterConsumptionTask = ChemicalReportItemService.GetLatstTimeNewWaterConsumption();
|
||||
var securityRiskOutputListTask = HSSEData_HSSEService.GetSecurityRiskOutputsAsync();
|
||||
var largeEngineeringOutputsTask = HSSEData_HSSEService.GetLargeEngineeringOutputsAsync();
|
||||
|
||||
var largerHiddenRectificationOutputsTask = HSSEData_HSSEService.GetLargerHiddenRectificationOutputsAsync();
|
||||
var safetyInjectionEngineerTask = HSSEData_HSSEService.GetSafetyInjectionEngineerAsync();
|
||||
var certificateATask = HSSEData_HSSEService.GetCertificateAAsync();
|
||||
var certificateBTask = HSSEData_HSSEService.GetCertificateBAsync();
|
||||
@@ -742,6 +771,7 @@ namespace BLL
|
||||
certificateATask,
|
||||
certificateBTask,
|
||||
certificateCTask,
|
||||
largerHiddenRectificationOutputsTask,
|
||||
qualityPersonNumTask,
|
||||
beUnderConstructionTask,
|
||||
shutdownTask,
|
||||
@@ -810,6 +840,7 @@ namespace BLL
|
||||
var certificateAList = await certificateATask;
|
||||
var certificateBList = await certificateBTask;
|
||||
var certificateCList = await certificateCTask;
|
||||
var largerHiddenRectificationOutputsList = await largerHiddenRectificationOutputsTask;
|
||||
var qualityPersonList = await qualityPersonNumTask;
|
||||
var beUnderConstructionList = await beUnderConstructionTask;
|
||||
var shutdownList = await shutdownTask;
|
||||
@@ -890,6 +921,16 @@ namespace BLL
|
||||
TotalWorkingHour = totalWorkingHour,
|
||||
LostWorkingHour = lostWorkingHour,
|
||||
SafeWorkingHour = safeWorkingHour,
|
||||
LargerClosedNum = largerHiddenRectificationOutputsList.Sum(x => x.RecNum),
|
||||
LargerNotClosedNum = largerHiddenRectificationOutputsList.Sum(x => x.NoRecNum),
|
||||
|
||||
AwaitApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.AwaitApprovalNum),
|
||||
PendingApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.PendingApprovalNum),
|
||||
CompletedApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.CompletedApprovalNum),
|
||||
SuperAwaitApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperAwaitApprovalNum),
|
||||
SuperPendingApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperPendingApprovalNum),
|
||||
SuperCompletedApprovalNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperCompletedApprovalNum),
|
||||
|
||||
SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum),
|
||||
@@ -978,6 +1019,12 @@ namespace BLL
|
||||
g => g.Key,
|
||||
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
|
||||
);
|
||||
var largerHiddenRectificationOutputsDict = largerHiddenRectificationOutputsList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
|
||||
);
|
||||
var majorHiddenRectificationOutputsDict = majorHiddenRectificationOutputsList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
@@ -1015,12 +1062,19 @@ namespace BLL
|
||||
SuperOperativesNum = g.Sum(x => x.SuperOperativesNum),
|
||||
SuperConstructionNum = g.Sum(x => x.SuperConstructionNum),
|
||||
SuperFinishedNum = g.Sum(x => x.SuperFinishedNum),
|
||||
AwaitApprovalNum = g.Sum(x => x.AwaitApprovalNum),
|
||||
PendingApprovalNum = g.Sum(x => x.PendingApprovalNum),
|
||||
CompletedApprovalNum = g.Sum(x => x.CompletedApprovalNum),
|
||||
SuperAwaitApprovalNum = g.Sum(x => x.SuperAwaitApprovalNum),
|
||||
SuperPendingApprovalNum = g.Sum(x => x.SuperPendingApprovalNum),
|
||||
SuperCompletedApprovalNum = g.Sum(x => x.SuperCompletedApprovalNum),
|
||||
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum)
|
||||
}
|
||||
);
|
||||
foreach (var projectid in BeUnderConstructionList)
|
||||
{
|
||||
generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs);
|
||||
largerHiddenRectificationOutputsDict.TryGetValue(projectid, out var largerHiddenRectificationOutputs);
|
||||
majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs);
|
||||
securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs);
|
||||
largeEngineeringOutputsDict.TryGetValue(projectid, out var largeEngineeringOutputs);
|
||||
@@ -1042,6 +1096,14 @@ namespace BLL
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
HseTechnicalNum = hseTechnicalList.Count(x => x.ProjectId == projectid),
|
||||
EnvironmentalTrainNum = 0,
|
||||
LargerClosedNum = largerHiddenRectificationOutputs?.ClosedNum ?? 0,
|
||||
LargerNotClosedNum = largerHiddenRectificationOutputs?.NotClosedNum ?? 0,
|
||||
AwaitApprovalNum = largeEngineeringOutputs?.AwaitApprovalNum ?? 0,
|
||||
PendingApprovalNum = largeEngineeringOutputs?.PendingApprovalNum ?? 0,
|
||||
CompletedApprovalNum = largeEngineeringOutputs?.CompletedApprovalNum ?? 0,
|
||||
SuperAwaitApprovalNum = largeEngineeringOutputs?.SuperAwaitApprovalNum ?? 0,
|
||||
SuperPendingApprovalNum = largeEngineeringOutputs?.SuperPendingApprovalNum ?? 0,
|
||||
SuperCompletedApprovalNum = largeEngineeringOutputs?.SuperCompletedApprovalNum ?? 0,
|
||||
TotalEnergyConsumption = 0,
|
||||
IncomeComprehensiveEnergyConsumption = 0,
|
||||
NewWaterConsumption = 0,
|
||||
@@ -1277,6 +1339,14 @@ namespace BLL
|
||||
table.SafeWorkingHour = newtable.SafeWorkingHour;
|
||||
table.SafeTrainNum = newtable.SafeTrainNum;
|
||||
table.SpecialTrainNum = newtable.SpecialTrainNum;
|
||||
table.LargerClosedNum = newtable.LargerClosedNum;
|
||||
table.LargerNotClosedNum = newtable.LargerNotClosedNum;
|
||||
table.AwaitApprovalNum = newtable.AwaitApprovalNum;
|
||||
table.PendingApprovalNum = newtable.PendingApprovalNum;
|
||||
table.CompletedApprovalNum = newtable.CompletedApprovalNum;
|
||||
table.SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum;
|
||||
table.SuperPendingApprovalNum = newtable.SuperPendingApprovalNum;
|
||||
table.SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum;
|
||||
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
|
||||
table.HseTechnicalNum = newtable.HseTechnicalNum;
|
||||
table.EnvironmentalTrainNum = newtable.EnvironmentalTrainNum;
|
||||
@@ -3937,24 +4007,24 @@ namespace BLL
|
||||
{
|
||||
List<LicenseOutput> result = new List<LicenseOutput>();
|
||||
var result1 = (from x in Funs.DB.View_License_LicenseManager
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsHighRisk == true &&
|
||||
x.CompileDate > Const.DtmarkTime
|
||||
select new Model.LicenseOutput
|
||||
{
|
||||
Id = x.LicenseManagerId,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
||||
UnitId = x.UnitId,
|
||||
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
||||
LicenseTypeName = x.LicenseTypeName,
|
||||
UnitTypeName = "",
|
||||
IsHighRisk = x.IsHighRisk,
|
||||
WorkAreaName = "",
|
||||
CompileDate = x.CompileDate,
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
WorkStatesStr = ""
|
||||
}).ToList();
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsHighRisk == true &&
|
||||
x.CompileDate > Const.DtmarkTime
|
||||
select new Model.LicenseOutput
|
||||
{
|
||||
Id = x.LicenseManagerId,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = ProjectService.GetProjectNameByProjectId(x.ProjectId),
|
||||
UnitId = x.UnitId,
|
||||
UnitName = UnitService.GetUnitNameByUnitId(x.UnitId),
|
||||
LicenseTypeName = x.LicenseTypeName,
|
||||
UnitTypeName = "",
|
||||
IsHighRisk = x.IsHighRisk,
|
||||
WorkAreaName = "",
|
||||
CompileDate = x.CompileDate,
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
WorkStatesStr = ""
|
||||
}).ToList();
|
||||
var result2 = (from x in Funs.DB.License_FireWork
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
select new Model.LicenseOutput
|
||||
@@ -4162,7 +4232,7 @@ namespace BLL
|
||||
var query = (from x in Funs.DB.Base_Project
|
||||
join y in Funs.DB.HSSE_Hazard_HazardRegister on x.ProjectId equals y.ProjectId into yGroup
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && (y.HazardValue == "0.3" || y.HazardValue == "1" || y.HazardValue == null) && y.CheckTime > Const.DtmarkTime
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && (y.HazardValue == "0.3" || y.HazardValue == null) && y.CheckTime > Const.DtmarkTime
|
||||
group y by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
select new HiddenRectificationOutput
|
||||
{
|
||||
@@ -4188,6 +4258,42 @@ namespace BLL
|
||||
return await Task.Run(GetGeneralHiddenRectificationOutputs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取较大隐患数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.HiddenRectificationOutput> GetLargerHiddenRectificationOutputs()
|
||||
{
|
||||
var query = (from x in Funs.DB.Base_Project
|
||||
join y in Funs.DB.HSSE_Hazard_HazardRegister on x.ProjectId equals y.ProjectId into yGroup
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && y.ProblemTypes == "1" && y.HazardValue == "1" && y.CheckTime > Const.DtmarkTime
|
||||
group y by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
select new HiddenRectificationOutput
|
||||
{
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
ProNum = gg.Count(y => y.States != "4" && y.States != "-1"),
|
||||
RecNum = gg.Count(y => y.States == "3"),
|
||||
NoRecNum = gg.Count(y => y.States != "3" && y.States != "4" && y.States != "-1"),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1") == 0 ? "0" :
|
||||
Math.Round(Convert.ToDecimal(gg.Count(y => y.States == "3") /
|
||||
gg.Count(y => y.States != "4" && y.States != "-1") * 100), 2, MidpointRounding.AwayFromZero).ToString()
|
||||
}).ToList();
|
||||
|
||||
foreach (var item in query)
|
||||
{
|
||||
item.RecRate = Math.Round(Convert.ToDecimal(item.RecRate), 2).ToString(); // 转换为字符串并格式化为两位小数
|
||||
}
|
||||
return query;
|
||||
}
|
||||
public static async Task<List<Model.HiddenRectificationOutput>> GetLargerHiddenRectificationOutputsAsync()
|
||||
{
|
||||
return await Task.Run(GetLargerHiddenRectificationOutputs);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取重大隐患数据
|
||||
/// </summary>
|
||||
@@ -4285,6 +4391,12 @@ namespace BLL
|
||||
SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true),
|
||||
OperativesNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.OperativesNum) ?? 0,
|
||||
SuperOperativesNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.OperativesNum) ?? 0,
|
||||
AwaitApprovalNum = gg.Count(x => x.ApprovalState == "0" && x.IsSuperLargerHazard == false),
|
||||
PendingApprovalNum = gg.Count(x => x.ApprovalState == "1" && x.IsSuperLargerHazard == false),
|
||||
CompletedApprovalNum = gg.Count(x => x.ApprovalState == "2" && x.IsSuperLargerHazard == false),
|
||||
SuperAwaitApprovalNum = gg.Count(x => x.ApprovalState == "0" && x.IsSuperLargerHazard == true),
|
||||
SuperPendingApprovalNum = gg.Count(x => x.ApprovalState == "1" && x.IsSuperLargerHazard == true),
|
||||
SuperCompletedApprovalNum = gg.Count(x => x.ApprovalState == "2" && x.IsSuperLargerHazard == true),
|
||||
}).ToList();
|
||||
return query;
|
||||
|
||||
@@ -4531,6 +4643,14 @@ namespace BLL
|
||||
x.SpecialTrainNum,
|
||||
x.SpecialOperationTrainNum,
|
||||
x.HseTechnicalNum,
|
||||
x.LargerClosedNum,
|
||||
x.LargerNotClosedNum,
|
||||
x.AwaitApprovalNum,
|
||||
x.PendingApprovalNum,
|
||||
x.CompletedApprovalNum,
|
||||
x.SuperAwaitApprovalNum,
|
||||
x.SuperPendingApprovalNum,
|
||||
x.SuperCompletedApprovalNum,
|
||||
x.EnvironmentalTrainNum,
|
||||
x.TotalEnergyConsumption,
|
||||
x.IncomeComprehensiveEnergyConsumption,
|
||||
|
||||
@@ -127,6 +127,16 @@ namespace BLL
|
||||
LostWorkingHour = newtable.LostWorkingHour,
|
||||
SafeWorkingHour = newtable.SafeWorkingHour,
|
||||
SafeTrainNum = newtable.SafeTrainNum,
|
||||
LargerClosedNum = newtable.LargerClosedNum,
|
||||
LargerNotClosedNum = newtable.LargerNotClosedNum,
|
||||
|
||||
AwaitApprovalNum = newtable.AwaitApprovalNum,
|
||||
PendingApprovalNum = newtable.PendingApprovalNum,
|
||||
CompletedApprovalNum = newtable.CompletedApprovalNum,
|
||||
SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum,
|
||||
SuperPendingApprovalNum = newtable.SuperPendingApprovalNum,
|
||||
SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum,
|
||||
|
||||
SpecialTrainNum = newtable.SpecialTrainNum,
|
||||
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
||||
HseTechnicalNum = newtable.HseTechnicalNum,
|
||||
@@ -275,6 +285,18 @@ namespace BLL
|
||||
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
||||
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
||||
table.NewWaterConsumption = newtable.NewWaterConsumption;
|
||||
table.LargerClosedNum = newtable.LargerClosedNum;
|
||||
table.LargerNotClosedNum = newtable.LargerNotClosedNum;
|
||||
|
||||
table.ArgumentNum = newtable.ArgumentNum;
|
||||
table.SuperArgumentNum = newtable.SuperArgumentNum;
|
||||
table.AwaitApprovalNum = newtable.AwaitApprovalNum;
|
||||
table.PendingApprovalNum = newtable.PendingApprovalNum;
|
||||
table.CompletedApprovalNum = newtable.CompletedApprovalNum;
|
||||
table.SuperAwaitApprovalNum = newtable.SuperAwaitApprovalNum;
|
||||
table.SuperPendingApprovalNum = newtable.SuperPendingApprovalNum;
|
||||
table.SuperCompletedApprovalNum = newtable.SuperCompletedApprovalNum;
|
||||
|
||||
table.HeadOfficeInspectorGeneralNum = newtable.HeadOfficeInspectorGeneralNum;
|
||||
table.HeadOfficeFullTimeNum = newtable.HeadOfficeFullTimeNum;
|
||||
table.BranchInspectorGeneralNum = newtable.BranchInspectorGeneralNum;
|
||||
@@ -552,6 +574,9 @@ namespace BLL
|
||||
table.GeneralNotClosedNum = GetGeneralNotClosedNum(projectid);
|
||||
table.MajorClosedNum = GetMajorClosedNum(projectid);
|
||||
table.MajorNotClosedNum = GetMajorNotClosedNum(projectid);
|
||||
table.LargerClosedNum = GetLargerClosedNum(projectid);
|
||||
table.LargerNotClosedNum = GetLargerNotClosedNum(projectid);
|
||||
|
||||
}
|
||||
|
||||
if (hSseDateType == HSSEDateType.SecurityRisk || hSseDateType == HSSEDateType.All)
|
||||
@@ -616,6 +641,14 @@ namespace BLL
|
||||
table.SuperOperativesNum = GetSuperOperativesNum(projectid);
|
||||
table.SuperConstructionNum = GetSuperConstructionNum(projectid);
|
||||
table.SuperFinishedNum = GetSuperFinishedNum(projectid);
|
||||
table.ArgumentNum = GetArgumentNum(projectid);
|
||||
table.SuperArgumentNum = GetSuperArgumentNum(projectid);
|
||||
table.AwaitApprovalNum = GetAwaitApprovalNum(projectid);
|
||||
table.PendingApprovalNum = GetPendingApprovalNum(projectid);
|
||||
table.CompletedApprovalNum = GetCompletedApprovalNum(projectid);
|
||||
table.SuperAwaitApprovalNum = GetSuperAwaitApprovalNum(projectid);
|
||||
table.SuperPendingApprovalNum = GetSuperPendingApprovalNum(projectid);
|
||||
table.SuperCompletedApprovalNum = GetSuperCompletedApprovalNum(projectid);
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
@@ -1389,7 +1422,7 @@ namespace BLL
|
||||
public static int GetGeneralClosedNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.ProjectId == projectid && (x.HazardValue == "0.3" || x.HazardValue == "1" || x.HazardValue == null) && x.States == "3" &&
|
||||
where x.ProjectId == projectid && (x.HazardValue == "0.3" || x.HazardValue == null) && x.States == "3" &&
|
||||
x.CheckTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
@@ -1402,7 +1435,33 @@ namespace BLL
|
||||
public static int GetGeneralNotClosedNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.ProjectId == projectid && (x.HazardValue == "0.3" || x.HazardValue == "1" || x.HazardValue == null) && x.States != "3" && x.States != "-1" &&
|
||||
where x.ProjectId == projectid && (x.HazardValue == "0.3" || x.HazardValue == null) && x.States != "3" && x.States != "-1" &&
|
||||
x.CheckTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取较大隐患整改闭环项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetLargerClosedNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.ProjectId == projectid && x.HazardValue == "1" && x.States == "3" &&
|
||||
x.CheckTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取较大隐患未整改完成项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetLargerNotClosedNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.ProjectId == projectid && x.HazardValue == "1" && x.States != "3" && x.States != "-1" &&
|
||||
x.CheckTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
@@ -1537,6 +1596,105 @@ namespace BLL
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取危大工程论证个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetArgumentNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.IsArgument == true && x.IsSuperLargerHazard == false &&
|
||||
x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取超危大工程论证个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSuperArgumentNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.IsArgument == true && x.IsSuperLargerHazard == true &&
|
||||
x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取危大工程待审核个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetAwaitApprovalNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.ApprovalState == "0" && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取超危大工程待审核个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSuperAwaitApprovalNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.ApprovalState == "0" && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取危大工程审核中个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetPendingApprovalNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.ApprovalState == "1" && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取超危大工程审核中个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSuperPendingApprovalNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.ApprovalState == "1" && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取危大工程已完成个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCompletedApprovalNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.ApprovalState == "2" && x.IsSuperLargerHazard == false && x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取超危大工程已完成个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSuperCompletedApprovalNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where x.ProjectId == projectid && x.ApprovalState == "2" && x.IsSuperLargerHazard == true && x.RecordTime > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取超危大工程审批完成数
|
||||
/// </summary>
|
||||
@@ -1639,6 +1797,18 @@ namespace BLL
|
||||
x.SafeWorkingHour,
|
||||
x.SafeTrainNum,
|
||||
x.SpecialTrainNum,
|
||||
x.LargerClosedNum,
|
||||
x.LargerNotClosedNum,
|
||||
|
||||
x.ArgumentNum,
|
||||
x.SuperArgumentNum,
|
||||
x.AwaitApprovalNum,
|
||||
x.PendingApprovalNum,
|
||||
x.CompletedApprovalNum,
|
||||
x.SuperAwaitApprovalNum,
|
||||
x.SuperPendingApprovalNum,
|
||||
x.SuperCompletedApprovalNum,
|
||||
|
||||
x.SpecialOperationTrainNum,
|
||||
x.TotalEnergyConsumption,
|
||||
x.IncomeComprehensiveEnergyConsumption,
|
||||
|
||||
@@ -214,10 +214,10 @@ namespace BLL
|
||||
ProjectId = r.ProjectId,
|
||||
CheckUnitName = u.UnitName,
|
||||
States = r.States,
|
||||
ProblemStatesName = i.CompleteStatus==1 ? "已整改":"未整改",
|
||||
ProblemStatesName = i.CompleteStatus == 1 ? "已整改" : "未整改",
|
||||
ProblemStates = i.CompleteStatus,
|
||||
InsResponsibleUserId = r.InsResponsibleUserId,
|
||||
InsResponsibleUserName= user.PersonName
|
||||
InsResponsibleUserName = user.PersonName
|
||||
};
|
||||
|
||||
// 应用检查大类过滤
|
||||
@@ -281,17 +281,24 @@ namespace BLL
|
||||
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();
|
||||
//// 先获取用户有权限的项目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))));
|
||||
|
||||
// 过滤查询结果
|
||||
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))));
|
||||
input.UnitId == r.CheckUnitId)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ namespace BLL
|
||||
|
||||
public enum StateInt : int
|
||||
{
|
||||
待提交 = 0,
|
||||
待整改= 1,
|
||||
部分整改 = 2,
|
||||
已闭环 = 3,
|
||||
待提交 = 0,
|
||||
待整改 = 1,
|
||||
部分整改 = 2,
|
||||
已闭环 = 3,
|
||||
}
|
||||
|
||||
#endregion Enums
|
||||
@@ -51,6 +51,7 @@ namespace BLL
|
||||
CheckDate = register.CheckDate,
|
||||
CheckMainType = register.CheckMainType,
|
||||
CheckType = register.CheckType,
|
||||
InspectionUnit = register.InspectionUnit,
|
||||
ProjectId = register.ProjectId,
|
||||
CheckUnitId = register.CheckUnitId,
|
||||
CheckTeam = register.CheckTeam,
|
||||
@@ -59,7 +60,7 @@ namespace BLL
|
||||
InsResponsibleUserId = register.InsResponsibleUserId,
|
||||
EvaluationResult = register.EvaluationResult,
|
||||
AttachUrl = register.AttachUrl,
|
||||
States = register.States??0,
|
||||
States = register.States ?? 0,
|
||||
CompileMan = register.CompileMan,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
@@ -119,7 +120,7 @@ namespace BLL
|
||||
public static int GetCount(string checkMainType)
|
||||
{
|
||||
return (from x in Funs.DB.Supervise_UnitHazardRegister
|
||||
where x.CheckMainType ==checkMainType
|
||||
where x.CheckMainType == checkMainType
|
||||
select x.UnitHazardRegisterId).Count();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -171,6 +172,9 @@ namespace BLL
|
||||
on new { MainType = x.CheckMainType, TypeCode = x.CheckType }
|
||||
equals new { MainType = ct.CheckMainType, TypeCode = ct.CheckTypeCode } into ctGroup
|
||||
from ct in ctGroup.DefaultIfEmpty()
|
||||
join inu in db.Base_Unit
|
||||
on x.InspectionUnit equals inu.UnitId into inuGroup
|
||||
from inu in inuGroup.DefaultIfEmpty()
|
||||
join u in db.Base_Unit
|
||||
on x.CheckUnitId equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
@@ -185,7 +189,9 @@ namespace BLL
|
||||
CheckMainTypeName = x.CheckMainType == "0" ? "安全" : "质量",
|
||||
CheckType = x.CheckType,
|
||||
CheckTypeName = ct.CheckTypeName,
|
||||
InspectionUnitName = inu.UnitName,
|
||||
CheckObjectText = p.ProjectName,
|
||||
CheckUnitId = x.CheckUnitId,
|
||||
CheckUnitName = u.UnitName,
|
||||
CheckTeam = x.CheckTeam,
|
||||
EvaluationResult = x.EvaluationResult,
|
||||
@@ -219,6 +225,10 @@ namespace BLL
|
||||
{
|
||||
query = query.Where(x => x.ProjectId != null && x.ProjectId == input.ProjectId);
|
||||
}
|
||||
if (input != null && !string.IsNullOrEmpty(input.CheckUnitId) && input.CheckUnitId != BLL.Const.UnitId_SEDIN)
|
||||
{
|
||||
query = query.Where(x => x.CheckUnitId != null && x.CheckUnitId == input.CheckUnitId);
|
||||
}
|
||||
|
||||
// 获取总数
|
||||
totalCount = query.Count();
|
||||
@@ -253,6 +263,7 @@ namespace BLL
|
||||
newRegister.CheckDate = register.CheckDate;
|
||||
newRegister.CheckMainType = register.CheckMainType;
|
||||
newRegister.CheckType = register.CheckType;
|
||||
newRegister.InspectionUnit = register.InspectionUnit;
|
||||
newRegister.ProjectId = register.ProjectId;
|
||||
newRegister.CheckUnitId = register.CheckUnitId;
|
||||
newRegister.CheckTeam = register.CheckTeam;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -3536,6 +3536,7 @@
|
||||
<Content Include="ZHGL\Supervise\SuperviseCheckReportEdit.aspx" />
|
||||
<Content Include="ZHGL\Supervise\SuperviseCheckReportFinalizeEdit.aspx" />
|
||||
<Content Include="ZHGL\Supervise\UnitHazardRegister.aspx" />
|
||||
<Content Include="ZHGL\Supervise\UnitHazardRegisterDetailIn.aspx" />
|
||||
<Content Include="ZHGL\Supervise\UnitHazardRegisterEdit.aspx" />
|
||||
<Content Include="ZHGL\Supervise\UnitHazardRegisterRecord.aspx" />
|
||||
<Content Include="ZHGL\Supervise\UnitHazardRegisterRecordEdit.aspx" />
|
||||
@@ -3653,6 +3654,9 @@
|
||||
<Content Include="File\Word\HSSE\环境监测数据接口.docx" />
|
||||
<Content Include="File\Excel\DataIn\图纸会审管理导入模板.xls" />
|
||||
<Content Include="File\Excel\DataIn\施工技术交底管理导入模板.xls" />
|
||||
<Content Include="File\Excel\DataIn\专项检查明细导入模板.xls" />
|
||||
<Content Include="File\Excel\DataIn\企业大检查明细导入模板.xls" />
|
||||
<Content Include="File\Excel\DataIn\现场车辆管理导入模板.xls" />
|
||||
<None Include="packages.config" />
|
||||
<Content Include="ReportPrint\ReportTabFile\分包商上传周报.tab" />
|
||||
<Content Include="ReportPrint\ReportTabFile\HSSE日志暨管理数据收集.tab" />
|
||||
@@ -16902,6 +16906,13 @@
|
||||
<Compile Include="ZHGL\Supervise\UnitHazardRegister.aspx.designer.cs">
|
||||
<DependentUpon>UnitHazardRegister.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\Supervise\UnitHazardRegisterDetailIn.aspx.cs">
|
||||
<DependentUpon>UnitHazardRegisterDetailIn.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\Supervise\UnitHazardRegisterDetailIn.aspx.designer.cs">
|
||||
<DependentUpon>UnitHazardRegisterDetailIn.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ZHGL\Supervise\UnitHazardRegisterEdit.aspx.cs">
|
||||
<DependentUpon>UnitHazardRegisterEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -17006,7 +17017,7 @@
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v18.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<f:RadioButtonList ID="rblIsSuperLargerHazard" runat="server" Label="超危大工程" LabelWidth="100px" Required="true" ShowRedStar="true">
|
||||
</f:RadioButtonList>
|
||||
<f:NumberBox runat="server" ID="txtTrainPersonNum" NoDecimal="true" NoNegative="true" Label="培训人次" LabelWidth="100px"></f:NumberBox>
|
||||
<f:DropDownList ID="drpStates" runat="server" Label="状态" LabelAlign="Right">
|
||||
<f:DropDownList ID="drpStates" runat="server" Label="作业状态" LabelAlign="Right">
|
||||
<f:ListItem Text="未开始" Value="1" />
|
||||
<f:ListItem Text="作业中" Value="2" />
|
||||
<f:ListItem Text="已完工" Value="3" />
|
||||
@@ -59,7 +59,11 @@
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" ID="txtOperativesNum" NoDecimal="true" NoNegative="true" Label="作业人员数" LabelWidth="100px"></f:NumberBox>
|
||||
<f:Label runat="server" ID="txtOperativesNum1"></f:Label>
|
||||
<f:DropDownList ID="drpApprovalState" runat="server" Label="审批状态" LabelAlign="Right">
|
||||
<f:ListItem Text="待审核" Value="0" />
|
||||
<f:ListItem Text="审核中" Value="1" />
|
||||
<f:ListItem Text="已完成" Value="2" />
|
||||
</f:DropDownList>
|
||||
<f:Label runat="server" ID="txtOperativesNum2"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
@@ -82,6 +82,7 @@ namespace FineUIPro.Web.HSSE.Solution
|
||||
{
|
||||
this.rblIsArgument.SelectedValue = "False";
|
||||
}
|
||||
this.drpApprovalState.SelectedValue = largerHazard.ApprovalState;
|
||||
if (largerHazard.IsSuperLargerHazard == true)
|
||||
{
|
||||
this.rblIsSuperLargerHazard.SelectedValue = "True";
|
||||
@@ -151,6 +152,7 @@ namespace FineUIPro.Web.HSSE.Solution
|
||||
OperativesNum = Funs.GetNewIntOrZero(this.txtOperativesNum.Text.Trim()),
|
||||
Remark = HttpUtility.HtmlEncode(this.txtRemark.Text.Trim()),
|
||||
Descriptions = this.txtDescriptions.Text.Trim(),
|
||||
ApprovalState = this.drpApprovalState.SelectedValue,
|
||||
RecordTime = Funs.GetNewDateTime(this.txtRecordTime.Text.Trim()),
|
||||
ProjectId = this.ProjectId,
|
||||
States = this.drpStates.SelectedValue,
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Solution
|
||||
{
|
||||
namespace FineUIPro.Web.HSSE.Solution {
|
||||
|
||||
|
||||
public partial class LargerHazardEdit
|
||||
{
|
||||
public partial class LargerHazardEdit {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -141,13 +139,13 @@ namespace FineUIPro.Web.HSSE.Solution
|
||||
protected global::FineUIPro.NumberBox txtOperativesNum;
|
||||
|
||||
/// <summary>
|
||||
/// txtOperativesNum1 控件。
|
||||
/// drpApprovalState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtOperativesNum1;
|
||||
protected global::FineUIPro.DropDownList drpApprovalState;
|
||||
|
||||
/// <summary>
|
||||
/// txtOperativesNum2 控件。
|
||||
|
||||
@@ -80,6 +80,10 @@
|
||||
<f:RenderField Width="80px" ColumnID="IsArgumentStr" DataField="IsArgumentStr" SortField="IsArgumentStr"
|
||||
FieldType="String" HeaderText="专家论证" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="ApprovalStateStr" DataField="ApprovalStateStr"
|
||||
SortField="ApprovalStateStr" FieldType="String" HeaderText="审批状态" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="FlowOperateName" DataField="FlowOperateName"
|
||||
SortField="FlowOperateName" FieldType="String" HeaderText="状态" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
|
||||
@@ -36,6 +36,10 @@ namespace FineUIPro.Web.HSSE.Solution
|
||||
{
|
||||
string strSql = @"SELECT LargerHazard.HazardId,LargerHazard.ProjectId,CodeRecords.Code AS HazardCode,LargerHazard.Address,Users.PersonName,LargerHazard.ExpectedTime,LargerHazard.RecordTime "
|
||||
+ @" ,(CASE WHEN LargerHazard.States = " + BLL.Const.State_0 + " OR LargerHazard.States IS NULL THEN '待['+OperateUser.PersonName+']提交' WHEN LargerHazard.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.PersonName+']办理' END) AS FlowOperateName"
|
||||
+ @" ,case LargerHazard.ApprovalState when '0' then '待审核'
|
||||
when '1' then '审核中'
|
||||
when '2' then '已完成'
|
||||
else '' end as ApprovalStateStr"
|
||||
+ @", case when LargerHazard.IsArgument=1 then '是' else '否' end as IsArgumentStr,Const.ConstText as TypeName"
|
||||
+ @" FROM Solution_LargerHazard AS LargerHazard "
|
||||
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON LargerHazard.HazardId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
|
||||
|
||||
@@ -33,6 +33,17 @@
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpApprovalState" runat="server" Label="审批状态" LabelAlign="Right">
|
||||
<f:ListItem Text="待审核" Value="0" />
|
||||
<f:ListItem Text="审核中" Value="1" />
|
||||
<f:ListItem Text="已完成" Value="2" />
|
||||
</f:DropDownList>
|
||||
<f:Label runat="server" ID="txtOperativesNum2"></f:Label>
|
||||
<f:Label runat="server" ID="Label1"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtDescriptions" runat="server" Label="描述" LabelWidth="100px"
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace FineUIPro.Web.HSSE.Solution
|
||||
{
|
||||
this.txtIsArgument.Text = "否";
|
||||
}
|
||||
this.drpApprovalState.SelectedValue = largerHazard.ApprovalState;
|
||||
this.txtDescriptions.Text = largerHazard.Descriptions;
|
||||
this.txtRemark.Text = HttpUtility.HtmlDecode(largerHazard.Remark);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,33 @@ namespace FineUIPro.Web.HSSE.Solution {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtAddress;
|
||||
|
||||
/// <summary>
|
||||
/// drpApprovalState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpApprovalState;
|
||||
|
||||
/// <summary>
|
||||
/// txtOperativesNum2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtOperativesNum2;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// txtDescriptions 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -30,22 +30,18 @@
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:TextBox runat="server" ID="txtSearch" Label="查询" EmptyText="编号/检查对象/检查组/评价结果"
|
||||
Width="300px" AutoPostBack="true" OnTextChanged="txtSearch_TextChanged">
|
||||
Width="300px" AutoPostBack="true" OnTextChanged="txtSearch_TextChanged" LabelWidth="50px" LabelAlign="right">
|
||||
</f:TextBox>
|
||||
|
||||
<f:DropDownList ID="drpCheckMainType" runat="server" AutoPostBack="true"
|
||||
<f:DropDownList ID="drpCheckMainType" runat="server" AutoPostBack="true" LabelWidth="100px" LabelAlign="right"
|
||||
OnSelectedIndexChanged="drpCheckMainType_SelectedIndexChanged" Label="检查大类" Width="200px" Readonly="true">
|
||||
<f:ListItem Value="0" Text="安全" />
|
||||
<f:ListItem Value="1" Text="质量" />
|
||||
</f:DropDownList>
|
||||
|
||||
<f:DropDownList runat="server" ID="drpCheckType" EnableSimulateTree="True"
|
||||
<f:DropDownList runat="server" ID="drpCheckType" EnableSimulateTree="True" LabelWidth="100px" LabelAlign="right"
|
||||
Label="检查类别" AutoPostBack="true" Width="260px" AutoSelectFirstItem="true"
|
||||
OnSelectedIndexChanged="txtSearch_TextChanged">
|
||||
</f:DropDownList>
|
||||
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
|
||||
<f:Button ID="btnNew" Icon="Add" EnablePostBack="false" runat="server" Text="新增" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Text="编辑" Hidden="true">
|
||||
@@ -68,8 +64,8 @@
|
||||
</asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="120px" ColumnID="UnitHazardRegisterCode" DataField="UnitHazardRegisterCode"
|
||||
SortField="UnitHazardRegisterCode" FieldType="String" HeaderText="编号" TextAlign="Left"
|
||||
<f:RenderField Width="100px" ColumnID="UnitHazardRegisterCode" DataField="UnitHazardRegisterCode"
|
||||
SortField="UnitHazardRegisterCode" FieldType="String" HeaderText="编号" TextAlign="Center"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="CheckDate" DataField="CheckDate" SortField="CheckDate"
|
||||
@@ -80,19 +76,22 @@
|
||||
FieldType="String" HeaderText="检查大类" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="CheckTypeName" DataField="CheckTypeName"
|
||||
SortField="CheckTypeName" FieldType="String" HeaderText="检查类别" TextAlign="Left"
|
||||
SortField="CheckTypeName" FieldType="String" HeaderText="检查类别" TextAlign="Center"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="InspectionUnitName" DataField="InspectionUnitName"
|
||||
FieldType="String" HeaderText="检查单位" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="CheckObjectText" DataField="CheckObjectText"
|
||||
FieldType="String" HeaderText="检查对象" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="CheckUnitName" DataField="CheckUnitName"
|
||||
FieldType="String" HeaderText="检查单位" TextAlign="Left" HeaderTextAlign="Center">
|
||||
<f:RenderField Width="200px" ColumnID="CheckUnitName" DataField="CheckUnitName"
|
||||
FieldType="String" HeaderText="受检单位" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="CheckTeam" DataField="CheckTeam" SortField="CheckTeam"
|
||||
<f:RenderField Width="200px" ColumnID="CheckTeam" DataField="CheckTeam" SortField="CheckTeam"
|
||||
FieldType="String" HeaderText="检查组/人" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="StatesName" DataField="StatesName"
|
||||
<f:RenderField Width="120px" ColumnID="StatesName" DataField="StatesName"
|
||||
FieldType="String" HeaderText="状态" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
@@ -115,7 +114,7 @@
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="编辑企业级检查" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" IsModal="true" OnClose="Window1_Close"
|
||||
Width="1000px" Height="660px">
|
||||
Width="1280px" Height="760px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
@@ -34,7 +34,8 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
CheckMainType = drpCheckMainType.SelectedValue,
|
||||
SearchText = this.txtSearch.Text.Trim(),
|
||||
CheckType = this.drpCheckType.SelectedValue,
|
||||
ProjectId = this.CurrUser.LoginProjectId
|
||||
ProjectId = this.CurrUser.LoginProjectId,
|
||||
CheckUnitId = this.CurrUser.UnitId
|
||||
};
|
||||
|
||||
int totalCount;
|
||||
@@ -112,7 +113,7 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
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))
|
||||
if (UnitHazardRegisterService.CanDeleteRegister(rowID) || (this.CurrUser.PersonId ==Const.hfnbdId || this.CurrUser.PersonId == Const.sysglyId))
|
||||
{
|
||||
BLL.UnitHazardRegisterItemService.DeleteItemsByRegisterId(rowID);
|
||||
BLL.UnitHazardRegisterService.DeleteUnitHazardRegisterById(rowID);
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<%@ Page Language="C#" CodeBehind="UnitHazardRegisterDetailIn.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Supervise.UnitHazardRegisterDetailIn" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>导入明细</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1" Text="审核"
|
||||
OnClick="btnAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" ValidateForms="SimpleForm1" Text="导入"
|
||||
OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" Text="下载模板" OnClick="btnDownLoad_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
||||
LabelWidth="150px">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="gvErrorInfo" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="导入质量隐患" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
|
||||
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10"
|
||||
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True">
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfPageIndex" Width="40px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblPageIndex" runat="server" Text='<%# gvErrorInfo.PageIndex * gvErrorInfo.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:BoundField DataField="Row" HeaderText="错误行号" Width="50px">
|
||||
</f:BoundField>
|
||||
<f:BoundField DataField="Column" HeaderText="错误列" Width="100px">
|
||||
</f:BoundField>
|
||||
<f:BoundField DataField="Reason" HeaderText="错误类型" MinWidth="220px">
|
||||
</f:BoundField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:HiddenField ID="hdFileName" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:HiddenField ID="hdCheckResult" runat="server">
|
||||
</f:HiddenField>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="lblBottom" runat="server" Text="说明:1 导入模板为.xls后缀的EXCEL文件,有背景色列为必填项。2 数据导入完成,成功后自动返回,如果有不成功数据页面弹出提示框,列表显示导入成功数据。">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,450 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.BaseInfo;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Services.Description;
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
public partial class UnitHazardRegisterDetailIn : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
|
||||
/// <summary>
|
||||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
|
||||
|
||||
/// <summary>
|
||||
/// 检查id
|
||||
/// </summary>
|
||||
public string UnitHazardRegisterId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["UnitHazardRegisterId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["UnitHazardRegisterId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Type"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Type"] = value;
|
||||
}
|
||||
}
|
||||
public static int Cols = 4;//列数
|
||||
|
||||
public static Dictionary<string, string> imgDic = new Dictionary<string, string>();
|
||||
|
||||
public static List<string> validLevelStrings = new List<string> { "一般", "较大", "重大" };
|
||||
public static List<string> validRegisterTypesStrings = new List<string>();
|
||||
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.Type = Request.Params["Type"];
|
||||
this.UnitHazardRegisterId = Request.Params["UnitHazardRegisterId"];
|
||||
|
||||
this.hdFileName.Text = string.Empty;
|
||||
if (errorInfos != null)
|
||||
{
|
||||
errorInfos.Clear();
|
||||
}
|
||||
if (this.Type == "0")
|
||||
{//安全类型
|
||||
validRegisterTypesStrings = (from x in Funs.DB.HSSE_Hazard_HazardRegisterTypes where x.HazardRegisterType == "1" orderby x.TypeCode select x.RegisterTypesName).ToList();
|
||||
}
|
||||
else
|
||||
{ //质量类型
|
||||
validRegisterTypesStrings = (from x in Funs.DB.Base_QualityQuestionType orderby x.SortIndex select x.QualityQuestionType).ToList();
|
||||
}
|
||||
//if (this.CurrUser.UserId == Const.AdminId)
|
||||
//{
|
||||
// this.btnFastImport.Hidden = false;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
#region 下载模板
|
||||
|
||||
/// <summary>
|
||||
/// 下载模板按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDownLoad_Click(object sender, EventArgs e)
|
||||
{
|
||||
//这里要注意了,如果传过来的没有记录
|
||||
PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty,
|
||||
MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"),
|
||||
PageManager1.GetCustomEventReference("Confirm_Cancel")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载导入模板
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
|
||||
{
|
||||
if (e.EventArgument == "Confirm_OK")
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string uploadfilepath = rootPath + Const.UnitHazardRegisterDetailTemplateUrl;
|
||||
string filePath = Const.UnitHazardRegisterDetailTemplateUrl;
|
||||
string fileName = Path.GetFileName(filePath);
|
||||
FileInfo info = new FileInfo(uploadfilepath);
|
||||
long fileSize = info.Length;
|
||||
Response.ClearContent();
|
||||
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
Response.ContentType = "excel/plain";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
Response.AddHeader("Content-Length", fileSize.ToString().Trim());
|
||||
Response.TransmitFile(uploadfilepath, 0, fileSize);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 审核
|
||||
/// <summary>
|
||||
/// 审核
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.fuAttachUrl.HasFile == false)
|
||||
{
|
||||
ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
|
||||
if (IsXls != ".xls" && IsXls != ".xlsx")
|
||||
{
|
||||
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (errorInfos != null)
|
||||
{
|
||||
errorInfos.Clear();
|
||||
}
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initFullPath = rootPath + initPath;
|
||||
if (!Directory.Exists(initFullPath))
|
||||
{
|
||||
Directory.CreateDirectory(initFullPath);
|
||||
}
|
||||
|
||||
this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
|
||||
string filePath = initFullPath + this.hdFileName.Text;
|
||||
this.fuAttachUrl.PostedFile.SaveAs(filePath);
|
||||
AuditExcelAndShowResult(filePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核Excel并展示校验结果
|
||||
/// </summary>
|
||||
private void AuditExcelAndShowResult(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
string msg = string.Empty;
|
||||
var dt = BLL.NPOIHelper.ExcelToDataSet(fileName, out msg, true);
|
||||
if (dt != null)
|
||||
{
|
||||
//string rootPath = Server.MapPath("~/");
|
||||
//var localPath = ConfigurationManager.AppSettings["localRoot"];
|
||||
//imgDic = NPOIHelper.ExtractDispimgImagesFromXml(rootPath + initPath + this.hdFileName.Text, localPath + "FileUpload/CheckSpecial");
|
||||
ValidateExcelData(dt.Tables[0], false);
|
||||
hdCheckResult.Text = "1";
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog("", exc);
|
||||
Response.Write(exc);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验Excel数据(仅校验)
|
||||
/// </summary>
|
||||
/// <param name="pds"></param>
|
||||
/// <param name="import">true:导入;false:审核</param>
|
||||
/// <returns></returns>
|
||||
private bool ValidateExcelData(DataTable pds, bool import)
|
||||
{
|
||||
int ic = pds.Columns.Count;
|
||||
if (ic < Cols)
|
||||
{
|
||||
ShowNotify($"导入Excel格式错误!Excel只有{ic}列", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
int ir = pds.Rows.Count;
|
||||
if (pds == null || ir <= 0)
|
||||
{
|
||||
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
var errors = new List<ErrorInfo>();
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
var (error, _) = ValidateRowAndBuildEntity(pds.Rows[i], (i + 2).ToString(), import);
|
||||
if (error.Any()) { errors.AddRange(error); }
|
||||
}
|
||||
errorInfos.Clear();
|
||||
errorInfos.AddRange(errors);
|
||||
this.gvErrorInfo.DataSource = errorInfos;
|
||||
this.gvErrorInfo.DataBind();
|
||||
if (errors.Count > 0)
|
||||
{
|
||||
ShowNotify("存在校验错误,请查看错误列表并修正后再次导入。", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 校验单行并生成实体(字段顺序与新模板一致)
|
||||
/// </summary>
|
||||
private (List<ErrorInfo> lstError, Model.Supervise_UnitHazardRegisterItem entity) ValidateRowAndBuildEntity(DataRow row, string displayRow, bool import)
|
||||
{
|
||||
List<ErrorInfo> lstError = new List<ErrorInfo>();
|
||||
// 新模板字段顺序
|
||||
string row0 = row[0]?.ToString().Trim(); // 问题描述
|
||||
string row1 = row[1]?.ToString().Trim(); // 问题类型
|
||||
string row2 = row[2]?.ToString().Trim(); // 风险级别
|
||||
string row3 = row[3]?.ToString().Trim(); // 整改要求
|
||||
//string row4 = row[4]?.ToString().Trim(); // 问题图片地址
|
||||
|
||||
string data0 = string.Empty;
|
||||
string data1 = string.Empty;
|
||||
string data2 = string.Empty;
|
||||
string data3 = string.Empty;
|
||||
string data4 = string.Empty;
|
||||
|
||||
// 校验并转换
|
||||
if (!string.IsNullOrEmpty(row0))
|
||||
{
|
||||
data0 = row0;
|
||||
}
|
||||
else
|
||||
{
|
||||
lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题描述", Reason = "不能为空" });
|
||||
}
|
||||
if (!string.IsNullOrEmpty(row1))
|
||||
{
|
||||
if (validRegisterTypesStrings.Any(x => x == row1))
|
||||
{
|
||||
data1 = row1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题类型", Reason = $"{(this.Type == "0" ? "安全" : "质量")}问题类型不存在[{row1}]" });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lstError.Add(new ErrorInfo { Row = displayRow, Column = "问题类型", Reason = "不能为空" });
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(row2))
|
||||
{
|
||||
lstError.Add(new ErrorInfo { Row = displayRow, Column = "风险级别", Reason = "不能为空" });
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(row2))
|
||||
{
|
||||
if (validLevelStrings.Any(x => x == row2))
|
||||
{
|
||||
data2 = row2;
|
||||
}
|
||||
else
|
||||
{
|
||||
lstError.Add(new ErrorInfo { Row = displayRow, Column = "风险级别", Reason = $"风险级别[{row2}]不存在" });
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(row3))
|
||||
{
|
||||
data3 = row3;
|
||||
}
|
||||
//if (import)
|
||||
//{图片待处理
|
||||
// try
|
||||
// {
|
||||
// urls = urls.Substring(urls.IndexOf('"') + 1, urls.LastIndexOf('"') - urls.IndexOf('"') - 1);
|
||||
// var sss = imgDic.ContainsKey(urls) ? imgDic[urls].Replace(Funs.RootPath, "") : "";
|
||||
// }
|
||||
// catch (Exception e) { }
|
||||
//}
|
||||
|
||||
if (lstError.Any())
|
||||
{
|
||||
return (lstError, null);
|
||||
}
|
||||
|
||||
// 其余字段可根据实际业务映射到实体
|
||||
var entity = new Model.Supervise_UnitHazardRegisterItem
|
||||
{
|
||||
UnitHazardRegisterItemId = SQLHelper.GetNewID(),
|
||||
UnitHazardRegisterId = this.UnitHazardRegisterId,
|
||||
ProblemDescription = data0,
|
||||
ProblemType = data1,
|
||||
RiskLevel = data2,
|
||||
RectifyRequirement = data3,
|
||||
CompleteStatus = 0,
|
||||
//CompletedDate = DateTime.Now,
|
||||
////SortIndex = 1,
|
||||
//RectificationMeasures = null,
|
||||
//IsUpdate = null
|
||||
};
|
||||
return (lstError, entity);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 导入
|
||||
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (hdCheckResult.Text == "1")
|
||||
{
|
||||
if (errorInfos.Count <= 0)
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
var localPath = ConfigurationManager.AppSettings["localRoot"];
|
||||
//imgDic = NPOIHelper.ExtractDispimgImagesFromXml(rootPath + initPath + this.hdFileName.Text, localPath + "FileUpload/CheckSpecial");
|
||||
ImportExcelToDatabase(rootPath + initPath + this.hdFileName.Text, true);
|
||||
|
||||
hdCheckResult.Text = string.Empty;
|
||||
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 导入Excel到数据库
|
||||
/// </summary>
|
||||
private void ImportExcelToDatabase(string fileName, bool import)
|
||||
{
|
||||
try
|
||||
{
|
||||
string msg = string.Empty;
|
||||
var dt = BLL.NPOIHelper.ExcelToDataSet(fileName, out msg, true);
|
||||
BLL.ErrLogInfo.WriteLog(msg);
|
||||
SaveExcelDataToDatabase(fileName, dt.Tables[0], import);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验并保存数据到数据库
|
||||
/// </summary>
|
||||
private bool SaveExcelDataToDatabase(string fileName, DataTable pds, bool import)
|
||||
{
|
||||
int ic = pds.Columns.Count;
|
||||
if (ic < Cols)
|
||||
{
|
||||
ShowNotify($"导入Excel格式错误!Excel只有{ic}列", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
int ir = pds.Rows.Count;
|
||||
if (pds == null || ir <= 0)
|
||||
{
|
||||
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
var errors = new List<ErrorInfo>();
|
||||
var toInsert = new List<Model.Supervise_UnitHazardRegisterItem>();
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
var (error, entity) = ValidateRowAndBuildEntity(pds.Rows[i], (i + 2).ToString(), import);
|
||||
if (error.Any())
|
||||
errors.AddRange(error);
|
||||
else
|
||||
toInsert.Add(entity);
|
||||
}
|
||||
if (errors.Count > 0)
|
||||
{
|
||||
errorInfos.Clear();
|
||||
errorInfos.AddRange(errors);
|
||||
this.gvErrorInfo.DataSource = errorInfos;
|
||||
this.gvErrorInfo.DataBind();
|
||||
ShowNotify("存在校验错误,请先审核并修正后再导入。", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (toInsert.Any())
|
||||
{
|
||||
Funs.DB.Supervise_UnitHazardRegisterItem.InsertAllOnSubmit(toInsert);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
ShowNotify($"成功导入 {toInsert.Count} 条记录。", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("导入 Hazard_HazardRegister_Unit 失败", ex);
|
||||
ShowNotify("导入失败:" + ex.Message, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // 导入
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
|
||||
|
||||
public partial class UnitHazardRegisterDetailIn
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// btnDownLoad 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDownLoad;
|
||||
|
||||
/// <summary>
|
||||
/// fuAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload fuAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// gvErrorInfo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid gvErrorInfo;
|
||||
|
||||
/// <summary>
|
||||
/// lblPageIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
|
||||
/// <summary>
|
||||
/// hdFileName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdFileName;
|
||||
|
||||
/// <summary>
|
||||
/// hdCheckResult 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdCheckResult;
|
||||
|
||||
/// <summary>
|
||||
/// lblBottom 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lblBottom;
|
||||
}
|
||||
}
|
||||
@@ -47,22 +47,24 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="ddlCheckUnitId" runat="server" EmptyText="请选择检查单位" OnSelectedIndexChanged="ddlCheckUnitId_SelectedIndexChanged"
|
||||
<f:DropDownList ID="ddlInspectionUnit" runat="server" EmptyText="请选择检查单位" OnSelectedIndexChanged="ddlInspectionUnit_SelectedIndexChanged"
|
||||
Label="检查单位" ShowRedStar="true" Required="true" AutoSelectFirstItem="true" AutoPostBack="true">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="ddlProjectId" runat="server" EmptyText="请选择项目" EnableEdit="true"
|
||||
Label="检查对象" ShowRedStar="true" AutoPostBack="true" OnSelectedIndexChanged="ddlProjectId_SelectedIndexChanged" Required="true">
|
||||
<f:DropDownList ID="ddlCheckUnitId" runat="server" EmptyText="请选择受检单位" OnSelectedIndexChanged="ddlCheckUnitId_SelectedIndexChanged"
|
||||
Label="受检单位" ShowRedStar="true" Required="true" AutoSelectFirstItem="true" AutoPostBack="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="ddlInsResponsibleUserId" runat="server" EmptyText="请选择受检责任人" ShowRedStar="true">
|
||||
<f:DropDownList ID="ddlProjectId" runat="server" EmptyText="请选择受检项目" EnableEdit="true" Label="检查项目" AutoPostBack="true" OnSelectedIndexChanged="ddlProjectId_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="ddlInsResponsibleUserId" runat="server" Label="受检责任人" EmptyText="请选择受检责任人" ShowRedStar="true">
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="txtCheckTeam" runat="server" Label="检查组/人" MaxLength="200" Width="400px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
@@ -81,6 +83,9 @@
|
||||
<f:Button ID="btnAdd" Icon="Add" runat="server" Text="新增问题" ValidateForms="SimpleForm1"
|
||||
OnClick="btnAdd_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" ToolTip="导入" Text="导入" Icon="ApplicationGet" runat="server"
|
||||
OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
@@ -161,6 +166,10 @@
|
||||
Target="Self" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="600px" Height="400px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="导入" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
CloseAction="HidePostBack" Width="720px" Height="560px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="上传附件" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="WindowAtt_Close" IsModal="true" Width="750px" Height="500px">
|
||||
</f:Window>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
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;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
@@ -42,13 +40,14 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
InitDropList();
|
||||
var unitModel = UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
|
||||
var thisUnitId = BLL.Const.UnitId_SEDIN;
|
||||
|
||||
this.UnitHazardRegisterId = Request.Params["UnitHazardRegisterId"];
|
||||
var register = BLL.UnitHazardRegisterService.GetUnitHazardRegisterById(this.UnitHazardRegisterId);
|
||||
|
||||
if (register != null)
|
||||
{
|
||||
// 编辑模式 - 加载数据
|
||||
{// 编辑模式 - 加载数据
|
||||
this.txtUnitHazardRegisterCode.Text = register.UnitHazardRegisterCode;
|
||||
if (register.CheckDate != null)
|
||||
{
|
||||
@@ -58,11 +57,23 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(register.CheckType))
|
||||
{
|
||||
BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(
|
||||
this.drpCheckType, register.CheckMainType, false);
|
||||
BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(this.drpCheckType, register.CheckMainType, false);
|
||||
this.drpCheckType.SelectedValue = register.CheckType;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(register.CheckUnitId))
|
||||
{
|
||||
this.ddlCheckUnitId.SelectedValue = register.CheckUnitId;
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(register.InspectionUnit))
|
||||
{
|
||||
this.ddlInspectionUnit.SelectedValue = register.InspectionUnit;
|
||||
if (register.InspectionUnit != thisUnitId)
|
||||
{
|
||||
this.ddlCheckUnitId.Readonly = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(register.ProjectId))
|
||||
{
|
||||
this.ddlProjectId.SelectedValue = register.ProjectId;
|
||||
@@ -73,71 +84,93 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
this.ddlInsResponsibleUserId.SelectedValue = register.InsResponsibleUserId;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(register.CheckUnitId))
|
||||
else
|
||||
{
|
||||
this.ddlCheckUnitId.SelectedValue = register.CheckUnitId;
|
||||
Person_PersonsService.InitIsOfficeUserUnitIdDropDownList(this.ddlInsResponsibleUserId, this.ddlCheckUnitId.SelectedValue, true);
|
||||
if (!string.IsNullOrWhiteSpace(register.InsResponsibleUserId))
|
||||
{
|
||||
this.ddlInsResponsibleUserId.SelectedValue = register.InsResponsibleUserId;
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
BindDetailGrid();
|
||||
|
||||
if (register.States> (int)UnitHazardRegisterService.StateInt.待提交)
|
||||
if (register.States > (int)UnitHazardRegisterService.StateInt.待提交)
|
||||
{
|
||||
btnImport.Hidden = true;
|
||||
btnAdd.Hidden = true;
|
||||
btnSave.Hidden = true;
|
||||
btnSubmit.Hidden = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 新增模式
|
||||
var unitModel = UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
|
||||
{// 新增模式
|
||||
if (unitModel?.IsBranch == true)
|
||||
{
|
||||
this.ddlInspectionUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
this.ddlCheckUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
}
|
||||
else
|
||||
{
|
||||
var thisUnit = BLL.CommonService.GetIsThisUnit();
|
||||
this.ddlCheckUnitId.SelectedValue = thisUnit.UnitId;
|
||||
this.ddlCheckUnitId.SelectedValue = thisUnitId;
|
||||
}
|
||||
BLL.Person_PersonsService.InitUserDropDownList(this.ddlInsResponsibleUserId, null, true, this.ddlCheckUnitId.SelectedValue);
|
||||
BLL.Person_PersonsService.InitIsOfficeUserUnitIdDropDownList(this.ddlInsResponsibleUserId, this.ddlCheckUnitId.SelectedValue, true);
|
||||
BLL.ProjectService.InitProjectDropDownList(this.ddlProjectId, this.ddlCheckUnitId.SelectedValue, true);//检查项目
|
||||
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');
|
||||
int newCount = UnitHazardRegisterService.GetCount(type) + 1;
|
||||
this.txtUnitHazardRegisterCode.Text = newCount.ToString().PadLeft(5, '0');
|
||||
}
|
||||
if (unitModel?.IsBranch == true)
|
||||
{
|
||||
this.ddlInspectionUnit.Readonly = true;
|
||||
this.ddlCheckUnitId.Readonly = true;
|
||||
}
|
||||
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindDetailGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.UnitHazardRegisterId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// 加载明细
|
||||
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 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")
|
||||
BLL.UnitService.InitBranchUnitDropDownList(this.ddlInspectionUnit, false);//检查单位
|
||||
BLL.UnitService.InitBranchUnitDropDownList(this.ddlCheckUnitId, false);//受检单位
|
||||
BLL.ProjectService.InitProjectDropDownList(this.ddlProjectId, ddlCheckUnitId.SelectedValue, true);//检查项目
|
||||
//BLL.UserService.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";
|
||||
@@ -148,9 +181,6 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
QualityQuestionTypeService.InitQualityQuestionType(drpProblemType, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
protected void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -187,16 +217,21 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
Alert.ShowInTop("请选择检查类别!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.ddlProjectId.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择检查对象!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.ddlCheckUnitId.SelectedValue == BLL.Const._Null)
|
||||
if (this.ddlInspectionUnit.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择检查单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.ddlCheckUnitId.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择受检单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//if (this.ddlProjectId.SelectedValue == BLL.Const._Null)
|
||||
//{
|
||||
// Alert.ShowInTop("请选择检查对象!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
//}
|
||||
SaveNew();
|
||||
SaveItem();
|
||||
|
||||
@@ -215,45 +250,85 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
Alert.ShowInTop("请选择检查类别!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.ddlProjectId.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择检查对象!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.ddlCheckUnitId.SelectedValue == BLL.Const._Null)
|
||||
if (this.ddlInspectionUnit.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择检查单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.ddlCheckUnitId.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择受检单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//if (this.ddlProjectId.SelectedValue == BLL.Const._Null)
|
||||
//{
|
||||
// Alert.ShowInTop("请选择检查对象!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
//}
|
||||
SaveNew(Const.BtnSubmit);
|
||||
SaveItem();
|
||||
|
||||
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
/// <summary>
|
||||
/// 检查单位下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlInspectionUnit_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.ddlProjectId.Items.Clear();
|
||||
this.ddlInsResponsibleUserId.Items.Clear();
|
||||
var inspectionUnit = this.ddlInspectionUnit.SelectedValue;
|
||||
this.ddlCheckUnitId.SelectedValue = inspectionUnit;
|
||||
BLL.ProjectService.InitProjectDropDownList(this.ddlProjectId, this.ddlCheckUnitId.SelectedValue, true);
|
||||
Person_PersonsService.InitIsOfficeUserUnitIdDropDownList(this.ddlInsResponsibleUserId, this.ddlCheckUnitId.SelectedValue, true);
|
||||
if (inspectionUnit == CommonService.GetIsThisUnit().UnitId)
|
||||
{
|
||||
this.ddlCheckUnitId.Readonly = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ddlCheckUnitId.Readonly = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 受检单位下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlCheckUnitId_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.ddlProjectId.Items.Clear();
|
||||
this.ddlInsResponsibleUserId.Items.Clear();
|
||||
BLL.ProjectService.InitProjectDropDownList(this.ddlProjectId,ddlCheckUnitId.SelectedValue, true);
|
||||
|
||||
BLL.ProjectService.InitProjectDropDownList(this.ddlProjectId, this.ddlCheckUnitId.SelectedValue, true);
|
||||
Person_PersonsService.InitIsOfficeUserUnitIdDropDownList(this.ddlInsResponsibleUserId, this.ddlCheckUnitId.SelectedValue, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 受检项目下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查大类下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpCheckMainType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(
|
||||
this.drpCheckType, this.drpCheckMainType.SelectedValue, false);
|
||||
BLL.SuperviseCheckTypeService.InitCheckTypeDropDownListByMainType(this.drpCheckType, this.drpCheckMainType.SelectedValue, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///设置LinkButtonField的点击客户端事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
@@ -264,7 +339,7 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
deleteField.OnClientClick = GetDeleteScript();
|
||||
var register = BLL.UnitHazardRegisterService.GetUnitHazardRegisterById(this.UnitHazardRegisterId);
|
||||
|
||||
if (register!=null&& register.States > (int)UnitHazardRegisterService.StateInt.待提交)
|
||||
if (register != null && register.States > (int)UnitHazardRegisterService.StateInt.待提交)
|
||||
{
|
||||
LinkButtonField lbUpload = Grid1.FindColumn(6) as LinkButtonField;
|
||||
LinkButtonField lbDelete = Grid1.FindColumn(7) as LinkButtonField;
|
||||
@@ -272,8 +347,6 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
lbUpload.Enabled = false;
|
||||
lbDelete.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
@@ -316,7 +389,7 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
}
|
||||
}
|
||||
|
||||
protected void SaveNew(string type="")
|
||||
protected void SaveNew(string type = "")
|
||||
{
|
||||
Supervise_UnitHazardRegister register = new Supervise_UnitHazardRegister
|
||||
{
|
||||
@@ -324,16 +397,20 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
CheckDate = Funs.GetNewDateTime(this.dpkCheckDate.Text.Trim()),
|
||||
CheckMainType = this.drpCheckMainType.SelectedValue,
|
||||
CheckType = this.drpCheckType.SelectedValue,
|
||||
ProjectId = this.ddlProjectId.SelectedValue,
|
||||
InspectionUnit = this.ddlInspectionUnit.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(this.ddlProjectId.SelectedValue) && this.ddlProjectId.SelectedValue != Const._Null)
|
||||
{
|
||||
register.ProjectId = this.ddlProjectId.SelectedValue;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(type))
|
||||
{
|
||||
|
||||
register.States = (int)UnitHazardRegisterService.StateInt.待整改;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(this.UnitHazardRegisterId))
|
||||
@@ -402,24 +479,52 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
#endregion Methods
|
||||
|
||||
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.UnitHazardRegisterId))
|
||||
{
|
||||
SaveNew();
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("UnitHazardRegisterDetailIn.aspx?Type={0}&UnitHazardRegisterId={1}", type, this.UnitHazardRegisterId, "导入 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindDetailGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 企业级检查明细视图类
|
||||
/// </summary>
|
||||
public class View_UnitHazardRegisterItem
|
||||
{
|
||||
#region Properties
|
||||
{
|
||||
#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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,15 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCheckType;
|
||||
|
||||
/// <summary>
|
||||
/// ddlInspectionUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlInspectionUnit;
|
||||
|
||||
/// <summary>
|
||||
/// ddlCheckUnitId 控件。
|
||||
/// </summary>
|
||||
@@ -149,6 +158,15 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAdd;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// txtProblemDescription 控件。
|
||||
/// </summary>
|
||||
@@ -275,6 +293,15 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<f:ListItem Text="重大" Value="重大" />
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpProblemStates" runat="server" Label="问题整改状态" AutoPostBack="true" EmptyText="-请选择-" AutoSelectFirstItem="false"
|
||||
OnSelectedIndexChanged="TextBox_TextChanged" LabelWidth="120px" LabelAlign="Right" Width="200px">
|
||||
OnSelectedIndexChanged="TextBox_TextChanged" LabelWidth="120px" LabelAlign="Right" Width="220px">
|
||||
<f:ListItem Text="待整改" Value="0" />
|
||||
<f:ListItem Text="已整改" Value="1" />
|
||||
</f:DropDownList>
|
||||
@@ -178,7 +178,7 @@
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="查看明细" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
|
||||
Width="900px" Height="580px">
|
||||
Width="1200px" Height="720px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="问题图片" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="750px"
|
||||
|
||||
@@ -15,7 +15,10 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
|
||||
|
||||
//if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
//{
|
||||
// Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
//}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
|
||||
// 绑定表格
|
||||
|
||||
@@ -18,24 +18,30 @@
|
||||
<Items>
|
||||
<f:TextBox ID="txtCheckType" runat="server" Label="检查类别" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtProblemType" runat="server" Label="问题类型" Readonly="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRiskLevel" runat="server" Label="风险级别" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtCheckDate" runat="server" Label="检查日期" Readonly="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtInspectionUnit" runat="server" Label="检查单位" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtCheckTeam" runat="server" Label="检查组/人" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtCheckUnitName" runat="server" Label="检查单位" Readonly="true">
|
||||
<%--<f:TextBox ID="txtCheckUnitName" runat="server" Label="受检单位" Readonly="true">
|
||||
</f:TextBox>--%>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtProblemType" runat="server" Label="问题类型" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtRiskLevel" runat="server" Label="风险级别" Readonly="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
|
||||
@@ -92,11 +92,12 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", register.CheckDate);
|
||||
}
|
||||
|
||||
this.txtInspectionUnit.Text = BLL.UnitService.GetUnitNameByUnitId(register.InspectionUnit);
|
||||
this.txtCheckTeam.Text = register.CheckTeam;
|
||||
this.txtCheckUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(register.CheckUnitId);
|
||||
//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.txtInsResponsibleUserName.Text = Person_PersonsService.GetUserNameByUserId(register.InsResponsibleUserId);
|
||||
|
||||
// 填充可编辑字段
|
||||
this.txtRectificationMeasures.Text = item.RectificationMeasures;
|
||||
|
||||
+27
-27
@@ -50,6 +50,33 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckType;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtInspectionUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtInspectionUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckTeam 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckTeam;
|
||||
|
||||
/// <summary>
|
||||
/// txtProblemType 控件。
|
||||
/// </summary>
|
||||
@@ -68,33 +95,6 @@ namespace FineUIPro.Web.ZHGL.Supervise
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRiskLevel;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckTeam 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckTeam;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckUnitName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckUnitName;
|
||||
|
||||
/// <summary>
|
||||
/// txtProblemDescription 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量巡检同步数据容器
|
||||
/// </summary>
|
||||
public class CheckControlSyncData
|
||||
{
|
||||
/// <summary>
|
||||
/// 公司社会统一信用代码
|
||||
/// </summary>
|
||||
public string CollCropCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目id
|
||||
/// </summary>
|
||||
public string ProjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分包单位程序访问地址
|
||||
/// </summary>
|
||||
public string UnitDomain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质量巡检数据列表
|
||||
/// </summary>
|
||||
public List<CheckControlSyncItem> Items { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 质量巡检数据项
|
||||
/// </summary>
|
||||
public class CheckControlSyncItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string CheckControlCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public string ProjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位工程ID
|
||||
/// </summary>
|
||||
public string UnitWorkId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位工程名称
|
||||
/// </summary>
|
||||
public string UnitWorkName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位ID
|
||||
/// </summary>
|
||||
public string UnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位名称
|
||||
/// </summary>
|
||||
public string UnitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查日期
|
||||
/// </summary>
|
||||
public DateTime? CheckDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查人ID
|
||||
/// </summary>
|
||||
public string CheckMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查人姓名
|
||||
/// </summary>
|
||||
public string CheckManName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查部位
|
||||
/// </summary>
|
||||
public string CheckSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据编号
|
||||
/// </summary>
|
||||
public string DocCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 专业代码
|
||||
/// </summary>
|
||||
public string CNProfessionalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 专业名称
|
||||
/// </summary>
|
||||
public string CNProfessionalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题类型ID
|
||||
/// </summary>
|
||||
public string QuestionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题类型名称
|
||||
/// </summary>
|
||||
public string QuestionTypeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题描述
|
||||
/// </summary>
|
||||
public string QuestionDef { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改意见
|
||||
/// </summary>
|
||||
public string RectifyOpinion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 限期整改日期
|
||||
/// </summary>
|
||||
public DateTime? LimitDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改前附件URL
|
||||
/// </summary>
|
||||
public string AttachUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理方式
|
||||
/// </summary>
|
||||
public string HandleWay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改日期
|
||||
/// </summary>
|
||||
public DateTime? RectifyDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 整改后附件URL
|
||||
/// </summary>
|
||||
public string ReAttachUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程状态(0-重新编制,1-总包编制,...,7-审批完成)
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否提交
|
||||
/// </summary>
|
||||
public bool? IsSubmit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交人ID
|
||||
/// </summary>
|
||||
public string SubmitMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交人姓名
|
||||
/// </summary>
|
||||
public string SubmitManName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否合格
|
||||
/// </summary>
|
||||
public bool? IsOK { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提出单位ID
|
||||
/// </summary>
|
||||
public string ProposeUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提出单位名称
|
||||
/// </summary>
|
||||
public string ProposeUnitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保存处理人
|
||||
/// </summary>
|
||||
public string SaveHandleMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据来源(1-同步数据)
|
||||
/// </summary>
|
||||
public string DataSource { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量会议同步数据容器
|
||||
/// </summary>
|
||||
public class CqmsMeetingSyncData
|
||||
{
|
||||
/// <summary>
|
||||
/// 分包单位社会统一信用码
|
||||
/// </summary>
|
||||
public string CollCropCode { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位Id
|
||||
/// </summary>
|
||||
public string UnitId { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位名称
|
||||
/// </summary>
|
||||
public string UnitName { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位简称
|
||||
/// </summary>
|
||||
public string ShortUnitName { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位域名
|
||||
/// </summary>
|
||||
public string UnitDomain { get; set; }
|
||||
/// <summary>
|
||||
/// 总包单位Id
|
||||
/// </summary>
|
||||
public string SubjectUnit { get; set; }
|
||||
/// <summary>
|
||||
/// 总包单位项目Id
|
||||
/// </summary>
|
||||
public string SubjectProject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质量会议数据列表
|
||||
/// </summary>
|
||||
public List<CqmsMeetingSyncItem> Items { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 质量会议数据项
|
||||
/// </summary>
|
||||
public class CqmsMeetingSyncItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string MeetingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会议编码
|
||||
/// </summary>
|
||||
public string MeetingCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会议名称
|
||||
/// </summary>
|
||||
public string MeetingName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public string ProjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位ID
|
||||
/// </summary>
|
||||
public string UnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位名称
|
||||
/// </summary>
|
||||
public string UnitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会议日期
|
||||
/// </summary>
|
||||
public DateTime? MeetingDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会议时长
|
||||
/// </summary>
|
||||
public decimal? MeetingHours { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会议地点
|
||||
/// </summary>
|
||||
public string MeetingPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主持人ID
|
||||
/// </summary>
|
||||
public string MeetingHostManId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主持人姓名
|
||||
/// </summary>
|
||||
public string MeetingHostMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 其他主持人
|
||||
/// </summary>
|
||||
public string MeetingHostManOther { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参会人数
|
||||
/// </summary>
|
||||
public int? AttentPersonNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参会人员(姓名列表,逗号分隔)
|
||||
/// </summary>
|
||||
public string AttentPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参会人员ID(ID列表,逗号分隔)
|
||||
/// </summary>
|
||||
public string AttentPersonIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会议内容(HTML编码)
|
||||
/// </summary>
|
||||
public string MeetingContents { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编制人ID
|
||||
/// </summary>
|
||||
public string CompileMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编制人姓名
|
||||
/// </summary>
|
||||
public string CompileManName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编制日期
|
||||
/// </summary>
|
||||
public DateTime? CompileDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(整数,2表示完成)
|
||||
/// </summary>
|
||||
public string States { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 数据来源(1-同步数据)
|
||||
///// </summary>
|
||||
//public string DataSource { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 内容附件
|
||||
/// </summary>
|
||||
public string AttachFileId { get; set; }
|
||||
public string ToKeyId { get; set; }
|
||||
public string AttachSource { get; set; }
|
||||
public string AttachUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 签到表
|
||||
/// </summary>
|
||||
public string AttachFileId1 { get; set; }
|
||||
public string ToKeyId1 { get; set; }
|
||||
public string AttachSource1 { get; set; }
|
||||
public string AttachUrl1 { get; set; }
|
||||
/// <summary>
|
||||
/// 会议过程
|
||||
/// </summary>
|
||||
public string AttachFileId2 { get; set; }
|
||||
public string ToKeyId2 { get; set; }
|
||||
public string AttachSource2 { get; set; }
|
||||
public string AttachUrl2 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,17 @@ namespace Model
|
||||
public string Risk_Level { get; set; } // 风险等级
|
||||
public string ControlId { get; set; } // 控制措施Id
|
||||
public string DataSource { get; set; } // 数据来源
|
||||
/// <summary>
|
||||
/// 内容附件
|
||||
/// </summary>
|
||||
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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量计量器具同步数据容器
|
||||
/// </summary>
|
||||
public class InspectionMachineSyncData
|
||||
{
|
||||
/// <summary>
|
||||
/// 分包单位社会统一信用码
|
||||
/// </summary>
|
||||
public string CollCropCode { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位Id
|
||||
/// </summary>
|
||||
public string UnitId { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位名称
|
||||
/// </summary>
|
||||
public string UnitName { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位简称
|
||||
/// </summary>
|
||||
public string ShortUnitName { get; set; }
|
||||
/// <summary>
|
||||
/// 分包单位域名
|
||||
/// </summary>
|
||||
public string UnitDomain { get; set; }
|
||||
/// <summary>
|
||||
/// 总包单位Id
|
||||
/// </summary>
|
||||
public string SubjectUnit { get; set; }
|
||||
/// <summary>
|
||||
/// 总包单位项目Id
|
||||
/// </summary>
|
||||
public string SubjectProject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质量计量器具数据列表
|
||||
/// </summary>
|
||||
public List<InspectionMachineSyncItem> Items { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 质量计量器具数据项
|
||||
/// </summary>
|
||||
public class InspectionMachineSyncItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string InspectionMachineId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计量器具编码
|
||||
/// </summary>
|
||||
public string InspectionMachineCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计量器具名称
|
||||
/// </summary>
|
||||
public string InspectionMachineName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格型号
|
||||
/// </summary>
|
||||
public string SpecificationModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public int? UnitsCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类别
|
||||
/// </summary>
|
||||
public string SType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检验类型
|
||||
/// </summary>
|
||||
public string InspectionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检验日期
|
||||
/// </summary>
|
||||
public DateTime? InspectionDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下次检验日期
|
||||
/// </summary>
|
||||
public DateTime? NextTestDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检验周期
|
||||
/// </summary>
|
||||
public string TestCycle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否校验合格
|
||||
/// </summary>
|
||||
public bool? IsCheckOK { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否在校验期内
|
||||
/// </summary>
|
||||
public bool? IsVerification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审批状态
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否在场
|
||||
/// </summary>
|
||||
public bool? IsOnSite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 离场日期
|
||||
/// </summary>
|
||||
public DateTime? LeaveDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位ID
|
||||
/// </summary>
|
||||
public string UnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位名称
|
||||
/// </summary>
|
||||
public string UnitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 专业ID
|
||||
/// </summary>
|
||||
public string CNProfessionalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 专业名称
|
||||
/// </summary>
|
||||
public string CNProfessionalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编制人ID
|
||||
/// </summary>
|
||||
public string CompileMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编制人姓名
|
||||
/// </summary>
|
||||
public string CompileManName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编制日期
|
||||
/// </summary>
|
||||
public DateTime? CompileDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附件URL
|
||||
/// </summary>
|
||||
public string AttachUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public string ProjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据来源(1-同步数据)
|
||||
/// </summary>
|
||||
public string DataSource { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
public string AttachFileId { get; set; }
|
||||
public string ToKeyId { get; set; }
|
||||
public string AttachSource { get; set; }
|
||||
//public string AttachUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -91,10 +91,29 @@ namespace Model
|
||||
public bool? IsSafetyMonitoring { get; set; }
|
||||
public string ProvinceCode { get; set; }
|
||||
public bool? IsCardNoOK { get; set; }
|
||||
public bool? IsTrain { get; set; }
|
||||
/// <summary>
|
||||
/// 内容附件
|
||||
/// </summary>
|
||||
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; }
|
||||
public string AttachFileId3 { get; set; }
|
||||
public string ToKeyId3 { get; set; }
|
||||
public string AttachSource3 { get; set; }
|
||||
public string AttachUrl3 { get; set; }
|
||||
public string AttachFileId4 { get; set; }
|
||||
public string ToKeyId4 { get; set; }
|
||||
public string AttachSource4 { get; set; }
|
||||
public string AttachUrl4 { get; set; }
|
||||
public string AttachFileId5 { get; set; }
|
||||
public string ToKeyId5 { get; set; }
|
||||
public string AttachSource5 { get; set; }
|
||||
public string AttachUrl5 { get; set; }
|
||||
public string WorkPostName { get; set; }
|
||||
public string PostType { get; set; }
|
||||
|
||||
+1252
-72
File diff suppressed because it is too large
Load Diff
@@ -79,9 +79,12 @@
|
||||
<Compile Include="APIItem\ChemicalReportItem.cs" />
|
||||
<Compile Include="APIItem\CNCEC_MasterData_PcEp.cs" />
|
||||
<Compile Include="APIItem\CQMS\TrainPlanItem.cs" />
|
||||
<Compile Include="APIItem\DataShare\CheckControlSyncData.cs" />
|
||||
<Compile Include="APIItem\DataShare\CheckSpecialSyncData.cs" />
|
||||
<Compile Include="APIItem\DataShare\ClassMeetingData.cs" />
|
||||
<Compile Include="APIItem\DataShare\CqmsMeetingSyncData.cs" />
|
||||
<Compile Include="APIItem\DataShare\HazardRegisterSyncData.cs" />
|
||||
<Compile Include="APIItem\DataShare\InspectionMachineSyncData.cs" />
|
||||
<Compile Include="APIItem\DataShare\LicenseManagerData.cs" />
|
||||
<Compile Include="APIItem\DataShare\PersonSyncData.cs" />
|
||||
<Compile Include="APIItem\DCGLCheckRectifyItem.cs" />
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
/// </summary>
|
||||
public string ProjectName { get; set; }
|
||||
/// <summary>
|
||||
/// 项目简称
|
||||
/// </summary>
|
||||
public string ShortName { get; set; }
|
||||
/// <summary>
|
||||
/// 单位id
|
||||
/// </summary>
|
||||
public string UnitId { get; set; }
|
||||
|
||||
@@ -57,6 +57,9 @@ namespace Model
|
||||
public int? GeneralNotClosedNum { get; set; }
|
||||
public string GeneralRate { get; set; }
|
||||
public int? GeneralRiskNum { get; set; }
|
||||
public int? LargerClosedNum { get; set; }
|
||||
public int? LargerNotClosedNum { get; set; }
|
||||
public string LargerRate { get; set; }
|
||||
public int? HeadOfficeFullTimeNum { get; set; }
|
||||
public int? HeadOfficeInspectorGeneralNum { get; set; }
|
||||
public int? HighRiskNum { get; set; }
|
||||
@@ -109,13 +112,19 @@ namespace Model
|
||||
public int? SuperConstructionNum { get; set; }
|
||||
public int? SuperFinishedNum { get; set; }
|
||||
public int? SuperTrainPersonNum { get; set; }
|
||||
public int? OperativesNum { get; set; }
|
||||
public int? SuperOperativesNum { get; set; }
|
||||
public int? AwaitApprovalNum { get; set; }
|
||||
public int? PendingApprovalNum { get; set; }
|
||||
public int? CompletedApprovalNum { get; set; }
|
||||
public int? SuperAwaitApprovalNum { get; set; }
|
||||
public int? SuperPendingApprovalNum { get; set; }
|
||||
public int? SuperCompletedApprovalNum { get; set; }
|
||||
public decimal? TotalEnergyConsumption { get; set; }
|
||||
public int? TotalWorkingHour { get; set; }
|
||||
public int? TrainPersonNum { get; set; }
|
||||
public string UnitId { get; set; }
|
||||
public int? UseEquipmentNum { get; set; }
|
||||
public int? OperativesNum { get; set; }
|
||||
public int? SuperOperativesNum { get; set; }
|
||||
public List<HSSEDataHiddenDangerDetailItem> HiddenDangerDetailItems { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -50,5 +50,29 @@
|
||||
/// 超危大工程作业人员数
|
||||
/// </summary>
|
||||
public int SuperOperativesNum { get; set; }
|
||||
/// <summary>
|
||||
/// 危大工程待审核个数
|
||||
/// </summary>
|
||||
public int AwaitApprovalNum { get; set; }
|
||||
/// <summary>
|
||||
/// 危大工程审核中个数
|
||||
/// </summary>
|
||||
public int PendingApprovalNum { get; set; }
|
||||
/// <summary>
|
||||
/// 危大工程已完成个数
|
||||
/// </summary>
|
||||
public int CompletedApprovalNum { get; set; }
|
||||
/// <summary>
|
||||
/// 超危大工程待审核个数
|
||||
/// </summary>
|
||||
public int SuperAwaitApprovalNum { get; set; }
|
||||
/// <summary>
|
||||
/// 超危大工程审核中个数
|
||||
/// </summary>
|
||||
public int SuperPendingApprovalNum { get; set; }
|
||||
/// <summary>
|
||||
/// 超危大工程已完成个数
|
||||
/// </summary>
|
||||
public int SuperCompletedApprovalNum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -26,5 +26,10 @@ namespace Model
|
||||
/// 项目ID(权限过滤)
|
||||
/// </summary>
|
||||
public string ProjectId { get; set; }
|
||||
/// <summary>
|
||||
/// 受检单位Id
|
||||
/// </summary>
|
||||
public string CheckUnitId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,9 +48,18 @@ namespace Model
|
||||
public string CheckObjectText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查单位名称
|
||||
/// 受检单位名称
|
||||
/// </summary>
|
||||
public string CheckUnitName { get; set; }
|
||||
/// <summary>
|
||||
/// 受检单位Id
|
||||
/// </summary>
|
||||
public string CheckUnitId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查单位名称
|
||||
/// </summary>
|
||||
public string InspectionUnitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检查组/人
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量巡检同步控制器
|
||||
/// </summary>
|
||||
public class CheckControlSyncController : ApiController
|
||||
{
|
||||
#region 拉取质量巡检数据
|
||||
|
||||
/// <summary>
|
||||
/// 拉取质量巡检数据
|
||||
/// </summary>
|
||||
/// <returns>响应数据</returns>
|
||||
[HttpGet]
|
||||
public Model.ResponeData getCheckControlLists()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.code = 1;
|
||||
responeData.data = APICheckControlSyncService.getCheckControlLists();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取质量巡检数据根据项目id和单位统一社会代码
|
||||
|
||||
/// <summary>
|
||||
/// 获取质量巡检数据根据项目id和单位统一社会代码
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="collCropCode">单位社会统一信用代码</param>
|
||||
/// <returns>响应数据</returns>
|
||||
[HttpGet]
|
||||
public Model.ResponeData getCheckControlListByProjectIdAndCollCropCode(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);
|
||||
if (unit != null)
|
||||
{
|
||||
responeData.data = APICheckControlSyncService.GetCheckControlListsByProjectIdUnitIdPage(projectId, unit.UnitId);
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "未找到对应单位";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 推送质量巡检数据
|
||||
|
||||
/// <summary>
|
||||
/// 推送质量巡检数据
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="dataId">数据ID(可选)</param>
|
||||
/// <returns>响应数据</returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData pushCheckControlLists(string projectId, string dataId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var returndata = APICheckControlSyncService.pushCheckControlLists(projectId, dataId);
|
||||
responeData.code = returndata.code;
|
||||
responeData.message = returndata.message;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 接收保存质量巡检数据
|
||||
|
||||
/// <summary>
|
||||
/// 接收保存质量巡检数据
|
||||
/// </summary>
|
||||
/// <param name="newItem">质量巡检同步数据</param>
|
||||
/// <returns>响应数据</returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData SaveCheckControlSyncData([FromBody] Model.CheckControlSyncData newItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.code = 1;
|
||||
responeData.message = APICheckControlSyncService.SaveCheckControlSyncData(newItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -133,5 +133,60 @@ namespace WebAPI.Controllers
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据id删除专项检查明细
|
||||
|
||||
/// <summary>
|
||||
/// 根据id删除专项检查明细
|
||||
/// </summary>
|
||||
/// <param name="newItem">专项检查</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public Model.ResponeData deleteCheckSpecialDetailById(string checkSpecialDetailId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
Check_CheckSpecialDetailService.DeleteCheckSpecialDetailById(checkSpecialDetailId);
|
||||
responeData.message = "删除成功!";
|
||||
responeData.code = 1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 保存专项检查 Check_CheckSpecial
|
||||
|
||||
/// <summary>
|
||||
/// 保存专项检查 Check_CheckSpecial
|
||||
/// </summary>
|
||||
/// <param name="newItem">专项检查</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public Model.ResponeData SaveCheckSpecialNew([FromBody] Model.CheckSpecialItem newItem)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.message = APICheckSpecialService.SaveCheckSpecialNew(newItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,12 +77,16 @@ namespace WebAPI.Controllers
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getPersonByProjectIdUnitId(string projectId, string unitId, int pageIndex)
|
||||
public Model.ResponeData getPersonByProjectIdUnitId(string projectId, string unitId, int pageIndex, string personName = "")
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getDataList = APIPersonService.getPersonByProjectIdUnitId(projectId, unitId);
|
||||
if (!string.IsNullOrEmpty(personName))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.PersonName.Contains(personName)).ToList();
|
||||
}
|
||||
int pageCount = getDataList.Count;
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
|
||||
@@ -88,7 +88,11 @@ namespace WebAPI.Filter
|
||||
,"HazardRegisterSync*getHazardRegisterListByProjectIdAndCollCropCode"
|
||||
,"HazardRegisterSync*SaveHazardRegisterSyncData"
|
||||
,"PersonSync*getPersonListByProjectIdAndCollCropCode"
|
||||
,"PersonSync*SavePersonSyncData"
|
||||
,"PersonSync*SavePersonSyncData",
|
||||
"InspectionMachineSync*SaveInspectionMachineSyncData",
|
||||
"CqmsMeetingSync*SaveCqmsMeetingSyncData",
|
||||
"MeetingSync*ReceiveSaveProjectClassMeetingData",
|
||||
"LicenseSync*ReceiveSaveProjectLicenseManagerData"
|
||||
,"CheckSpecialSync*getCheckSpecialListByProjectIdAndCollCropCode"
|
||||
,"CheckSpecialSync*SaveCheckSpecialSyncData" };
|
||||
|
||||
|
||||
@@ -177,6 +177,7 @@
|
||||
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
|
||||
<Compile Include="Controllers\BaseInfoController.cs" />
|
||||
<Compile Include="Controllers\CommonController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CheckControlSyncController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSMeetingController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSModelsController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSPersonManageController.cs" />
|
||||
|
||||
Reference in New Issue
Block a user