From 8fa65352484eb9f931ebf94473681fe9523b8b2c Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Sat, 21 Jun 2025 14:32:55 +0800 Subject: [PATCH 1/2] 1 --- HJGL_DS/FineUIPro.Web/ErrLog.txt | 18 + .../FineUIPro.Web/FineUIPro.Web.csproj.user | 2 +- .../HJGL/CheckManage/QualityRating.aspx.cs | 331 ++++++++++-------- .../HJGL/RepairManage/QualityRating.aspx.cs | 13 +- HJGL_DS/FineUIPro.Web/Web.config | 2 +- HJGL_DS/WebAPI/WebAPI.csproj.user | 2 +- 6 files changed, 216 insertions(+), 152 deletions(-) diff --git a/HJGL_DS/FineUIPro.Web/ErrLog.txt b/HJGL_DS/FineUIPro.Web/ErrLog.txt index ca1b0c7..9aaee77 100644 --- a/HJGL_DS/FineUIPro.Web/ErrLog.txt +++ b/HJGL_DS/FineUIPro.Web/ErrLog.txt @@ -52,3 +52,21 @@ IP地址:::1 出错时间:06/09/2025 10:47:53 + +错误信息开始=====> +错误类型:NullReferenceException +错误信息:未将对象引用设置到对象的实例。 +错误堆栈: + 在 FineUIPro.Web._default.Page_Init(Object sender, EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\default.aspx.cs:行号 114 + 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) + 在 System.Web.UI.Control.OnInit(EventArgs e) + 在 System.Web.UI.Page.OnInit(EventArgs e) + 在 FineUIPro.Web.PageBase.OnInit(EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\common\PageBase.cs:行号 135 + 在 System.Web.UI.Control.InitRecursive(Control namingContainer) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:06/13/2025 16:47:46 +出错文件:http://localhost:64304/default.aspx?menuModule=6 +IP地址:::1 + +出错时间:06/13/2025 16:47:46 + diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user index 8aa7c11..bf54086 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ true - Release|Any CPU + Debug|Any CPU diff --git a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/QualityRating.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/QualityRating.aspx.cs index e73a1b7..cf19ad1 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/QualityRating.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/QualityRating.aspx.cs @@ -626,7 +626,6 @@ namespace FineUIPro.Web.HJGL.CheckManage { if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_CheckMenuId, Const.BtnSave)) { - SubmitQualityRating(); foreach (JObject mergedRow in Grid1.GetMergedData()) { JObject values = mergedRow.Value("values"); @@ -640,7 +639,13 @@ namespace FineUIPro.Web.HJGL.CheckManage return; } } + if ((string.IsNullOrEmpty(values.Value("DefectResult")) || values.Value("DefectResult") == " ") && values.Value("IsPass") == "不合格") + { + ShowNotify("不合格记录评定结果不能为空!", MessageBoxIcon.Warning); + return; + } } + SubmitQualityRating(); ShowNotify("提交成功!", MessageBoxIcon.Success); } else @@ -656,156 +661,155 @@ namespace FineUIPro.Web.HJGL.CheckManage int rMatNum = 0; string changeId = string.Empty; bool b = true; //默认合格 + bool bRT = true; //RT默认合格 bool needRemake = false; //重拍 foreach (JObject mergedRow in Grid1.GetMergedData()) { JObject values = mergedRow.Value("values"); string cH_TrustItemID = values.Value("CH_TrustItemID"); - if (!string.IsNullOrEmpty(values.Value("DefectResult"))) //有评定结果的口再保存记录 + + if (changeId != cH_TrustItemID) //循环至新的焊口记录 { - if (changeId != cH_TrustItemID) //循环至新的焊口记录 + Model.HJGL_CH_TrustItem oldTrustItem = BLL.HJGL_CH_TrustItemService.GetTrustItemByID(changeId); + if (oldTrustItem != null) { - Model.HJGL_CH_TrustItem oldTrustItem = BLL.HJGL_CH_TrustItemService.GetTrustItemByID(changeId); - if (oldTrustItem != null) + BLL.HJGL_PW_JointInfoService.JointFileNumWriteBack(oldTrustItem.JOT_ID, filmNum); + BLL.HJGL_PW_JointInfoService.JointRMaterialWriteBack(oldTrustItem.JOT_ID, rMatNum); + Model.HJGL_CH_Trust trust1 = BLL.HJGL_TrustManageEditService.GetCH_TrustByID(oldTrustItem.CH_TrustID); + if (trust1.CH_NDTMethod != "20d2cbca-8b3d-434b-b1c1-181796986fa5") //非RT检测,更新焊口检测状态 { - BLL.HJGL_PW_JointInfoService.JointFileNumWriteBack(oldTrustItem.JOT_ID, filmNum); - BLL.HJGL_PW_JointInfoService.JointRMaterialWriteBack(oldTrustItem.JOT_ID, rMatNum); - Model.HJGL_CH_Trust trust1 = BLL.HJGL_TrustManageEditService.GetCH_TrustByID(oldTrustItem.CH_TrustID); - if (trust1.CH_NDTMethod != "20d2cbca-8b3d-434b-b1c1-181796986fa5") //非RT检测,更新焊口检测状态 + if (b) { - if (b) + if (needRemake) { - if (needRemake) - { - oldTrustItem.States = "3"; //待重检 - } - else - { - oldTrustItem.States = "2"; //检测合格 - } + oldTrustItem.States = "3"; //待重检 } else { - oldTrustItem.States = "4"; //待返修 + oldTrustItem.States = "2"; //检测合格 } } - - - oldTrustItem.FeedbackMan = this.CurrUser.UserName; - oldTrustItem.FeedbackDate = DateTime.Now; - BLL.HJGL_CH_TrustItemService.UpdateTrustItem(oldTrustItem); - } - changeId = cH_TrustItemID; - b = true; - needRemake = false; - - filmNum = 0; - rMatNum = 0; - } - Model.HJGL_CH_TrustItem trustItem = BLL.HJGL_CH_TrustItemService.GetTrustItemByID(cH_TrustItemID); - if (this.drpEquipment.SelectedValue != "null") - { - trustItem.EquipmentId = this.drpEquipment.SelectedValue; - } - if (!string.IsNullOrEmpty(this.txtShootMan.Text)) - { - trustItem.ShootMan = this.txtShootMan.Text.Trim(); - } - if (!string.IsNullOrEmpty(this.txtShootDate.Text)) - { - trustItem.ShootDate = Convert.ToDateTime(this.txtShootDate.Text); - } - - var trust = BLL.HJGL_TrustManageEditService.GetCH_TrustByID(trustItem.CH_TrustID); - var jot = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(trustItem.JOT_ID); - Model.HJGL_BO_QualityRating newQualityRating = new Model.HJGL_BO_QualityRating(); - - - newQualityRating.CH_TrustItemID = cH_TrustItemID; - if (!string.IsNullOrEmpty(jot.ISO_ID)) - { - newQualityRating.ISO_ID = jot.ISO_ID; - } - if (!string.IsNullOrEmpty(trustItem.JOT_ID)) - { - newQualityRating.JOT_ID = trustItem.JOT_ID; - } - newQualityRating.Remake = Convert.ToBoolean(values.Value("Remake")); - newQualityRating.RemakeResult = values.Value("RemakeResult"); - if (Grid1.Columns[5].Hidden == true) - { - newQualityRating.FilmNum = null; - } - else - { - newQualityRating.FilmNum = values.Value("FilmNum"); - } - newQualityRating.RepairTag = values.Value("RepairTag"); - newQualityRating.RMaterial = Convert.ToBoolean(values.Value("RMaterial")); - newQualityRating.Cack = Convert.ToBoolean(values.Value("Cack")); - newQualityRating.NotFusion = Convert.ToBoolean(values.Value("NotFusion")); - newQualityRating.NotPenetration = Convert.ToBoolean(values.Value("NotPenetration")); - newQualityRating.StripDefects = Convert.ToBoolean(values.Value("StripDefects")); - newQualityRating.CircularDefects = Convert.ToBoolean(values.Value("CircularDefects")); - newQualityRating.DeepHoleDefects = Convert.ToBoolean(values.Value("DeepHoleDefects")); - newQualityRating.RootsConcave = Convert.ToBoolean(values.Value("RootsConcave")); - newQualityRating.RootsBiteEdge = Convert.ToBoolean(values.Value("RootsBiteEdge")); - newQualityRating.PseudoDefects = Convert.ToBoolean(values.Value("PseudoDefects")); - newQualityRating.DefectLength = values.Value("DefectLength"); - newQualityRating.DefectResult = values.Value("DefectResult"); - newQualityRating.DefectRation = values.Value("DefectRation"); - newQualityRating.SignDate = Funs.GetNewDateTime(values.Value("SignDate")); - newQualityRating.Remark = values.Value("Remark"); - - newQualityRating.DetectLength = Funs.GetNewDecimal(values.Value("DetectLength")); - newQualityRating.PeakAmplitude = values.Value("PeakAmplitude"); - newQualityRating.DefectLocation = values.Value("DefectLocation"); - newQualityRating.DepthDefect = Funs.GetNewDecimal(values.Value("DepthDefect")); - newQualityRating.IndicatingLength = Funs.GetNewDecimal(values.Value("IndicatingLength")); - newQualityRating.DefectHeight = Funs.GetNewDecimal(values.Value("DefectHeight")); - newQualityRating.DefectsHighSide = Funs.GetNewDecimal(values.Value("DefectsHighSide")); - newQualityRating.DefectSize = Funs.GetNewDecimal(values.Value("DefectSize")); - - newQualityRating.DefectNature = values.Value("DefectNature"); - if (values.Value("IsPass") == "不合格") - { - b = false; - } - if (Convert.ToBoolean(values.Value("Remake"))) - { - needRemake = true; - } - newQualityRating.IsPass = values.Value("IsPass"); - this.QualityRatingId = values.Value("QualityRatingId"); - if (trust.CH_NDTMethod == "20d2cbca-8b3d-434b-b1c1-181796986fa5") //RT检测,评定结果不为空才保存拍片记录 - { - if (!string.IsNullOrEmpty(newQualityRating.DefectResult)) - { - filmNum++; - if (newQualityRating.RMaterial == true) - { - rMatNum++; - } - var quatlityRating = BLL.HJGL_BO_QualityRatingService.GetQualityRatingById(this.QualityRatingId); - if (quatlityRating == null) - { - newQualityRating.QualityRatingId = this.QualityRatingId; - BLL.HJGL_BO_QualityRatingService.AddQualityRating(newQualityRating); - } else { - Model.HJGL_BO_QualityRating oldQualityRating = BLL.HJGL_BO_QualityRatingService.GetQualityRatingById(this.QualityRatingId); - if (oldQualityRating != null) - { - newQualityRating.RemakeResult = oldQualityRating.RemakeResult; - } - newQualityRating.QualityRatingId = this.QualityRatingId; - BLL.HJGL_BO_QualityRatingService.UpadteQualityRating(newQualityRating); + oldTrustItem.States = "4"; //待返修 } } + else + { + if (bRT) + { + if (needRemake) + { + oldTrustItem.States = "3"; //待重检 + } + else + { + oldTrustItem.States = "2"; //检测合格 + } + } + else + { + oldTrustItem.States = "4"; //待返修 + } + } + + oldTrustItem.FeedbackMan = this.CurrUser.UserName; + oldTrustItem.FeedbackDate = DateTime.Now; + BLL.HJGL_CH_TrustItemService.UpdateTrustItem(oldTrustItem); } - else - { + changeId = cH_TrustItemID; + b = true; + bRT = true; + needRemake = false; + + filmNum = 0; + rMatNum = 0; + } + Model.HJGL_CH_TrustItem trustItem = BLL.HJGL_CH_TrustItemService.GetTrustItemByID(cH_TrustItemID); + if (this.drpEquipment.SelectedValue != "null") + { + trustItem.EquipmentId = this.drpEquipment.SelectedValue; + } + if (!string.IsNullOrEmpty(this.txtShootMan.Text)) + { + trustItem.ShootMan = this.txtShootMan.Text.Trim(); + } + if (!string.IsNullOrEmpty(this.txtShootDate.Text)) + { + trustItem.ShootDate = Convert.ToDateTime(this.txtShootDate.Text); + } + + var trust = BLL.HJGL_TrustManageEditService.GetCH_TrustByID(trustItem.CH_TrustID); + var jot = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(trustItem.JOT_ID); + Model.HJGL_BO_QualityRating newQualityRating = new Model.HJGL_BO_QualityRating(); + + + newQualityRating.CH_TrustItemID = cH_TrustItemID; + if (!string.IsNullOrEmpty(jot.ISO_ID)) + { + newQualityRating.ISO_ID = jot.ISO_ID; + } + if (!string.IsNullOrEmpty(trustItem.JOT_ID)) + { + newQualityRating.JOT_ID = trustItem.JOT_ID; + } + newQualityRating.Remake = Convert.ToBoolean(values.Value("Remake")); + newQualityRating.RemakeResult = values.Value("RemakeResult"); + if (Grid1.Columns[5].Hidden == true) + { + newQualityRating.FilmNum = null; + } + else + { + newQualityRating.FilmNum = values.Value("FilmNum"); + } + newQualityRating.RepairTag = values.Value("RepairTag"); + newQualityRating.RMaterial = Convert.ToBoolean(values.Value("RMaterial")); + newQualityRating.Cack = Convert.ToBoolean(values.Value("Cack")); + newQualityRating.NotFusion = Convert.ToBoolean(values.Value("NotFusion")); + newQualityRating.NotPenetration = Convert.ToBoolean(values.Value("NotPenetration")); + newQualityRating.StripDefects = Convert.ToBoolean(values.Value("StripDefects")); + newQualityRating.CircularDefects = Convert.ToBoolean(values.Value("CircularDefects")); + newQualityRating.DeepHoleDefects = Convert.ToBoolean(values.Value("DeepHoleDefects")); + newQualityRating.RootsConcave = Convert.ToBoolean(values.Value("RootsConcave")); + newQualityRating.RootsBiteEdge = Convert.ToBoolean(values.Value("RootsBiteEdge")); + newQualityRating.PseudoDefects = Convert.ToBoolean(values.Value("PseudoDefects")); + newQualityRating.DefectLength = values.Value("DefectLength"); + newQualityRating.DefectResult = values.Value("DefectResult"); + newQualityRating.DefectRation = values.Value("DefectRation"); + newQualityRating.SignDate = Funs.GetNewDateTime(values.Value("SignDate")); + newQualityRating.Remark = values.Value("Remark"); + + newQualityRating.DetectLength = Funs.GetNewDecimal(values.Value("DetectLength")); + newQualityRating.PeakAmplitude = values.Value("PeakAmplitude"); + newQualityRating.DefectLocation = values.Value("DefectLocation"); + newQualityRating.DepthDefect = Funs.GetNewDecimal(values.Value("DepthDefect")); + newQualityRating.IndicatingLength = Funs.GetNewDecimal(values.Value("IndicatingLength")); + newQualityRating.DefectHeight = Funs.GetNewDecimal(values.Value("DefectHeight")); + newQualityRating.DefectsHighSide = Funs.GetNewDecimal(values.Value("DefectsHighSide")); + newQualityRating.DefectSize = Funs.GetNewDecimal(values.Value("DefectSize")); + + newQualityRating.DefectNature = values.Value("DefectNature"); + if (values.Value("IsPass") == "不合格") + { + b = false; + bRT = false; + } + if (Convert.ToBoolean(values.Value("Remake"))) + { + needRemake = true; + } + newQualityRating.IsPass = values.Value("IsPass"); + this.QualityRatingId = values.Value("QualityRatingId"); + if (trust.CH_NDTMethod == "20d2cbca-8b3d-434b-b1c1-181796986fa5") //RT检测,评定结果不为空才保存拍片记录 + { + //if (!string.IsNullOrEmpty(newQualityRating.DefectResult)) + //{ + filmNum++; + if (newQualityRating.RMaterial == true) + { + rMatNum++; + } var quatlityRating = BLL.HJGL_BO_QualityRatingService.GetQualityRatingById(this.QualityRatingId); if (quatlityRating == null) { @@ -822,21 +826,40 @@ namespace FineUIPro.Web.HJGL.CheckManage newQualityRating.QualityRatingId = this.QualityRatingId; BLL.HJGL_BO_QualityRatingService.UpadteQualityRating(newQualityRating); } - } - BLL.HJGL_CH_TrustItemService.UpdateTrustItem(trustItem); - - // 有焊口增加的,对应的检测报告打印要变成未打印状态 - var p = from x in Funs.DB.HJGL_CH_TestingReportPrint - where x.ISO_ID == jot.ISO_ID && x.Specifications == jot.JOT_JointDesc - && x.NDT_ID == trust.CH_NDTMethod && x.BatchId == trust.BatchId - select x; - if (p.Count() > 0) + //} + } + else + { + var quatlityRating = BLL.HJGL_BO_QualityRatingService.GetQualityRatingById(this.QualityRatingId); + if (quatlityRating == null) { - Model.HJGL_CH_TestingReportPrint report = Funs.DB.HJGL_CH_TestingReportPrint.FirstOrDefault(x => x.TestingReportPrintId == p.First().TestingReportPrintId); - report.Printer = null; - report.PrintTime = null; - Funs.DB.SubmitChanges(); + newQualityRating.QualityRatingId = this.QualityRatingId; + BLL.HJGL_BO_QualityRatingService.AddQualityRating(newQualityRating); } + else + { + Model.HJGL_BO_QualityRating oldQualityRating = BLL.HJGL_BO_QualityRatingService.GetQualityRatingById(this.QualityRatingId); + if (oldQualityRating != null) + { + newQualityRating.RemakeResult = oldQualityRating.RemakeResult; + } + newQualityRating.QualityRatingId = this.QualityRatingId; + BLL.HJGL_BO_QualityRatingService.UpadteQualityRating(newQualityRating); + } + } + BLL.HJGL_CH_TrustItemService.UpdateTrustItem(trustItem); + + // 有焊口增加的,对应的检测报告打印要变成未打印状态 + var p = from x in Funs.DB.HJGL_CH_TestingReportPrint + where x.ISO_ID == jot.ISO_ID && x.Specifications == jot.JOT_JointDesc + && x.NDT_ID == trust.CH_NDTMethod && x.BatchId == trust.BatchId + select x; + if (p.Count() > 0) + { + Model.HJGL_CH_TestingReportPrint report = Funs.DB.HJGL_CH_TestingReportPrint.FirstOrDefault(x => x.TestingReportPrintId == p.First().TestingReportPrintId); + report.Printer = null; + report.PrintTime = null; + Funs.DB.SubmitChanges(); } } //更新列表最后一个口的数据 @@ -862,6 +885,24 @@ namespace FineUIPro.Web.HJGL.CheckManage oldTrustItem1.States = "4"; //待返修 } } + else + { + if (bRT) + { + if (needRemake) + { + oldTrustItem1.States = "3"; //待重检 + } + else + { + oldTrustItem1.States = "2"; //检测合格 + } + } + else + { + oldTrustItem1.States = "4"; //待返修 + } + } oldTrustItem1.FeedbackMan = this.CurrUser.UserName; oldTrustItem1.FeedbackDate = DateTime.Now; BLL.HJGL_PW_JointInfoService.JointFileNumWriteBack(oldTrustItem1.JOT_ID, filmNum); @@ -1108,7 +1149,7 @@ namespace FineUIPro.Web.HJGL.CheckManage newRepairItemRecord.SignMan = this.CurrUser.UserName; newRepairItemRecord.SignDate = DateTime.Now; BLL.HJGL_CH_RepairItemRecordService.AddCH_RepairItemRecord(newRepairItemRecord); - + defectNatures = string.Empty; } } diff --git a/HJGL_DS/FineUIPro.Web/HJGL/RepairManage/QualityRating.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/RepairManage/QualityRating.aspx.cs index f67de2d..101ccb2 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/RepairManage/QualityRating.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/RepairManage/QualityRating.aspx.cs @@ -624,7 +624,6 @@ namespace FineUIPro.Web.HJGL.RepairManage { if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_CheckAuditMenuId, Const.BtnSave)) { - SubmitQualityRating(); foreach (JObject mergedRow in Grid1.GetMergedData()) { JObject values = mergedRow.Value("values"); @@ -638,7 +637,13 @@ namespace FineUIPro.Web.HJGL.RepairManage return; } } + if ((string.IsNullOrEmpty(values.Value("DefectResult")) || values.Value("DefectResult") == " ") && values.Value("IsPass") == "不合格") + { + ShowNotify("不合格记录评定结果不能为空!", MessageBoxIcon.Warning); + return; + } } + SubmitQualityRating(); ShowNotify("提交成功!", MessageBoxIcon.Success); } else @@ -813,8 +818,8 @@ namespace FineUIPro.Web.HJGL.RepairManage } BLL.HJGL_RepairItemService.UpdateCH_TrustItem(repairItem); //回写返修片子情况 - if (!string.IsNullOrEmpty(newQualityRatingRepair.DefectResult)) - { + //if (!string.IsNullOrEmpty(newQualityRatingRepair.DefectResult)) + //{ if (newQualityRatingRepair.RepairTag == "R1") { if (ndt.NDT_Code.Contains("RT")) @@ -896,7 +901,7 @@ namespace FineUIPro.Web.HJGL.RepairManage } } } - } + //} if (newQualityRatingRepair.RMaterial == true) { diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index bf404b8..ede14f6 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -50,7 +50,7 @@ - + diff --git a/HJGL_DS/WebAPI/WebAPI.csproj.user b/HJGL_DS/WebAPI/WebAPI.csproj.user index 28be9c4..a48b337 100644 --- a/HJGL_DS/WebAPI/WebAPI.csproj.user +++ b/HJGL_DS/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU FolderProfile true From d2719f2825b718f8e3ea129c87528d9e7f0a963f Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Sat, 21 Jun 2025 14:35:11 +0800 Subject: [PATCH 2/2] 1 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9046ab9..0a49fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ bin-release/ /HJGL_DS/.vs/ /HJGL_DS/.vs/config/applicationhost.config /HJGL_DS/FineUIPro.Web/FileUpload/Sign +/sh.exe.stackdump