diff --git a/DataBase/版本日志/HJGLDB_DS_2025-05-12_gf.sql b/DataBase/版本日志/HJGLDB_DS_2025-05-12_gf.sql index bab0357..a618757 100644 --- a/DataBase/版本日志/HJGLDB_DS_2025-05-12_gf.sql +++ b/DataBase/版本日志/HJGLDB_DS_2025-05-12_gf.sql @@ -138,3 +138,384 @@ WHERE GO + + + +ALTER PROC [dbo].[HJGL_sp_rpt_welderStatistics] + @unitcode varchar(50) = NULL, + @WED_ID nvarchar(50) = NULL, + @projectId NVARCHAR(50) = NULL +AS +/*ӼͳƱ*/ +SELECT + welder.ProjectId, + project.ProjectCode,--ʩ + wld.wed_code,-- + wld.wed_name,-- + + ISNULL(totalJoint.totalJoint,0) AS totalJoint, --Ѻ + ISNULL(TrustJointNum.TrustJointNum,0) AS TrustJointNum, --ίк + CAST((CASE ISNULL(TrustJointNum.TrustJointNum,0) WHEN 0 THEN 0 + ELSE 1.0 * ISNULL(TrustJointNum.TrustJointNum,0)/(1.0 * totalJoint.totalJoint) END) AS DECIMAL(19,3)) + AS OneCheckRate , ---һμ + + ISNULL(FixedJoint.FixedJoint,0) AS FixedJoint, --Ѻ̶ + ISNULL(TrustFixedJoint.TrustFixedJoint,0) AS TrustFixedJoint, --ίй̶ + CAST((CASE ISNULL(TrustFixedJoint.TrustFixedJoint,0) WHEN 0 THEN 0 + ELSE 1.0 * ISNULL(TrustFixedJoint.TrustFixedJoint,0)/(1.0 * FixedJoint.FixedJoint) END) AS DECIMAL(19,3)) + AS FixedJointCheckRate , ---̶ڼ + + ISNULL(ButtJoint.ButtJoint,0) AS ButtJoint, --ѺԽӺ + ISNULL(TrustButtJoint.TrustButtJoint,0) AS TrustButtJoint, --ίжԽӺ + CAST((CASE ISNULL(TrustButtJoint.TrustButtJoint,0) WHEN 0 THEN 0 + ELSE 1.0 * ISNULL(TrustButtJoint.TrustButtJoint,0)/(1.0 * ButtJoint.ButtJoint) END) AS DECIMAL(19,3)) + AS ButtJointCheckRate , ---ԽӺ + + ISNULL(FilletJoint.FilletJoint,0) AS FilletJoint, --ѺǺ + ISNULL(TrustFilletJoint.TrustFilletJoint,0) AS TrustFilletJoint, --ίнǺ + CAST((CASE ISNULL(TrustFilletJoint.TrustFilletJoint,0) WHEN 0 THEN 0 + ELSE 1.0 * ISNULL(TrustFilletJoint.TrustFilletJoint,0)/(1.0 * FilletJoint.FilletJoint) END) AS DECIMAL(19,3)) + AS FilletJointCheckRate + +FROM dbo.Project_Welder AS welder +LEFT JOIN Base_Project project on welder.ProjectId=project.ProjectId +LEFT JOIN dbo.HJGL_BS_Welder wld on wld.WED_ID=welder.WED_ID + --Ѻ +LEFT JOIN (SELECT COUNT(*) AS totalJoint,HJGL_pw_jointinfo.JOT_CellWelder,ProjectId + FROM HJGL_PW_JointInfo + WHERE HJGL_pw_jointinfo.DReportID is not null + GROUP BY HJGL_pw_jointinfo.JOT_CellWelder,ProjectId) AS totalJoint ON totalJoint.JOT_CellWelder = welder.WED_ID and totalJoint.ProjectId=welder.ProjectId + + --Ѻ̶ +LEFT JOIN (SELECT COUNT(*) AS FixedJoint,JOT_CellWelder,ProjectId + FROM HJGL_PW_JointInfo + WHERE DReportID is not null AND JOT_JointAttribute='̶' + GROUP BY HJGL_pw_jointinfo.JOT_CellWelder,ProjectId) AS FixedJoint ON FixedJoint.JOT_CellWelder = welder.WED_ID and FixedJoint.ProjectId=welder.ProjectId + + + --ѺԽӺ +LEFT JOIN (SELECT COUNT(*) AS ButtJoint,joint.JOT_CellWelder,ProjectId + FROM HJGL_PW_JointInfo joint + LEFT JOIN dbo.HJGL_BS_JointType jointType on jointType.JOTY_ID=joint.JOTY_ID + WHERE DReportID is not null AND jointType.JOTY_Group='1' + GROUP BY joint.JOT_CellWelder,ProjectId) AS ButtJoint ON ButtJoint.JOT_CellWelder = welder.WED_ID and ButtJoint.ProjectId=welder.ProjectId + + + --ѺǺ +LEFT JOIN (SELECT COUNT(*) AS FilletJoint,joint.JOT_CellWelder,ProjectId + FROM HJGL_PW_JointInfo joint + LEFT JOIN dbo.HJGL_BS_JointType jointType on jointType.JOTY_ID=joint.JOTY_ID + WHERE DReportID is not null AND jointType.JOTY_Group='2' + GROUP BY joint.JOT_CellWelder,ProjectId) AS FilletJoint ON FilletJoint.JOT_CellWelder = welder.WED_ID and FilletJoint.ProjectId=welder.ProjectId + + +--ίк + LEFT JOIN (SELECT COUNT(*) AS TrustJointNum,joint.JOT_CellWelder,ProjectId + FROM dbo.HJGL_BO_BatchDetail batchDetail + LEFT JOIN HJGL_pw_jointinfo joint ON joint.jot_id=batchDetail.jot_id + WHERE (batchDetail.NDT is not null OR batchDetail.NDT!='') and joint.JOT_JointNo not like '%A%' and joint.JOT_JointNo not like '%B%' and batchDetail.PointType!='2' + GROUP BY joint.JOT_CellWelder,ProjectId) AS TrustJointNum ON TrustJointNum.JOT_CellWelder = welder.WED_ID and TrustJointNum.ProjectId=welder.ProjectId + + +--ίй̶ + LEFT JOIN (SELECT COUNT(*) AS TrustFixedJoint,joint.JOT_CellWelder,ProjectId + FROM dbo.HJGL_BO_BatchDetail batchDetail + LEFT JOIN HJGL_pw_jointinfo joint ON joint.jot_id=batchDetail.jot_id + WHERE (batchDetail.NDT is not null OR batchDetail.NDT!='') + AND joint.JOT_JointAttribute='̶' and joint.JOT_JointNo not like '%A%' and joint.JOT_JointNo not like '%B%' and batchDetail.PointType!='2' + GROUP BY joint.JOT_CellWelder,ProjectId) AS TrustFixedJoint ON TrustFixedJoint.JOT_CellWelder = welder.WED_ID and TrustFixedJoint.ProjectId=welder.ProjectId + + +--ίжԽӺ + LEFT JOIN (SELECT COUNT(*) AS TrustButtJoint,joint.JOT_CellWelder,ProjectId + FROM dbo.HJGL_BO_BatchDetail batchDetail + LEFT JOIN HJGL_pw_jointinfo joint ON joint.jot_id=batchDetail.jot_id + LEFT JOIN dbo.HJGL_BS_JointType jointType on jointType.JOTY_ID=joint.JOTY_ID + WHERE (batchDetail.NDT is not null OR batchDetail.NDT!='') + AND jointType.JOTY_Group='1' and joint.JOT_JointNo not like '%A%' and joint.JOT_JointNo not like '%B%' and batchDetail.PointType!='2' + GROUP BY joint.JOT_CellWelder,ProjectId) AS TrustButtJoint ON TrustButtJoint.JOT_CellWelder = welder.WED_ID and TrustButtJoint.ProjectId=welder.ProjectId + +--ίнǺ + LEFT JOIN (SELECT COUNT(*) AS TrustFilletJoint,joint.JOT_CellWelder,ProjectId + FROM dbo.HJGL_BO_BatchDetail batchDetail + LEFT JOIN HJGL_pw_jointinfo joint ON joint.jot_id=batchDetail.jot_id + LEFT JOIN dbo.HJGL_BS_JointType jointType on jointType.JOTY_ID=joint.JOTY_ID + WHERE (batchDetail.NDT is not null OR batchDetail.NDT!='') + AND jointType.JOTY_Group='2' and joint.JOT_JointNo not like '%A%' and joint.JOT_JointNo not like '%B%' and batchDetail.PointType!='2' + GROUP BY joint.JOT_CellWelder,ProjectId) AS TrustFilletJoint ON TrustFilletJoint.JOT_CellWelder = welder.WED_ID and TrustFilletJoint.ProjectId=welder.ProjectId + + +WHERE (welder.ProjectId = @projectId OR @projectId IS NULL) +AND (wld.WED_Unit=@unitcode OR @unitcode IS NULL) +AND (wld.WED_ID=@WED_ID OR @WED_ID is null) +order BY wld.WED_Code + + +GO + + + +ALTER VIEW [dbo].[HJGL_View_JointInfo] +AS +/*ߺϢͼ*/ +SELECT + JointInfo.JOT_ID, + JointInfo.ProjectId, + JointInfo.PointType, + JointInfo.RT1_RepairFilm, + JointInfo.dreportid, + IsoInfo.BSU_ID, + JointInfo.STE_ID, + JOT_JointNo, + JOT_DailyReportNo, --ձ + (CASE WHEN JointInfo.Jot_WeldingDate IS NOT NULL THEN JointInfo.Jot_WeldingDate + ELSE WeldReportMain.JOT_WeldDate END) AS JOT_WeldDate, -- + JointInfo.ISO_ID, + ISO_IsoNo, --ߺ + Unit.UnitCode, + Unit.UnitName, + Steel.STE_Code AS STE_Name1,--1 + Steel1.STE_Code AS STE_Name2,--2 + Welder.WED_Code AS WED_Code1, --溸 + Welder.WED_Name AS WED_Name1, --溸 + FloorWelder.WED_Code AS WED_Code2, --׺ + FloorWelder.WED_Name AS WED_Name2, --׺ + JointInfo.WLO_Code, + (CASE WHEN JointInfo.WLO_Code='F' THEN 'ֳװ' ELSE 'Ԥ' END) AS WLO_Name,-- + JOT_DoneDin, + IS_Compute, + com1.Com_Name AS Component1,--1 + com1.COM_Code AS COM_Code1,--1 + com2.COM_Name AS Component2,--2 + com2.COM_Code AS COM_Code2,--1 + m1.WMT_MatCode AS WeldMat,-- + WeldMaterial.WMT_MatCode AS WeldSilk,--˿ + batchDetail.PointType AS JointStatus,---״̬ + JOT_Dia, + JOT_Size, + JOT_Sch, + JOT_FactSch, + JOT_JointFlag, + JOT_TrustFlag, + ProessTypes, + JOT_JointDesc, + JointInfo.JOTY_ID, + JointType.JOTY_Name,-- + JointType.JOTY_Code,-- + JointInfo.WME_ID, + WeldMethod.WME_Name AS WME_Name,--ӷ + WeldMethod.WME_Code,--ӷ + SlopeType.JST_Name, --¿ + SlopeType.JST_Code, --¿ʹ + IS_Proess, + (CASE WHEN IS_Proess=1 THEN '' ELSE '' END) AS IS_ProessName, + JOT_PrepareTemp, + JOT_CellTemp, + JOT_LastTemp, + JOT_JointAttribute, + JOT_Location, + batch.BatchCode AS BatchCode,--κ + batchDetail.PointDate AS PointDate,-- + NULL AS CH_TrustCode, NULL AS CH_TrustDate, + --NDTType.NDT_Name as NDT_Name,--̽ + JointInfo.JOT_Remark, + JointInfo.RT_States, + JointInfo.UT_States, + JointInfo.MT_States, + JointInfo.PT_States, + JointInfo.PAUT_States, + (case when (select top 1 IsOK from HJGL_CH_HotProessResult hr where hr.JOT_ID=JointInfo.JOT_ID)=1 then 'ϸ' + else '' end) as HotProessResult, + Servicess.SER_Code,--ʴ + --NDTRate.NDTR_Name as NDTR_Name, --̽˱ + --NDTRate.NDTR_Code, --̽˱ + isoInfo.ISO_TestPress,--ѹ + isoInfo.ISO_DesignPress,--ѹ + isoInfo.ISO_DesignTemperature,--¶ + IsoClass.ISC_IsoCode,--ߵȼ + is_hj= CAST((CASE WHEN JointInfo.DReportID IS NULL THEN '0' ELSE '1' END ) AS BIT), --Ƿ񺸽 + if_dk=CAST((CASE WHEN batchDetail.NDT IS NULL THEN '0' ELSE '1' END) AS BIT), --Ƿ + JointInfo.InstallationId, + JointInfo.NDTR_ID, + JointInfo.IsSpecial, + JointInfo.IsSpecial AS IsSpecialName, --Ƿ + Installation.InstallationName,--װ + NDTRate.NDTR_Name, + JointInfo.Sort1,JointInfo.Sort2,JointInfo.Sort3,JointInfo.Sort4,JointInfo.Sort5 + ,JointType.JOTY_Group +FROM HJGL_PW_JointInfo AS JointInfo +LEFT JOIN HJGL_PW_IsoInfo AS IsoInfo ON IsoInfo.ISO_ID=JointInfo.ISO_ID +LEFT JOIN HJGL_BO_WeldReportMain AS WeldReportMain ON WeldReportMain.DReportID=JointInfo.DReportID +LEFT JOIN HJGL_BS_Steel AS Steel ON Steel.STE_ID=JointInfo.STE_ID +LEFT JOIN HJGL_BS_Steel AS Steel1 ON Steel1.STE_ID=JointInfo.STE_ID2 +LEFT JOIN HJGL_BS_Welder AS Welder ON Welder.WED_ID= JointInfo.JOT_CellWelder +LEFT JOIN HJGL_BS_Welder AS FloorWelder ON FloorWelder.WED_ID=JointInfo.JOT_FloorWelder +--LEFT JOIN HJGL_BS_WeldLocation AS WeldLocation ON WeldLocation.WLO_Code =JointInfo.WLO_Code +LEFT JOIN HJGL_BS_Component AS com1 ON com1.COM_ID=JointInfo.JOT_Component1 +LEFT JOIN HJGL_BS_Component AS com2 ON com2.COM_ID=JointInfo.JOT_Component2 +LEFT JOIN HJGL_BS_WeldMaterial m1 ON m1.WMT_ID=JointInfo.JOT_WeldMat +LEFT JOIN HJGL_BS_WeldMaterial AS WeldMaterial ON WeldMaterial.WMT_ID=JointInfo.JOT_WeldSilk +LEFT JOIN HJGL_BS_JointType AS JointType ON JointType.JOTY_ID=JointInfo.JOTY_ID +LEFT JOIN HJGL_BS_WeldMethod AS WeldMethod ON WeldMethod .WME_ID=JointInfo.WME_ID +LEFT JOIN HJGL_BS_SlopeType AS SlopeType ON SlopeType.JST_ID=JointInfo.JST_ID +LEFT JOIN dbo.HJGL_BO_BatchDetail AS batchDetail ON batchDetail.JOT_ID = JointInfo.JOT_ID +LEFT JOIN dbo.HJGL_BO_Batch AS batch ON batch.BatchId = batchDetail.BatchId +LEFT JOIN Base_Unit AS Unit ON Unit.UnitId=IsoInfo.BSU_ID +--left join HJGL_BS_NDTRate AS NDTRate on NDTRate.NDTR_ID=IsoInfo.NDTR_ID +LEFT JOIN HJGL_BS_Service AS Servicess ON Servicess.SER_ID=IsoInfo.SER_ID +LEFT JOIN HJGL_BS_IsoClass AS IsoClass ON IsoClass.ISC_ID=IsoInfo.ISC_ID +LEFT JOIN Project_Installation AS Installation ON Installation.InstallationId =JointInfo.InstallationId +LEFT JOIN HJGL_BS_NDTRate AS NDTRate ON NDTRate.NDTR_ID =JointInfo.NDTR_ID + + + + + +GO + + + +ALTER PROC [dbo].[HJGL_sp_rpt_welderPerformance] + @unitcode VARCHAR(50) = NULL, + @steel VARCHAR(50) = NULL, + @WED_ID NVARCHAR(50) = NULL, + @date1 DATETIME = NULL, + @date2 DATETIME = NULL, + @projectId NVARCHAR(500) = NULL, + @installationId NVARCHAR(50)=NULL +AS +/*ҵ*/ +SELECT + NEWID() AS Id, + total.ProjectId, + project.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.ProjectId,joint.InstallationId,joint.BSU_ID,joint.Welder + FROM View_JointWelder joint + LEFT JOIN HJGL_BO_WeldReportMain report ON joint.DReportID = report.DReportID + WHERE joint.DReportID IS NOT NULL + AND (report.JOT_WeldDate >= @date1 OR @date1 IS NULL) AND (report.JOT_WeldDate <= @date2 OR @date2 IS NULL) + AND (joint.ste_id=@steel OR @steel IS NULL) + GROUP BY joint.ProjectId,joint.InstallationId,joint.BSU_ID, joint.Welder) AS total + + +--һƬ , һƬ,һƬϸ + LEFT JOIN (SELECT COUNT(joint.JOT_ID) AS JointNum1, SUM(joint.RT_FilmNum) AS totalfilm, + joint.ProjectId,joint.InstallationId,joint.BSU_ID,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 where JOT_ID=joint.JOT_ID and FilmNum is not null)>0 + AND (joint.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_BO_QualityRating WHERE JOT_ID=joint.JOT_ID)>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_BO_QualityRating WHERE JOT_ID=joint.JOT_ID)<= @date2 OR @date2 IS NULL) + GROUP BY joint.ProjectId,joint.InstallationId,joint.BSU_ID, joint.Welder) AS JointNum1 + ON JointNum1.ProjectId=total.ProjectId AND JointNum1.InstallationId = total.InstallationId + AND JointNum1.BSU_ID = total.BSU_ID AND JointNum1.Welder = total.Welder + + --һƬϸ񺸿 + LEFT JOIN (SELECT COUNT(distinct joint.JOT_ID) AS JointNoPassNum1, + joint.ProjectId,joint.InstallationId,joint.BSU_ID,rr.JOT_CellWelder as Welder + FROM dbo.HJGL_CH_RepairItemRecord rr + left join dbo.HJGL_View_JointInfo joint on rr.JOT_ID=joint.JOT_ID + WHERE joint.PointType='' 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.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL and rr.RepairMark='R1' + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')<= @date2 OR @date2 IS NULL) + GROUP BY joint.ProjectId,joint.InstallationId,joint.BSU_ID, rr.JOT_CellWelder) AS JointNoPassNum1 + ON JointNoPassNum1.ProjectId=total.ProjectId AND JointNoPassNum1.InstallationId = total.InstallationId + AND JointNoPassNum1.BSU_ID = total.BSU_ID AND JointNoPassNum1.Welder = total.Welder + --һƬϸƬ + LEFT JOIN (SELECT count(rr.RepairItemRecordId) as JointNoPassFilmNum2, + joint.ProjectId,joint.InstallationId,joint.BSU_ID,rr.JOT_CellWelder as Welder + FROM dbo.HJGL_CH_RepairItemRecord rr + left join dbo.HJGL_View_JointInfo joint on rr.JOT_ID=joint.JOT_ID + WHERE joint.PointType='' + --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.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL and rr.RepairMark='R1' + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')<= @date2 OR @date2 IS NULL) + GROUP BY joint.ProjectId,joint.InstallationId,joint.BSU_ID, rr.JOT_CellWelder) AS JointNoPassNum2 + ON JointNoPassNum2.ProjectId=total.ProjectId AND JointNoPassNum2.InstallationId = total.InstallationId + AND JointNoPassNum2.BSU_ID = total.BSU_ID AND JointNoPassNum2.Welder = total.Welder + --ηƬ,ηƬ + LEFT JOIN (SELECT COUNT(joint.JOT_ID) AS RepairJoint2, SUM(ISNULL(joint.RT2_RepairFilmNum,0)) AS RepairFilm2, + joint.ProjectId,joint.InstallationId,joint.BSU_ID,joint.Welder + FROM dbo.View_JointWelder joint + WHERE joint.PointType='' AND joint.RT2_RepairFilm IS NOT NULL + AND (joint.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R2')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R2')<= @date2 OR @date2 IS NULL) + GROUP BY joint.ProjectId,joint.InstallationId,joint.BSU_ID, joint.Welder) AS RepairJoint2 + ON RepairJoint2.ProjectId=total.ProjectId AND RepairJoint2.InstallationId = total.InstallationId + AND RepairJoint2.BSU_ID = total.BSU_ID AND RepairJoint2.Welder = total.Welder + + + + --ηƬ,ηƬ + LEFT JOIN (SELECT COUNT(joint.JOT_ID) AS RepairJoint3, SUM(ISNULL(joint.RT3_RepairFilmNum,0)) AS RepairFilm3, + joint.ProjectId,joint.InstallationId,joint.BSU_ID,joint.Welder + FROM dbo.View_JointWelder joint + WHERE joint.PointType='' AND joint.RT3_RepairFilm IS NOT NULL + AND (joint.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R3')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R3')<= @date2 OR @date2 IS NULL) + GROUP BY joint.ProjectId,joint.InstallationId,joint.BSU_ID, joint.Welder) AS RepairJoint3 + ON RepairJoint3.ProjectId=total.ProjectId AND RepairJoint3.InstallationId = total.InstallationId + AND RepairJoint3.BSU_ID = total.BSU_ID AND RepairJoint3.Welder = total.Welder + +LEFT JOIN Base_Project project ON total.ProjectId=project.ProjectId +LEFT JOIN dbo.HJGL_BS_Welder wld ON wld.WED_ID=total.Welder + +WHERE + (CHARINDEX(total.ProjectId,@projectId)>0 OR @projectId IS NULL) + AND (total.InstallationId = @installationId OR @installationId IS NULL) + AND (wld.WED_Unit=@unitcode OR @unitcode IS NULL) + AND (total.Welder = @WED_ID OR @WED_ID IS NULL) + + + + + + + + + + + + + +GO + + diff --git a/DataBase/版本日志/HJGLDB_DS_2025-05-16_gf.sql b/DataBase/版本日志/HJGLDB_DS_2025-05-16_gf.sql new file mode 100644 index 0000000..d258102 --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2025-05-16_gf.sql @@ -0,0 +1,142 @@ + +CREATE PROC [dbo].[HJGL_sp_rpt_welderPerformance2] + @unitcode VARCHAR(50) = NULL, + @steel VARCHAR(50) = NULL, + @WED_ID NVARCHAR(50) = NULL, + @date1 DATETIME = NULL, + @date2 DATETIME = NULL, + @projectId NVARCHAR(500) = NULL, + @installationId NVARCHAR(50)=NULL +AS +/*ҵ*/ +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 + AND (report.JOT_WeldDate >= @date1 OR @date1 IS NULL) AND (report.JOT_WeldDate <= @date2 OR @date2 IS NULL) + AND (joint.ste_id=@steel OR @steel IS 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 where JOT_ID=joint.JOT_ID and FilmNum is not null)>0 + AND (joint.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_BO_QualityRating WHERE JOT_ID=joint.JOT_ID)>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_BO_QualityRating WHERE JOT_ID=joint.JOT_ID)<= @date2 OR @date2 IS NULL) + GROUP BY joint.Welder) AS JointNum1 + ON JointNum1.Welder = total.Welder + + --һƬϸ񺸿 + LEFT JOIN (SELECT COUNT(distinct joint.JOT_ID) AS JointNoPassNum1, + rr.JOT_CellWelder as Welder + FROM dbo.HJGL_CH_RepairItemRecord rr + left join dbo.HJGL_View_JointInfo joint on rr.JOT_ID=joint.JOT_ID + WHERE joint.PointType='' 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.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL and rr.RepairMark='R1' + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')<= @date2 OR @date2 IS NULL) + GROUP BY rr.JOT_CellWelder) AS JointNoPassNum1 + ON JointNoPassNum1.Welder = total.Welder + --һƬϸƬ + LEFT JOIN (SELECT count(rr.RepairItemRecordId) as JointNoPassFilmNum2, + rr.JOT_CellWelder as Welder + FROM dbo.HJGL_CH_RepairItemRecord rr + left join dbo.HJGL_View_JointInfo joint on rr.JOT_ID=joint.JOT_ID + WHERE joint.PointType='' + --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.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL and rr.RepairMark='R1' + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R1')<= @date2 OR @date2 IS NULL) + GROUP BY rr.JOT_CellWelder) 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.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R2')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R2')<= @date2 OR @date2 IS 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.ste_id=@steel OR @steel IS NULL) AND joint.dreportid IS NOT NULL + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R3')>= @date1 OR @date1 IS NULL) + AND ((SELECT TOP 1 SignDate FROM dbo.HJGL_CH_RepairItemRecord WHERE JOT_ID=joint.JOT_ID AND RepairMark='R3')<= @date2 OR @date2 IS NULL) + GROUP BY joint.Welder) AS RepairJoint3 + ON RepairJoint3.Welder = total.Welder + +--LEFT JOIN Base_Project project ON total.ProjectId=project.ProjectId +LEFT JOIN dbo.HJGL_BS_Welder wld ON wld.WED_ID=total.Welder + +WHERE + -- (CHARINDEX(total.ProjectId,@projectId)>0 OR @projectId IS NULL) + --AND (total.InstallationId = @installationId OR @installationId IS NULL) + (wld.WED_Unit=@unitcode OR @unitcode IS NULL) + AND (total.Welder = @WED_ID OR @WED_ID IS NULL) + + + + + + + + + + + + + + +GO + + diff --git a/HJGL_DS/BLL/WeldMat/Stock/StockInService.cs b/HJGL_DS/BLL/WeldMat/Stock/StockInService.cs index e90fcbd..1d43042 100644 --- a/HJGL_DS/BLL/WeldMat/Stock/StockInService.cs +++ b/HJGL_DS/BLL/WeldMat/Stock/StockInService.cs @@ -102,6 +102,37 @@ namespace BLL } } + /// + /// 修改焊材入库 + /// + /// + public static void UpdateStockIn2(Model.Weld_StockIn stockIn) + { + Model.SGGLDB db = Funs.DB; + Model.Weld_StockIn newStockIn = db.Weld_StockIn.FirstOrDefault(e => e.StockInId == stockIn.StockInId); + if (newStockIn != null) + { + newStockIn.WeldId = stockIn.WeldId; + newStockIn.Amount = stockIn.Amount; + newStockIn.Weight = stockIn.Weight; + //newStockIn.RecycleAmount = stockIn.RecycleAmount; + //newStockIn.RecycleWeight = stockIn.RecycleWeight; + //newStockIn.Materialman = stockIn.Materialman; + //newStockIn.InStockDate = stockIn.InStockDate; + newStockIn.IsReview = stockIn.IsReview; + //newStockIn.ReviewMan = stockIn.ReviewMan; + newStockIn.ReviewDate = stockIn.ReviewDate; + //newStockIn.ReviewResult = stockIn.ReviewResult; + newStockIn.AttachUrl = stockIn.AttachUrl; + //newStockIn.UsingAmount = stockIn.UsingAmount; + newStockIn.Warrantybook = stockIn.Warrantybook; + newStockIn.HeartNo = stockIn.HeartNo; + newStockIn.SupplierId = stockIn.SupplierId; + newStockIn.UnitStoreId = stockIn.UnitStoreId; + db.SubmitChanges(); + } + } + /// /// 更新附件 /// diff --git a/HJGL_DS/FineUIPro.Web/ErrLog.txt b/HJGL_DS/FineUIPro.Web/ErrLog.txt index 5f28270..042c148 100644 --- a/HJGL_DS/FineUIPro.Web/ErrLog.txt +++ b/HJGL_DS/FineUIPro.Web/ErrLog.txt @@ -1 +1,86 @@ - \ No newline at end of file + +错误信息开始=====> +错误类型: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.Linq.IQueryProvider.Execute[S](Expression expression) + 在 System.Linq.Queryable.Count[TSource](IQueryable`1 source) + 在 BLL.Sys_UserService.UserLogOn(String account, String password, Boolean rememberMe, Page page) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\BLL\Common\SysManage\Sys_UserService.cs:行号 39 + 在 FineUIPro.Web.Login.btnLogin_Click(Object sender, EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\Login.aspx.cs:行号 52 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:05/12/2025 16:45:20 +出错文件:http://localhost:64304/Login.aspx +IP地址:::1 + +出错时间:05/12/2025 16:45:20 + + +错误信息开始=====> +错误类型:IndexOutOfRangeException +错误信息:无法找到列 ProjectCode。 +错误堆栈: + 在 System.Data.DataTable.ParseSortString(String sortString) + 在 System.Data.DataView.CheckSort(String sort) + 在 System.Data.DataView.set_Sort(String value) + 在 FineUIPro.Web.PageBase.GetPagedDataTable(Grid Grid1, DataTable tb) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\common\PageBase.cs:行号 328 + 在 FineUIPro.Web.HJGL.WeldingReport.WelderPerformance.BindGrid2() 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\HJGL\WeldingReport\WelderPerformance.aspx.cs:行号 354 + 在 FineUIPro.Web.HJGL.WeldingReport.WelderPerformance.BtnAnalyse2_Click(Object sender, EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\HJGL\WeldingReport\WelderPerformance.aspx.cs:行号 414 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:05/16/2025 15:00:34 +出错文件:http://localhost:64304/HJGL/WeldingReport/WelderPerformance.aspx +IP地址:::1 +操作人员:管理员 + +出错时间:05/16/2025 15:00:34 + + +错误信息开始=====> +错误类型:IndexOutOfRangeException +错误信息:无法找到列 ProjectCode。 +错误堆栈: + 在 System.Data.DataTable.ParseSortString(String sortString) + 在 System.Data.DataView.CheckSort(String sort) + 在 System.Data.DataView.set_Sort(String value) + 在 FineUIPro.Web.PageBase.GetPagedDataTable(Grid Grid1, DataTable tb) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\common\PageBase.cs:行号 328 + 在 FineUIPro.Web.HJGL.WeldingReport.WelderPerformance.BindGrid2() 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\HJGL\WeldingReport\WelderPerformance.aspx.cs:行号 354 + 在 FineUIPro.Web.HJGL.WeldingReport.WelderPerformance.BtnAnalyse2_Click(Object sender, EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\HJGL\WeldingReport\WelderPerformance.aspx.cs:行号 414 + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:05/16/2025 15:00:37 +出错文件:http://localhost:64304/HJGL/WeldingReport/WelderPerformance.aspx +IP地址:::1 +操作人员:管理员 + +出错时间:05/16/2025 15:00:37 + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx index 5ceda75..0245af5 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx @@ -45,8 +45,8 @@ - - + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx.cs index d022212..9f1921d 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/WelderPerformance.aspx.cs @@ -398,6 +398,7 @@ /// protected void BtnAnalyse_Click(object sender, EventArgs e) { + this.Grid1.Columns[1].Hidden = false; BindGrid(); OutputSummaryData(); } @@ -409,8 +410,10 @@ /// protected void BtnAnalyse2_Click(object sender, EventArgs e) { + this.Grid1.Columns[1].Hidden = true; BindGrid2(); - OutputSummaryData(); + this.Grid1.SummaryData = null; + //OutputSummaryData(); } #endregion diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index 97d6b43..bf404b8 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -11,7 +11,7 @@ - + diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx index 87092ad..c98b077 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx @@ -4,6 +4,12 @@ 编辑焊材入库录入 +
@@ -49,10 +55,16 @@ - + + diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.cs index 43db0b4..1021b9d 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.cs @@ -116,6 +116,20 @@ namespace FineUIPro.Web.WeldMat.Stock { this.drpUnitStore.SelectedValue = stockIn.UnitStoreId; } + if (!string.IsNullOrEmpty(Request.Params["RemainingAmount"])) + { + this.trRemainingAmount.Hidden = false; + decimal remainingAmount = (stockIn.Amount ?? 0) - (stockIn.UsingAmount ?? 0); + this.lbReAmount.Text = remainingAmount.ToString("0.####"); + if (weld.ConvertValue > 0) + { + this.lbRemainingAmount.Text = "库存重量(公斤):" + (remainingAmount * weld.ConvertValue.Value).ToString("0.####"); + } + else + { + this.lbRemainingAmount.Text = stockIn.Weight.ToString(); + } + } } } } @@ -191,8 +205,15 @@ namespace FineUIPro.Web.WeldMat.Stock var mat = from x in Funs.DB.Weld_UsingMat where x.StockInId == this.StockInId select x; if (mat.Count() > 0) { - // 焊材已有领用,不更新数量 - BLL.StockInService.UpdateStockIn1(stockIn); + if (!string.IsNullOrEmpty(Request.Params["RemainingAmount"])) + { + BLL.StockInService.UpdateStockIn2(stockIn); + } + else + { + // 焊材已有领用,不更新数量 + BLL.StockInService.UpdateStockIn1(stockIn); + } } else { @@ -317,6 +338,37 @@ namespace FineUIPro.Web.WeldMat.Stock } } } + + protected void txtAmount_TextChanged(object sender, EventArgs e) + { + if (this.trRemainingAmount.Hidden == false) + { + if (!string.IsNullOrEmpty(this.hdWeldId.Text.Trim())) + { + var weld = BLL.WeldInfoService.GetWeldInfoById(this.hdWeldId.Text.Trim()); + if (weld != null) + { + Model.Weld_StockIn stockIn = BLL.StockInService.GetStockInById(this.StockInId); + decimal remainingAmount = Funs.GetNewDecimalOrZero(this.txtAmount.Text.Trim()) - (stockIn.UsingAmount ?? 0); + if (weld.ConvertValue > 0) + { + this.lbRemainingAmount.Text = "库存重量(公斤):" + (remainingAmount * weld.ConvertValue.Value).ToString("0.####"); + } + this.lbReAmount.Text = remainingAmount.ToString("0.####"); + //if (weld.ConvertValue.HasValue) + //{ + // decimal? amountCov = Funs.GetNewDecimal(this.txtWeight.Text.Trim()) / weld.ConvertValue; + // int amount = Convert.ToInt32(Math.Floor(amountCov.Value)); + // this.txtAmount.Text = amount.ToString(); + //} + //else + //{ + // this.txtAmount.Text = this.txtWeight.Text.Trim(); + //} + } + } + } + } #endregion //protected void rblIsReview_SelectedIndexChanged(object sender, EventArgs e) diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.designer.cs index d797bb9..03298c1 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockInEdit.aspx.designer.cs @@ -129,6 +129,33 @@ namespace FineUIPro.Web.WeldMat.Stock { /// protected global::FineUIPro.NumberBox txtAmount; + /// + /// trRemainingAmount 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow trRemainingAmount; + + /// + /// lbRemainingAmount 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbRemainingAmount; + + /// + /// lbReAmount 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbReAmount; + /// /// drpUnitStore 控件。 /// diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx index 8054699..701260a 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx @@ -71,13 +71,13 @@ HeaderText="剩余数量(Kg)" HeaderTextAlign="Center" TextAlign="Center"> + HeaderText="剩余数量(根)" HeaderTextAlign="Center" TextAlign="Center"> + HeaderText="回收数量(根)" HeaderTextAlign="Center" TextAlign="Center"> diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx.cs index 0000d96..c52e969 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelect.aspx.cs @@ -37,7 +37,7 @@ namespace FineUIPro.Web.WeldMat.Stock /// private void BindGrid() { - string strSql = @" SELECT v.WeldId+v.UnitStoreId as WeldId, weld.WeldCode, weld.WeldName,weld.WeldSpec,wType.WeldTypeName,'Kg' as WeldUnit,(unit.UnitName+'('+store.UnitStoreName+')') AS UnitStoreName, + string strSql = @" SELECT v.WeldId+','+v.UnitStoreId as WeldId, weld.WeldCode, weld.WeldName,weld.WeldSpec,wType.WeldTypeName,'Kg' as WeldUnit,(unit.UnitName+'('+store.UnitStoreName+')') AS UnitStoreName, v.RemainingAmount as ReAmount, (CASE WHEN weld.ConvertValue>0 THEN v.RemainingAmount*weld.ConvertValue @@ -172,7 +172,7 @@ namespace FineUIPro.Web.WeldMat.Stock Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); return; } - string id = Grid1.SelectedRowID; + string id = Grid1.SelectedRowID.Split(',')[0]; if (!string.IsNullOrEmpty(id)) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("StockSelectDetail.aspx?WeldId={0}", id, "编辑 - "))); diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx index 0af0078..739a54b 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx @@ -16,7 +16,7 @@ @@ -75,8 +75,10 @@ - + + + @@ -92,6 +94,27 @@ + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.cs index e1468d1..7605262 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.cs @@ -10,7 +10,7 @@ namespace FineUIPro.Web.WeldMat.Stock public partial class StockSelectDetail : PageBase { #region 定义变量 - + /// /// 焊材ID /// @@ -81,12 +81,12 @@ namespace FineUIPro.Web.WeldMat.Stock listStr.Add(new SqlParameter("@WeldId", this.WeldId)); } - if (drpUnit.SelectedValue!=Const._Null && drpUnit.SelectedValue != null) + if (drpUnit.SelectedValue != Const._Null && drpUnit.SelectedValue != null) { strSql += " AND unit.UnitId = @UnitId"; listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue)); } - if (drpUnitStore.SelectedValue != Const._Null && drpUnitStore.SelectedValue!=null) + if (drpUnitStore.SelectedValue != Const._Null && drpUnitStore.SelectedValue != null) { strSql += " AND StockIn.UnitStoreId = @UnitStoreId"; listStr.Add(new SqlParameter("@UnitStoreId", drpUnitStore.SelectedValue)); @@ -96,7 +96,7 @@ namespace FineUIPro.Web.WeldMat.Stock strSql += " AND WeldInfo.WeldName LIKE @WeldName"; listStr.Add(new SqlParameter("@WeldName", "%" + this.txtWeldName.Text.Trim() + "%")); } - + SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -175,5 +175,62 @@ namespace FineUIPro.Web.WeldMat.Stock } } #endregion + + #region 弹出编辑窗口关闭事件 + /// + /// 弹出编辑窗体关闭事件 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 编辑 + /// + /// 双击Grid事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + if (!string.IsNullOrEmpty(id)) + { + var q = BLL.StockInService.GetStockInById(id); + if (q.UnitStoreId != null) + { + var s = BLL.UnitStoreService.GetUnitStoreById(q.UnitStoreId); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("StockInEdit.aspx?StockInId={0}&RemainingAmount=RemainingAmount", id, "编辑 - "))); + } + + } + } + #endregion } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.designer.cs index 81d88f0..055c875 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/Stock/StockSelectDetail.aspx.designer.cs @@ -146,5 +146,32 @@ namespace FineUIPro.Web.WeldMat.Stock { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; } }