ApprovalFlowNotifyTemplate.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. namespace Admin.NET.Plugin.ApprovalFlow;
  2. /// <summary>
  3. /// 审批流通知模板(P4-16 延伸)
  4. /// 一条模板 = 一对 (NotifyType, BizType);BizType="" 表示全局默认,非空表示业务定制覆盖。
  5. /// Title / Content 支持变量插值:{title} {nodeName} {initiatorName} {fromName} {statusText} 等。
  6. /// 未匹配到启用模板时,FlowNotifyService 回退到代码内置默认文案。
  7. /// </summary>
  8. [SugarTable(null, "审批流通知模板")]
  9. [SugarIndex("idx_notifytpl_type_biz", nameof(NotifyType), OrderByType.Asc, nameof(BizType), OrderByType.Asc, true)]
  10. public class ApprovalFlowNotifyTemplate : EntityBase
  11. {
  12. /// <summary>
  13. /// 通知类型(NewTask / Urge / FlowCompleted / Transferred / Returned / AddSign / Withdrawn / Escalated / Timeout)
  14. /// </summary>
  15. [SugarColumn(ColumnDescription = "通知类型", Length = 32)]
  16. [Required, MaxLength(32)]
  17. public string NotifyType { get; set; } = "";
  18. /// <summary>
  19. /// 业务类型编码;空字符串 = 全局默认,非空 = 按业务覆盖
  20. /// </summary>
  21. [SugarColumn(ColumnDescription = "业务类型", Length = 32, DefaultValue = "")]
  22. [MaxLength(32)]
  23. public string BizType { get; set; } = "";
  24. /// <summary>
  25. /// 标题模板(支持 {变量})
  26. /// </summary>
  27. [SugarColumn(ColumnDescription = "标题模板", Length = 256)]
  28. [Required, MaxLength(256)]
  29. public string Title { get; set; } = "";
  30. /// <summary>
  31. /// 正文模板(支持 {变量})
  32. /// </summary>
  33. [SugarColumn(ColumnDescription = "正文模板", Length = 1024)]
  34. [Required, MaxLength(1024)]
  35. public string Content { get; set; } = "";
  36. /// <summary>
  37. /// 是否启用
  38. /// </summary>
  39. [SugarColumn(ColumnDescription = "是否启用", DefaultValue = "1")]
  40. public bool IsEnabled { get; set; } = true;
  41. /// <summary>
  42. /// 是否系统预置(预置模板不可删除,但可编辑覆盖)
  43. /// </summary>
  44. [SugarColumn(ColumnDescription = "是否系统预置", DefaultValue = "0")]
  45. public bool IsSystem { get; set; }
  46. /// <summary>
  47. /// 备注
  48. /// </summary>
  49. [SugarColumn(ColumnDescription = "备注", Length = 256, IsNullable = true)]
  50. [MaxLength(256)]
  51. public string? Remark { get; set; }
  52. }