|
|
using System.ComponentModel;
|
|
|
using DS.Module.Core;
|
|
|
using DS.Module.Core.Data;
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
using SqlSugar;
|
|
|
|
|
|
namespace DS.WMS.Core.Flow.Entity;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 工作流实例
|
|
|
/// </summary>
|
|
|
[SugarTable("sys_flow_instance")]
|
|
|
public class FlowInstance : BaseModelV2<long>
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 业务Id
|
|
|
/// </summary>
|
|
|
[Description("业务Id")]
|
|
|
public long BusinessId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 业务类型
|
|
|
/// </summary>
|
|
|
[Description("业务类型")]
|
|
|
public BusinessType? BusinessType { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 模板Id
|
|
|
/// </summary>
|
|
|
[Description("模板Id")]
|
|
|
public long TemplateId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 引用模板
|
|
|
/// </summary>
|
|
|
[Navigate(NavigateType.OneToOne, nameof(TemplateId))]
|
|
|
public FlowTemplate? Template { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 客户自定义名称
|
|
|
/// </summary>
|
|
|
[Description("客户自定义名称")]
|
|
|
public string CustomName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 模块Id
|
|
|
/// </summary>
|
|
|
[Description("模块Id")]
|
|
|
public long PermissionId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 当前节点ID
|
|
|
/// </summary>
|
|
|
[Description("当前节点ID")]
|
|
|
public string ActivityId { get; set; } = "";
|
|
|
/// <summary>
|
|
|
/// 当前节点类型(0会签节点)
|
|
|
/// </summary>
|
|
|
[Description("当前节点类型(0会签节点)")]
|
|
|
public int? ActivityType { get; set; }
|
|
|
/// <summary>
|
|
|
/// 当前节点名称
|
|
|
/// </summary>
|
|
|
[Description("当前节点名称")]
|
|
|
public string ActivityName { get; set; }
|
|
|
/// <summary>
|
|
|
/// 前一个ID
|
|
|
/// </summary>
|
|
|
[Description("前一个ID")]
|
|
|
public string PreviousId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 执行人
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "执行人", ColumnDataType = "longtext", IsNullable = true)]
|
|
|
public string MakerList { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 工作流状态
|
|
|
/// </summary>
|
|
|
[Description("工作流状态")]
|
|
|
public FlowStatusEnum FlowStatus { get; set; } = FlowStatusEnum.Ready;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 中文视图名;设计方案时,提供中文字段的视图来源
|
|
|
/// </summary>
|
|
|
[Description("中文视图名;设计方案时,提供中文字段的视图来源")]
|
|
|
public string? ColumnView { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 流程内容
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "流程内容", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
|
|
public string Content { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 工作流类型
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "工作流类型", IsNullable = true)]
|
|
|
public TaskBaseTypeEnum? AuditType { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 是否已执行回调
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "是否已执行回调")]
|
|
|
public bool IsCallbackExecuted { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 执行人变更回调地址
|
|
|
/// </summary>
|
|
|
[SugarColumn(IsIgnore = true)]
|
|
|
public string? MarkerNotifyURL { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 审批完成回调地址
|
|
|
/// </summary>
|
|
|
[SugarColumn(IsIgnore = true)]
|
|
|
public string? CallbackURL { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 工作流是否已完成
|
|
|
/// </summary>
|
|
|
[SugarColumn(IsIgnore = true)]
|
|
|
public bool IsCompleted => string.IsNullOrEmpty(MakerList) || MakerList == "-1" || MakerList == "1";
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取当前实例的所有审批人
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public string[] GetMarkerList()
|
|
|
{
|
|
|
if (IsCompleted)
|
|
|
return [];
|
|
|
|
|
|
return MakerList.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
|
|
}
|
|
|
} |