优化证书预览接口

master
xiaochanghai 3 weeks ago
parent c731c542d1
commit 9390ce720e
  1. 10
      Tiobon.Core.Model/Base/Ghre/Ghre_Certificate.Dto.Base.cs
  2. 12
      Tiobon.Core.Model/Models/Ghre/Ghre_Certificate.cs
  3. 9
      Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs
  4. 10
      Tiobon.Core/Tiobon.Core.Model.xml

@ -6,9 +6,9 @@
*
* Ver
*
*V0.01 2024/12/25 10:29:10 SimonHsiao
*V0.01 2025/6/3 10:11:34 SimonHsiao
*
* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved.
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
*  
* SimonHsiao
@ -157,4 +157,10 @@ public class Ghre_CertificateBase
/// 预留字段12
/// </summary>
public int? ReverseI2 { get; set; }
/// <summary>
/// 证书编号
/// </summary>
[Display(Name = "CertificateNo"), Description("证书编号"), MaxLength(32, ErrorMessage = "证书编号 不能超过 32 个字符")]
public string CertificateNo { get; set; }
}

@ -6,9 +6,9 @@
*
* Ver
*
*V0.01 2024/12/25 10:29:10 SimonHsiao
*V0.01 2025/6/3 10:11:34 SimonHsiao
*
* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved.
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
*  
* SimonHsiao
@ -20,7 +20,7 @@ namespace Tiobon.Core.Model.Models;
/// <summary>
/// 培训证书 (Model)
/// </summary>
[SugarTable("Ghre_Certificate", "Ghre_Certificate"), Entity(TableCnName = "Ghre_Certificate", TableName = "Ghre_Certificate")]
[SugarTable("Ghre_Certificate", "Ghre_Certificate"), Entity(TableCnName = "培训证书", TableName = "Ghre_Certificate")]
public class Ghre_Certificate : BasePoco
{
@ -158,4 +158,10 @@ public class Ghre_Certificate : BasePoco
/// 预留字段12
/// </summary>
public int? ReverseI2 { get; set; }
/// <summary>
/// 证书编号
/// </summary>
[Display(Name = "CertificateNo"), Description("证书编号"), MaxLength(32, ErrorMessage = "证书编号 不能超过 32 个字符")]
public string CertificateNo { get; set; }
}

@ -204,10 +204,10 @@ public class Ghre_CertificateRuleServices : BaseServices<Ghre_CertificateRule, G
int? staffId = App.User.StaffId;
long? studyRecordId = null;
Ghre_Certificate certificate = null;
if (result is null)
{
var certificate = await Db.Queryable<Ghre_Certificate>().Where(x => x.Id == id).FirstAsync();
certificate = await Db.Queryable<Ghre_Certificate>().Where(x => x.Id == id).FirstAsync();
staffId = certificate.StaffId;
studyRecordId = certificate.Reverse1.IsNotEmptyOrNull() ? certificate.Reverse1.ObjToLong() : null;
result = await base.QueryById(certificate.CertificateRuleId);
@ -256,10 +256,15 @@ public class Ghre_CertificateRuleServices : BaseServices<Ghre_CertificateRule, G
if (item.certNoRule == "random")
item.text = SnowFlakeSingle.Instance.NextId().ObjToString();
if (certificate != null) item.text = certificate.CertificateNo;
break;
case "AwardDate"://发证日期
if (item.dateFormat == "YYYY年MM月DD日")
item.text = DateTimeHelper.ConvertToDayString(DateTime.Now);
if (certificate != null) item.text = DateTimeHelper.ConvertToDayString(certificate.CreateTime);
break;
case "CertificationBody"://颁发机构
item.text = result.IssueOrgName;

@ -2530,6 +2530,11 @@
预留字段12
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CertificateBase.CertificateNo">
<summary>
证书编号
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_CertificateDesignBase">
<summary>
Ghre_CertificateDesign (Dto.Base)
@ -22277,6 +22282,11 @@
预留字段12
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_Certificate.CertificateNo">
<summary>
证书编号
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_CertificateDesign">
<summary>
Ghre_CertificateDesign (Model)

Loading…
Cancel
Save