using DS.Module.Core;
using DS.Module.Core.Extensions;
using SqlSugar;
namespace DS.WMS.Core.Op.Entity.TaskInteraction
{
///
/// 业务任务交互表
///
[SugarTable("business_task", "业务任务交互表")]
public class BusinessTask
{
///
/// ID
///
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
///
/// 业务ID
///
[SugarColumn(ColumnDescription = "业务ID", IsNullable = false)]
public long BusinessId { get; set; }
///
/// 业务类型
///
[SugarColumn(ColumnDescription = "业务类型", IsNullable = false)]
public BusinessType BusinessType { get; set; }
///
/// 任务类型
///
[SugarColumn(ColumnDescription = "任务类型", IsNullable = false)]
public TaskBaseTypeEnum TaskType { get; set; }
///
/// 任务状态
///
[SugarColumn(ColumnDescription = "任务状态", IsNullable = false)]
public TaskStatusEnum TaskStatus { get; set; }
///
/// 下一任务类型
///
[SugarColumn(ColumnDescription = "下一任务类型", IsNullable = true)]
public TaskBaseTypeEnum? NextType { get; set; }
///
/// 工作流ID
///
[SugarColumn(ColumnDescription = "工作流ID", IsNullable = true)]
public long? FlowId { get; set; }
///
/// 接收人列表
///
[SugarColumn(ColumnDescription = "接收人列表", IsNullable = false, ColumnDataType = "text")]
public string RecvUsers { get; set; } = string.Empty;
///
/// 获取接收人用户ID列表
///
[SugarColumn(IsIgnore = true)]
public long[] RecvUserIdArray => RecvUsers.IsNullOrEmpty() ? [] :
RecvUsers.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
///
/// 创建人
///
[SugarColumn(ColumnDescription = "创建人", IsNullable = false)]
public long CreateBy { get; set; }
///
/// 创建时间
///
[SugarColumn(ColumnDescription = "创建时间", IsNullable = false)]
public DateTime CreateTime { get; set; }
}
}