Merge branch 'master' of http://47.104.102.122:3000/lpf/SGGL_SeDin_New
This commit is contained in:
@@ -0,0 +1,313 @@
|
||||
alter table Project_ProjectUnit add CQMS_OrganizationPic nvarchar(100)
|
||||
GO
|
||||
alter table Project_ProjectUnit add QRCodeAttachUrl nvarchar(200) null
|
||||
GO
|
||||
|
||||
|
||||
alter table dbo.HSSEData_HSSE add HseTechnicalNum int
|
||||
go
|
||||
alter table dbo.HSSEData_HSSE add ArgumentNum int
|
||||
go
|
||||
alter table dbo.HSSEData_HSSE add SuperArgumentNum int
|
||||
go
|
||||
alter table dbo.HSSEData_HSSE add ProjectDrillPersonNum int
|
||||
go
|
||||
alter table dbo.HSSEData_HSSE add CompanyDrillPersonNum int
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'安全技术交底数', 'SCHEMA', 'dbo', 'TABLE', 'HSSEData_HSSE',
|
||||
'COLUMN', 'HseTechnicalNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'危大工程论证个数', 'SCHEMA', 'dbo', 'TABLE', 'HSSEData_HSSE',
|
||||
'COLUMN', 'ArgumentNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'超危大工程论证个数', 'SCHEMA', 'dbo', 'TABLE', 'HSSEData_HSSE',
|
||||
'COLUMN', 'SuperArgumentNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'项目级参演人数', 'SCHEMA', 'dbo', 'TABLE', 'HSSEData_HSSE',
|
||||
'COLUMN', 'ProjectDrillPersonNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'公司级级参演人数', 'SCHEMA', 'dbo', 'TABLE', 'HSSEData_HSSE',
|
||||
'COLUMN', 'CompanyDrillPersonNum'
|
||||
go
|
||||
alter table dbo.Project_HSSEData_HSSE add HseTechnicalNum int
|
||||
go
|
||||
alter table dbo.Project_HSSEData_HSSE add ArgumentNum int
|
||||
go
|
||||
alter table dbo.Project_HSSEData_HSSE add SuperArgumentNum int
|
||||
go
|
||||
alter table dbo.Project_HSSEData_HSSE add ProjectDrillPersonNum int
|
||||
go
|
||||
alter table dbo.Project_HSSEData_HSSE add CompanyDrillPersonNum int
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'安全技术交底数', 'SCHEMA', 'dbo', 'TABLE', 'Project_HSSEData_HSSE',
|
||||
'COLUMN', 'HseTechnicalNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'危大工程论证个数', 'SCHEMA', 'dbo', 'TABLE', 'Project_HSSEData_HSSE',
|
||||
'COLUMN', 'ArgumentNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'超危大工程论证个数', 'SCHEMA', 'dbo', 'TABLE', 'Project_HSSEData_HSSE',
|
||||
'COLUMN', 'SuperArgumentNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'项目级参演人数', 'SCHEMA', 'dbo', 'TABLE', 'Project_HSSEData_HSSE',
|
||||
'COLUMN', 'ProjectDrillPersonNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'公司级级参演人数', 'SCHEMA', 'dbo', 'TABLE', 'Project_HSSEData_HSSE',
|
||||
'COLUMN', 'CompanyDrillPersonNum'
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
alter table dbo.CQMSData_CQMS
|
||||
add EquipmentInspectionNum int,
|
||||
EquipmentInspectionQualifiedNum int,
|
||||
MachineInspectionNum int,
|
||||
MachineInspectionQualifiedNum int,
|
||||
PersonInspectionNum int,
|
||||
PersonInspectionQualifiedNum int,
|
||||
MaterialInspectionNum int,
|
||||
MaterialInspectionQualifiedNum int,
|
||||
ConstructSolutionNum int,
|
||||
ConstructSolutionProjectApproveNum int,
|
||||
ConstructSolutionUnitApproveNum int,
|
||||
SpecialEquipmentQualityAssuranceSystemNum int,
|
||||
DesignDetailsNum int,
|
||||
UnitProjectAcceptNum int,
|
||||
UnitProjectAcceptOKNum int,
|
||||
SubProjectAcceptNum int,
|
||||
SubProjectAcceptOKNum int,
|
||||
SubdivisionalWorksAcceptNum int,
|
||||
SubdivisionalWorksAcceptOKNum int
|
||||
go
|
||||
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'设备报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'EquipmentInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'设备报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'EquipmentInspectionQualifiedNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'机具报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'MachineInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'机具报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'MachineInspectionQualifiedNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'人员报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'PersonInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'人员报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'PersonInspectionQualifiedNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'材料报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'MaterialInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'材料报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'MaterialInspectionQualifiedNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'施工方案数量', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'ConstructSolutionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'施工方案项目审批数量', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'CQMSData_CQMS', 'COLUMN', 'ConstructSolutionProjectApproveNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'施工方案企业审批数量', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'CQMSData_CQMS', 'COLUMN', 'ConstructSolutionUnitApproveNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'特种设备质保体系', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'CQMSData_CQMS', 'COLUMN', 'SpecialEquipmentQualityAssuranceSystemNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'图纸会审/设计交底', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'CQMSData_CQMS', 'COLUMN', 'DesignDetailsNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'分项工程验收数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'SubdivisionalWorksAcceptNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'分部工程合格数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'SubProjectAcceptOKNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'分部工程验收数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'SubProjectAcceptNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'单位工程合格数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'UnitProjectAcceptOKNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'单位工程验收数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'UnitProjectAcceptNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'分项工程合格数', 'SCHEMA', 'dbo', 'TABLE', 'CQMSData_CQMS',
|
||||
'COLUMN', 'SubdivisionalWorksAcceptOKNum'
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
alter table dbo.Project_CQMSData_CQMS
|
||||
add EquipmentInspectionNum int,
|
||||
EquipmentInspectionQualifiedNum int,
|
||||
MachineInspectionNum int,
|
||||
MachineInspectionQualifiedNum int,
|
||||
PersonInspectionNum int,
|
||||
PersonInspectionQualifiedNum int,
|
||||
MaterialInspectionNum int,
|
||||
MaterialInspectionQualifiedNum int,
|
||||
ConstructSolutionNum int,
|
||||
ConstructSolutionProjectApproveNum int,
|
||||
ConstructSolutionUnitApproveNum int,
|
||||
SpecialEquipmentQualityAssuranceSystemNum int,
|
||||
DesignDetailsNum int,
|
||||
UnitProjectAcceptNum int,
|
||||
UnitProjectAcceptOKNum int,
|
||||
SubProjectAcceptNum int,
|
||||
SubProjectAcceptOKNum int,
|
||||
SubdivisionalWorksAcceptNum int,
|
||||
SubdivisionalWorksAcceptOKNum int
|
||||
go
|
||||
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'设备报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'EquipmentInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'设备报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'EquipmentInspectionQualifiedNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'机具报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'MachineInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'机具报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'MachineInspectionQualifiedNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'人员报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'PersonInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'人员报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'PersonInspectionQualifiedNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'材料报验-报检数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'MaterialInspectionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'材料报验-报检合格数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'MaterialInspectionQualifiedNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'施工方案数量', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'ConstructSolutionNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'施工方案项目审批数量', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'Project_CQMSData_CQMS', 'COLUMN', 'ConstructSolutionProjectApproveNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'施工方案企业审批数量', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'Project_CQMSData_CQMS', 'COLUMN', 'ConstructSolutionUnitApproveNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'特种设备质保体系', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'Project_CQMSData_CQMS', 'COLUMN', 'SpecialEquipmentQualityAssuranceSystemNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'图纸会审/设计交底', 'SCHEMA', 'dbo', 'TABLE',
|
||||
'Project_CQMSData_CQMS', 'COLUMN', 'DesignDetailsNum'
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', N'分项工程验收数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'SubdivisionalWorksAcceptNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'分部工程合格数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'SubProjectAcceptOKNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'分部工程验收数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'SubProjectAcceptNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'单位工程合格数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'UnitProjectAcceptOKNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'单位工程验收数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'UnitProjectAcceptNum'
|
||||
go
|
||||
exec sp_addextendedproperty 'MS_Description', N'分项工程合格数', 'SCHEMA', 'dbo', 'TABLE', 'Project_CQMSData_CQMS',
|
||||
'COLUMN', 'SubdivisionalWorksAcceptOKNum'
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER VIEW [dbo].[View_DCGL_CheckRectifyListFromSUB]
|
||||
AS
|
||||
/*子公司隐患整改单集团视图*/
|
||||
SELECT CheckRectifyItem.CheckRectifyItemId
|
||||
,CheckRectifyItem.CheckRectifyId
|
||||
,CheckRectifyItem.NoticeItemId
|
||||
,CheckRectifyItem.ConfirmMan
|
||||
,CheckRectifyItem.ConfirmManName
|
||||
,CheckRectifyItem.ConfirmDate
|
||||
,CheckRectifyItem.OrderEndDate
|
||||
,CheckRectifyItem.OrderEndPerson
|
||||
,CheckRectifyItem.RealEndDate
|
||||
,CheckRectifyItem.Verification
|
||||
,CheckRectify.CheckRectifyCode
|
||||
,CheckRectify.ProjectId
|
||||
,CheckRectify.UnitId
|
||||
,CheckRectify.CheckDate
|
||||
,CheckRectify.IssueMan
|
||||
,CheckRectify.IssueDate
|
||||
,CheckRectify.HandleState
|
||||
,NoticeItem.ProblemTypes AS ProblemTypes
|
||||
,NoticeItem.SortIndex AS SortIndex
|
||||
,NoticeItem.Situation AS Situation
|
||||
,'' AS WorkType
|
||||
,'' AS DangerPoint
|
||||
,'隐患(问题)描述:'+NoticeItem.Describe+';依据标准:'+NoticeItem.Standards+';建议:'+NoticeItem.Advice AS RiskExists
|
||||
,'' AS IsProject
|
||||
,'' AS CheckMan
|
||||
,'' AS SubjectUnitMan
|
||||
--,Table5Item.SortIndex
|
||||
--,Table5Item.WorkType
|
||||
--,Table5Item.DangerPoint
|
||||
--,Table5Item.RiskExists
|
||||
--,Table5Item.IsProject
|
||||
--,Table5Item.CheckMan
|
||||
--,Table5Item.SubjectUnitMan
|
||||
,AttachFile.AttachFileId
|
||||
,AttachFile.ToKeyId
|
||||
,AttachFile.AttachSource
|
||||
,AttachFile.AttachUrl
|
||||
,AttachFile2.AttachFileId AS AttachFileId2
|
||||
,AttachFile2.ToKeyId AS ToKeyId2
|
||||
,AttachFile2.AttachSource AS AttachSource2
|
||||
,AttachFile2.AttachUrl AS AttachUrl2
|
||||
FROM dbo.DCGL_Check_CheckRectifyItem AS CheckRectifyItem
|
||||
LEFT JOIN dbo.DCGL_Check_CheckRectify AS CheckRectify ON CheckRectifyItem.CheckRectifyid=CheckRectify.CheckRectifyId
|
||||
--LEFT JOIN dbo.Check_CheckInfo_Table5Item as Table5Item on CheckRectifyItem.Table5ItemId=Table5Item.ID
|
||||
LEFT JOIN DCGL_Check_CheckInfo_TableNoticeItem AS NoticeItem ON CheckRectifyItem.NoticeItemId=NoticeItem.ID
|
||||
LEFT JOIN dbo.AttachFile AS AttachFile on AttachFile.ToKeyId =CheckRectifyItem.NoticeItemId
|
||||
LEFT JOIN dbo.AttachFile AS AttachFile2 on AttachFile2.ToKeyId =CheckRectifyItem.CheckRectifyItemId
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
|
||||
ALTER TABLE [dbo].[HJGL_ProductionSchedulingPlan] DROP CONSTRAINT [FK_HJGL_ProductionSchedulingPlan_HJGL_Pipeline]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[HJGL_ProductionSchedulingPlan] WITH CHECK ADD CONSTRAINT [FK_HJGL_ProductionSchedulingPlan_WBS_UnitWork] FOREIGN KEY([PipelineId])
|
||||
REFERENCES [dbo].[WBS_UnitWork] ([UnitWorkId])
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[HJGL_ProductionSchedulingPlan] CHECK CONSTRAINT [FK_HJGL_ProductionSchedulingPlan_WBS_UnitWork]
|
||||
GO
|
||||
|
||||
alter table HJGL_ProductionSchedulingPlan add CompletedCount int
|
||||
alter table HJGL_ProductionSchedulingPlan add CompletedRate decimal(18,2)
|
||||
alter table HJGL_ProductionSchedulingPlan add TotalCompletedRate decimal(18,2)
|
||||
go
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'已完成量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'CompletedCount'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'已完成百分比' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'CompletedRate'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'已完成百分比汇总' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'TotalCompletedRate'
|
||||
GO
|
||||
|
||||
drop view View_HJGL_ProductionSchedulingPlanStatistics
|
||||
go
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[Sp_ProductionSchedulingPlanStatistics]
|
||||
@projectId nvarchar(50)=null,
|
||||
@unitWorkId nvarchar(50)=null,
|
||||
@flowingSection nvarchar(50)=null,
|
||||
@caliber nvarchar(50)=null
|
||||
AS
|
||||
/************排产计划统计**********/
|
||||
SELECT distinct unitWork.UnitWorkId,
|
||||
unitWork.UnitWorkCode,
|
||||
unitWork.UnitWorkName,
|
||||
unitWork.ProjectId,
|
||||
pipeline.FlowingSection,
|
||||
(case p.SteelType when '1' then '碳钢' when '2' then '不锈钢' when '3' then '铬钼钢' when '4' then '低合金钢' when '5' then '镍合金钢' when '6' then '钛合金钢' when '7' then '其他' end) as Material,
|
||||
'<'+ @caliber as Caliber,
|
||||
isnull(weldJoint.Dia,0) as Dia,
|
||||
isnull(maxDia.maxTotalDia+weldJoint.Dia,0) as totalDia,
|
||||
isnull(cTotal.cTotalCount,0) as cTotalCount,
|
||||
(case when isnull(total.totalCount,0)>0 then
|
||||
isnull(cTotal.cTotalCount,0) / isnull(cast(total.totalCount as decimal(18,2)),0)*100.0 else 0 end) as rate,
|
||||
(case when isnull(ScTotal.ScTotalCount,0)>0 then
|
||||
isnull(Stotal.StotalCount,0)/isnull(cast(ScTotal.ScTotalCount as decimal(18,2)),0)*100.0 else 0 end)as Srate
|
||||
FROM WBS_UnitWork AS unitWork
|
||||
LEFT JOIN (select FlowingSection,UnitWorkId from HJGL_Pipeline where PipeArea='1') as pipeline on pipeline.UnitWorkId = unitWork.UnitWorkId
|
||||
--材质
|
||||
LEFT JOIN (select distinct Base_Material.SteelType,UnitWorkId from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口') as p on p.UnitWorkId = unitWork.UnitWorkId
|
||||
--达因
|
||||
LEFT JOIN (select sum(Dia) as Dia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as weldJoint on weldJoint.UnitWorkId =unitWork.UnitWorkId
|
||||
and weldJoint.FlowingSection = pipeline.FlowingSection
|
||||
--大于口径的达因
|
||||
LEFT JOIN (select sum(Dia) as maxTotalDia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as maxDia on maxDia.UnitWorkId =unitWork.UnitWorkId
|
||||
and maxDia.FlowingSection = pipeline.FlowingSection
|
||||
--总焊口数
|
||||
LEFT JOIN (select count(*) as totalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as total on total.UnitWorkId =unitWork.UnitWorkId
|
||||
and total.FlowingSection = pipeline.FlowingSection
|
||||
--完成焊口数
|
||||
LEFT JOIN (select count(*) as cTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber
|
||||
and HJGL_WeldJoint.WeldingDailyId is not null
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as cTotal on cTotal.UnitWorkId =unitWork.UnitWorkId
|
||||
and cTotal.FlowingSection = pipeline.FlowingSection
|
||||
--汇总总焊口
|
||||
LEFT JOIN (select count(*) as StotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as Stotal on Stotal.UnitWorkId =unitWork.UnitWorkId
|
||||
and total.FlowingSection = pipeline.FlowingSection
|
||||
--完成焊口数
|
||||
LEFT JOIN (select count(*) as ScTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and HJGL_WeldJoint.WeldingDailyId is not null
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as ScTotal on ScTotal.UnitWorkId =unitWork.UnitWorkId
|
||||
and cTotal.FlowingSection = pipeline.FlowingSection
|
||||
where (unitWork.ProjectId=@projectId or @projectId is null)
|
||||
and (unitWork.UnitWorkId=@unitWorkId or @unitWorkId is null)
|
||||
and (pipeline.FlowingSection=@flowingSection or @flowingSection is null)
|
||||
union
|
||||
|
||||
SELECT distinct unitWork.UnitWorkId,
|
||||
unitWork.UnitWorkCode,
|
||||
unitWork.UnitWorkName,
|
||||
unitWork.ProjectId,
|
||||
pipeline.FlowingSection,
|
||||
(case p.SteelType when '1' then '碳钢' when '2' then '不锈钢' when '3' then '铬钼钢' when '4' then '低合金钢' when '5' then '镍合金钢' when '6' then '钛合金钢' when '7' then '其他' end) as Material,
|
||||
'≥'+@caliber as Caliber,
|
||||
isnull(weldJoint.Dia,0) as Dia,
|
||||
isnull(weldJoint.Dia+minDia.minTotalDia,0) as TotalDia,
|
||||
isnull(cTotal.cTotalCount,0) as cTotalCount,
|
||||
(case when isnull(total.totalCount,0)>0 then
|
||||
isnull(cTotal.cTotalCount,0) / isnull(cast(total.totalCount as decimal(18,2)),0)*100.0 else 0 end) as rate,
|
||||
(case when isnull(ScTotal.ScTotalCount,0)>0 then
|
||||
isnull(Stotal.StotalCount,0)/isnull(cast(ScTotal.ScTotalCount as decimal(18,2)),0)*100.0 else 0 end)as Srate
|
||||
FROM WBS_UnitWork AS unitWork
|
||||
LEFT JOIN (select FlowingSection,UnitWorkId from HJGL_Pipeline where PipeArea='1') as pipeline on pipeline.UnitWorkId = unitWork.UnitWorkId
|
||||
|
||||
LEFT JOIN (select distinct Base_Material.SteelType,UnitWorkId from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口') as p on p.UnitWorkId = unitWork.UnitWorkId
|
||||
|
||||
LEFT JOIN (select sum(Dia) as Dia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as weldJoint on weldJoint.UnitWorkId =unitWork.UnitWorkId
|
||||
and weldJoint.FlowingSection = pipeline.FlowingSection
|
||||
--小于口径的达因
|
||||
LEFT JOIN (select sum(Dia) as minTotalDia,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)<@caliber
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as minDia on minDia.UnitWorkId =unitWork.UnitWorkId
|
||||
and minDia.FlowingSection = pipeline.FlowingSection
|
||||
|
||||
--总焊口数
|
||||
LEFT JOIN (select count(*) as totalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as total on total.UnitWorkId =unitWork.UnitWorkId
|
||||
and total.FlowingSection = pipeline.FlowingSection
|
||||
--完成焊口数
|
||||
LEFT JOIN (select count(*) as cTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
left join Base_Material on Base_Material.MaterialId = HJGL_WeldJoint.Material1Id
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and cast(SUBSTRING(HJGL_WeldJoint.DNDia,CHARINDEX('N',HJGL_WeldJoint.DNDia)+1,len(HJGL_WeldJoint.DNDia)-charindex('N',HJGL_WeldJoint.DNDia)) as int)>=@caliber
|
||||
and HJGL_WeldJoint.WeldingDailyId is not null
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection,Base_Material.SteelType,HJGL_WeldJoint.DNDia) as cTotal on cTotal.UnitWorkId =unitWork.UnitWorkId
|
||||
and cTotal.FlowingSection = pipeline.FlowingSection
|
||||
|
||||
--汇总总焊口
|
||||
LEFT JOIN (select count(*) as StotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as Stotal on Stotal.UnitWorkId =unitWork.UnitWorkId
|
||||
and total.FlowingSection = pipeline.FlowingSection
|
||||
--完成焊口数
|
||||
LEFT JOIN (select count(*) as ScTotalCount,HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection from HJGL_WeldJoint
|
||||
left join HJGL_Pipeline on HJGL_Pipeline.PipelineId = HJGL_WeldJoint.PipelineId
|
||||
where HJGL_Pipeline.PipeArea='1' and HJGL_WeldJoint.JointAttribute='预制口'
|
||||
and HJGL_WeldJoint.WeldingDailyId is not null
|
||||
group by HJGL_Pipeline.UnitWorkId,HJGL_Pipeline.FlowingSection) as ScTotal on ScTotal.UnitWorkId =unitWork.UnitWorkId
|
||||
and cTotal.FlowingSection = pipeline.FlowingSection
|
||||
where (unitWork.ProjectId=@projectId or @projectId is null)
|
||||
and (unitWork.UnitWorkId=@unitWorkId or @unitWorkId is null)
|
||||
and (pipeline.FlowingSection=@flowingSection or @flowingSection is null)
|
||||
GO
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
CREATE VIEW View_TestPackage_PipelineList
|
||||
as
|
||||
/*********ÊÔѹ°üÃ÷ϸ**********/
|
||||
select l.PT_PipeId,
|
||||
l.PTP_ID,
|
||||
l.PipelineId,
|
||||
l.TestPressure,
|
||||
t.ProjectId,
|
||||
t.TestPackageNo,
|
||||
t.TestPackageName,
|
||||
t.Remark,
|
||||
t.UnitWorkId,
|
||||
t.Tabler,
|
||||
t.TableDate,
|
||||
p.PipelineCode,
|
||||
uw.UnitWorkCode,
|
||||
uw.UnitWorkName,
|
||||
uw.UnitId,
|
||||
u.UnitCode,
|
||||
u.UnitName
|
||||
from PTP_PipelineList l
|
||||
left join PTP_TestPackage as t on t.PTP_ID=l.PTP_ID
|
||||
left join HJGL_Pipeline p on p.PipelineId = l.PipelineId
|
||||
left join WBS_UnitWork uw on uw.UnitWorkId = t.UnitWorkId
|
||||
left join Base_Unit u on u.UnitId =uw.UnitId
|
||||
go
|
||||
@@ -3504,6 +3504,11 @@ namespace BLL
|
||||
/// 施工作业风险导出模板
|
||||
/// </summary>
|
||||
public const string ConstructionRiskOutTemplateUrl = "File\\Excel\\DataOut\\每周施工作业风险动态管控表.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 试压包导入模板
|
||||
/// </summary>
|
||||
public const string TestPackageTemplateUrl = "File\\Excel\\DataIn\\试压包导入模版.xlsx";
|
||||
#endregion
|
||||
|
||||
#region 初始化上传路径
|
||||
@@ -4806,7 +4811,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string HJGL_ProductionSchedulingPlanPath = "File\\Excel\\DataOut\\排产计划导出模板.xlsx";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 试压包导入文件路径
|
||||
/// </summary>
|
||||
public static string TestPackageDataImportPath = "FileUpload\\TestPackageDataImport\\";
|
||||
#region 焊接报表
|
||||
/// <summary>
|
||||
/// 管道焊接工作记录
|
||||
|
||||
@@ -24,16 +24,16 @@ namespace BLL
|
||||
}
|
||||
|
||||
|
||||
public static Model.HJGL_ProductionSchedulingPlan GetProductionSchedulingPlan(string loginProjectId, string flowingSection, string unitWorkName, string material, string caliber)
|
||||
public static Model.HJGL_ProductionSchedulingPlan GetProductionSchedulingPlan(string loginProjectId, string flowingSection, string unitWorkId, string material, string caliber)
|
||||
{
|
||||
return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProjectId == loginProjectId && e.FlowNum == flowingSection && e.MainItemName == unitWorkName && e.Caliber == caliber);
|
||||
return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProjectId == loginProjectId && e.FlowNum == flowingSection && e.PipelineId == unitWorkId && e.Caliber == caliber);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加排产计划
|
||||
/// </summary>
|
||||
/// <param name="plan"></param>
|
||||
public static void AddProductionSchedulingPlan(Model.HJGL_ProductionSchedulingPlan plan)
|
||||
/// <summary>
|
||||
/// 增加排产计划
|
||||
/// </summary>
|
||||
/// <param name="plan"></param>
|
||||
public static void AddProductionSchedulingPlan(Model.HJGL_ProductionSchedulingPlan plan)
|
||||
{
|
||||
SGGLDB db = Funs.DB;
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
@@ -52,6 +52,9 @@ namespace BLL
|
||||
newPlan.PlanEndDate = plan.PlanEndDate;
|
||||
newPlan.Days = plan.Days;
|
||||
newPlan.AvgDailyWorkload = plan.Days;
|
||||
newPlan.CompletedCount = plan.CompletedCount;
|
||||
newPlan.CompletedRate = plan.CompletedRate;
|
||||
newPlan.TotalCompletedRate = plan.TotalCompletedRate;
|
||||
db.HJGL_ProductionSchedulingPlan.InsertOnSubmit(newPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -79,6 +82,9 @@ namespace BLL
|
||||
newPlan.PlanEndDate = plan.PlanEndDate;
|
||||
newPlan.Days = plan.Days;
|
||||
newPlan.AvgDailyWorkload = plan.AvgDailyWorkload;
|
||||
newPlan.CompletedCount = plan.CompletedCount;
|
||||
newPlan.CompletedRate = plan.CompletedRate;
|
||||
newPlan.TotalCompletedRate = plan.TotalCompletedRate;
|
||||
try
|
||||
{
|
||||
db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -405,5 +406,54 @@ namespace BLL
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据试压包号、单位工程获取试压包信息
|
||||
/// </summary>
|
||||
/// <param name="testPackageNo"></param>
|
||||
/// <param name="unitWorkId"></param>
|
||||
/// <returns></returns>
|
||||
public static PTP_TestPackage GetTestPackageByNo(string testPackageNo, string unitWorkId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.PTP_TestPackage q = null;
|
||||
q = Funs.DB.PTP_TestPackage.FirstOrDefault(x => x.TestPackageNo == testPackageNo && x.UnitWorkId == unitWorkId);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
public static List<Model.PTP_TestPackage> GetTestPackageByUnitWordId(string unitworkId)
|
||||
{
|
||||
var q = Funs.DB.PTP_TestPackage.Where(e => e.UnitWorkId == unitworkId).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
public static void DeletePipelineListByUnitWorkId(string unitworkId)
|
||||
{
|
||||
var oldPipeline = GetTestPackageByUnitWordId(unitworkId);
|
||||
if (oldPipeline != null)
|
||||
{
|
||||
foreach (var pipeline in oldPipeline)
|
||||
{
|
||||
DeletePipelineListByPTP_ID(pipeline.PTP_ID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位工程删除相关试压包
|
||||
/// </summary>
|
||||
/// <param name="unitworkId"></param>
|
||||
public static void DeleteTestPackageByUnitworkId(string unitworkId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var pipeline = db.PTP_TestPackage.Where(e => e.UnitWorkId == unitworkId);
|
||||
if (pipeline != null)
|
||||
{
|
||||
db.PTP_TestPackage.DeleteAllOnSubmit(pipeline);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,12 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.FlowingSection == flowingSection);
|
||||
}
|
||||
|
||||
public static Model.HJGL_Pipeline GetPipelineByUnitWorkId(string unitWorkId)
|
||||
{
|
||||
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.UnitWorkId == unitWorkId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线id获取管线状态
|
||||
/// </summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
using FineUIPro;
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
@@ -6,13 +6,16 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Model;
|
||||
using System.Net.PeerToPeer;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class HJGLData_HJGLService
|
||||
{
|
||||
public static SGGLDB db = Funs.DB;
|
||||
public static List<string> BeUnderConstructionList = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList();
|
||||
|
||||
#region 获取列表
|
||||
|
||||
@@ -49,22 +52,22 @@ namespace BLL
|
||||
if (count == 0) return null;
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.WelderNum,
|
||||
x.TotalDineNum,
|
||||
x.CompleteDineNum,
|
||||
x.TotalFilmNum,
|
||||
x.OKFilmNum,
|
||||
x.State,
|
||||
x.CreateDate,
|
||||
x.CreateMan
|
||||
};
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.WelderNum,
|
||||
x.TotalDineNum,
|
||||
x.CompleteDineNum,
|
||||
x.TotalFilmNum,
|
||||
x.OKFilmNum,
|
||||
x.State,
|
||||
x.CreateDate,
|
||||
x.CreateMan
|
||||
};
|
||||
}
|
||||
|
||||
#endregion 获取列表
|
||||
@@ -155,23 +158,27 @@ namespace BLL
|
||||
return data;
|
||||
}
|
||||
|
||||
public static HJGLData GetTodayHJGLData_HJGL()
|
||||
public static async Task<HJGLData> GetTodayHJGLData_HJGLAsync()
|
||||
{
|
||||
var data = new HJGLData();
|
||||
if (CommonService.GetIsThisUnit().CollCropCode== "91410200170644116B")
|
||||
if (CommonService.GetIsThisUnit().CollCropCode == "91410200170644116B")
|
||||
{
|
||||
return GetELECLTodayHJGLData_HJGL();
|
||||
return GetELECLTodayHJGLData_HJGL();
|
||||
}
|
||||
if (CommonService.GetIsThisUnit().CollCropCode == "914200001775697881")
|
||||
{
|
||||
return GetCNCEC_16TodayHJGLData_HJGL();
|
||||
|
||||
}
|
||||
var q = GetTodayData();
|
||||
/* var q = GetTodayData();
|
||||
if (q != null && q.State == Const.CNCEC_State_S)
|
||||
data = StatisticalData();
|
||||
else
|
||||
data = StatisticalData();
|
||||
data = StatisticalData();*/
|
||||
|
||||
var modelTask = StatisticalDataAsync();
|
||||
var model = await modelTask;
|
||||
data = model;
|
||||
return data;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -185,10 +192,10 @@ namespace BLL
|
||||
string token = Const.sysglyId;
|
||||
string response = Funs.RequestPost(baseurl, token, "");
|
||||
var json = JsonConvert.DeserializeObject(response) as JObject;
|
||||
if (json != null && json["code"]?.ToString()=="1")
|
||||
if (json != null && json["code"]?.ToString() == "1")
|
||||
{
|
||||
var str = json["data"]?.ToString();
|
||||
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
|
||||
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
|
||||
}
|
||||
return data;
|
||||
|
||||
@@ -212,7 +219,7 @@ namespace BLL
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, e.ToString());
|
||||
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, e.ToString(), "Request|Post");
|
||||
|
||||
}
|
||||
|
||||
@@ -223,14 +230,14 @@ namespace BLL
|
||||
var str = json["data"]?.ToString();
|
||||
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
|
||||
}
|
||||
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, response);
|
||||
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, response, "Request|Post");
|
||||
return data;
|
||||
}
|
||||
public static HJGLData_HJGL GetTodayData()
|
||||
{
|
||||
var q = (from x in Funs.DB.HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).FirstOrDefault();
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
public static HJGLData_HJGL GetSubUnitHjglDataByDate(string Unitid, DateTime? reportdate)
|
||||
@@ -244,7 +251,7 @@ namespace BLL
|
||||
var baseUnit = UnitService.GetUnitByUnitId(Unitid);
|
||||
var ProjectData = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate == reportdate && projectlist.Select(e => e.ProjectId).Contains(x.ProjectId)
|
||||
select x).ToList();
|
||||
select x).ToList();
|
||||
result = new HJGLData_HJGL
|
||||
{
|
||||
UnitId = Unitid,
|
||||
@@ -275,8 +282,8 @@ namespace BLL
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.HJGLData_HJGL
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
|
||||
select x).ToList();
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0) result = true;
|
||||
return result;
|
||||
}
|
||||
@@ -289,8 +296,8 @@ namespace BLL
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).ToList();
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).ToList();
|
||||
if (q.Count > 0) result = true;
|
||||
return result;
|
||||
}
|
||||
@@ -304,18 +311,31 @@ namespace BLL
|
||||
return responeData;
|
||||
}
|
||||
|
||||
public static HJGLData StatisticalData()
|
||||
public static async Task<HJGLData> StatisticalDataAsync()
|
||||
{
|
||||
var data = new HJGLData();
|
||||
var thisUnitId = string.Empty;
|
||||
var thisUnit = CommonService.GetIsThisUnit();
|
||||
if (thisUnit != null) thisUnitId = thisUnit.UnitId;
|
||||
var baseUnit = UnitService.GetUnitByUnitId(thisUnitId);
|
||||
var ProjectData = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).ToList();
|
||||
Project_HJGLData_HJGLService.StatisticalAllProjectData();
|
||||
Project_HJGLData_DefectService.StatisticalAllProjectData();
|
||||
// 并行执行异步方法
|
||||
var welderNumTask = HJGLData_HJGLService.GetWelderNumAsync(); //获取焊工总数
|
||||
var dineInfoListTask = HJGLData_HJGLService.GetDineInfoAsync(); //获达因数信息
|
||||
var chCheckItemListTask = HJGLData_HJGLService.GetCHCheckItemAsync(); //获取焊接检查信息
|
||||
|
||||
// 等待所有异步方法执行完成
|
||||
await Task.WhenAll(
|
||||
welderNumTask,
|
||||
dineInfoListTask,
|
||||
chCheckItemListTask
|
||||
);
|
||||
|
||||
// 统一获取异步方法的返回值
|
||||
var welderNum = await welderNumTask;
|
||||
var dineInfoList = await dineInfoListTask;
|
||||
var chCheckItemList = await chCheckItemListTask;
|
||||
|
||||
|
||||
var table = new HJGLData_HJGL
|
||||
{
|
||||
@@ -323,14 +343,69 @@ namespace BLL
|
||||
CollCropCode = baseUnit.CollCropCode,
|
||||
UnitName = baseUnit.UnitName,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
WelderNum = ProjectData.Sum(x => x.WelderNum),
|
||||
TotalDineNum = ProjectData.Sum(x => x.TotalDineNum),
|
||||
CompleteDineNum = ProjectData.Sum(x => x.CompleteDineNum),
|
||||
TotalFilmNum = ProjectData.Sum(x => x.TotalFilmNum),
|
||||
OKFilmNum = ProjectData.Sum(x => x.OKFilmNum),
|
||||
WelderNum = welderNum.Count(),
|
||||
TotalDineNum = Convert.ToInt32(dineInfoList.Sum(x => x.Size)),
|
||||
CompleteDineNum = Convert.ToInt32(dineInfoList.Sum(x => x.DoneDin)),
|
||||
TotalFilmNum = Convert.ToInt32(chCheckItemList.Sum(x => x.CHT_TotalFilm)),
|
||||
OKFilmNum = Convert.ToInt32(chCheckItemList.Sum(x => x.CHT_PassFilm)),
|
||||
CreateMan = Const.sysglyId,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
|
||||
Project_HJGLData_HJGLService.DeleteProject_HJGLData_HJGLByDate(DateTime.Now.Date);
|
||||
// 预先对 dineInfoList 和 chCheckItemList 按 ProjectId 进行分组
|
||||
var dineInfoDict = dineInfoList
|
||||
.Where(x => BeUnderConstructionList.Contains(x.ProjectId))
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(g => g.Key, g => new
|
||||
{
|
||||
TotalDineNum = g.Sum(x => x.Size),
|
||||
CompleteDineNum = g.Sum(x => x.DoneDin)
|
||||
});
|
||||
|
||||
var chCheckItemDict = chCheckItemList
|
||||
.Where(x => BeUnderConstructionList.Contains(x.ProjectId))
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(g => g.Key, g => new
|
||||
{
|
||||
TotalFilmNum = g.Sum(x => x.CHT_TotalFilm),
|
||||
OKFilmNum = g.Sum(x => x.CHT_PassFilm)
|
||||
});
|
||||
|
||||
foreach (var projectid in BeUnderConstructionList)
|
||||
{
|
||||
// 获取焊工数量
|
||||
int welderCount = welderNum.Count(x => x.ProjectId == projectid);
|
||||
|
||||
// 获取达因信息
|
||||
var dineInfo = dineInfoDict.TryGetValue(projectid, out var dineData)
|
||||
? dineData
|
||||
: new { TotalDineNum = (decimal ?)0, CompleteDineNum = (decimal?)0 };
|
||||
|
||||
// 获取拍片信息
|
||||
var chCheckItem = chCheckItemDict.TryGetValue(projectid, out var checkData)
|
||||
? checkData
|
||||
: new { TotalFilmNum = (int?)0, OKFilmNum = (int?)0 };
|
||||
|
||||
var projectCqmsData = new Project_HJGLData_HJGL()
|
||||
{
|
||||
Id = SQLHelper.GetNewID(),
|
||||
ProjectId = projectid,
|
||||
UnitId = thisUnitId,
|
||||
CollCropCode = baseUnit.CollCropCode,
|
||||
UnitName = baseUnit.UnitName,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
WelderNum = welderCount,
|
||||
TotalDineNum = Convert.ToInt32 (dineInfo.TotalDineNum),
|
||||
CompleteDineNum = Convert.ToInt32(dineInfo.CompleteDineNum),
|
||||
TotalFilmNum = chCheckItem.TotalFilmNum,
|
||||
OKFilmNum = chCheckItem.OKFilmNum,
|
||||
};
|
||||
|
||||
Project_HJGLData_HJGLService.AddProject_HJGLData_HJGL(projectCqmsData);
|
||||
}
|
||||
|
||||
|
||||
if (IsReportByToday())
|
||||
{
|
||||
table.Id = GetTodayData().Id;
|
||||
@@ -388,5 +463,83 @@ namespace BLL
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取焊工总数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<WelderOutput> GetWelderNum()
|
||||
{
|
||||
var result = (from x in Funs.DB.SitePerson_Person
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && x.WorkPostId == Const.WorkPost_Welder && x.States == "1"
|
||||
select new Model.WelderOutput()
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
UnitId = x.UnitId,
|
||||
WEDCode = x.CardNo,
|
||||
WEDName = x.PersonName
|
||||
//UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取焊工总数(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<WelderOutput>> GetWelderNumAsync()
|
||||
{
|
||||
return await Task.Run(GetWelderNum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取总达因数和完成达因数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<WeldDineOutput> GetDineInfo()
|
||||
{
|
||||
var result = (from x in Funs.DB.HJGL_WeldJoint
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
group x by x.ProjectId into g
|
||||
select new Model.WeldDineOutput()
|
||||
{
|
||||
ProjectId = g.Key,
|
||||
Size = g.Sum(x => x.Size),
|
||||
DoneDin = g.Sum(x => x.Dia)
|
||||
});
|
||||
return result;
|
||||
}
|
||||
public static async Task<IEnumerable<WeldDineOutput>> GetDineInfoAsync()
|
||||
{
|
||||
return await Task.Run(GetDineInfo);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取焊接检查信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<CHCheckItemOutput> GetCHCheckItem()
|
||||
{
|
||||
var result = (from x in Funs.DB.HJGL_Batch_NDEItem
|
||||
join y in Funs.DB.HJGL_Batch_NDE on x.NDEID equals y.NDEID
|
||||
where BeUnderConstructionList.Contains(y.ProjectId)
|
||||
select new Model.CHCheckItemOutput()
|
||||
{
|
||||
Id = x.NDEItemID,
|
||||
ProjectId = y.ProjectId,
|
||||
UnitId = y.UnitId,
|
||||
CHT_TotalFilm = x.TotalFilm,
|
||||
CHT_PassFilm = x.PassFilm
|
||||
//UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取焊接检查信息(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<CHCheckItemOutput>> GetCHCheckItemAsync()
|
||||
{
|
||||
return await Task.Run(GetCHCheckItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ namespace BLL
|
||||
SafeTrainNum = newtable.SafeTrainNum,
|
||||
SpecialTrainNum = newtable.SpecialTrainNum,
|
||||
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
||||
HseTechnicalNum = newtable.HseTechnicalNum,
|
||||
EnvironmentalTrainNum = newtable.EnvironmentalTrainNum,
|
||||
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
||||
@@ -75,10 +76,12 @@ namespace BLL
|
||||
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
|
||||
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
|
||||
CompanyDrillNum = newtable.CompanyDrillNum,
|
||||
CompanyDrillPersonNum = newtable.CompanyDrillPersonNum,
|
||||
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
|
||||
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
|
||||
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
|
||||
ProjectDrillNum = newtable.ProjectDrillNum,
|
||||
ProjectDrillPersonNum = newtable.ProjectDrillPersonNum,
|
||||
CostExtract = newtable.CostExtract,
|
||||
CostUse = newtable.CostUse,
|
||||
UseEquipmentNum = newtable.UseEquipmentNum,
|
||||
@@ -97,10 +100,12 @@ namespace BLL
|
||||
TrainPersonNum = newtable.TrainPersonNum,
|
||||
ConstructionNum = newtable.ConstructionNum,
|
||||
FinishedNum = newtable.FinishedNum,
|
||||
ArgumentNum = newtable.ArgumentNum,
|
||||
SuperCompletedNum = newtable.SuperCompletedNum,
|
||||
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
|
||||
SuperConstructionNum = newtable.SuperConstructionNum,
|
||||
SuperFinishedNum = newtable.SuperFinishedNum,
|
||||
SuperArgumentNum = newtable.SuperArgumentNum,
|
||||
State = newtable.State,
|
||||
CreateDate = newtable.CreateDate,
|
||||
CreateMan = newtable.CreateMan
|
||||
@@ -108,6 +113,7 @@ namespace BLL
|
||||
db.HSSEData_HSSE.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteHSSEData_HSSEById(string id)
|
||||
@@ -148,6 +154,7 @@ namespace BLL
|
||||
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
||||
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
||||
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
||||
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
||||
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
||||
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
||||
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
||||
@@ -158,6 +165,7 @@ namespace BLL
|
||||
item.CostUse = dataHsse.CostUse;
|
||||
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
||||
item.FinishedNum = dataHsse.FinishedNum;
|
||||
item.ArgumentNum = dataHsse.ArgumentNum;
|
||||
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
||||
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
||||
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
||||
@@ -183,6 +191,7 @@ namespace BLL
|
||||
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
||||
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
||||
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
||||
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
||||
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
||||
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
||||
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
||||
@@ -203,6 +212,7 @@ namespace BLL
|
||||
item.ShutdownNum = dataHsse.ShutdownNum;
|
||||
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
||||
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
||||
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
||||
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
||||
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
||||
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
||||
@@ -210,6 +220,7 @@ namespace BLL
|
||||
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
||||
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
||||
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
||||
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
||||
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
||||
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
||||
item.TrainPersonNum = dataHsse.TrainPersonNum;
|
||||
@@ -234,6 +245,7 @@ namespace BLL
|
||||
var hsseDataItems = new List<HsseDataItem> { item };
|
||||
data.HSSEDataItems = hsseDataItems;
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
public static HSSEData GetItemByHSSEData_HSSE(HSSEData_HSSE dataHsse,
|
||||
@@ -253,6 +265,7 @@ namespace BLL
|
||||
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
||||
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
||||
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
||||
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
||||
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
||||
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
||||
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
||||
@@ -263,6 +276,7 @@ namespace BLL
|
||||
item.CostUse = dataHsse.CostUse;
|
||||
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
||||
item.FinishedNum = dataHsse.FinishedNum;
|
||||
item.ArgumentNum = dataHsse.ArgumentNum;
|
||||
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
||||
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
||||
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
||||
@@ -288,6 +302,7 @@ namespace BLL
|
||||
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
||||
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
||||
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
||||
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
||||
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
||||
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
||||
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
||||
@@ -308,12 +323,14 @@ namespace BLL
|
||||
item.ShutdownNum = dataHsse.ShutdownNum;
|
||||
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
||||
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
||||
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
||||
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
||||
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
||||
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
||||
item.SuperCompletedNum = dataHsse.SuperCompletedNum;
|
||||
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
||||
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
||||
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
||||
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
||||
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
||||
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
||||
@@ -338,6 +355,7 @@ namespace BLL
|
||||
var hsseDataItems = new List<HsseDataItem> { item };
|
||||
data.HSSEDataItems = hsseDataItems;
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
public static async Task<HSSEData> GetTodayHSSEData_HSSE()
|
||||
@@ -633,6 +651,7 @@ namespace BLL
|
||||
var safeTrainTask = HSSEData_HSSEService.GetSafeTrainAsync();
|
||||
var specialTrainTask = HSSEData_HSSEService.GetSpecialTrainAsync();
|
||||
var specialOperationTrainTask = HSSEData_HSSEService.GetSpecialOperationTrainAsync();
|
||||
var hseTechnicalNumTask = HSSEData_HSSEService.GetHseTechnicalNumAsync();
|
||||
var headOfficeInspectorGeneralTask = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralAsync();
|
||||
var headOfficeFullTimeTask = HSSEData_HSSEService.GetHeadOfficeFullTimeAsync();
|
||||
var branchInspectorGeneralTask = HSSEData_HSSEService.GetBranchInspectorGeneralAsync();
|
||||
@@ -690,7 +709,7 @@ namespace BLL
|
||||
safeWorkingHourTask,
|
||||
safeTrainTask,
|
||||
specialTrainTask,
|
||||
specialOperationTrainTask,
|
||||
specialOperationTrainTask, hseTechnicalNumTask,
|
||||
headOfficeInspectorGeneralTask,
|
||||
headOfficeFullTimeTask,
|
||||
branchInspectorGeneralTask,
|
||||
@@ -751,6 +770,7 @@ namespace BLL
|
||||
var safeTrainList = await safeTrainTask;
|
||||
var specialTrainList = await specialTrainTask;
|
||||
var specialOperationTrainList = await specialOperationTrainTask;
|
||||
var hseTechnicalNum = await hseTechnicalNumTask;
|
||||
var headOfficeInspectorGeneralList = await headOfficeInspectorGeneralTask;
|
||||
var headOfficeFullTimeList = await headOfficeFullTimeTask;
|
||||
var branchInspectorGeneralList = await branchInspectorGeneralTask;
|
||||
@@ -812,6 +832,7 @@ namespace BLL
|
||||
SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum),
|
||||
HseTechnicalNum = hseTechnicalNum,
|
||||
EnvironmentalTrainNum = 0,
|
||||
TotalEnergyConsumption = totalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumption,
|
||||
@@ -843,10 +864,12 @@ namespace BLL
|
||||
CompanySpecialPlanNum = companySpecialPlanList.Count(),
|
||||
CompanyOnSiteDisposalPlan = companyOnSiteDisposalPlanList.Count(),
|
||||
CompanyDrillNum = companyDrillList.Count(),
|
||||
CompanyDrillPersonNum = companyDrillList.Sum(x => x.JointPersonNum),
|
||||
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(),
|
||||
ProjectSpecialPlanNum = projectSpecialPlanList.Count(),
|
||||
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(),
|
||||
ProjectDrillNum = projectDrillList.Count(),
|
||||
ProjectDrillPersonNum = projectDrillList.Sum(x => x.JointPersonNum),
|
||||
CostExtract = Convert.ToInt32(costExtract.Sum(x => x.SUMCost)),
|
||||
CostUse = Convert.ToInt32(costUseList.Sum(x => x.SUMCost)),
|
||||
UseEquipmentNum = useEquipmentList.Count(),
|
||||
@@ -865,16 +888,67 @@ namespace BLL
|
||||
TrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.ConstructionNum),
|
||||
FinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.FinishedNum),
|
||||
ArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.ArgumentNum),
|
||||
SuperCompletedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum)
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum),
|
||||
SuperFinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperFinishedNum),
|
||||
SuperArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperArgumentNum)
|
||||
};
|
||||
|
||||
#region 添加项目统计数据
|
||||
|
||||
Project_HSSEData_HSSEService.DeleteProject_HSSEData_HSSEByDate(DateTime.Now.Date);
|
||||
|
||||
var generalHiddenRectificationOutputsDict = generalHiddenRectificationOutputsList
|
||||
.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(
|
||||
g => g.Key,
|
||||
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
|
||||
);
|
||||
var securityRiskOutputList = securityRiskOutputListTask.Result;
|
||||
var securityRiskOutputDict = securityRiskOutputList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new
|
||||
{
|
||||
LowRiskNum = g.Sum(x => x.LowRiskNum),
|
||||
GeneralRiskNum = g.Sum(x => x.GeneralRiskNum),
|
||||
MediumRiskNum = g.Sum(x => x.MediumRiskNum),
|
||||
HighRiskNum = g.Sum(x => x.HighRiskNum)
|
||||
}
|
||||
);
|
||||
var largeEngineeringOutputList = largeEngineeringOutputsTask.Result;
|
||||
var largeEngineeringOutputsDict = largeEngineeringOutputList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new
|
||||
{
|
||||
CompletedNum = g.Sum(x => x.CompletedNum),
|
||||
TrainPersonNum = g.Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = g.Sum(x => x.ConstructionNum),
|
||||
FinishedNum = g.Sum(x => x.FinishedNum),
|
||||
ArgumentNum = g.Sum(x => x.ArgumentNum),
|
||||
SuperCompletedNum = g.Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = g.Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = g.Sum(x => x.SuperConstructionNum),
|
||||
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum)
|
||||
}
|
||||
);
|
||||
foreach (var projectid in BeUnderConstructionList)
|
||||
{
|
||||
generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs);
|
||||
majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs);
|
||||
securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs);
|
||||
largeEngineeringOutputsDict.TryGetValue(projectid, out var largeEngineeringOutputs);
|
||||
var projectHsseData = new Project_HSSEData_HSSE
|
||||
{
|
||||
Id = SQLHelper.GetNewID(),
|
||||
@@ -891,6 +965,7 @@ namespace BLL
|
||||
SafeTrainNum = safeTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
SpecialTrainNum = specialTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
HseTechnicalNum = hseTechnicalNum,
|
||||
EnvironmentalTrainNum = 0,
|
||||
TotalEnergyConsumption = 0,
|
||||
IncomeComprehensiveEnergyConsumption = 0,
|
||||
@@ -925,31 +1000,35 @@ namespace BLL
|
||||
CompanySpecialPlanNum = 0,
|
||||
CompanyOnSiteDisposalPlan = 0,
|
||||
CompanyDrillNum = 0,
|
||||
CompanyDrillPersonNum = 0,
|
||||
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectSpecialPlanNum = projectSpecialPlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectDrillNum = projectDrillList.Count(x => x.ProjectId == projectid),
|
||||
ProjectDrillPersonNum = projectDrillList.Where(x => x.ProjectId == projectid).Sum(x => x.JointPersonNum),
|
||||
CostExtract = Convert.ToInt32(costExtract.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)),
|
||||
CostUse = Convert.ToInt32(costUseList.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)),
|
||||
UseEquipmentNum = useEquipmentList.Count(x => x.ProjectId == projectid),
|
||||
SpecialEquipmentNum = specialEquipmentList.Count(x => x.ProjectId == projectid),
|
||||
LicensesNum = licensesList.Count(x => x.ProjectId == projectid),
|
||||
LicensesCloseNum = licensesCloseList.Count(x => x.ProjectId == projectid),
|
||||
GeneralClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum),
|
||||
GeneralNotClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum),
|
||||
MajorClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum),
|
||||
MajorNotClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum),
|
||||
LowRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.LowRiskNum),
|
||||
GeneralRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.GeneralRiskNum),
|
||||
MediumRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.MediumRiskNum),
|
||||
HighRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.HighRiskNum),
|
||||
CompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.CompletedNum),
|
||||
TrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.ConstructionNum),
|
||||
FinishedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.FinishedNum),
|
||||
SuperCompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperConstructionNum)
|
||||
GeneralClosedNum = generalHiddenRectificationOutputs?.ClosedNum ?? 0,
|
||||
GeneralNotClosedNum = generalHiddenRectificationOutputs?.NotClosedNum ?? 0,
|
||||
MajorClosedNum = majorHiddenRectificationOutputs?.ClosedNum ?? 0,
|
||||
MajorNotClosedNum = majorHiddenRectificationOutputs?.NotClosedNum ?? 0,
|
||||
LowRiskNum = securityRiskOutputs?.LowRiskNum ?? 0,
|
||||
GeneralRiskNum = securityRiskOutputs?.GeneralRiskNum ?? 0,
|
||||
MediumRiskNum = securityRiskOutputs?.MediumRiskNum ?? 0,
|
||||
HighRiskNum = securityRiskOutputs?.HighRiskNum ?? 0,
|
||||
CompletedNum = largeEngineeringOutputs?.CompletedNum ?? 0,
|
||||
TrainPersonNum = largeEngineeringOutputs?.TrainPersonNum ?? 0,
|
||||
ConstructionNum = largeEngineeringOutputs?.ConstructionNum ?? 0,
|
||||
FinishedNum = largeEngineeringOutputs?.FinishedNum ?? 0,
|
||||
ArgumentNum = largeEngineeringOutputs?.ArgumentNum ?? 0,
|
||||
SuperCompletedNum = largeEngineeringOutputs?.SuperCompletedNum ?? 0,
|
||||
SuperTrainPersonNum = largeEngineeringOutputs?.SuperTrainPersonNum ?? 0,
|
||||
SuperConstructionNum = largeEngineeringOutputs?.SuperConstructionNum ?? 0,
|
||||
SuperArgumentNum = largeEngineeringOutputs?.SuperArgumentNum ?? 0
|
||||
};
|
||||
Project_HSSEData_HSSEService.AddProject_HSSEData_HSSE(projectHsseData);
|
||||
}
|
||||
@@ -971,6 +1050,7 @@ namespace BLL
|
||||
|
||||
var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
//public static HSSEData StatisticalDataOld()
|
||||
@@ -1109,6 +1189,7 @@ namespace BLL
|
||||
table.SafeTrainNum = newtable.SafeTrainNum;
|
||||
table.SpecialTrainNum = newtable.SpecialTrainNum;
|
||||
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
|
||||
table.HseTechnicalNum = newtable.HseTechnicalNum;
|
||||
table.EnvironmentalTrainNum = newtable.EnvironmentalTrainNum;
|
||||
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
||||
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
||||
@@ -1144,10 +1225,12 @@ namespace BLL
|
||||
table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
|
||||
table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
|
||||
table.CompanyDrillNum = newtable.CompanyDrillNum;
|
||||
table.CompanyDrillPersonNum = newtable.CompanyDrillPersonNum;
|
||||
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
|
||||
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
|
||||
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
|
||||
table.ProjectDrillNum = newtable.ProjectDrillNum;
|
||||
table.ProjectDrillPersonNum = newtable.ProjectDrillPersonNum;
|
||||
table.CostExtract = newtable.CostExtract;
|
||||
table.CostUse = newtable.CostUse;
|
||||
table.UseEquipmentNum = newtable.UseEquipmentNum;
|
||||
@@ -1166,19 +1249,45 @@ namespace BLL
|
||||
table.TrainPersonNum = newtable.TrainPersonNum;
|
||||
table.ConstructionNum = newtable.ConstructionNum;
|
||||
table.FinishedNum = newtable.FinishedNum;
|
||||
table.ArgumentNum = newtable.ArgumentNum;
|
||||
table.SuperCompletedNum = newtable.SuperCompletedNum;
|
||||
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
|
||||
table.SuperConstructionNum = newtable.SuperConstructionNum;
|
||||
table.SuperFinishedNum = newtable.SuperFinishedNum;
|
||||
table.SuperArgumentNum = newtable.SuperArgumentNum;
|
||||
table.State = newtable.State;
|
||||
table.CreateMan = newtable.CreateMan;
|
||||
table.CreateDate = newtable.CreateDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取安全技术交底数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHseTechnicalNum()
|
||||
{
|
||||
var list = (from x in Funs.DB.License_HSETechnical
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
select x).Distinct().ToList();
|
||||
var result = list.ToList().Count();
|
||||
return result;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取安全技术交底数(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<int> GetHseTechnicalNumAsync()
|
||||
{
|
||||
return await Task.Run(GetHseTechnicalNum);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 安监人员数据
|
||||
@@ -3513,13 +3622,15 @@ namespace BLL
|
||||
TrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
ConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == false),
|
||||
FinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == false),
|
||||
ArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == false),
|
||||
SuperCompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == true),
|
||||
SuperTrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
SuperConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == true),
|
||||
SuperFinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == true),
|
||||
|
||||
SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true),
|
||||
}).ToList();
|
||||
return query;
|
||||
|
||||
}
|
||||
public static async Task<List<Model.LargeEngineeringOutput>> GetLargeEngineeringOutputsAsync()
|
||||
{
|
||||
@@ -3690,6 +3801,7 @@ namespace BLL
|
||||
x.SafeTrainNum,
|
||||
x.SpecialTrainNum,
|
||||
x.SpecialOperationTrainNum,
|
||||
x.HseTechnicalNum,
|
||||
x.EnvironmentalTrainNum,
|
||||
x.TotalEnergyConsumption,
|
||||
x.IncomeComprehensiveEnergyConsumption,
|
||||
@@ -3725,10 +3837,12 @@ namespace BLL
|
||||
x.CompanySpecialPlanNum,
|
||||
x.CompanyOnSiteDisposalPlan,
|
||||
x.CompanyDrillNum,
|
||||
x.CompanyDrillPersonNum,
|
||||
x.ProjectComprehensivePlanNum,
|
||||
x.ProjectSpecialPlanNum,
|
||||
x.ProjectOnSiteDisposalPlan,
|
||||
x.ProjectDrillNum,
|
||||
x.ProjectDrillPersonNum,
|
||||
x.CostExtract,
|
||||
x.CostUse,
|
||||
x.UseEquipmentNum,
|
||||
@@ -3747,14 +3861,17 @@ namespace BLL
|
||||
x.TrainPersonNum,
|
||||
x.ConstructionNum,
|
||||
x.FinishedNum,
|
||||
x.ArgumentNum,
|
||||
x.SuperCompletedNum,
|
||||
x.SuperTrainPersonNum,
|
||||
x.SuperConstructionNum,
|
||||
x.SuperFinishedNum,
|
||||
x.SuperArgumentNum,
|
||||
x.State,
|
||||
x.CreateDate,
|
||||
x.CreateMan
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endregion 获取列表
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
using FineUIPro;
|
||||
using RestSharp;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Project_CQMSDataService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
/// <summary>
|
||||
/// CQMS数据类型
|
||||
/// </summary>
|
||||
@@ -47,6 +46,18 @@ namespace BLL
|
||||
/// </summary>
|
||||
ProjectDivision,
|
||||
/// <summary>
|
||||
/// 报验数据
|
||||
/// </summary>
|
||||
Inspection,
|
||||
/// <summary>
|
||||
/// 施工方案数据
|
||||
/// </summary>
|
||||
ConstructSolution,
|
||||
/// <summary>
|
||||
/// 特种设备质保体系和图纸会审/设计交底
|
||||
/// </summary>
|
||||
SpecialEquipmentAndDesignDetails,
|
||||
/// <summary>
|
||||
/// 全部数据
|
||||
/// </summary>
|
||||
All
|
||||
@@ -63,7 +74,7 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByModle(Model.Project_CQMSData_CQMS table)
|
||||
{
|
||||
var q = from x in Funs.DB.Project_CQMSData_CQMS
|
||||
var q = from x in db.Project_CQMSData_CQMS
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
|
||||
@@ -140,11 +151,11 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static Model.Project_CQMSData_CQMS GetProject_CQMSData_CQMSById(string Id)
|
||||
{
|
||||
return Funs.DB.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
|
||||
return db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByprojectid(string projectid)
|
||||
{
|
||||
var q = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
var q = (from x in db.Project_CQMSData_CQMS
|
||||
where x.ProjectId == projectid
|
||||
select x).ToList();
|
||||
return q;
|
||||
@@ -194,6 +205,25 @@ namespace BLL
|
||||
SubProjectNum = newtable.SubProjectNum,
|
||||
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
|
||||
InspectionLotNum = newtable.InspectionLotNum,
|
||||
EquipmentInspectionNum = newtable.EquipmentInspectionNum,
|
||||
EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum,
|
||||
MachineInspectionNum = newtable.MachineInspectionNum,
|
||||
MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum,
|
||||
PersonInspectionNum = newtable.PersonInspectionNum,
|
||||
PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum,
|
||||
MaterialInspectionNum = newtable.MaterialInspectionNum,
|
||||
MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum,
|
||||
ConstructSolutionNum = newtable.ConstructSolutionNum,
|
||||
ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum,
|
||||
ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum,
|
||||
SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum,
|
||||
DesignDetailsNum = newtable.DesignDetailsNum,
|
||||
UnitProjectAcceptNum = newtable.UnitProjectAcceptNum,
|
||||
UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum,
|
||||
SubProjectAcceptNum = newtable.SubProjectAcceptNum,
|
||||
SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum,
|
||||
SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum,
|
||||
SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum
|
||||
};
|
||||
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
@@ -246,6 +276,25 @@ namespace BLL
|
||||
table.SubProjectNum = newtable.SubProjectNum;
|
||||
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
|
||||
table.InspectionLotNum = newtable.InspectionLotNum;
|
||||
table.EquipmentInspectionNum = newtable.EquipmentInspectionNum;
|
||||
table.EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum;
|
||||
table.MachineInspectionNum = newtable.MachineInspectionNum;
|
||||
table.MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum;
|
||||
table.PersonInspectionNum = newtable.PersonInspectionNum;
|
||||
table.PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum;
|
||||
table.MaterialInspectionNum = newtable.MaterialInspectionNum;
|
||||
table.MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum;
|
||||
table.ConstructSolutionNum = newtable.ConstructSolutionNum;
|
||||
table.ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum;
|
||||
table.ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum;
|
||||
table.SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum;
|
||||
table.DesignDetailsNum = newtable.DesignDetailsNum;
|
||||
table.UnitProjectAcceptNum = newtable.UnitProjectAcceptNum;
|
||||
table.UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum;
|
||||
table.SubProjectAcceptNum = newtable.SubProjectAcceptNum;
|
||||
table.SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum;
|
||||
table.SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum;
|
||||
table.SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -268,6 +317,20 @@ namespace BLL
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void DeleteProject_CQMSData_CQMByDate(DateTime? reportDate)
|
||||
{
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var table = db.Project_CQMSData_CQMS.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_CQMSData_CQMS.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid判断当天项目是否已统计数据
|
||||
/// </summary>
|
||||
@@ -321,6 +384,7 @@ namespace BLL
|
||||
StatisticalData(item.ProjectId, CQMSDateType.All);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
@@ -391,6 +455,13 @@ namespace BLL
|
||||
table.UnitProjectOnesOKNum = GetUnitProjectOnesOKNum(projectid);
|
||||
table.MaterialInRecheckNum = GetMaterialInRecheckNum(projectid);
|
||||
table.MaterialInRecheckOKNum = GetMaterialInRecheckOKNum(projectid);
|
||||
|
||||
table.UnitProjectAcceptNum = GetUnitProjectOnesNum(projectid);
|
||||
table.UnitProjectAcceptOKNum = GetUnitProjectOnesOKNum(projectid);
|
||||
table.SubProjectAcceptNum = GetMaterialInRecheckNum(projectid);
|
||||
table.SubProjectAcceptOKNum = GetMaterialInRecheckOKNum(projectid);
|
||||
table.SubdivisionalWorksAcceptNum = GetSubdivisionalWorksAcceptNum(projectid);
|
||||
table.SubdivisionalWorksAcceptOKNum = GetSubdivisionalWorksAcceptOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ProjectDivision || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
@@ -400,6 +471,28 @@ namespace BLL
|
||||
table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid);
|
||||
table.InspectionLotNum = GetInspectionLotNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.Inspection || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.EquipmentInspectionNum = GetComprehensiveInspectionEquipmentNum(projectid);
|
||||
table.EquipmentInspectionQualifiedNum = GetComprehensiveInspectionEquipmentOKNum(projectid);
|
||||
table.MachineInspectionNum = GetComprehensiveInspectionMachineNum(projectid);
|
||||
table.MachineInspectionQualifiedNum = GetComprehensiveInspectionMachineOKNum(projectid);
|
||||
table.PersonInspectionNum = GetComprehensiveInspectionPersonNum(projectid);
|
||||
table.PersonInspectionQualifiedNum = GetComprehensiveInspectionPersonOKNum(projectid);
|
||||
table.MaterialInspectionNum = GetComprehensiveInspectionMaterialNum(projectid);
|
||||
table.MaterialInspectionQualifiedNum = GetComprehensiveInspectionMaterialOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ConstructSolution || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.ConstructSolutionNum = GetConstructSolutionNum(projectid);
|
||||
table.ConstructSolutionProjectApproveNum = GetConstructSolutionProjectApproveNum(projectid);
|
||||
table.ConstructSolutionUnitApproveNum = GetConstructSolutionUnitApproveNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.SpecialEquipmentAndDesignDetails || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.SpecialEquipmentQualityAssuranceSystemNum = GetSpecialEquipmentQualityAssuranceSystemNum(projectid);
|
||||
table.DesignDetailsNum = GetTechnicalDisclosePersonNum(projectid);
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
@@ -484,7 +577,7 @@ namespace BLL
|
||||
{
|
||||
int result = (from x in Funs.DB.SitePerson_Person
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where x.ProjectId == projectid && y.IsCQMS == true && x.States == "1"
|
||||
where x.ProjectId == projectid && y.IsCQMS == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -690,13 +783,39 @@ namespace BLL
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程验收数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksAcceptNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "6" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程验收合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksAcceptOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "6" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单项工程个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSingleProjectNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_UnitWork
|
||||
int result = (from x in Funs.DB.ProjectData_MainItem
|
||||
where x.ProjectId == projectid
|
||||
select x).Count();
|
||||
return result;
|
||||
@@ -746,6 +865,148 @@ namespace BLL
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备报验-报检数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionEquipmentNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Check_CheckEquipment
|
||||
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备报验-报检合格数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionEquipmentOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Check_CheckEquipment
|
||||
where x.ProjectId == projectid && x.IsCheckCertificate == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具报验-报检数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMachineNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具报验-报检合格数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMachineOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.IsCheckOK.HasValue && x.IsCheckOK == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员报验-报检数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionPersonNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsOnSite.HasValue && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员报验-报检合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionPersonOKNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsOnSite == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取材料报验-报检数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMaterialNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取材料报验-报检合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMaterialOKNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 施工方案数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_CQMSConstructSolution
|
||||
where x.ProjectId == projectid
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 施工方案数量——项目审批数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionProjectApproveNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_CQMSConstructSolution
|
||||
where x.ProjectId == projectid && x.State == "1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 施工方案数量——项目审批数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionUnitApproveNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 特种设备质保体系
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialEquipmentQualityAssuranceSystemNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 推送项目质量数据
|
||||
|
||||
|
||||
@@ -354,11 +354,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static ReturnData PushProjectHJGLData()
|
||||
{
|
||||
var db1 = Funs.DB;
|
||||
var items = (from x in db1.Project_HJGLData_HJGL
|
||||
var items = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate == DateTime.Now.Date
|
||||
select x).ToList();
|
||||
var defectItems = (from x in db1.Project_HJGLData_Defect
|
||||
var defectItems = (from x in Funs.DB.Project_HJGLData_Defect
|
||||
where x.ReportDate == DateTime.Now.Date
|
||||
select x).ToList();
|
||||
Model.ReturnData responeData = new Model.ReturnData();
|
||||
@@ -376,8 +375,22 @@ namespace BLL
|
||||
responeData.message = "当前没有项目焊接数据";
|
||||
}
|
||||
return responeData;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static void DeleteProject_HJGLData_HJGLByDate(DateTime? reportDate)
|
||||
{
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var table = db.Project_HJGLData_HJGL.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HJGLData_HJGL.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1591,10 +1591,10 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static ReturnData PushProjectHSSEData()
|
||||
{
|
||||
var items = (from x in db.Project_HSSEData_HSSE
|
||||
var items = (from x in Funs.DB.Project_HSSEData_HSSE
|
||||
where x.ReportDate == DateTime.Now.Date
|
||||
select x).ToList();
|
||||
var detailItems = (from x in db.Project_HSSEData_HiddenDangerDetail
|
||||
var detailItems = (from x in Funs.DB.Project_HSSEData_HiddenDangerDetail
|
||||
where x.ReportDate == DateTime.Now.Date
|
||||
select x).ToList();
|
||||
Model.ReturnData responeData = new Model.ReturnData();
|
||||
|
||||
Binary file not shown.
@@ -1590,6 +1590,7 @@
|
||||
<Content Include="HJGL\TestPackage\TestPackageComplete.aspx" />
|
||||
<Content Include="HJGL\TestPackage\TestPackageCompleteEdit.aspx" />
|
||||
<Content Include="HJGL\TestPackage\TestPackageEdit.aspx" />
|
||||
<Content Include="HJGL\TestPackage\TestPackageImport.aspx" />
|
||||
<Content Include="HJGL\TestPackage\TestPackageItemEdit.aspx" />
|
||||
<Content Include="HJGL\WeldingManage\JointShowColumn.aspx" />
|
||||
<Content Include="HJGL\WeldingManage\JotTwoDesign.aspx" />
|
||||
@@ -10810,6 +10811,13 @@
|
||||
<Compile Include="HJGL\TestPackage\TestPackageEdit.aspx.designer.cs">
|
||||
<DependentUpon>TestPackageEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\TestPackage\TestPackageImport.aspx.cs">
|
||||
<DependentUpon>TestPackageImport.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\TestPackage\TestPackageImport.aspx.designer.cs">
|
||||
<DependentUpon>TestPackageImport.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\TestPackage\TestPackageItemEdit.aspx.cs">
|
||||
<DependentUpon>TestPackageItemEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -16583,7 +16591,7 @@
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v17.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}">
|
||||
|
||||
@@ -12,60 +12,52 @@
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="300px" Title="WBS目录"
|
||||
ShowBorder="true" Layout="VBox" ShowHeader="true" AutoScroll="true" BodyPadding="5px"
|
||||
IconFont="ArrowCircleLeft">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线"
|
||||
EmptyText="输入查询条件" Width="280px" LabelWidth="60px">
|
||||
</f:TextBox>
|
||||
<f:HiddenField runat="server" ID="hdUnitWorkId"></f:HiddenField>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<toolbars>
|
||||
<f:Toolbar runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<items>
|
||||
<f:NumberBox ID="txtSize" runat="server" Label="口径" Width="180px" LabelWidth="60px" LabelAlign="Right" NoDecimal="true" NoNegative="true"></f:NumberBox>
|
||||
<f:Button ID="btnStatics" runat="server" Text="统计" Icon="ChartPie" OnClick="btnStatics_Click"></f:Button>
|
||||
<f:HiddenField runat="server" ID="hdUnitWorkId"></f:HiddenField>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnTreeFind" ToolTip="查询" Icon="SystemSearch"
|
||||
EnablePostBack="true" OnClick="btnTreeFind_Click" runat="server">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
</toolbars>
|
||||
<items>
|
||||
<f:Tree ID="tvControlItem" ShowHeader="false" Height="560px" Title="单位工程"
|
||||
OnNodeCommand="tvControlItem_NodeCommand" runat="server" ShowBorder="false" EnableCollapse="true"
|
||||
EnableSingleClickExpand="false" AutoLeafIdentification="true" OnNodeExpand="tvControlItem_TreeNodeExpanded"
|
||||
EnableTextSelection="true">
|
||||
</f:Tree>
|
||||
</Items>
|
||||
</items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="排产计划"
|
||||
TitleToolTip="排产计划" AutoScroll="true">
|
||||
<Toolbars>
|
||||
<toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<items>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="保存" Icon="SystemSave"></f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出"
|
||||
Icon="TableGo" EnableAjax="false" EnablePostBack="true" >
|
||||
Icon="TableGo" EnableAjax="false" EnablePostBack="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
</toolbars>
|
||||
<items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="排产计划" ForceFit="false"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="ProductionSchedulingPlanId" AllowCellEditing="true"
|
||||
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="1" DataIDField="ProductionSchedulingPlanId"
|
||||
AllowSorting="true" SortField="FlowNum" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableTextSelection="True">
|
||||
<Columns>
|
||||
<columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
|
||||
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField HeaderText="流水段号" ColumnID="FlowNum"
|
||||
@@ -95,50 +87,65 @@
|
||||
<f:RenderField HeaderText="总优先级" ColumnID="TotalPriority"
|
||||
DataField="TotalPriority" SortField="TotalPriority" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="100px">
|
||||
<Editor>
|
||||
<editor>
|
||||
<f:TextBox ID="txtTotalPriority" runat="server"></f:TextBox>
|
||||
</Editor>
|
||||
</editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="优先级总达因" ColumnID="PriorityTotalDyne"
|
||||
DataField="PriorityTotalDyne" SortField="PriorityTotalDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
<Editor>
|
||||
<editor>
|
||||
<f:NumberBox ID="txtPriorityTotalDyne" runat="server"></f:NumberBox>
|
||||
</Editor>
|
||||
</editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="计划开始时间" ColumnID="PlanStartDate"
|
||||
DataField="PlanStartDate" SortField="PlanStartDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
<Editor>
|
||||
<editor>
|
||||
<f:DatePicker ID="txtPlanStartDate" runat="server"></f:DatePicker>
|
||||
</Editor>
|
||||
</editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="计划结束时间" ColumnID="PlanEndDate"
|
||||
DataField="PlanEndDate" SortField="PlanEndDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
<Editor>
|
||||
<editor>
|
||||
<f:DatePicker ID="txtPlanEndDate" runat="server"></f:DatePicker>
|
||||
</Editor>
|
||||
</editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="天数" ColumnID="Days"
|
||||
DataField="Days" SortField="Days" FieldType="Int" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="90px">
|
||||
<Editor>
|
||||
<editor>
|
||||
<f:NumberBox ID="txtDays" runat="server" NoDecimal="true" NoNegative="true"></f:NumberBox>
|
||||
</Editor>
|
||||
</editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="平均每天工作量" ColumnID="AvgDailyWorkload"
|
||||
DataField="AvgDailyWorkload" SortField="AvgDailyWorkload" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
<Editor>
|
||||
<editor>
|
||||
<f:NumberBox ID="txtAvgDailyWorkload" runat="server" NoNegative="true"></f:NumberBox>
|
||||
</Editor>
|
||||
</editor>
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:RenderField HeaderText="已完成量" ColumnID="CompletedCount"
|
||||
DataField="CompletedCount" SortField="CompletedCount" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="已完成百分比" ColumnID="CompletedRate"
|
||||
DataField="CompletedRate" SortField="CompletedRate" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="已完成百分比汇总" ColumnID="TotalCompletedRate"
|
||||
DataField="TotalCompletedRate" SortField="TotalCompletedRate" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="120px">
|
||||
</f:RenderField>
|
||||
</columns>
|
||||
<listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</listeners>
|
||||
<listeners>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
</listeners>
|
||||
<pageitems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
@@ -151,14 +158,26 @@
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="所有行" Value="10000" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</pageitems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</items>
|
||||
</f:Panel>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
|
||||
ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.ProjectData;
|
||||
using MiniExcelLibs;
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -11,6 +13,7 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.WebSockets;
|
||||
|
||||
@@ -83,7 +86,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
foreach (var q in unitWork1)
|
||||
{
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x.FlowingSection).Distinct().Count();
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x.FlowingSection).Distinct().Count();
|
||||
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
||||
TreeNode tn1 = new TreeNode();
|
||||
tn1.NodeID = q.UnitWorkId;
|
||||
@@ -112,7 +115,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
foreach (var q in unitWork2)
|
||||
{
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x.FlowingSection).Distinct().Count();
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x.FlowingSection).Distinct().Count();
|
||||
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
||||
TreeNode tn2 = new TreeNode();
|
||||
tn2.NodeID = q.UnitWorkId;
|
||||
@@ -147,7 +150,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
List<string> flowingSection = new List<string>();
|
||||
//List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
|
||||
var list = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x.FlowingSection).ToList();
|
||||
var list = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" && x.UnitWorkId == node.NodeID select x.FlowingSection).ToList();
|
||||
flowingSection = list.Where(x => !string.IsNullOrWhiteSpace(x) == true).Distinct().OrderBy(x => x).ToList();
|
||||
//int pageindex = int.Parse(node.CommandName.Split('|')[0]);
|
||||
//int pageCount = int.Parse(node.CommandName.Split('|')[1]);
|
||||
@@ -199,16 +202,16 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
/// <param name="e"></param>
|
||||
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
if (e.CommandName == "流水段")
|
||||
{
|
||||
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByFlowingSection(this.tvControlItem.SelectedNode.Text);
|
||||
this.hdUnitWorkId.Text = string.Empty;
|
||||
if (pipeline != null)
|
||||
{
|
||||
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
|
||||
SaveProductionSchedulingPlan();
|
||||
}
|
||||
}
|
||||
//if (e.CommandName == "流水段")
|
||||
//{
|
||||
// Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByFlowingSection(this.tvControlItem.SelectedNode.Text);
|
||||
// this.hdUnitWorkId.Text = string.Empty;
|
||||
// if (pipeline != null)
|
||||
// {
|
||||
// this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
|
||||
// SaveProductionSchedulingPlan();
|
||||
// }
|
||||
//}
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
@@ -220,23 +223,145 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
|
||||
{
|
||||
List<Model.View_HJGL_ProductionSchedulingPlanStatistics> lists = (from x in Funs.DB.View_HJGL_ProductionSchedulingPlanStatistics.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.FlowingSection == this.tvControlItem.SelectedNode.Text) select x).ToList();
|
||||
foreach (var item in lists)
|
||||
if (tvControlItem.SelectedNode.CommandName == "流水段")
|
||||
{
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, item.FlowingSection, item.UnitWorkName, item.Material, item.Caliber);
|
||||
if (plan == null)
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNode.ParentNode.NodeID))
|
||||
{
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
//newPlan.PipelineId = this.tvControlItem.SelectedNodeID;
|
||||
newPlan.FlowNum = item.FlowingSection;
|
||||
newPlan.MainItemName = item.UnitWorkName;
|
||||
newPlan.Material = item.Material;
|
||||
newPlan.Caliber = item.Caliber;
|
||||
newPlan.Dain = item.Dia;
|
||||
newPlan.TotalDyne = lists.Sum(x => x.Dia);
|
||||
BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan);
|
||||
listStr.Add(new SqlParameter("@unitWorkId", this.tvControlItem.SelectedNode.ParentNode.NodeID));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", null));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNode.Text))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@flowingSection", this.tvControlItem.SelectedNode.Text));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@flowingSection", null));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSize.Text.Trim()))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@caliber", this.txtSize.Text.Trim()));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
//decimal totalDia = 0;
|
||||
//totalDia += Convert.ToDecimal(tb.Rows[i]["Dia"].ToString());//总达因
|
||||
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString());
|
||||
if (plan == null)
|
||||
{
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newPlan.PipelineId = tb.Rows[i]["UnitWorkId"].ToString();//装置ID
|
||||
newPlan.FlowNum = tb.Rows[i]["FlowingSection"].ToString();
|
||||
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
|
||||
newPlan.Material = tb.Rows[i]["Material"].ToString();
|
||||
newPlan.Caliber = tb.Rows[i]["Caliber"].ToString();
|
||||
newPlan.Dain = Funs.GetNewDecimalOrZero(tb.Rows[i]["Dia"].ToString());
|
||||
newPlan.TotalDyne = Funs.GetNewDecimalOrZero(tb.Rows[i]["TotalDia"].ToString());
|
||||
newPlan.CompletedCount = Funs.GetNewIntOrZero(tb.Rows[i]["cTotalCount"].ToString());
|
||||
newPlan.CompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["rate"].ToString());
|
||||
newPlan.TotalCompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["Srate"].ToString());
|
||||
BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)//单位工程
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNode.NodeID))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", this.tvControlItem.SelectedNode.NodeID));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", null));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSize.Text.Trim()))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@caliber", this.txtSize.Text.Trim()));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString());
|
||||
if (plan == null)
|
||||
{
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newPlan.PipelineId = tb.Rows[i]["UnitWorkId"].ToString();//装置ID
|
||||
newPlan.FlowNum = tb.Rows[i]["FlowingSection"].ToString();
|
||||
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
|
||||
newPlan.Material = tb.Rows[i]["Material"].ToString();
|
||||
newPlan.Caliber = tb.Rows[i]["Caliber"].ToString();
|
||||
newPlan.Dain = Funs.GetNewDecimalOrZero(tb.Rows[i]["Dia"].ToString());
|
||||
newPlan.TotalDyne = Funs.GetNewDecimalOrZero(tb.Rows[i]["TotalDia"].ToString());
|
||||
newPlan.CompletedCount = Funs.GetNewIntOrZero(tb.Rows[i]["cTotalCount"].ToString());
|
||||
newPlan.CompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["rate"].ToString());
|
||||
newPlan.TotalCompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["Srate"].ToString());
|
||||
BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.tvControlItem.SelectedNodeID == "1" || this.tvControlItem.SelectedNodeID == "2")
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(this.hdUnitWorkId.Text))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", this.hdUnitWorkId.Text));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", null));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSize.Text.Trim()))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@caliber", this.txtSize.Text.Trim()));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(tb.Rows[i]["FlowingSection"].ToString()))
|
||||
{
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString());
|
||||
if (plan == null)
|
||||
{
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newPlan.PipelineId = tb.Rows[i]["UnitWorkId"].ToString();//装置ID
|
||||
newPlan.FlowNum = tb.Rows[i]["FlowingSection"].ToString();
|
||||
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
|
||||
newPlan.Material = tb.Rows[i]["Material"].ToString();
|
||||
newPlan.Caliber = tb.Rows[i]["Caliber"].ToString();
|
||||
newPlan.Dain = Funs.GetNewDecimalOrZero(tb.Rows[i]["Dia"].ToString());
|
||||
newPlan.TotalDyne = Funs.GetNewDecimalOrZero(tb.Rows[i]["TotalDia"].ToString());
|
||||
newPlan.CompletedCount = Funs.GetNewIntOrZero(tb.Rows[i]["cTotalCount"].ToString());
|
||||
newPlan.CompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["rate"].ToString());
|
||||
newPlan.TotalCompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["Srate"].ToString());
|
||||
BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,22 +389,35 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
p.PlanStartDate,
|
||||
p.PlanEndDate,
|
||||
p.Days,
|
||||
p.AvgDailyWorkload
|
||||
p.AvgDailyWorkload,
|
||||
w.ProjectType,
|
||||
p.CompletedCount,
|
||||
p.CompletedRate,
|
||||
p.TotalCompletedRate
|
||||
FROM HJGL_ProductionSchedulingPlan p
|
||||
left join WBS_UnitWork w on w.UnitWorkId=p.PipelineId
|
||||
WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
|
||||
{
|
||||
strSql += " and p.MainItemName =@UnitWorkId";
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNode.Text));
|
||||
strSql += " and p.PipelineId =@UnitWorkId";
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNode.NodeID));
|
||||
|
||||
}
|
||||
else if (tvControlItem.SelectedNode.CommandName == "流水段")
|
||||
{
|
||||
strSql += " and p.FlowNum = @FlowNum ";
|
||||
strSql += "and p.PipelineId =@UnitWorkId and p.FlowNum = @FlowNum ";
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNode.ParentNode.NodeID));
|
||||
listStr.Add(new SqlParameter("@FlowNum", this.tvControlItem.SelectedNode.Text));
|
||||
|
||||
}
|
||||
else if (tvControlItem.SelectedNodeID == "1")
|
||||
{
|
||||
strSql += "and w.ProjectType ='1' ";
|
||||
}
|
||||
else if (tvControlItem.SelectedNodeID == "2")
|
||||
{
|
||||
strSql += "and w.ProjectType ='2' ";
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
@@ -332,10 +470,10 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
#endregion
|
||||
|
||||
#region 维护事件
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
//protected void btnSearch_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// BindGrid();
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -345,15 +483,15 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
protected void btnTreeFind_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.InitTreeMenu();
|
||||
//protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// this.BindGrid();
|
||||
//}
|
||||
//protected void btnTreeFind_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// this.InitTreeMenu();
|
||||
|
||||
}
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
@@ -470,7 +608,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
cell = row.CreateCell(5);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.TotalDyne.HasValue?item.TotalDyne.ToString():"");//总达因数
|
||||
cell.SetCellValue(item.TotalDyne.HasValue ? item.TotalDyne.ToString() : "");//总达因数
|
||||
|
||||
cell = row.CreateCell(6);
|
||||
cell.CellStyle = cellStyle;
|
||||
@@ -490,11 +628,23 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
cell = row.CreateCell(10);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.Days.HasValue?item.Days.ToString():"");//天数
|
||||
cell.SetCellValue(item.Days.HasValue ? item.Days.ToString() : "");//天数
|
||||
|
||||
cell = row.CreateCell(11);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.AvgDailyWorkload.HasValue ? item.AvgDailyWorkload.ToString():"");//平均每天工作量
|
||||
cell.SetCellValue(item.AvgDailyWorkload.HasValue ? item.AvgDailyWorkload.ToString() : "");//平均每天工作量
|
||||
|
||||
cell = row.CreateCell(12);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.CompletedCount.HasValue ? item.CompletedCount.ToString() : "");//已完成量
|
||||
|
||||
cell = row.CreateCell(13);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.CompletedRate.HasValue ? item.CompletedRate.ToString() : "");//已完成百分比
|
||||
|
||||
cell = row.CreateCell(14);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.TotalCompletedRate.HasValue ? item.TotalCompletedRate.ToString() : "");//已完成百分比汇总
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -522,5 +672,103 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 统计
|
||||
/// <summary>
|
||||
/// 统计
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnStatics_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtSize.Text.Trim()))
|
||||
{
|
||||
//单位工程
|
||||
if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
|
||||
{
|
||||
///根据流水段获取管线信息
|
||||
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByUnitWorkId(this.tvControlItem.SelectedNode.NodeID);
|
||||
this.hdUnitWorkId.Text = string.Empty;
|
||||
if (pipeline != null)
|
||||
{
|
||||
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.NodeID;
|
||||
SaveProductionSchedulingPlan();
|
||||
}
|
||||
|
||||
}
|
||||
else if (tvControlItem.SelectedNode.CommandName == "流水段")
|
||||
{
|
||||
///根据流水段获取管线信息
|
||||
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByFlowingSection(this.tvControlItem.SelectedNode.Text);
|
||||
this.hdUnitWorkId.Text = string.Empty;
|
||||
if (pipeline != null)
|
||||
{
|
||||
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
|
||||
SaveProductionSchedulingPlan();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
|
||||
select x).ToList();
|
||||
|
||||
List<Model.WBS_UnitWork> unitWorks = null;
|
||||
//List<Model.WBS_UnitWork> unitWork2 = null;
|
||||
//
|
||||
if (this.tvControlItem.SelectedNodeID == "1")
|
||||
{
|
||||
unitWorks = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
|
||||
}
|
||||
else if (this.tvControlItem.SelectedNodeID == "2")
|
||||
{
|
||||
unitWorks = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
|
||||
}
|
||||
foreach (var item in unitWorks)
|
||||
{
|
||||
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByUnitWorkId(item.UnitWorkId);
|
||||
this.hdUnitWorkId.Text = string.Empty;
|
||||
if (pipeline != null)
|
||||
{
|
||||
this.hdUnitWorkId.Text = item.UnitWorkId;
|
||||
SaveProductionSchedulingPlan();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.BindGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请输入口径!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 右键删除
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var model = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlanById(rowID);
|
||||
if (model != null)
|
||||
{
|
||||
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanById(rowID);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+22
-13
@@ -51,22 +51,22 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// txtSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
protected global::FineUIPro.NumberBox txtSize;
|
||||
|
||||
/// <summary>
|
||||
/// txtPipelineCode 控件。
|
||||
/// btnStatics 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPipelineCode;
|
||||
protected global::FineUIPro.Button btnStatics;
|
||||
|
||||
/// <summary>
|
||||
/// hdUnitWorkId 控件。
|
||||
@@ -77,15 +77,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdUnitWorkId;
|
||||
|
||||
/// <summary>
|
||||
/// btnTreeFind 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnTreeFind;
|
||||
|
||||
/// <summary>
|
||||
/// tvControlItem 控件。
|
||||
/// </summary>
|
||||
@@ -229,5 +220,23 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,8 @@
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<Items>
|
||||
<f:MenuButton ID="btnMenuImport" EnablePostBack="true" runat="server" Text="导入" Icon="PageExcel" OnClick="btnMenuImport_Click" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuNew" EnablePostBack="true" runat="server" Text="新增" Icon="Add" OnClick="btnMenuNew_Click">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Text="编辑" Icon="Pencil" OnClick="btnMenuModify_Click">
|
||||
|
||||
@@ -597,5 +597,35 @@ namespace FineUIPro.Web.HJGL.TestPackage
|
||||
ctlAuditFlow.data = parameter3D;
|
||||
ctlAuditFlow.BindData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.TestPackageEditMenuId, Const.BtnAdd))
|
||||
{
|
||||
if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.CommandName == "单位工程")
|
||||
{
|
||||
this.SetTextTemp();
|
||||
string window = String.Format("TestPackageImport.aspx?unitWorkId={0}", this.tvControlItem.SelectedNodeID, "导入 - ");
|
||||
PageContext.RegisterStartupScript(Window1.GetSaveStateReference(this.hdPTP_ID.ClientID)
|
||||
+ Window1.GetShowReference(window));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("非单位工程类型无法导入!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -230,6 +230,15 @@ namespace FineUIPro.Web.HJGL.TestPackage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuImport;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuNew 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPackageImport.aspx.cs" Inherits="FineUIPro.Web.HJGL.TestPackage.TestPackageImport" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>试压包导入</title>
|
||||
</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:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
||||
LabelWidth="150px">
|
||||
</f:FileUpload>
|
||||
<f:DropDownList ID="DrpType" runat="server" Label="导入类型">
|
||||
<f:ListItem Text="补充导入" Value="0"/>
|
||||
<f:ListItem Text="更新导入" Value="1"/>
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:HiddenField ID="hdFileName" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" Text="下载模板" OnClick="btnDownLoad_Click">
|
||||
</f:Button>
|
||||
<%--<f:Label ID="lbVersion" runat="server" Label="当前版本:"></f:Label>--%>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar3" runat="server">
|
||||
<Items>
|
||||
<%--<f:TextArea runat="server" ID="txtRemark" Label="更新原因:"></f:TextArea>--%>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" Text="审核" ValidateForms="SimpleForm1"
|
||||
OnClick="btnAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" Text="导入" ValidateForms="SimpleForm1"
|
||||
OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="提交" Text="提交" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="试压包信息" Height="350px"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipelineCode" AllowCellEditing="true"
|
||||
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="PipelineCode" EnableBigData="true"
|
||||
AllowSorting="true" SortField="PipelineCode" SortDirection="ASC"
|
||||
AllowPaging="true" IsDatabasePaging="false" PageSize="300" EnableBigDataRowTip="false"
|
||||
EnableTextSelection="True" >
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
|
||||
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="" DataField="" SortField=""
|
||||
FieldType="String" HeaderText="试压包号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="" DataField="" SortField=""
|
||||
FieldType="String" HeaderText="系统名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="130px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
|
||||
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="" DataField="" SortField=""
|
||||
FieldType="String" HeaderText="调整试验压力" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="备注" ColumnID=""
|
||||
DataField="" SortField="" FieldType="String" HeaderTextAlign="Center"
|
||||
TextAlign="Left" Width="100px">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="10" Value="10" />
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="所有行" Value="10000" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<%--<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="历史记录" IsFluid="true"
|
||||
EnableCollapse="false" runat="server" BoxFlex="1" DataKeyNames="DesignBasisDataImportId"
|
||||
AllowColumnLocking="true" EnableColumnLines="true" DataIDField="DesignBasisDataImportId"
|
||||
AllowSorting="true" SortField="CreateDate" SortDirection="ASC" EnableMultiSelect="false"
|
||||
IsDatabasePaging="false" PageSize="15" >
|
||||
<Toolbars>
|
||||
<f:Toolbar runat="server">
|
||||
<Items>
|
||||
<f:DropDownList runat="server" ID="drpVersion" Label="恢复版本至" ></f:DropDownList>
|
||||
<f:Button runat="server" ID="btnRestore" Text="确定" OnClick="btnRestore_Click"> </f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="编号"
|
||||
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField HeaderText="名称" ColumnID="FileName"
|
||||
DataField="FileName" SortField="FileName" FieldType="String" HeaderTextAlign="Center"
|
||||
TextAlign="Left" Width="90px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="版本" ColumnID="Version"
|
||||
DataField="Version" SortField="Version" FieldType="String" HeaderTextAlign="Center"
|
||||
TextAlign="Left" Width="100px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="导入类型" ColumnID="ImportType"
|
||||
DataField="ImportType" SortField="ImportType" FieldType="String" HeaderTextAlign="Center"
|
||||
TextAlign="Left" Width="100px">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="UserName" DataField="UserName" SortField="UserName"
|
||||
FieldType="String" HeaderText="更新人" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="更新日期" ColumnID="CreateDate"
|
||||
DataField="CreateDate" SortField="CreateDate" FieldType="String" HeaderTextAlign="Center"
|
||||
TextAlign="Left" Width="90px">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Remark" DataField="Remark" FieldType="String"
|
||||
HeaderText="更新原因" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>--%>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,761 @@
|
||||
using BLL;
|
||||
using MiniExcelLibs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.TestPackage
|
||||
{
|
||||
public partial class TestPackageImport : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 试压包集合
|
||||
/// </summary>
|
||||
public static List<Model.View_TestPackage_PipelineList> PipelineList = new List<Model.View_TestPackage_PipelineList>();
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
public static string errorInfos = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 导入数据分类(管线)
|
||||
/// </summary>
|
||||
//public static string DataClassification = "Pipeline";
|
||||
public enum ButtonState { Check = 0, Import = 1, Save = 2 }
|
||||
|
||||
public static int State;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.hdFileName.Text = string.Empty;
|
||||
State = (int)ButtonState.Check;
|
||||
|
||||
if (PipelineList != null)
|
||||
{
|
||||
PipelineList.Clear();
|
||||
}
|
||||
errorInfos = string.Empty;
|
||||
//lbVersion.Text = BLL.HJGL_DesignBasisDataImportService.GetNowVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification).ToString();
|
||||
//BindGrid2();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
//void BindGrid2()
|
||||
//{
|
||||
// string strSql = @" select Import.DesignBasisDataImportId
|
||||
// ,Import.ProjectId
|
||||
// ,Import.UnitWorkId
|
||||
// ,(Case Import.ImportType when '0' then '补充导入'
|
||||
// when '1' then '更新导入' end) as ImportType
|
||||
// ,Import.FileName
|
||||
// ,Import.FilePath
|
||||
// ,Import.DataClassification
|
||||
// ,Import.FileType
|
||||
// ,Import.FileSize
|
||||
// ,Import.FileId
|
||||
// ,Import.Version
|
||||
// ,Import.Remark
|
||||
// ,Import.CreateMan
|
||||
// ,Import.CreateDate
|
||||
// , Users.PersonName
|
||||
// from HJGL_DesignBasisDataImport as Import
|
||||
// left join Person_Persons as Users on Users.PersonId=Import.CreateMan
|
||||
// where Import.UnitWorkId=@UnitWorkId and Import.ProjectId=@ProjectId and Import.DataClassification=@DataClassification
|
||||
// order by Import.CreateDate";
|
||||
// List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
// listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
// listStr.Add(new SqlParameter("@UnitWorkId", Request.Params["UnitWorkId"]));
|
||||
// //listStr.Add(new SqlParameter("@DataClassification", DataClassification));
|
||||
// SqlParameter[] parameter = listStr.ToArray();
|
||||
// DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
// // 2.获取当前分页数据
|
||||
// //var table = this.GetPagedDataTable(Grid1, tb1);
|
||||
// Grid2.RecordCount = tb.Rows.Count;
|
||||
// tb = GetFilteredTable(Grid2.FilteredData, tb);
|
||||
// var table = this.GetPagedDataTable(Grid2, tb);
|
||||
// Grid2.DataSource = table;
|
||||
// Grid2.DataBind();
|
||||
// drpVersion.DataSource = BLL.HJGL_DesignBasisDataImportService.GetListVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification);
|
||||
// drpVersion.DataBind();
|
||||
|
||||
//}
|
||||
#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 != ".xlsx")
|
||||
{
|
||||
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (PipelineList != null)
|
||||
{
|
||||
PipelineList.Clear();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
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);
|
||||
ImportXlsToData(rootPath + initPath + this.hdFileName.Text);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Alert alert = new Alert
|
||||
{
|
||||
Message = "'" + ex.Message + "'",
|
||||
Target = Target.Self
|
||||
};
|
||||
alert.Show();
|
||||
}
|
||||
}
|
||||
#region 读Excel提取数据
|
||||
/// <summary>
|
||||
/// 从Excel提取数据--》Dataset
|
||||
/// </summary>
|
||||
/// <param name="filename">Excel文件路径名</param>
|
||||
private void ImportXlsToData(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ds = MiniExcel.Query(fileName).ToList();
|
||||
var columns = MiniExcel.GetColumns(fileName);
|
||||
var cnt = columns.Count;
|
||||
var reposedata = AddDatasetToSQL(ds, cnt);
|
||||
if (reposedata.code == 1)
|
||||
{
|
||||
State = (int)ButtonState.Import;
|
||||
ShowNotify("审核完成请点击导入");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert alert = new Alert
|
||||
{
|
||||
Message = reposedata.message,
|
||||
Target = Target.Self
|
||||
};
|
||||
alert.Show();
|
||||
//ShowNotify(reposedata.message);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
ErrLogInfo.WriteLog("试压包导入数据上传失败!", exc);
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 将Dataset的数据导入数据库
|
||||
/// <summary>
|
||||
/// 将Dataset的数据导入数据库
|
||||
/// </summary>
|
||||
/// <param name="pds">数据集</param>
|
||||
/// <param name="Cols">数据集行数</param>
|
||||
/// <returns></returns>
|
||||
private Model.ResponeData AddDatasetToSQL(List<dynamic> pds, int count)
|
||||
{
|
||||
Model.ResponeData responeData = new Model.ResponeData();
|
||||
// string result = string.Empty;
|
||||
List<string> result = new List<string>();
|
||||
//pds = BLL.Funs.FilterBlankLines(pds);
|
||||
if (count < 5)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "导入Excel格式错误!Excel只有" + count.ToString().Trim() + "列";
|
||||
return responeData;
|
||||
}
|
||||
if (pds.Count > 0 && pds != null)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var getPipeline = from x in db.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
|
||||
Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(Request.Params["UnitWorkId"]);
|
||||
for (int i = 1; i < pds.Count; i++)
|
||||
{
|
||||
Model.View_TestPackage_PipelineList pipeline = new Model.View_TestPackage_PipelineList();
|
||||
|
||||
if (unitWork != null)
|
||||
{
|
||||
pipeline.UnitWorkId = Request.Params["UnitWorkId"];
|
||||
pipeline.UnitId = unitWork.UnitId;
|
||||
}
|
||||
|
||||
string col0 = pds[i].A;
|
||||
if (string.IsNullOrEmpty(col0))
|
||||
{
|
||||
result.Add("第" + (i + 1).ToString() + "行," + "试压包编号" + "," + "此项为必填项!" + "|");
|
||||
}
|
||||
else
|
||||
{
|
||||
pipeline.TestPackageNo = col0;
|
||||
}
|
||||
|
||||
pipeline.TestPackageName = pds[i].B;//系统名称
|
||||
|
||||
string col2 = pds[i].C;
|
||||
if (string.IsNullOrEmpty(col2))
|
||||
{
|
||||
result.Add("第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
|
||||
}
|
||||
else
|
||||
{
|
||||
var line = getPipeline.FirstOrDefault(u => u.PipelineCode == col2);
|
||||
if (line!=null)
|
||||
{
|
||||
pipeline.PipelineId = line.PipelineId;
|
||||
pipeline.PipelineCode = col2;
|
||||
}
|
||||
}
|
||||
string col3 = pds[i].D;
|
||||
if (!string.IsNullOrEmpty(col3))
|
||||
{
|
||||
try
|
||||
{
|
||||
decimal testPressure = Convert.ToDecimal(col3);
|
||||
pipeline.TestPressure = testPressure;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result.Add("第" + (i + 1).ToString() + "行," + "调整试验压力格式输入有误" + "|");
|
||||
}
|
||||
}
|
||||
pipeline.Remark = pds[i].E;
|
||||
pipeline.Tabler = this.CurrUser.PersonId;
|
||||
pipeline.TableDate = DateTime.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(pipeline.PipelineCode) && !string.IsNullOrEmpty(pipeline.TestPackageNo))
|
||||
{
|
||||
pipeline.ProjectId = this.CurrUser.LoginProjectId;
|
||||
PipelineList.Add(pipeline);
|
||||
}
|
||||
}
|
||||
if (result.Count > 0)
|
||||
{
|
||||
PipelineList.Clear();
|
||||
errorInfos = string.Join("|", result.Distinct());
|
||||
responeData.code = 0;
|
||||
responeData.message = errorInfos;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "导入数据为空!";
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (State != (int)ButtonState.Import)
|
||||
{
|
||||
ShowNotify("请先审核");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.hdFileName.Text))
|
||||
{
|
||||
if (PipelineList.Count > 0)
|
||||
{
|
||||
this.Grid1.Hidden = false;
|
||||
this.Grid1.DataSource = PipelineList;
|
||||
this.Grid1.DataBind();
|
||||
Grid1.RecordCount = PipelineList.Count;
|
||||
State = (int)ButtonState.Save;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region 提交
|
||||
/// <summary>
|
||||
/// 提交
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (State != (int)ButtonState.Save)
|
||||
{
|
||||
ShowNotify("请先审核/导入");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string oldefilePath = rootPath + initPath + this.hdFileName.Text;
|
||||
string unitworkId = Request.Params["UnitWorkId"];
|
||||
string filePath = rootPath + Const.TestPackageDataImportPath + this.hdFileName.Text;
|
||||
if (oldefilePath != string.Empty && System.IO.File.Exists(oldefilePath))
|
||||
{
|
||||
if (!Directory.Exists(rootPath + Const.TestPackageDataImportPath))
|
||||
{
|
||||
Directory.CreateDirectory(rootPath + Const.TestPackageDataImportPath);
|
||||
}
|
||||
File.Move(oldefilePath, filePath);
|
||||
}
|
||||
string FileName = this.fuAttachUrl.FileName;
|
||||
|
||||
if (DrpType.SelectedValue == "1")//更新导入
|
||||
{
|
||||
//BLL.PipelineMatService.DeletePipeLineMatByUnitWorkId(unitworkId);//删除原有管线对应材料
|
||||
BLL.WeldJointService.DeleteWeldJointByUnitWorkId(unitworkId);////删除原有管线对应焊口
|
||||
BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线
|
||||
AddView_HJGL_WeldJoint(PipelineList);//导入数据
|
||||
|
||||
//Model.HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model.HJGL_DesignBasisDataImport();
|
||||
//hJGL_DesignBasisDataImport.DesignBasisDataImportId = SQLHelper.GetNewID();
|
||||
//hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId;
|
||||
//hJGL_DesignBasisDataImport.UnitWorkId = unitworkId;
|
||||
//hJGL_DesignBasisDataImport.ImportType = "1";
|
||||
//hJGL_DesignBasisDataImport.DataClassification = DataClassification;
|
||||
//hJGL_DesignBasisDataImport.FileName = FileName;
|
||||
//hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, "");
|
||||
//hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName);
|
||||
//hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId, DataClassification);
|
||||
//hJGL_DesignBasisDataImport.Remark = txtRemark.Text;
|
||||
//hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId;
|
||||
//hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
//BLL.HJGL_DesignBasisDataImportService.AddHJGL_DesignBasisDataImport(hJGL_DesignBasisDataImport);
|
||||
|
||||
//BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, (decimal)hJGL_DesignBasisDataImport.Version, DataClassification);
|
||||
|
||||
|
||||
}
|
||||
else //补充导入
|
||||
{
|
||||
AddView_HJGL_WeldJoint(PipelineList);
|
||||
|
||||
//Model.HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model.HJGL_DesignBasisDataImport();
|
||||
//hJGL_DesignBasisDataImport.DesignBasisDataImportId = SQLHelper.GetNewID();
|
||||
//hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId;
|
||||
//hJGL_DesignBasisDataImport.UnitWorkId = unitworkId;
|
||||
//hJGL_DesignBasisDataImport.ImportType = "0";
|
||||
//hJGL_DesignBasisDataImport.DataClassification = DataClassification;
|
||||
//hJGL_DesignBasisDataImport.FileName = FileName;
|
||||
//hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, ""); ;
|
||||
//hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName);
|
||||
//hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNowVersionByUnitWorkId(unitworkId, DataClassification);
|
||||
//hJGL_DesignBasisDataImport.Remark = txtRemark.Text;
|
||||
//hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId;
|
||||
//hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
//BLL.HJGL_DesignBasisDataImportService.AddHJGL_DesignBasisDataImport(hJGL_DesignBasisDataImport);
|
||||
|
||||
//BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, (decimal)hJGL_DesignBasisDataImport.Version, DataClassification);
|
||||
|
||||
}
|
||||
|
||||
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
||||
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
|
||||
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
public void AddView_HJGL_WeldJoint(List<Model.View_TestPackage_PipelineList> PipelineList)
|
||||
{
|
||||
string unitworkId = Request.Params["UnitWorkId"];
|
||||
|
||||
addTestPackage(PipelineList, unitworkId);
|
||||
addHJGL_WeldJoints(PipelineList, unitworkId);
|
||||
|
||||
}
|
||||
void addTestPackage(List<Model.View_TestPackage_PipelineList> PipelineList, string UnitWorkId)
|
||||
{
|
||||
var pipelines = (from x in PipelineList
|
||||
select new Model.PTP_TestPackage
|
||||
{
|
||||
PTP_ID = x.PTP_ID,
|
||||
ProjectId = this.CurrUser.LoginProjectId,
|
||||
UnitId = x.UnitId,
|
||||
UnitWorkId = x.UnitWorkId,
|
||||
TestPackageNo=x.TestPackageNo,
|
||||
TestPackageName=x.TestPackageName,
|
||||
Tabler =x.Tabler,
|
||||
TableDate=x.TableDate,
|
||||
Remark = x.Remark
|
||||
}).DistinctBy(temp => new
|
||||
{
|
||||
temp.PTP_ID,
|
||||
temp.ProjectId,
|
||||
temp.UnitId,
|
||||
temp.UnitWorkId,
|
||||
temp.TestPackageNo,
|
||||
temp.TestPackageName,
|
||||
temp.Remark
|
||||
}).ToList();
|
||||
for (int i = 0; i < pipelines.Count(); i++)
|
||||
{
|
||||
Model.PTP_TestPackage pipeline = new Model.PTP_TestPackage();
|
||||
pipeline.PTP_ID = pipelines[i].PTP_ID;
|
||||
pipeline.ProjectId = this.CurrUser.LoginProjectId;
|
||||
pipeline.UnitId = pipelines[i].UnitId;
|
||||
pipeline.UnitWorkId = pipelines[i].UnitWorkId;
|
||||
pipeline.TestPackageNo = pipelines[i].TestPackageNo;
|
||||
pipeline.TestPackageName = pipelines[i].TestPackageName;
|
||||
pipeline.Tabler = pipelines[i].Tabler;
|
||||
pipeline.TableDate = pipelines[i].TableDate;
|
||||
pipeline.Remark = pipelines[i].Remark;
|
||||
|
||||
var isExistTestPackageNo = TestPackageEditService.GetTestPackageByNo(pipeline.TestPackageNo, pipeline.UnitWorkId);
|
||||
if (isExistTestPackageNo != null) // 更新试压包
|
||||
{
|
||||
pipeline.PTP_ID = isExistTestPackageNo.PTP_ID;
|
||||
BLL.TestPackageEditService.UpdateTestPackage(pipeline);
|
||||
}
|
||||
else // 增加试压包
|
||||
{
|
||||
pipeline.PTP_ID = SQLHelper.GetNewID();
|
||||
BLL.TestPackageEditService.AddTestPackage(pipeline);
|
||||
}
|
||||
}
|
||||
}
|
||||
void addHJGL_WeldJoints(List<Model.View_TestPackage_PipelineList> PipelineList, string UnitWorkId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var getpipelines = from y in db.PTP_TestPackage where y.UnitWorkId == UnitWorkId select y;
|
||||
var allWeldJoints = from x in db.PTP_PipelineList
|
||||
join y in db.PTP_TestPackage on x.PTP_ID equals y.PTP_ID
|
||||
where y.UnitWorkId == UnitWorkId
|
||||
select x;
|
||||
List<Model.PTP_PipelineList> weldJoints_add = new List<Model.PTP_PipelineList>();
|
||||
|
||||
var weldJoints = (from x in PipelineList
|
||||
select new Model.PTP_PipelineList
|
||||
{
|
||||
PTP_ID = x.PTP_ID,
|
||||
PipelineId = x.PipelineId,
|
||||
TestPressure = x.TestPressure,
|
||||
}).DistinctBy(temp => new
|
||||
{
|
||||
temp.PTP_ID,
|
||||
temp.PipelineId,
|
||||
temp.TestPressure
|
||||
}).ToList();
|
||||
|
||||
var pipelineCodes = weldJoints.Select(x => x.PTP_ID).Distinct().ToList();
|
||||
for (int i = 0; i < weldJoints.Count(); i++)
|
||||
{
|
||||
Model.PTP_PipelineList weldJoint = new Model.PTP_PipelineList();
|
||||
//weldJoint.PipelineId = getpipelines.Where(x => x.TestPackageNo == weldJoints[i].PipelineCode).FirstOrDefault().PipelineId;
|
||||
//weldJoint.WeldJointCode = weldJoints[i].WeldJointCode;
|
||||
//weldJoint.PipelineCode = weldJoints[i].PipelineCode;
|
||||
|
||||
|
||||
var isExistJot = allWeldJoints.FirstOrDefault(x => x.PTP_ID == weldJoint.PTP_ID && x.PipelineId == weldJoint.PipelineId);
|
||||
if (isExistJot != null) // 更新焊口
|
||||
{
|
||||
weldJoint.PT_PipeId = isExistJot.PT_PipeId;
|
||||
BLL.TestPackageEditService.UpdatePipelineList(weldJoint);
|
||||
}
|
||||
else // 增加试压管线
|
||||
{
|
||||
weldJoint.PT_PipeId = SQLHelper.GetNewID();
|
||||
weldJoints_add.Add(weldJoint);
|
||||
}
|
||||
}
|
||||
if (weldJoints_add.Count > 0)
|
||||
{
|
||||
//BLL.TestPackageEditService.AddPipelineList(weldJoints_add);
|
||||
}
|
||||
Model.SGGLDB db2 = Funs.DB;
|
||||
List<Model.PTP_PipelineList> delJoints = new List<Model.PTP_PipelineList>();
|
||||
var allWeldJoints2 = from x in db2.PTP_PipelineList
|
||||
join y in db2.PTP_TestPackage on x.PTP_ID equals y.PTP_ID
|
||||
where y.UnitWorkId == Request.Params["UnitWorkId"]
|
||||
select x;
|
||||
foreach (var pipelineCode in pipelineCodes)
|
||||
{
|
||||
var pipelineWeldJointCodes = weldJoints.Where(x => x.PTP_ID == pipelineCode).Select(x => x.PipelineId).ToList();
|
||||
var q = allWeldJoints2.Where(x => x.PTP_ID == pipelineCode && !pipelineWeldJointCodes.Contains(x.PipelineId)).ToList();
|
||||
delJoints.AddRange(q);
|
||||
}
|
||||
if (delJoints.Count() > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
db2.PTP_PipelineList.DeleteAllOnSubmit(delJoints);
|
||||
db2.SubmitChanges();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
string weldJointCodes = string.Empty;
|
||||
foreach (var item in delJoints)
|
||||
{
|
||||
weldJointCodes += item.PipelineId + ",";
|
||||
}
|
||||
Alert.ShowInParent(weldJointCodes, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//public void AddView_HJGL_WeldJoint(List<Model.View_HJGL_WeldJoint> PipelineList)
|
||||
//{
|
||||
// string unitworkId = Request.Params["UnitWorkId"];
|
||||
|
||||
// var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId== unitworkId select x;
|
||||
// List<Model.HJGL_WeldJoint> weldJoints_add = new List<Model.HJGL_WeldJoint>();
|
||||
|
||||
// for (int i = 0; i < PipelineList.Count(); i++)
|
||||
// {
|
||||
// var pipeLineId = string.Empty;
|
||||
// var WeldJointId = string.Empty;
|
||||
|
||||
// Model.HJGL_Pipeline pipeline = new Model.HJGL_Pipeline();
|
||||
// pipeline.PipelineId = PipelineList[i].PipelineId;
|
||||
// pipeline.ProjectId = this.CurrUser.LoginProjectId;
|
||||
// pipeline.UnitId = PipelineList[i].UnitId;
|
||||
// pipeline.UnitWorkId = PipelineList[i].UnitWorkId;
|
||||
// pipeline.PipelineCode = PipelineList[i].PipelineCode;
|
||||
// pipeline.SingleName = PipelineList[i].SingleName;
|
||||
// pipeline.SingleNumber = PipelineList[i].SingleNumber;
|
||||
// pipeline.MediumId = PipelineList[i].MediumId;
|
||||
// pipeline.PipingClassId = PipelineList[i].PipingClassId;
|
||||
// pipeline.DetectionRateId = PipelineList[i].DetectionRateId;
|
||||
// pipeline.DetectionType = PipelineList[i].DetectionType;
|
||||
// pipeline.DesignPress = PipelineList[i].DesignPress;
|
||||
// pipeline.DesignTemperature = PipelineList[i].DesignTemperature;
|
||||
// pipeline.TestMedium = PipelineList[i].TestMedium;
|
||||
// pipeline.TestPressure = PipelineList[i].TestPressure;
|
||||
// pipeline.PressurePipingClassId = PipelineList[i].PressurePipingClassId;
|
||||
// pipeline.PipeLenth = PipelineList[i].PipeLenth;
|
||||
// pipeline.LeakMedium = PipelineList[i].LeakMedium;
|
||||
// pipeline.LeakPressure = PipelineList[i].LeakPressure;
|
||||
// pipeline.VacuumPressure = PipelineList[i].VacuumPressure;
|
||||
// pipeline.PCMedium = PipelineList[i].PCMedium;
|
||||
// pipeline.MaterialId = PipelineList[i].MaterialId;
|
||||
// pipeline.Remark = PipelineList[i].Remark;
|
||||
|
||||
// var isExistPipelineCode = getPipeline.FirstOrDefault(x => x.PipelineCode == pipeline.PipelineCode && x.UnitWorkId == Request.Params["UnitWorkId"]);
|
||||
// if (isExistPipelineCode != null) // 更新管线
|
||||
// {
|
||||
// pipeLineId = isExistPipelineCode.PipelineId;
|
||||
// pipeline.PipelineId = isExistPipelineCode.PipelineId;
|
||||
// BLL.PipelineService.UpdatePipeline(pipeline);
|
||||
// }
|
||||
// else // 增加管线
|
||||
// {
|
||||
// pipeLineId = SQLHelper.GetNewID();
|
||||
// pipeline.PipelineId = pipeLineId;
|
||||
// BLL.PipelineService.AddPipeline(pipeline);
|
||||
|
||||
// }
|
||||
|
||||
// Model.HJGL_WeldJoint weldJoint = new Model.HJGL_WeldJoint();
|
||||
// weldJoint.PipelineId = pipeLineId;
|
||||
// weldJoint.WeldJointCode = PipelineList[i].WeldJointCode;
|
||||
// weldJoint.PipelineCode = PipelineList[i].PipelineCode;
|
||||
// weldJoint.Material1Id = PipelineList[i].Material1Id;
|
||||
// weldJoint.Material2Id = PipelineList[i].Material2Id;
|
||||
// weldJoint.Dia = PipelineList[i].Dia;
|
||||
// weldJoint.Size = PipelineList[i].Size;
|
||||
// weldJoint.Thickness = PipelineList[i].Thickness;
|
||||
// weldJoint.Specification = PipelineList[i].Specification;
|
||||
// weldJoint.WeldTypeId = PipelineList[i].WeldTypeId;
|
||||
// weldJoint.DetectionTypeId = PipelineList[i].DetectionTypeId;
|
||||
// weldJoint.JointAttribute = PipelineList[i].JointAttribute;
|
||||
// weldJoint.ProjectId= PipelineList[i].ProjectId;
|
||||
// var isExistJot = getPipeline.FirstOrDefault(x => x.PipelineId == pipeLineId && x.WeldJointCode == PipelineList[i].WeldJointCode);
|
||||
// if (isExistJot != null) // 更新焊口
|
||||
// {
|
||||
// weldJoint.WeldJointId = isExistJot.WeldJointId;
|
||||
// BLL.WeldJointService.UpdateWeldJoint(weldJoint);
|
||||
// }
|
||||
// else // 增加焊口
|
||||
// {
|
||||
// weldJoint.WeldJointId=SQLHelper.GetNewID();
|
||||
// weldJoints_add.Add(weldJoint);
|
||||
// //BLL.WeldJointService.AddWeldJoint(weldJoint);
|
||||
// }
|
||||
// }
|
||||
// if (weldJoints_add.Count>0)
|
||||
// {
|
||||
// BLL.WeldJointService.AddBulkWeldJoint(weldJoints_add);
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 恢复版本
|
||||
/// </summary>
|
||||
/// <param name="unitworkId"></param>
|
||||
/// <param name="version"></param>
|
||||
private void RestoreVersion(string unitworkId, decimal version)
|
||||
{
|
||||
//var model = BLL.HJGL_DesignBasisDataImportService.GetDataByUnitWorkIdAndVersion(unitworkId, version, DataClassification);
|
||||
//if (model != null && model.Count > 0)
|
||||
//{
|
||||
// foreach (var item in model)
|
||||
// {
|
||||
|
||||
// string rootPath = Server.MapPath("~/");
|
||||
// // initFullPath = rootPath + initPath;
|
||||
// string filePath = rootPath + item.FilePath;
|
||||
// ImportXlsToData(filePath);
|
||||
// BLL.PipelineMatService.DeletePipeLineMatByUnitWorkId(unitworkId);//删除原有管线对应材料
|
||||
// BLL.WeldJointService.DeleteWeldJointByUnitWorkId(unitworkId);////删除原有管线对应焊口
|
||||
// BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线
|
||||
// AddView_HJGL_WeldJoint(PipelineList);//导入数据
|
||||
// PipelineList.Clear();
|
||||
|
||||
// }
|
||||
// BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, version, DataClassification);
|
||||
// PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
|
||||
|
||||
// ShowNotify("恢复成功!");
|
||||
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void btnRestore_Click(object sender, EventArgs e)
|
||||
{
|
||||
//if (string.IsNullOrEmpty(drpVersion.SelectedValue))
|
||||
//{
|
||||
// ShowNotify("请选择版本");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// PageContext.RegisterStartupScript(Confirm.GetShowReference("确定恢复至该版本吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_Restore"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
#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.TestPackageTemplateUrl;
|
||||
string filePath = Const.TestPackageTemplateUrl;
|
||||
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();
|
||||
}
|
||||
//else if (e.EventArgument == "Confirm_Restore")
|
||||
//{
|
||||
// var unitworkid = Request.Params["UnitWorkId"];
|
||||
// decimal version = decimal.Parse(drpVersion.SelectedValue);
|
||||
// RestoreVersion(unitworkid, version);
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页选择下拉改变事件
|
||||
/// <summary>
|
||||
/// 分页选择下拉改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
this.Grid1.DataSource = PipelineList;
|
||||
this.Grid1.DataBind();
|
||||
Grid1.RecordCount = PipelineList.Count;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HJGL.TestPackage
|
||||
{
|
||||
|
||||
|
||||
public partial class TestPackageImport
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// fuAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload fuAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// DrpType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DrpType;
|
||||
|
||||
/// <summary>
|
||||
/// hdFileName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdFileName;
|
||||
|
||||
/// <summary>
|
||||
/// btnDownLoad 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDownLoad;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
this.ProjectId = Request.QueryString["ProjectId"];
|
||||
|
||||
UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true);
|
||||
BindGrid();
|
||||
this.drpUnit.SelectedValue = Const.UnitId_SEDIN;
|
||||
if (!String.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
|
||||
+759
-201
File diff suppressed because it is too large
Load Diff
@@ -258,6 +258,7 @@
|
||||
<Compile Include="TokenItem.cs" />
|
||||
<Compile Include="ZHGL\DataSync\AccidentOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\BaseEntities.cs" />
|
||||
<Compile Include="ZHGL\DataSync\CHCheckItemOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\CheckOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\ConstructionEquipmentOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\CostSmallDetailOutput.cs" />
|
||||
@@ -267,6 +268,7 @@
|
||||
<Compile Include="ZHGL\DataSync\HiddenRectificationOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\HJGLDataItem.cs" />
|
||||
<Compile Include="ZHGL\DataSync\HSSEDataItem.cs" />
|
||||
<Compile Include="ZHGL\DataSync\InspectionManagementOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\LargeEngineeringOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\LicenseOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\MeetingOutput.cs" />
|
||||
@@ -275,6 +277,9 @@
|
||||
<Compile Include="ZHGL\DataSync\ProjectOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\SecurityRiskOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\SYHSEDataItem.cs" />
|
||||
<Compile Include="ZHGL\DataSync\WBSBreakdownProjectOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\WeldDineOutput.cs" />
|
||||
<Compile Include="ZHGL\DataSync\WelderOutput.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 焊接信息
|
||||
/// </summary>
|
||||
public class CHCheckItemOutput : BaseEntities
|
||||
{
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 总片数
|
||||
/// </summary>
|
||||
public int? CHT_TotalFilm { get; set; }
|
||||
/// <summary>
|
||||
/// 合格片数
|
||||
/// </summary>
|
||||
public int? CHT_PassFilm { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,25 @@ namespace Model
|
||||
public int? UnitProjectOnesOKNum { get; set; }
|
||||
public string UnitProjectOnesRate { get; set; }
|
||||
public int? UseNum { get; set; }
|
||||
public int? EquipmentInspectionNum { get; set; }
|
||||
public int? EquipmentInspectionQualifiedNum { get; set; }
|
||||
public int? MachineInspectionNum { get; set; }
|
||||
public int? MachineInspectionQualifiedNum { get; set; }
|
||||
public int? PersonInspectionNum { get; set; }
|
||||
public int? PersonInspectionQualifiedNum { get; set; }
|
||||
public int? MaterialInspectionNum { get; set; }
|
||||
public int? MaterialInspectionQualifiedNum { get; set; }
|
||||
public int? ConstructSolutionNum { get; set; }
|
||||
public int? ConstructSolutionProjectApproveNum { get; set; }
|
||||
public int? ConstructSolutionUnitApproveNum { get; set; }
|
||||
public int? SpecialEquipmentQualityAssuranceSystemNum { get; set; }
|
||||
public int? DesignDetailsNum { get; set; }
|
||||
public int? UnitProjectAcceptNum { get; set; }
|
||||
public int? UnitProjectAcceptOKNum { get; set; }
|
||||
public int? SubProjectAcceptNum { get; set; }
|
||||
public int? SubProjectAcceptOKNum { get; set; }
|
||||
public int? SubdivisionalWorksAcceptNum { get; set; }
|
||||
public int? SubdivisionalWorksAcceptOKNum { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace Model
|
||||
public int? CompanyComprehensiveCheckNum { get; set; }
|
||||
public int? CompanyComprehensivePlanNum { get; set; }
|
||||
public int? CompanyDrillNum { get; set; }
|
||||
public int? CompanyDrillPersonNum { get; set; }
|
||||
|
||||
public int? CompanyLeadShiftCheckNum { get; set; }
|
||||
public int? CompanyOnSiteDisposalPlan { get; set; }
|
||||
public int? CompanySpecialCheckNum { get; set; }
|
||||
@@ -39,6 +41,8 @@ namespace Model
|
||||
public int? CostUse { get; set; }
|
||||
public int? EnterpriseTopicsMeetingNum { get; set; }
|
||||
public int? FinishedNum { get; set; }
|
||||
public int? ArgumentNum { get; set; }
|
||||
public int? SuperArgumentNum { get; set; }
|
||||
public int? GeneralAccidentNum { get; set; }
|
||||
public int? GeneralClosedNum { get; set; }
|
||||
public int? GeneralNotClosedNum { get; set; }
|
||||
@@ -64,6 +68,8 @@ namespace Model
|
||||
public decimal? NewWaterConsumption { get; set; }
|
||||
public int? ProjectComprehensivePlanNum { get; set; }
|
||||
public int? ProjectDrillNum { get; set; }
|
||||
public int? ProjectDrillPersonNum { get; set; }
|
||||
|
||||
public int? ProjectFullTimeNum { get; set; }
|
||||
public int? ProjectInspectorGeneralNum { get; set; }
|
||||
public int? ProjectLeadShiftCheckNum { get; set; }
|
||||
@@ -84,6 +90,8 @@ namespace Model
|
||||
public int? ShutdownNum { get; set; }
|
||||
public int? SpecialEquipmentNum { get; set; }
|
||||
public int? SpecialOperationTrainNum { get; set; }
|
||||
public int? HseTechnicalNum { get; set; }
|
||||
|
||||
public int? EnvironmentalTrainNum { get; set; }
|
||||
public int? SpecialSeriousAccidentNum { get; set; }
|
||||
public int? SpecialTrainNum { get; set; }
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量验收数据
|
||||
/// </summary>
|
||||
public class InspectionManagementOutput : BaseEntities
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string BreakdownCode { get; set; }
|
||||
public string BreakdownName { get; set; }
|
||||
public string Basis { get; set; }
|
||||
public string CheckPoints { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Model
|
||||
{
|
||||
public class LargeEngineeringOutput:BaseEntities
|
||||
public class LargeEngineeringOutput : BaseEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// 危大工程审批完成数
|
||||
@@ -34,5 +34,13 @@
|
||||
/// 超危大工程完工个数
|
||||
/// </summary>
|
||||
public int SuperFinishedNum { get; set; }
|
||||
/// <summary>
|
||||
/// 危大工程论证个数
|
||||
/// </summary>
|
||||
public int ArgumentNum { get; set; }
|
||||
/// <summary>
|
||||
/// 超危大工程论证个数
|
||||
/// </summary>
|
||||
public int SuperArgumentNum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
public class WBSBreakdownProjectOutput :BaseEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public int Sum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 焊接达因数
|
||||
/// </summary>
|
||||
public class WeldDineOutput : BaseEntities
|
||||
{
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 达因数
|
||||
/// </summary>
|
||||
public decimal? Size { get; set; }
|
||||
/// <summary>
|
||||
/// 完成达因数
|
||||
/// </summary>
|
||||
public decimal? DoneDin { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 焊工数据
|
||||
/// </summary>
|
||||
public class WelderOutput : BaseEntities
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string WEDCode { get; set; }
|
||||
public string WEDName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ namespace WebAPI.Controllers
|
||||
/// 获取质量统计数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ReturnData PostGetCQMSData()
|
||||
public async Task<Model.ReturnData> PostGetCQMSData()
|
||||
{
|
||||
var returnData = new Model.ReturnData();
|
||||
returnData.type = "CQMS";
|
||||
@@ -29,7 +29,7 @@ namespace WebAPI.Controllers
|
||||
returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime;
|
||||
if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now)
|
||||
{
|
||||
returnData.data = CQMSDataService.GetTodayCQMSData_CQMS();
|
||||
returnData.data = await CQMSDataService.GetTodayCQMSData_CQMS();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -70,7 +70,7 @@ namespace WebAPI.Controllers
|
||||
/// 获取焊接统计数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ReturnData PostGetHJGLData()
|
||||
public async Task<ReturnData> PostGetHJGLData()
|
||||
{
|
||||
var returnData = new Model.ReturnData();
|
||||
returnData.type = "HJGL";
|
||||
@@ -80,7 +80,7 @@ namespace WebAPI.Controllers
|
||||
returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime;
|
||||
if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now)
|
||||
{
|
||||
returnData.data = HJGLData_HJGLService.GetTodayHJGLData_HJGL();
|
||||
returnData.data = await HJGLData_HJGLService.GetTodayHJGLData_HJGLAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -120,6 +120,35 @@ namespace WebAPI.Controllers
|
||||
/// 获取安全统计数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/*public Model.ReturnData PostGetHSSEData()
|
||||
{
|
||||
var returnData = new Model.ReturnData();
|
||||
returnData.type = "HSSE";
|
||||
returnData.time = DateTime.Now.ToString();
|
||||
ServerService.GetToken();
|
||||
returnData.token = BLL.SysConstSetService.CNCECToken;
|
||||
returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime;
|
||||
if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now)
|
||||
{
|
||||
try
|
||||
{
|
||||
returnData.data = HSSEData_HSSEService.StatisticalDataAsync().Result;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
returnData.code = 0;
|
||||
returnData.message = ex.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
returnData.code = 500;
|
||||
returnData.message = "token失效";
|
||||
}
|
||||
return returnData;
|
||||
}*/
|
||||
public async Task<Model.ReturnData> PostGetHSSEData()
|
||||
{
|
||||
var returnData = new Model.ReturnData();
|
||||
@@ -147,6 +176,7 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
return returnData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取安全统计数据成功后,回调通知上报成功
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user