This commit is contained in:
高飞 2025-12-19 16:30:00 +08:00
parent f9db060ce5
commit 6a756be0e7
2 changed files with 143 additions and 0 deletions

View File

@ -0,0 +1,105 @@
CREATE VIEW [dbo].[View_WelderPerformance]
AS
select v.* from
(SELECT
NEWID() AS Id,
--total.ProjectId,
--project.ProjectCode,--
'' as ProjectCode,
total.Welder,
wld.wed_code,-- 焊工代码
wld.wed_name,--
wld.WED_Sex, --
-------------start
CAST(ISNULL(total.totalSize,0) AS DECIMAL(19,2)) AS totalSize, --
ISNULL(total.totalJoint,0) AS totalJoint, --
ISNULL(JointNum1.JointNum1,0) AS JointNum1, --
ISNULL(JointNum1.JointNum1,0)-ISNULL(JointNoPassNum1.JointNoPassNum1,0) AS JointPassNum1, --
ISNULL(JointNoPassNum1.JointNoPassNum1,0) AS RepairJoint1, --
ISNULL(RepairJoint2.RepairJoint2,0) AS RepairJoint2, --
ISNULL(RepairJoint3.RepairJoint3,0) AS RepairJoint3, --
CAST((CASE ISNULL((ISNULL(JointNum1.JointNum1,0)-ISNULL(JointNoPassNum1.JointNoPassNum1,0)),0) WHEN 0 THEN 0
ELSE (CASE(ISNULL(JointNum1.JointNum1,0)) WHEN 0 THEN 0
ELSE 1.0 * ISNULL((ISNULL(JointNum1.JointNum1,0)-ISNULL(JointNoPassNum1.JointNoPassNum1,0)),0)/(1.0 * JointNum1.JointNum1)
END)END) AS DECIMAL(19,3)) AS JointPassRate , ---
ISNULL(JointNum1.totalfilm,0) AS totalfilm, --
(ISNULL(JointNum1.totalfilm,0)- ISNULL(JointNoPassNum2.JointNoPassFilmNum2,0)) AS totalPassfilm, --
ISNULL(JointNoPassNum2.JointNoPassFilmNum2,0) AS repairFilm1, --
ISNULL(RepairJoint2.repairFilm2,0) AS repairFilm2, --
ISNULL(RepairJoint3.repairFilm3,0) AS repairFilm3, --
CAST((CASE (ISNULL(JointNum1.totalfilm,0)- ISNULL(JointNoPassNum2.JointNoPassFilmNum2,0)) WHEN 0 THEN 0
ELSE (CASE(ISNULL(JointNum1.totalfilm,0)) WHEN 0 THEN 0
ELSE 1.0 * (ISNULL(JointNum1.totalfilm,0)- ISNULL(JointNoPassNum2.JointNoPassFilmNum2,0))/(1.0 * JointNum1.totalfilm)
END) END) AS DECIMAL(19,3)) AS JointFilmPassRate ---
FROM
-- --
(SELECT SUM(joint.JOT_Size) AS totalSize,COUNT(*) AS totalJoint
,joint.Welder
FROM View_JointWelder joint
LEFT JOIN HJGL_BO_WeldReportMain report ON joint.DReportID = report.DReportID
WHERE joint.DReportID IS NOT NULL
GROUP BY joint.Welder) AS total
-- , ,
LEFT JOIN (SELECT COUNT(joint.JOT_ID) AS JointNum1, SUM(joint.RT_FilmNum) AS totalfilm,
joint.Welder
FROM dbo.View_JointWelder joint
WHERE joint.PointType='点口' AND joint.RT_FilmNum IS NOT NULL and joint.RT_FilmNum>0 and (select COUNT(*) from dbo.HJGL_BO_QualityRating a
left join HJGL_CH_TrustItem b on a.CH_TrustItemID=b.CH_TrustItemID
left join HJGL_CH_Trust c on b.CH_TrustID=c.CH_TrustID where a.JOT_ID=joint.JOT_ID and FilmNum is not null and c.CH_NDTMethod='20d2cbca-8b3d-434b-b1c1-181796986fa5')>0
AND joint.dreportid IS NOT NULL
GROUP BY joint.Welder) AS JointNum1
ON JointNum1.Welder = total.Welder
--
LEFT JOIN (SELECT COUNT(distinct joint.JOT_ID) AS JointNoPassNum1,
joint.Welder
FROM dbo.HJGL_CH_RepairItemRecord rr
left join dbo.View_JointWelder joint on rr.JOT_ID=joint.JOT_ID
WHERE joint.PointType='点口' and rr.NDT_ID='20d2cbca-8b3d-434b-b1c1-181796986fa5'
--AND (joint.RT1_RepairFilm IS NOT NULL or (select top 1 CH_TrustItemID from dbo.HJGL_CH_TrustItem ti where ti.JOT_ID=joint.JOT_ID and ti.States='4') is not null)
AND joint.dreportid IS NOT NULL and rr.RepairMark='R1'
GROUP BY joint.Welder) AS JointNoPassNum1
ON JointNoPassNum1.Welder = total.Welder
--
LEFT JOIN (SELECT count(rr.RepairItemRecordId) as JointNoPassFilmNum2,
joint.Welder
FROM dbo.HJGL_CH_RepairItemRecord rr
left join dbo.View_JointWelder joint on rr.JOT_ID=joint.JOT_ID
WHERE joint.PointType='点口' and rr.NDT_ID='20d2cbca-8b3d-434b-b1c1-181796986fa5'
--AND (joint.RT1_RepairFilm IS NOT NULL or (select top 1 CH_TrustItemID from dbo.HJGL_CH_TrustItem ti where ti.JOT_ID=joint.JOT_ID and ti.States='4') is not null)
AND joint.dreportid IS NOT NULL and rr.RepairMark='R1'
GROUP BY joint.Welder) AS JointNoPassNum2
ON JointNoPassNum2.Welder = total.Welder
--,
LEFT JOIN (SELECT COUNT(joint.JOT_ID) AS RepairJoint2, SUM(ISNULL(joint.RT2_RepairFilmNum,0)) AS RepairFilm2,
joint.Welder
FROM dbo.View_JointWelder joint
WHERE joint.PointType='点口' AND joint.RT2_RepairFilm IS NOT NULL
AND joint.dreportid IS NOT NULL
GROUP BY joint.Welder) AS RepairJoint2
ON RepairJoint2.Welder = total.Welder
--,
LEFT JOIN (SELECT COUNT(joint.JOT_ID) AS RepairJoint3, SUM(ISNULL(joint.RT3_RepairFilmNum,0)) AS RepairFilm3,
joint.Welder
FROM dbo.View_JointWelder joint
WHERE joint.PointType='点口' AND joint.RT3_RepairFilm IS NOT NULL
AND joint.dreportid IS NOT NULL
GROUP BY joint.Welder) AS RepairJoint3
ON RepairJoint3.Welder = total.Welder
LEFT JOIN dbo.HJGL_BS_Welder wld ON wld.WED_ID=total.Welder) v
where v.JointFilmPassRate>0 and v.JointFilmPassRate<0.965
GO

View File

@ -108,3 +108,41 @@ IP地址:::1
出错时间:12/17/2025 23:07:59 出错时间:12/17/2025 23:07:59
错误信息开始=====>
错误类型:SqlException
错误信息:在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - 定位指定的服务器/实例时出错)
错误堆栈:
在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
在 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
在 System.Data.SqlClient.SqlConnection.Open()
在 System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
在 System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
在 System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
在 System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
在 BLL.Base_UnitService.GetAllUnits2() 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\BLL\Common\BaseInfo\Base_UnitService.cs:行号 232
在 FineUIPro.Web.HJGL.WeldingReport.WelderPerformance.Page_Load(Object sender, EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\HJGL\WeldingReport\WelderPerformance.aspx.cs:行号 26
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:12/19/2025 15:48:37
出错文件:http://localhost:60961/HJGL/WeldingReport/WelderPerformance.aspx
IP地址:::1
出错时间:12/19/2025 15:48:37