焊接修改

This commit is contained in:
2023-04-30 10:08:41 +08:00
parent a7b215109c
commit c96a443c37
10 changed files with 355 additions and 7 deletions
@@ -0,0 +1,97 @@
CREATE PROCEDURE [dbo].[Sp_APP_GetHSSEToDoItems]
@projectId NVARCHAR(50) = NULL,
@userId NVARCHAR(200)=NULL
AS
/*获取当前人待办事项*/
BEGIN
select a.DataId, '职业健康安全危险源辨识与评价' as MenuName, '编号: '+b.HazardListCode+' 单位工程:'+b.WorkAreaName+' 待处理' as Content, b.CompileDate as DataTime,users.UserId
,users.UserName, '../HSSE/Hazard/HazardListEdit.aspx?HazardListId='+b.HazardListId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+b.HazardListId+'' as UrlStr
from Hazard_HazardList b left join Sys_FlowOperate a on a.DataId = b.HazardListId
left join Sys_User users on users.UserId = b.CompileMan
where a.IsClosed = 0
and b.ProjectId=@projectId
and a.OperaterId=@userId
union ALL
select a.LawRegulationIdentifyId, '法律法规辨识' as MenuName, '编号: '+a.LawRegulationIdentifyCode+' 版本号:'+a.VersionNumber+' 待处理' as Content, a.UpdateDate as DataTime,users.UserId
,users.UserName, '../HSSE/InformationProject/LawRegulationIdentifyEdit.aspx?LawRegulationIdentifyId='+a.LawRegulationIdentifyId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+a.LawRegulationIdentifyId+'' as UrlStr
from Law_LawRegulationIdentify a left join Sys_FlowOperate b on a.LawRegulationIdentifyId = b.DataId
left join Sys_User users on users.UserId = a.IdentifyPerson
where b.IsClosed = 0 and a.ProjectId=@projectId
and b.OperaterId=@userId
union ALL
select a.ConstructionStandardIdentifyId, '标准规范清单' as MenuName, '编号: '+a.ConstructionStandardIdentifyCode+' 版本号:'+a.VersionNumber+' 待处理' as Content, a.UpdateDate as DataTime,users.UserId
,users.UserName, '../HSSE/InformationProject/ConstructionStandardIdentifyEdit.aspx?ConstructionStandardIdentifyId='+a.ConstructionStandardIdentifyId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+a.ConstructionStandardIdentifyId+'' as UrlStr
from InformationProject_ConstructionStandardIdentify a left join Sys_FlowOperate b on a.ConstructionStandardIdentifyId = b.DataId
left join Sys_User users on users.UserId = a.IdentifyPerson
where b.IsClosed = 0 and a.ProjectId=@projectId
and b.OperaterId=@userId
union ALL
select a.ActionPlanListId, 'HSE实施计划' as MenuName, '编号: '+a.ActionPlanListCode+' 名称:'+a.ActionPlanListName+' 待处理' as Content, a.CompileDate as DataTime,users.UserId
,users.UserName, '../HSSE/ActionPlan/ActionPlanListId.aspx?ActionPlanListId='+a.ActionPlanListId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+a.ActionPlanListId+'' as UrlStr
from ActionPlan_ActionPlanList a left join Sys_FlowOperate b on a.ActionPlanListId = b.DataId
left join Sys_User users on users.UserId = a.CompileMan
where b.IsClosed = 0 and a.ProjectId=@projectId
and b.OperaterId=@userId
union ALL
select a.EnvironmentalRiskListId, '环境因素识别与评价' as MenuName, '编号: '+CodeRecords.Code+' 单位工程:'+a.WorkAreaName+' 待处理' as Content, a.CompileDate as DataTime,users.UserId
,users.UserName, '../HSSE/Hazard/EnvironmentalRiskListEdit.aspx?EnvironmentalRiskListId='+a.EnvironmentalRiskListId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+a.EnvironmentalRiskListId+'' as UrlStr
from Hazard_EnvironmentalRiskList a left join Sys_FlowOperate b on a.EnvironmentalRiskListId = b.DataId
left join Sys_User users on users.UserId = a.CompileMan
LEFT JOIN Sys_CodeRecords AS CodeRecords ON a.EnvironmentalRiskListId=CodeRecords.DataId
where b.IsClosed = 0 and a.ProjectId=@projectId
and b.OperaterId=@userId
union ALL
select a.OtherHazardId, '其他危险源辨识文件' as MenuName, '编号: '+CodeRecords.Code+' 文件名称:'+a.OtherHazardName+' 待处理' as Content, a.CompileDate as DataTime,users.UserId
,users.UserName, '../HSSE/Hazard/OtherHazardEdit.aspx?OtherHazardId='+a.OtherHazardId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+a.OtherHazardId+'' as UrlStr
from Hazard_OtherHazard a left join Sys_FlowOperate b on a.OtherHazardId = b.DataId
left join Sys_User users on users.UserId = a.CompileMan
LEFT JOIN Sys_CodeRecords AS CodeRecords ON a.OtherHazardId=CodeRecords.DataId
where b.IsClosed = 0 and a.ProjectId=@projectId
and b.OperaterId=@userId
union ALL
select a.TrainingId, '培训记录' as MenuName, '编号: '+a.TrainingCode+' 标题:'+a.TrainTitle+' 待处理' as Content, a.TrainStartDate as DataTime,users.UserId
,users.UserName, '../HSSE/EduTrain/TrainRecordEdit.aspx?TrainingId='+a.TrainingId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+a.TrainingId+'' as UrlStr
from EduTrain_TrainRecord a left join Sys_FlowOperate b on a.TrainingId = b.DataId
left join Sys_User users on users.UserId = a.CompileMan
where b.IsClosed = 0 and a.ProjectId=@projectId
and b.OperaterId=@userId
union ALL
select a.PersonId, '人员信息档案' as MenuName, '姓名: '+a.PersonName+' 身份证:'+a.IdentityCard+' 待处理' as Content, a.InTime as DataTime,''
,'', '../HSSE/SitePerson/PersonListEdit.aspx?PersonId='+a.PersonId+'' as PCUrl
,'/pagesQ/file_manage/detail?id='+a.PersonId+'' as UrlStr
from SitePerson_Person a left join Sys_FlowOperate b on a.PersonId = b.DataId
where b.IsClosed = 0 and a.ProjectId=@projectId
and b.OperaterId=@userId
END
GO
@@ -0,0 +1,39 @@
ALTER VIEW [dbo].[View_CH_TrustSearch]
/*官辜츠玖깊꿴璂죗깊*/
AS
SELECT
JointInfo.JOT_ID, --보왯id
JointInfo.JOT_JointNo, --보왯덜뵀
JointInfo.JOT_JointStatus,
IsoInfo.ISO_ID, --밗窟id
IsoInfo.ISO_IsoNo,
IsoInfo.UnitId,
WorkArea.WorkAreaId, --혐堵id
JointInfo.ProjectId,
Point.PW_PointID, --듐왯
Point.PW_PointNo,
Point.PW_PointType,
JointInfo.JOT_JointDesc,--보왯방목
case when isoInfo.[Is_Standard] = 0 then
(detectionRate.DetectionRate+'%') else (detectionRate1.DetectionRate+'%') end AS DetectionRate
FROM dbo.PW_JointInfo AS JointInfo
LEFT JOIN dbo.PW_IsoInfo AS IsoInfo ON IsoInfo.ISO_ID = JointInfo.ISO_ID
LEFT JOIN dbo.ProjectData_WorkArea AS WorkArea ON WorkArea.WorkAreaId=IsoInfo.WorkAreaId
LEFT JOIN dbo.BO_Point AS Point ON Point.PW_PointID =JointInfo.PW_PointID
LEFT JOIN dbo.CH_TrustItem AS TrustItem ON TrustItem.JOT_ID =JointInfo.JOT_ID
LEFT JOIN Base_DetectionRate AS detectionRate ON detectionRate.DetectionRateId = IsoInfo.DetectionRateId
LEFT JOIN Base_DetectionRate AS detectionRate1 ON detectionRate1.DetectionRateId = JointInfo.DetectionRateId
WHERE TrustItem.CH_TrustItemID IS NULL AND Point.PW_PointID IS NOT NULL
AND JointInfo.JOT_JointStatus ='101'
GO
@@ -0,0 +1,77 @@
ALTER VIEW [dbo].[View_CH_RepairSearch]
/*返修委托明细表查询列表*/
AS
SELECT DISTINCT
JointInfo.JOT_ID, --焊口id
JointInfo.JOT_JointNo, --焊口代号
(CASE WHEN JointInfo.JOT_JointStatus ='102' THEN '扩透'
ELSE CASE WHEN JointInfo.JOT_JointStatus ='104' THEN '切除'
ELSE '点口' END END) AS JOT_JointStatus,
IsoInfo.ISO_ID, --管线id
IsoInfo.ISO_IsoNo,
IsoInfo.UnitId,
WorkArea.WorkAreaId, --区域id
JointInfo.ProjectId,
Checks.CHT_CheckID, --点口
Checks.CHT_CheckCode,
Checks.RepairTrustId,
JointInfo.JOT_JointDesc,--焊口规格
case when isoInfo.[Is_Standard] = 0 then
(detectionRate.DetectionRate+'%') else (detectionRate1.DetectionRate+'%') end AS DetectionRate
FROM
dbo.CH_Check AS Checks
LEFT JOIN dbo.CH_CheckItem AS CheckItem ON Checks.CHT_CheckID =CheckItem.CHT_CheckID
LEFT JOIN dbo.PW_JointInfo AS JointInfo ON CheckItem.JOT_ID =JointInfo.JOT_ID
LEFT JOIN dbo.PW_IsoInfo AS IsoInfo ON IsoInfo.ISO_ID = JointInfo.ISO_ID
LEFT JOIN dbo.ProjectData_WorkArea AS WorkArea ON WorkArea.WorkAreaId=IsoInfo.WorkAreaId
LEFT JOIN dbo.CH_Trust AS trust ON trust.CH_TrustID = Checks.CH_TrustID
LEFT JOIN dbo.Base_DetectionType AS ndt ON ndt.DetectionTypeId = trust.CH_NDTMethod
LEFT JOIN Base_DetectionRate AS detectionRate ON detectionRate.DetectionRateId = IsoInfo.DetectionRateId
LEFT JOIN Base_DetectionRate AS detectionRate1 ON detectionRate1.DetectionRateId = JointInfo.DetectionRateId
WHERE Checks.CHT_AuditDate IS NOT NULL AND
ndt.DetectionTypeCode='RT' AND
CheckItem.CHT_PassFilm != CheckItem.CHT_TotalFilm
UNION
SELECT DISTINCT
JointInfo.JOT_ID, --焊口id
JointInfo.JOT_JointNo, --焊口代号
(CASE WHEN JointInfo.JOT_JointStatus ='102' THEN '扩透'
ELSE CASE WHEN JointInfo.JOT_JointStatus ='104' THEN '切除'
ELSE '点口' END END) AS JOT_JointStatus,
IsoInfo.ISO_ID, --管线id
IsoInfo.ISO_IsoNo,
IsoInfo.UnitId,
WorkArea.WorkAreaId, --区域id
JointInfo.ProjectId,
Checks.CHT_CheckID, --点口
Checks.CHT_CheckCode,
Checks.RepairTrustId,
JointInfo.JOT_JointDesc,--焊口规格
case when isoInfo.[Is_Standard] = 0 then
(detectionRate.DetectionRate+'%') else (detectionRate1.DetectionRate+'%') end AS DetectionRate
FROM
dbo.CH_Check AS Checks
LEFT JOIN dbo.CH_CheckItem AS CheckItem ON Checks.CHT_CheckID =CheckItem.CHT_CheckID
LEFT JOIN dbo.PW_JointInfo AS JointInfo ON CheckItem.JOT_ID =JointInfo.JOT_ID
LEFT JOIN dbo.PW_IsoInfo AS IsoInfo ON IsoInfo.ISO_ID = JointInfo.ISO_ID
LEFT JOIN dbo.ProjectData_WorkArea AS WorkArea ON WorkArea.WorkAreaId=IsoInfo.WorkAreaId
LEFT JOIN dbo.CH_Trust AS trust ON trust.CH_TrustID = Checks.CH_TrustID
LEFT JOIN dbo.Base_DetectionType AS ndt ON ndt.DetectionTypeId = trust.CH_NDTMethod
LEFT JOIN Base_DetectionRate AS detectionRate ON detectionRate.DetectionRateId = IsoInfo.DetectionRateId
LEFT JOIN Base_DetectionRate AS detectionRate1 ON detectionRate1.DetectionRateId = JointInfo.DetectionRateId
WHERE Checks.CHT_AuditDate IS NOT NULL AND
ndt.DetectionTypeCode!='RT' AND
CheckItem.CHT_CheckResult='不合格'
GO