From 75d7c48ff2d3634b63d30c9c08bdae92f079190d Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Wed, 17 Jun 2026 18:37:50 +0800 Subject: [PATCH] 1 --- ...LDB_V2026-06-17-lpf - (焊前管理菜单脚本).sql | 22 ++++++++- .../API/HJGL/APIPreWeldInspectionService.cs | 3 ++ .../CQMS/PersonManage/WelderManage.aspx | 7 +++ .../CQMS/PersonManage/WelderManage.aspx.cs | 22 ++++++++- .../WelderManage.aspx.designer.cs | 9 ++++ .../CQMS/PersonManage/WelderManageEdit.aspx | 3 ++ .../PersonManage/WelderManageEdit.aspx.cs | 45 ++++++++++++++++++- .../WelderManageEdit.aspx.designer.cs | 9 ++++ .../File/Fastreport/材料入库条码.frx | 6 +-- .../HJGL/HotProcessHard/HardReport.aspx | 3 ++ .../HJGL/HotProcessHard/HardReport.aspx.cs | 22 ++++++++- .../HardReport.aspx.designer.cs | 9 ++++ .../HJGL/HotProcessHard/HardReportEdit.aspx | 3 ++ .../HotProcessHard/HardReportEdit.aspx.cs | 38 +++++++++++++++- .../HardReportEdit.aspx.designer.cs | 9 ++++ .../HJGL/HotProcessHard/HotProessReport.aspx | 3 ++ .../HotProcessHard/HotProessReport.aspx.cs | 22 ++++++++- .../HotProessReport.aspx.designer.cs | 9 ++++ .../HotProcessHard/HotProessReportEdit.aspx | 3 ++ .../HotProessReportEdit.aspx.cs | 38 +++++++++++++++- .../HotProessReportEdit.aspx.designer.cs | 9 ++++ .../APIItem/HJGL/PreWeldInspectionItem.cs | 2 + 22 files changed, 286 insertions(+), 10 deletions(-) diff --git a/DataBase/版本日志/SGGLDB_V2026-06-17-lpf - (焊前管理菜单脚本).sql b/DataBase/版本日志/SGGLDB_V2026-06-17-lpf - (焊前管理菜单脚本).sql index c01551ca..a663c052 100644 --- a/DataBase/版本日志/SGGLDB_V2026-06-17-lpf - (焊前管理菜单脚本).sql +++ b/DataBase/版本日志/SGGLDB_V2026-06-17-lpf - (焊前管理菜单脚本).sql @@ -31,4 +31,24 @@ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES (NEWID(),N'D1B5A8B7-5D2A-4C51-9B7E-6A2F15B7F002',N'修改',3); GO -GO \ No newline at end of file +GO +-- 焊工维护:考试时间 +IF COL_LENGTH('dbo.SitePerson_Person', 'ExamDate') IS NULL +BEGIN + ALTER TABLE dbo.SitePerson_Person ADD ExamDate DATETIME NULL; +END +GO + +-- 热处理报告:报告日期 +IF COL_LENGTH('dbo.HJGL_HotProess_Trust', 'ReportDate') IS NULL +BEGIN + ALTER TABLE dbo.HJGL_HotProess_Trust ADD ReportDate DATETIME NULL; +END +GO + +-- 硬度检测报告:报告日期 +IF COL_LENGTH('dbo.HJGL_Hard_Trust', 'ReportDate') IS NULL +BEGIN + ALTER TABLE dbo.HJGL_Hard_Trust ADD ReportDate DATETIME NULL; +END +GO diff --git a/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs b/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs index 6fe3a872..9c1e7901 100644 --- a/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs +++ b/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs @@ -19,6 +19,8 @@ namespace BLL using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { var query = from x in db.HJGL_WeldJoint + join p in db.Base_Project on x.ProjectId equals p.ProjectId into projects + from p in projects.DefaultIfEmpty() join g in db.Base_GrooveType on x.GrooveTypeId equals g.GrooveTypeId into grooveTypes from g in grooveTypes.DefaultIfEmpty() where x.WeldJointId == weldJointId @@ -29,6 +31,7 @@ namespace BLL PipelineId = x.PipelineId, PipelineCode = x.PipelineCode, ProjectId = x.ProjectId, + ProjectName = p == null ? string.Empty : p.ProjectName, GrooveTypeId = x.GrooveTypeId, GrooveTypeCode = g == null ? string.Empty : g.GrooveTypeCode, GrooveTypeName = g == null ? string.Empty : g.GrooveTypeName, diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx index 19e89f0d..01176191 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx @@ -112,6 +112,13 @@ + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs index cd7bad9f..85d63f92 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs @@ -62,6 +62,7 @@ namespace FineUIPro.Web.CQMS.PersonManage this.txtCertificateLimitTime.Text = string.Format("{0:yyyy-MM-dd}", welder.CertificateLimitTime); } this.txtWelderLevel.Text = welder.WelderLevel; + this.txtExamDate.Text = GetWelderExamDate(welder.SitePersonId); //if (welder.IsUsed == true) //{ // cbIsOnDuty.Checked = true; @@ -84,11 +85,30 @@ namespace FineUIPro.Web.CQMS.PersonManage this.txtCertificateCode.Text = string.Empty; this.txtCertificateLimitTime.Text = string.Empty; this.txtWelderLevel.Text = string.Empty; + this.txtExamDate.Text = string.Empty; cbIsOnDuty.Checked = false; } } } + /// + /// 读取焊工考试时间,新增字段未纳入 DBML 时通过参数化 SQL 获取。 + /// + private string GetWelderExamDate(string sitePersonId) + { + if (string.IsNullOrEmpty(sitePersonId)) + { + return string.Empty; + } + string strSql = @"SELECT ExamDate FROM SitePerson_Person WHERE SitePersonId=@SitePersonId"; + DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@SitePersonId", sitePersonId)); + if (dt.Rows.Count > 0 && dt.Rows[0]["ExamDate"] != DBNull.Value) + { + return string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["ExamDate"]); + } + return string.Empty; + } + #endregion #region 绑定数据-资质信息 /// @@ -601,4 +621,4 @@ namespace FineUIPro.Web.CQMS.PersonManage #endregion #endregion } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs index 3d1b574b..eafdcb85 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.designer.cs @@ -228,6 +228,15 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// protected global::FineUIPro.CheckBox cbIsOnDuty; + /// + /// txtExamDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtExamDate; + /// /// txtCertificateLimitTime 控件。 /// diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx index eaf18778..e5d63f9d 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx @@ -79,6 +79,9 @@ + + + /// 读取焊工考试时间,兼容新增字段未纳入 DBML 的情况。 + /// + private string GetWelderExamDate(string sitePersonId) + { + if (string.IsNullOrEmpty(sitePersonId)) + { + return string.Empty; + } + string strSql = @"SELECT ExamDate FROM SitePerson_Person WHERE SitePersonId=@SitePersonId"; + DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@SitePersonId", sitePersonId)); + if (dt.Rows.Count > 0 && dt.Rows[0]["ExamDate"] != DBNull.Value) + { + return string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["ExamDate"]); + } + return string.Empty; + } + + /// + /// 保存焊工考试时间,和焊工基础信息同表存储。 + /// + private void SaveWelderExamDate(string personId) + { + if (string.IsNullOrEmpty(personId)) + { + return; + } + string strSql = @"UPDATE SitePerson_Person SET ExamDate=@ExamDate WHERE ProjectId=@ProjectId AND PersonId=@PersonId"; + SqlParameter examDate = new SqlParameter("@ExamDate", SqlDbType.DateTime); + var newExamDate = Funs.GetNewDateTime(this.txtExamDate.Text.Trim()); + examDate.Value = newExamDate.HasValue ? (object)newExamDate.Value : DBNull.Value; + SQLHelper.ExecuteCommand(CommandType.Text, strSql, new SqlParameter[] + { + examDate, + new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId), + new SqlParameter("@PersonId", personId) + }); + } #endregion protected void drpUnitId_SelectedIndexChanged(object sender, EventArgs e) @@ -319,4 +362,4 @@ namespace FineUIPro.Web.CQMS.PersonManage } } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.designer.cs index 0375acb6..cdd1d069 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManageEdit.aspx.designer.cs @@ -156,6 +156,15 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// protected global::FineUIPro.TextBox txtWelderLevel; + /// + /// txtExamDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtExamDate; + /// /// Panel5 控件。 /// diff --git a/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx b/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx index db3a94ea..452bc220 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx @@ -1,5 +1,5 @@  - + @@ -13,8 +13,8 @@ - - + + diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx index da11c71f..27666bd2 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx @@ -61,6 +61,9 @@ + + diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs index f6dc197e..9be01425 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs @@ -253,8 +253,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard this.txtHardnessMethod.Text = trust.HardnessMethod; this.txtInspectionNum.Text = trust.InspectionNum; this.txtEquipmentModel.Text = trust.EquipmentModel; + this.txtReportDate.Text = GetHardReportDate(trust.HardTrustID); } } + + /// + /// 读取硬度检测报告日期,新增字段未纳入 DBML 时通过参数化 SQL 获取。 + /// + private string GetHardReportDate(string hardTrustID) + { + if (string.IsNullOrEmpty(hardTrustID)) + { + return string.Empty; + } + string strSql = @"SELECT ReportDate FROM HJGL_Hard_Trust WHERE HardTrustID=@HardTrustID"; + DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@HardTrustID", hardTrustID)); + if (dt.Rows.Count > 0 && dt.Rows[0]["ReportDate"] != DBNull.Value) + { + return string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["ReportDate"]); + } + return string.Empty; + } #endregion /// @@ -265,6 +284,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard this.txtHardnessMethod.Text = string.Empty; this.txtInspectionNum.Text = string.Empty; this.txtEquipmentModel.Text = string.Empty; + this.txtReportDate.Text = string.Empty; } #endregion @@ -420,4 +440,4 @@ namespace FineUIPro.Web.HJGL.HotProcessHard BindGrid(); } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.designer.cs index 722ad317..83c5941c 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.designer.cs @@ -129,6 +129,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard { /// protected global::FineUIPro.Label txtEquipmentModel; + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtReportDate; + /// /// Grid1 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx index 58dddaf4..d112ac9c 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx @@ -106,6 +106,9 @@ + + diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.cs index 2abbaf4f..ad47938b 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.cs @@ -81,11 +81,30 @@ namespace FineUIPro.Web.HJGL.HotProcessHard this.txtCheckName.Text = trust.CheckName; this.txtAcceptStandard.Text = trust.AcceptStandard; this.txtEquipmentModel.Text = trust.EquipmentModel; + this.txtReportDate.Text = GetHardReportDate(trust.HardTrustID); BindGrid(); } } } + /// + /// 读取硬度检测报告日期,兼容新增字段未纳入 DBML 的情况。 + /// + private string GetHardReportDate(string hardTrustID) + { + if (string.IsNullOrEmpty(hardTrustID)) + { + return string.Empty; + } + string strSql = @"SELECT ReportDate FROM HJGL_Hard_Trust WHERE HardTrustID=@HardTrustID"; + DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@HardTrustID", hardTrustID)); + if (dt.Rows.Count > 0 && dt.Rows[0]["ReportDate"] != DBNull.Value) + { + return string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["ReportDate"]); + } + return string.Empty; + } + #region 数据绑定 protected void TextBox_TextChanged(object sender, EventArgs e) { @@ -180,10 +199,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard trust.HardnessMethod = this.txtHardnessMethod.Text; trust.EquipmentModel = this.txtEquipmentModel.Text; BLL.Hard_TrustService.UpdateHardTrust(trust); + SaveHardReportDate(trust.HardTrustID); } ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } + + /// + /// 保存硬度检测报告日期,和硬度报告编号同表存储。 + /// + private void SaveHardReportDate(string hardTrustID) + { + string strSql = @"UPDATE HJGL_Hard_Trust SET ReportDate=@ReportDate WHERE HardTrustID=@HardTrustID"; + SqlParameter reportDate = new SqlParameter("@ReportDate", SqlDbType.DateTime); + var newReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); + reportDate.Value = newReportDate.HasValue ? (object)newReportDate.Value : DBNull.Value; + SQLHelper.ExecuteCommand(CommandType.Text, strSql, new SqlParameter[] + { + reportDate, + new SqlParameter("@HardTrustID", hardTrustID) + }); + } #endregion } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.designer.cs index 04d8cb77..0466bf82 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReportEdit.aspx.designer.cs @@ -246,6 +246,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard { /// protected global::FineUIPro.TextBox txtEquipmentModel; + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + /// /// Grid1 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx index adaa7631..677c0b66 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx @@ -70,6 +70,9 @@ + + diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs index ecb2081f..140b0f0d 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs @@ -282,8 +282,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard this.txtTabler.Text = BLL.Person_PersonsService.GetPersonsNameById(trust.Tabler); } this.txtReport.Text = trust.ReportNo; + this.txtReportDate.Text = GetHotProessReportDate(trust.HotProessTrustId); } } + + /// + /// 读取热处理报告日期,新增字段未纳入 DBML 时通过参数化 SQL 获取。 + /// + private string GetHotProessReportDate(string hotProessTrustId) + { + if (string.IsNullOrEmpty(hotProessTrustId)) + { + return string.Empty; + } + string strSql = @"SELECT ReportDate FROM HJGL_HotProess_Trust WHERE HotProessTrustId=@HotProessTrustId"; + DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@HotProessTrustId", hotProessTrustId)); + if (dt.Rows.Count > 0 && dt.Rows[0]["ReportDate"] != DBNull.Value) + { + return string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["ReportDate"]); + } + return string.Empty; + } #endregion #region 清空文本 @@ -298,6 +317,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard this.txtProessEquipment.Text = string.Empty; this.txtTabler.Text = string.Empty; this.txtReport.Text = string.Empty; + this.txtReportDate.Text = string.Empty; } #endregion #endregion @@ -462,4 +482,4 @@ namespace FineUIPro.Web.HJGL.HotProcessHard } } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.designer.cs index a0d506f8..20c99fb4 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.designer.cs @@ -156,6 +156,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard { /// protected global::FineUIPro.Label txtReport; + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtReportDate; + /// /// Grid1 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx index 8c07c6c6..f0b89e83 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx @@ -42,6 +42,9 @@ + + diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.cs index b13564c4..385a235c 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.cs @@ -110,8 +110,27 @@ namespace FineUIPro.Web.HJGL.HotProcessHard } this.txtRemark.Text = trust.Remark; this.txtReportNo.Text = trust.ReportNo; + this.txtReportDate.Text = GetHotProessReportDate(trust.HotProessTrustId); } } + + /// + /// 读取热处理报告日期,兼容新增字段未纳入 DBML 的情况。 + /// + private string GetHotProessReportDate(string hotProessTrustId) + { + if (string.IsNullOrEmpty(hotProessTrustId)) + { + return string.Empty; + } + string strSql = @"SELECT ReportDate FROM HJGL_HotProess_Trust WHERE HotProessTrustId=@HotProessTrustId"; + DataTable dt = SQLHelper.GetDataTableRunText(strSql, new SqlParameter("@HotProessTrustId", hotProessTrustId)); + if (dt.Rows.Count > 0 && dt.Rows[0]["ReportDate"] != DBNull.Value) + { + return string.Format("{0:yyyy-MM-dd}", dt.Rows[0]["ReportDate"]); + } + return string.Empty; + } #endregion #endregion @@ -164,14 +183,31 @@ namespace FineUIPro.Web.HJGL.HotProcessHard trust.ProessEquipment = this.txtProessEquipment.Text.Trim(); trust.ReportNo = this.txtReportNo.Text.Trim(); BLL.HotProess_TrustService.UpdateHotProessTrust(trust); + SaveHotProessReportDate(trust.HotProessTrustId); ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } } + /// + /// 保存热处理报告日期,和热处理报告编号同表存储。 + /// + private void SaveHotProessReportDate(string hotProessTrustId) + { + string strSql = @"UPDATE HJGL_HotProess_Trust SET ReportDate=@ReportDate WHERE HotProessTrustId=@HotProessTrustId"; + SqlParameter reportDate = new SqlParameter("@ReportDate", SqlDbType.DateTime); + var newReportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); + reportDate.Value = newReportDate.HasValue ? (object)newReportDate.Value : DBNull.Value; + SQLHelper.ExecuteCommand(CommandType.Text, strSql, new SqlParameter[] + { + reportDate, + new SqlParameter("@HotProessTrustId", hotProessTrustId) + }); + } + protected void txtIsoNo_TextChanged(object sender, EventArgs e) { this.BindGrid(); } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.designer.cs index 516500a7..8db5a555 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReportEdit.aspx.designer.cs @@ -111,6 +111,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard { /// protected global::FineUIPro.TextBox txtReportNo; + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + /// /// drpUnitWork 控件。 /// diff --git a/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs b/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs index 125ea362..e2fd9872 100644 --- a/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs +++ b/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs @@ -17,6 +17,8 @@ namespace Model public string ProjectId { get; set; } + public string ProjectName { get; set; } + public string GrooveTypeId { get; set; } public string GrooveTypeCode { get; set; }