using AutoMapper.Configuration.Annotations;
using Newtonsoft.Json;
using OASystem.Domain.Enums;
using System.ComponentModel;
namespace OASystem.Domain.Entities.Groups
{
///
/// 团组流程总览
///
[SugarTable("Grp_ProcessOverview", "团组流程总览表")]
public class Grp_ProcessOverview : EntityBase
{
///
/// 团组Id
///
[SugarColumn(ColumnName = "GroupId", ColumnDescription = "团组Id", IsNullable = true, ColumnDataType = "int")]
public int GroupId { get; set; }
///
/// 流程顺序
///
[SugarColumn(ColumnName = "ProcessOrder", ColumnDescription = "流程顺序", IsNullable = true, ColumnDataType = "int")]
public int ProcessOrder { get; set; }
///
/// 流程类型
///
[SugarColumn(ColumnName = "ProcessType", ColumnDescription = "流程类型", ColumnDataType = "int")]
public GroupProcessType ProcessType { get; set; }
///
/// 整体状态
///
[SugarColumn(ColumnName = "OverallStatus", ColumnDescription = "流程整体状态", ColumnDataType = "int")]
public ProcessStatus OverallStatus { get; set; } = ProcessStatus.UnStarted;
///
/// 开始时间
///
[SugarColumn(ColumnName = "StartTime", ColumnDescription = "开始时间", IsNullable = true, ColumnDataType = "datetime")]
public DateTime? StartTime { get; set; }
///
/// 结束时间
///
[SugarColumn(ColumnName = "EndTime", ColumnDescription = "结束时间", IsNullable = true, ColumnDataType = "datetime")]
public DateTime? EndTime { get; set; }
///
/// 更新人
///
[SugarColumn(ColumnName = "UpdatedUserId", ColumnDescription = "更新人", IsNullable = true, ColumnDataType = "int")]
public int UpdatedUserId { get; set; }
///
/// 更新时间
///
[SugarColumn(ColumnName = "UpdatedTime", ColumnDescription = "更新时间", ColumnDataType = "datetime")]
public DateTime UpdatedTime { get; set; } = DateTime.Now;
///
/// 节点集合 - 流程包含的所有节点(导航属性)
///
[Ignore]
[Navigate(NavigateType.OneToMany, nameof(Grp_ProcessNode.ProcessId))]
public List Nodes { get; set; } = new List();
public Grp_ProcessOverview() { }
public static Grp_ProcessOverview Create(int groupId, int processOrder, GroupProcessType processType, ProcessStatus overallStatus, int currUserId, List nodes)
{
return new Grp_ProcessOverview
{
GroupId = groupId,
ProcessOrder = processOrder,
ProcessType = processType,
OverallStatus = ProcessStatus.InProgress,
StartTime = DateTime.Now,
UpdatedUserId = currUserId,
CreateUserId = currUserId,
Nodes = nodes
};
}
}
///
/// 流程节点
///
[SugarTable("Grp_ProcessNode", "流程节点")]
public class Grp_ProcessNode : EntityBase
{
///
/// 流程ID
///
[SugarColumn(ColumnName = "ProcessId", ColumnDescription = "流程ID", IsNullable = true, ColumnDataType = "int")]
public int ProcessId { get; set; }
///
/// 节点名称
///
[SugarColumn(ColumnName = "NodeName", ColumnDescription = "节点名称", ColumnDataType = "varchar(100)")]
public string NodeName { get; set; }
///
/// 节点描述提示
///
[SugarColumn(ColumnName = "NodeDescTips", ColumnDescription = "节点描述提示", ColumnDataType = "varchar(300)")]
public string NodeDescTips { get; set; }
///
/// 节点顺序
///
[SugarColumn(ColumnName = "NodeOrder", ColumnDescription = "节点顺序", ColumnDataType = "int")]
public int NodeOrder { get; set; }
///
/// 节点状态
///
[SugarColumn(ColumnName = "OverallStatus", ColumnDescription = "节点状态", ColumnDataType = "int")]
public ProcessStatus OverallStatus { get; set; } = ProcessStatus.UnStarted;
///
/// 操作人
///
[SugarColumn(ColumnName = "Operator", ColumnDescription = "操作人", IsNullable = true, ColumnDataType = "int")]
public int? Operator { get; set; }
///
/// 操作时间
///
[SugarColumn(ColumnName = "OperationTime", ColumnDescription = "操作时间", IsNullable = true, ColumnDataType = "datetime")]
public DateTime? OperationTime { get; set; }
///
/// 实际完成时间
///
[SugarColumn(ColumnName = "ActualDone", ColumnDescription = "实际完成时间", IsNullable = true, ColumnDataType = "datetime")]
public DateTime? ActualDone { get; set; }
/////
///// 国家
/////
//[SugarColumn(ColumnName = "Country", ColumnDescription = "国家", ColumnDataType = "varchar(100)",IsNullable = true)]
//public string? Country { get; set; }
///
/// 是否为当前节点
///
[SugarColumn(ColumnName = "IsCurrent", ColumnDescription = "是否为当前节点", ColumnDataType = "bit")]
[DefaultValue(false)]
public bool IsCurrent { get; set; }
public Grp_ProcessNode() { }
///
/// Create
///
///
///
///
///
///
///
///
///
public static Grp_ProcessNode Create(int nodeOrder, string nodeName, string nodeDescTips,ProcessStatus status, bool isCurrent, int currUserId, string remark=null)
{
return new Grp_ProcessNode
{
NodeOrder = nodeOrder,
NodeName = nodeName,
NodeDescTips = nodeDescTips,
OverallStatus = status,
IsCurrent = isCurrent,
CreateUserId = currUserId,
Remark = remark
};
}
}
public class VisaProcessNode
{
///
/// 国家名称
///
public string CountryName { get; set; }
///
/// 序号
///
public int OrderNo { get; set; }
///
/// 收集资料 -> 签证材料收集和准备 - 节点名称
///
public string NodeName1 { get; set; } = "签证材料收集和准备";
///
/// 收集资料 -> 签证材料收集和准备 - 是否办理
///
public bool IsHandle1 { get; set; } = false;
///
/// 收集资料 -> 签证材料收集和准备 - 办理时间
///
public string HandleTime1 { get; set; } = "";
///
/// 取护照资料 - 节点名称
///
public string NodeName2 { get; set; } = "取护照资料";
///
/// 取护照资料 - 是否办理
///
public bool IsHandle2 { get; set; } = false;
///
/// 取护照资料 - 办理时间
///
public string HandleTime2 { get; set; } = "";
///
/// 填资料 - 节点名称
///
public string NodeName3 { get; set; } = "填资料";
///
/// 填资料 - 是否办理
///
public bool IsHandle3 { get; set; } = false;
///
/// 填资料 - 办理时间
///
public string HandleTime3 { get; set; } = "";
///
/// 送签 - 节点名称
///
public string NodeName4 { get; set; } = "送签";
///
/// 送签 - 是否办理
///
public bool IsHandle4 { get; set; } = false;
///
/// 送签 - 办理时间
///
public string HandleTime4 { get; set; } = "";
///
/// 出签+取护照 - 节点名称
///
public string NodeName5 { get; set; } = "签+取护照";
///
/// 出签+取护照 - 是否办理
///
public bool IsHandle5 { get; set; } = false;
///
/// 出签+取护照 - 办理时间
///
public string HandleTime5 { get; set; } = "";
///
/// 归还护照 - 节点名称
///
public string NodeName6 { get; set; } = "归还护照";
///
/// 归还护照 - 是否办理
///
public bool IsHandle6 { get; set; } = false;
///
/// 归还护照 - 办理时间
///
public string HandleTime6 { get; set; } = "";
///
/// 归还人
/// NodeName = "归还护照" 时使用
///
public string Returner { get; set; } = "";
public VisaProcessNode() { }
public static VisaProcessNode Info(int orderNo, string countryName)
{
return new VisaProcessNode() { OrderNo = orderNo, CountryName = countryName };
}
}
///
/// 团组流程操作日志
///
[SugarTable("Grp_ProcessLog", "团组流程总览操作日志")]
public class Grp_ProcessLog : EntityBase
{
///
/// 流程ID
///
[SugarColumn(ColumnName = "ProcessId", ColumnDescription = "流程ID", IsNullable = true, ColumnDataType = "int")]
public int? ProcessId { get; set; }
///
/// 节点ID
///
[SugarColumn(ColumnName = "NodeId", ColumnDescription = "节点ID", IsNullable = true, ColumnDataType = "int")]
public int? NodeId { get; set; }
///
/// 团组ID
///
[SugarColumn(ColumnName = "GroupId", ColumnDescription = "团组ID", IsNullable = true, ColumnDataType = "int")]
public int GroupId { get; set; }
///
/// 操作类型
///
[SugarColumn(ColumnName = "OpType", ColumnDescription = "操作类型", ColumnDataType = "varchar(50)")]
public string OpType { get; set; }
///
/// 操作描述
///
[SugarColumn(ColumnName = "OpDesc", ColumnDescription = "操作描述", ColumnDataType = "varchar(500)")]
public string OpDesc { get; set; }
///
/// 变更前数据
///
[SugarColumn(ColumnName = "BeforeData", ColumnDescription = "变更前数据", IsNullable = true, ColumnDataType = "nvarchar(max)")]
public string BeforeData { get; set; }
///
/// 变更后数据
///
[SugarColumn(ColumnName = "AfterData", ColumnDescription = "变更后数据", IsNullable = true, ColumnDataType = "nvarchar(max)")]
public string AfterData { get; set; }
///
/// 变更字段
///
[SugarColumn(ColumnName = "ChgFields", ColumnDescription = "变更字段", IsNullable = true, ColumnDataType = "varchar(500)")]
public string ChgFields { get; set; }
}
///
/// 字段变更详情
///
public class FieldChgDetail
{
public string FieldName { get; set; }
public string BeforeValue { get; set; }
public string AfterValue { get; set; }
}
}