This commit is contained in:
2026-06-17 18:37:50 +08:00
parent 2736e8ad89
commit 75d7c48ff2
22 changed files with 286 additions and 10 deletions
@@ -31,4 +31,24 @@ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES (NEWID(),N'D1B5A8B7-5D2A-4C51-9B7E-6A2F15B7F002',N'修改',3);
GO
GO
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
@@ -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,
@@ -112,6 +112,13 @@
<f:CheckBox ID="cbIsOnDuty" runat="server" Label="是否在岗" Enabled="false"
LabelWidth="120px">
</f:CheckBox>
<f:Label ID="txtExamDate" runat="server" Label="考试时间"
LabelWidth="120px">
</f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Label ID="txtCertificateLimitTime" runat="server" Label="有效期"
LabelWidth="120px" Hidden="true">
</f:Label>
@@ -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;
}
}
}
/// <summary>
/// 读取焊工考试时间,新增字段未纳入 DBML 时通过参数化 SQL 获取。
/// </summary>
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 -
/// <summary>
@@ -601,4 +621,4 @@ namespace FineUIPro.Web.CQMS.PersonManage
#endregion
#endregion
}
}
}
@@ -228,6 +228,15 @@ namespace FineUIPro.Web.CQMS.PersonManage {
/// </remarks>
protected global::FineUIPro.CheckBox cbIsOnDuty;
/// <summary>
/// txtExamDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtExamDate;
/// <summary>
/// txtCertificateLimitTime 控件。
/// </summary>
@@ -79,6 +79,9 @@
<f:TextBox ID="txtWelderLevel" runat="server" Label="焊工等级"
MaxLength="50" LabelWidth="120px">
</f:TextBox>
<f:DatePicker ID="txtExamDate" runat="server" Label="考试时间"
LabelWidth="120px" DateFormatString="yyyy-MM-dd">
</f:DatePicker>
</Items>
</f:Panel>
<f:Panel ID="Panel5" Title="面板1" BoxFlex="3" runat="server" ShowBorder="false" ShowHeader="false"
@@ -1,5 +1,7 @@
using BLL;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
namespace FineUIPro.Web.CQMS.PersonManage
@@ -109,6 +111,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.States == Const.ProjectPersonStates_1)
{
cbIsUsed.Checked = true;
@@ -202,6 +205,7 @@ namespace FineUIPro.Web.CQMS.PersonManage
{
newWelder.PersonId = PersonId;
BLL.WelderService.UpdateWelder(newWelder);
SaveWelderExamDate(PersonId);
//BLL.Sys_LogService.AddLog(Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.WelderManageMenuId, Const.BtnModify, PersonId);
}
else
@@ -225,6 +229,45 @@ namespace FineUIPro.Web.CQMS.PersonManage
}
return PersonId;
}
/// <summary>
/// 读取焊工考试时间,兼容新增字段未纳入 DBML 的情况。
/// </summary>
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;
}
/// <summary>
/// 保存焊工考试时间,和焊工基础信息同表存储。
/// </summary>
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
}
}
}
}
}
@@ -156,6 +156,15 @@ namespace FineUIPro.Web.CQMS.PersonManage {
/// </remarks>
protected global::FineUIPro.TextBox txtWelderLevel;
/// <summary>
/// txtExamDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtExamDate;
/// <summary>
/// Panel5 控件。
/// </summary>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="2026-05-18" ReportInfo.Modified="06/17/2026 10:53:39" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="2026-05-18" ReportInfo.Modified="06/17/2026 17:42:00" ReportInfo.CreatorVersion="2017.1.16.0">
<Dictionary>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="Id" DataType="System.String"/>
@@ -13,8 +13,8 @@
</TableDataSource>
</Dictionary>
<ReportPage Name="Page1" PaperWidth="80" PaperHeight="30" LeftMargin="0" TopMargin="0" RightMargin="0" BottomMargin="0">
<DataBand Name="Data1" Width="302.4" Height="122.93" DataSource="Table1">
<BarcodeObject Name="Barcode1" Left="9.45" Top="18.9" Width="281.91" Height="85.43" AutoSize="false" Text="[Table1.BarCode]" AllowExpressions="true" Barcode="Code128" Barcode.AutoEncode="true"/>
<DataBand Name="Data1" Width="302.4" Height="100" DataSource="Table1">
<BarcodeObject Name="Barcode1" Left="11.34" Top="7.56" Width="206" Height="88" AutoSize="false" Text="[Table1.BarCode]" ShowText="false" AllowExpressions="true" Barcode="PDF417" Barcode.AspectRatio="0.5" Barcode.Columns="0" Barcode.Rows="0" Barcode.CodePage="437" Barcode.CompactionMode="Auto" Barcode.ErrorCorrection="Auto" Barcode.PixelSize="2, 8"/>
</DataBand>
</ReportPage>
</Report>
@@ -61,6 +61,9 @@
<f:Label ID="txtEquipmentModel" Label="设备型号" runat="server"
LabelWidth="180px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtReportDate" Label="报告日期" runat="server"
LabelWidth="180px" LabelAlign="Right">
</f:Label>
</Items>
</f:FormRow>
</Rows>
@@ -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);
}
}
/// <summary>
/// 读取硬度检测报告日期,新增字段未纳入 DBML 时通过参数化 SQL 获取。
/// </summary>
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
/// <summary>
@@ -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();
}
}
}
}
@@ -129,6 +129,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
/// </remarks>
protected global::FineUIPro.Label txtEquipmentModel;
/// <summary>
/// txtReportDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtReportDate;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -106,6 +106,9 @@
<f:TextBox ID="txtEquipmentModel" Label="设备型号" runat="server"
LabelWidth="190px">
</f:TextBox>
<f:DatePicker ID="txtReportDate" Label="报告日期" runat="server"
LabelWidth="190px" DateFormatString="yyyy-MM-dd">
</f:DatePicker>
</Items>
</f:FormRow>
</Rows>
@@ -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();
}
}
}
/// <summary>
/// 读取硬度检测报告日期,兼容新增字段未纳入 DBML 的情况。
/// </summary>
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());
}
/// <summary>
/// 保存硬度检测报告日期,和硬度报告编号同表存储。
/// </summary>
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
}
}
}
@@ -246,6 +246,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentModel;
/// <summary>
/// txtReportDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtReportDate;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -70,6 +70,9 @@
<f:Label ID="txtReport" Label="报告编号" runat="server" LabelAlign="Right"
LabelWidth="100px">
</f:Label>
<f:Label ID="txtReportDate" Label="报告日期" runat="server" LabelAlign="Right"
LabelWidth="100px">
</f:Label>
</Items>
</f:FormRow>
</Rows>
@@ -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);
}
}
/// <summary>
/// 读取热处理报告日期,新增字段未纳入 DBML 时通过参数化 SQL 获取。
/// </summary>
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
}
}
}
}
}
@@ -156,6 +156,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
/// </remarks>
protected global::FineUIPro.Label txtReport;
/// <summary>
/// txtReportDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtReportDate;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -42,6 +42,9 @@
<f:TextBox ID="txtReportNo" Label="报告编号" runat="server"
LabelAlign="Right" MaxLength="50" LabelWidth="180px">
</f:TextBox>
<f:DatePicker ID="txtReportDate" Label="报告日期" runat="server"
LabelAlign="Right" LabelWidth="180px" DateFormatString="yyyy-MM-dd">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
@@ -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);
}
}
/// <summary>
/// 读取热处理报告日期,兼容新增字段未纳入 DBML 的情况。
/// </summary>
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());
}
}
/// <summary>
/// 保存热处理报告日期,和热处理报告编号同表存储。
/// </summary>
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();
}
}
}
}
@@ -111,6 +111,15 @@ namespace FineUIPro.Web.HJGL.HotProcessHard {
/// </remarks>
protected global::FineUIPro.TextBox txtReportNo;
/// <summary>
/// txtReportDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtReportDate;
/// <summary>
/// drpUnitWork 控件。
/// </summary>
@@ -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; }