using Hotline.CallCenter.Calls;
using Hotline.FlowEngine.Workflows;
using Hotline.Settings;
using Hotline.Settings.Hotspots;
using Hotline.Share.Dtos;
using Hotline.Share.Dtos.File;
using Hotline.Share.Enums.FlowEngine;
using Hotline.Share.Enums.Order;
using Hotline.Share.Enums.Settings;
using Hotline.Share.Tools;
using Hotline.Users;
using SqlSugar;
using System.ComponentModel;
using Hotline.Snapshot;
using XF.Domain.Exceptions;
using XF.Domain.Extensions;
using XF.Domain.Repository;
using XF.Utility.EnumExtensions;
using Hotline.KnowledgeBase;
using Hotline.Early;

namespace Hotline.Orders
{
    /// <summary>
    /// 工单
    /// </summary>
    [Description("工单")]
    [SugarIndex("unique_order_no", nameof(Order.No), OrderByType.Desc, true)]
    [SugarIndex("index_order_creationtime", nameof(Order.CreationTime), OrderByType.Desc)]
    [SugarIndex("index_order_startTime", nameof(Order.StartTime), OrderByType.Desc)]
    [SugarIndex("index_order_expiredTime", nameof(Order.ExpiredTime), OrderByType.Desc)]
    public partial class Order : PositionWorkflowEntity
    {
        public Order()
        {
            //HotspotCodeLv1 ??= HotspotCode?[..2];
        }

        /// <summary>
        /// 第一次评价结果
        /// </summary>
        [SugarColumn(ColumnDescription = "第一次评价结果")]
        public string? FirstVisitResult { get; set; }

        [SugarColumn(ColumnDescription = "第一次评价结果代码")]
        public string? FirstVisitResultCode { get; set; }

        #region 来电信息
        /// <summary>
        /// 政治身份
        /// </summary>
        [SugarColumn(ColumnDescription = "政治身份")]
        public string? PoliticalIdentityValue { get; set; }

        /// <summary>
        /// 政治身份
        /// </summary>
        [SugarColumn(ColumnDescription = "政治身份")]
        public string? PoliticalIdentityName { get; set; }

        /// <summary>
        /// 来源渠道（电话、网站、APP等）
        /// </summary>
        [SugarColumn(ColumnDescription = "来源渠道")]
        public string? SourceChannel { get; set; }

        [SugarColumn(ColumnDescription = "来源渠道代码")]
        public string? SourceChannelCode { get; set; }

        /// <summary>
        /// 渠道为电话时，此字段存在（Call.Id）
        /// </summary>
        [SugarColumn(ColumnDescription = "来电ID")]
        public string? CallId { get; set; }

        /// <summary>
        /// 来电归属地
        /// </summary>
        [SugarColumn(ColumnDescription = "来电地址")]
        public string? CallAddress { get; set; }

        /// <summary>
        /// 来电号码
        /// </summary>
        [SugarColumn(ColumnDescription = "来电号码")]
        public string? FromPhone { get; set; }

        /// <summary>
        /// 转接号码（转接来源）
        /// </summary>
        [SugarColumn(ColumnDescription = "转接号码")]
        public string? TransferPhone { get; set; }

        /// <summary>
        /// 来电/信人姓名
        /// </summary>
        [SugarColumn(ColumnDescription = "来电姓名")]
        public string? FromName { get; set; }

        /// <summary>
        /// 来电/信人性别
        /// </summary>
        [SugarColumn(ColumnDescription = "来电性别")]
        public EGender FromGender { get; set; }

        /// <summary>
        /// 来电/信人身份
        /// </summary>
        [SugarColumn(ColumnDescription = "来电身份")]
        public EIdentityType? IdentityType { get; set; }

        /// <summary>
        /// 证件类型
        /// </summary>
        [SugarColumn(ColumnDescription = "证件类型")]
        public string? LicenceTypeCode { get; set; }

        [SugarColumn(ColumnDescription = "证件类型名称")]
        public string? LicenceType { get; set; }

        /// <summary>
        /// 证件号码
        /// </summary>
        [SugarColumn(ColumnDescription = "证件号码")]
        public string? LicenceNo { get; set; }

        /// <summary>
        /// 年龄段
        /// </summary>
        [SugarColumn(ColumnDescription = "年龄段代码")]
        public string? AgeRangeCode { get; set; }

        [SugarColumn(ColumnDescription = "年龄段")]
        public string? AgeRange { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(ColumnDescription = "联系电话")]
        public string? Contact { get; set; }

        [SugarColumn(ColumnDescription = "联系电话脱敏", IsNullable = true)]
        public string? ContactMask { get; set; }

        /// <summary>
        /// 是否接受短信，勾选校验手机号
        /// </summary>
        [SugarColumn(ColumnDescription = "是否接受短信")]
        public bool AcceptSms { get; set; }

        /// <summary>
        /// 是否已发送短信
        /// </summary>
        [SugarColumn(ColumnDescription = "是否已发送短信")]
        public bool SmsSended { get; set; }

        /// <summary>
        /// 是否保密
        /// </summary>
        [SugarColumn(ColumnDescription = "是否保密")]
        public bool IsSecret { get; set; }

        /// <summary>
        /// 工作单位(当“来电/信人身份”为“企业”时必填，其他情况非必填)
        /// </summary>
        [SugarColumn(ColumnDescription = "工作单位", IsNullable = true)]
        public string? Company { get; set; }

        #endregion

        #region 诉求信息

        /// <summary>
        /// 受理类型
        /// </summary>
        [SugarColumn(ColumnDescription = "受理类型")]
        public string? AcceptType { get; set; }

        /// <summary>
        /// 受理类型代码
        /// </summary>
        [SugarColumn(ColumnDescription = "受理类型代码")]
        public string? AcceptTypeCode { get; set; }

        [SugarColumn(ColumnDescription = "标题")]
        public string Title { get; set; }

        #region 工单标签（自贡）
        /// <summary>
        /// 工单标签（自贡）-- 弃用
        /// </summary>
        [SugarColumn(ColumnDescription = "工单标签-- 弃用")]
        public string? OrderTag { get; set; }

        [SugarColumn(ColumnDescription = "工单标签代码")]
        public string? OrderTagCode { get; set; }



        /// <summary>
        /// 工单标签
        /// </summary>
        [Navigate(typeof(OrderRelationTag), nameof(OrderRelationTag.OrderId), nameof(OrderRelationTag.TagId))]
        public List<SystemDicData> OrderTags { get; set; }

        #endregion

        #region 热点

        /// <summary>
        /// 热点
        /// </summary>
        [SugarColumn(ColumnDescription = "热点ID")]
        public string? HotspotId { get; set; }

        //public string? HotspotCode { get; set; }
        //public string? HotspotCodeLv1 { get; set; }

        [SugarColumn(ColumnDescription = "热点名称")]
        public string? HotspotName { get; set; }

        /// <summary>
        /// 热点分类类目名称
        /// </summary>
        [SugarColumn(ColumnDescription = "热点分类名称")]
        public string? HotspotSpliceName { get; set; }

        /// <summary>
        /// 外部数据（为前端提供级联功能）
        /// </summary>
        [SugarColumn(ColumnDescription = "外部数据")]
        public string? HotspotExternal { get; set; }

        #endregion

        #region 事件分类

        [SugarColumn(ColumnDescription = "事件分类ID")]
        public string? EventCategoryId { get; set; }

        [SugarColumn(ColumnDescription = "事件分类名称")]
        public string? EventCategoryName { get; set; }

        [SugarColumn(ColumnDescription = "事件分类拼接名称")]
        public string? EventCategorySpliceName { get; set; }

        [SugarColumn(ColumnDescription = "事件分类外部数据")]
        public string? EventCategoryExternal { get; set; }

        #endregion

        /// <summary>
        /// 事发时间
        /// </summary>
        [SugarColumn(ColumnDescription = "事发时间")]
        public DateTime? IncidentTime { get; set; }

        /// <summary>
        /// 事件目的
        /// </summary>
        [SugarColumn(ColumnDescription = "事件目的")]
        public string? IncidentPurpose { get; set; }

        /// <summary>
        /// 重复工单Id
        /// </summary>
        [SugarColumn(ColumnDescription = "重复工单Id", ColumnDataType = "json", IsJson = true)]
        public List<string>? DuplicateIds { get; set; }

        /// <summary>
        /// 推送分类 --  转为表存储
        /// </summary>
        [SugarColumn(ColumnDescription = "推送分类代码")]
        public string? PushTypeCode { get; set; }

        /// <summary>
        /// 推送分类 -- 冗余 多选存储 ,分割
        /// </summary>
        [SugarColumn(ColumnDescription = "推送分类")]
        public string? PushType { get; set; }

        /// <summary>
        /// 附件
        /// </summary>
        [SugarColumn(ColumnDataType = "json", IsJson = true)]
        public List<FileDto>? Additions { get; set; } = new();

        /// <summary>
        /// 诉求内容
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar(8000)", ColumnDescription = "诉求内容")]
        public string Content { get; set; }

        #endregion

        #region 工单属性

        /// <summary>
        /// 工单状态
        /// </summary>
        [SugarColumn(ColumnDescription = "工单状态")]
        public EOrderStatus Status { get; set; }

        /// <summary>
        /// 过期状态 //todo 延迟消息更新此字段
        /// </summary>
        [SugarColumn(ColumnDescription = "过期状态")]
        public EExpiredStatus ExpiredStatus { get; set; }

        /// <summary>
        /// 来源，区分省平台或110等其他平台同步过来的工单
        /// </summary>
        [SugarColumn(ColumnDescription = "来源")]
        public ESource Source { get; set; }

        /// <summary>
        /// 处理方式（直办、交办）
        /// </summary>
        [SugarColumn(ColumnDescription = "处理方式")]
        public EProcessType ProcessType { get; set; } = EProcessType.Zhiban;

        /// <summary>
        /// 是否公开
        /// </summary>
        [SugarColumn(ColumnDescription = "是否公开")]
        public bool IsPublicity { get; set; }

        /// <summary>
        /// 是否为省工单（省派发工单非政民互动直派的为省工单）
        /// </summary>
        [SugarColumn(ColumnDescription = "是否省工单")]
        public bool IsProvince { get; set; }

        /// <summary>
        /// 工单编码（20220101000001）
        /// </summary>
        [SugarColumn(ColumnDescription = "工单编码")]
        public string? No { get; set; }

        /// <summary>
        /// 是否已撤销
        /// </summary>
        [SugarColumn(ColumnDescription = "是否已撤销")]
        public bool IsCancel { get; set; }

        /// <summary>
        /// 市民查询密码
        /// </summary>
        [SugarColumn(ColumnDescription = "查询密码")]
        public string? Password { get; set; }

        /// <summary>
        /// 企业名称
        /// </summary>
        [SugarColumn(ColumnDescription = "企业名称")]
        public string? EnterpriseName { get; set; }

        /// <summary>
        /// 企业Code
        /// </summary>
        [SugarColumn(ColumnDescription = "企业编码")]
        public string? EnterpriseCode { get; set; }

        /// <summary>
        /// 专班名称
        /// </summary>
        [SugarColumn(ColumnDescription = "专班名称")]
        public string? ZhuanBanMingCheng { get; set; }

        /// <summary>
        /// 专班Code
        /// </summary>
        [SugarColumn(ColumnDescription = "专班编码")]
        public string? ZhuanBanCode { get; set; }

        #endregion

        #region 流程信息

        /// <summary>
        /// 工单开始时间(受理/接办时间=流程开启时间)
        /// </summary>
        [SugarColumn(ColumnDescription = "工单开始时间")]
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 超期时间（期满时间）
        /// </summary>
        [SugarColumn(ColumnDescription = "超期时间")]
        public DateTime? ExpiredTime { get; set; }

        /// <summary>
        /// 即将超期时间
        /// </summary>
        [SugarColumn(ColumnDescription = "即将超期时间")]
        public DateTime? NearlyExpiredTime { get; set; }

        /// <summary>
        /// 即将超期时间第一级
        /// </summary>
        [SugarColumn(ColumnDescription = "即将超期时间第一级")]
        public DateTime? NearlyExpiredTimeOne { get; set; }

        /// <summary>
        /// 交办时间(中心交部门办理时间)
        /// </summary>
        [SugarColumn(ColumnDescription = "交办时间")]
        public DateTime? CenterToOrgTime { get; set; }

        /// <summary>
        /// 交办意见
        /// </summary>
        [SugarColumn(ColumnDataType = "text", ColumnDescription = "交办意见")]
        public string? CenterToOrgOpinion { get; set; }

        /// <summary>
        /// 交办人
        /// </summary>
        [SugarColumn(ColumnDescription = "交办人ID")]
        public string? CenterToOrgHandlerId { get; set; }

        [SugarColumn(ColumnDescription = "交办人姓名")]
        public string? CenterToOrgHandlerName { get; set; }

        /// <summary>
        /// 归档时间（暂为流程结束时间，因流程结束自动归档）
        /// </summary>
        [SugarColumn(ColumnDescription = "归档时间")]
        public DateTime? FiledTime { get; set; }

        /// <summary>
        /// 办结时长（秒） 办结时间-交办时间
        /// </summary>
        [SugarColumn(ColumnDescription = "办结时长")]
        public double? HandleDuration { get; set; }

        /// <summary>
        /// 办结工作日时长（秒）
        /// </summary>
        [SugarColumn(ColumnDescription = "办结工作日时长")]
        public double? HandleDurationWorkday { get; set; }

        /// <summary>
        /// 办结时长（秒）归档时间-受理时间（工单创建时间）
        /// </summary>
        [SugarColumn(ColumnDescription = "工单创建到办结时长")]
        public double? CreationTimeHandleDuration { get; set; }

        /// <summary>
        /// 办结工作日时长（秒）归档时间-受理时间（工单创建时间）
        /// </summary>
        [SugarColumn(ColumnDescription = "工作日办结时长")]
        public double? CreationTimeHandleDurationWorkday { get; set; }

        /// <summary>
        /// 办结时长（秒） 归档时间-派单时间（中心到部门时间）
        /// </summary>
        [SugarColumn(ColumnDescription = "中心到部门办结时长")]
        public double? CenterToOrgHandleDuration { get; set; }

        /// <summary>
        /// 办结工作日时长（秒）归档时间-派单时间（中心到部门时间）
        /// </summary>
        [SugarColumn(ColumnDescription = "中心到部门工作日办结时长")]
        public double? CenterToOrgHandleDurationWorkday { get; set; }

        /// <summary>
        /// 归档时长（秒）
        /// </summary>
        [SugarColumn(ColumnDescription = "归档时长")]
        public double? FileDuration { get; set; }

        /// <summary>
        /// 归档工作时长（秒）
        /// </summary>
        [SugarColumn(ColumnDescription = "归档工作时长")]
        public double? FileDurationWorkday { get; set; }

        /// <summary>
        /// 重办时长,最新二次办理审批通过后的归档时间-最新二次办理审批通过时间（秒）
        /// </summary>
        [SugarColumn(ColumnDescription = "重办时长,最新二次办理审批通过后的归档时间-最新二次办理审批通过时间（秒）")]
        public double? SecondaryHandlingDuration { get; set; }

        [SugarColumn(ColumnDescription = "重办时长工作日时长")]
        public double? SecondaryHandlingDurationWorkday { get; set; }

        /// <summary>
        /// 全流程时长（秒）
        /// </summary>
        [SugarColumn(ColumnDescription = "全流程时长")]
        public double? AllDuration { get; set; }

        [SugarColumn(ColumnDescription = "全流程工作日时长")]
        public double? AllDurationWorkday { get; set; }


        //public string? AllDurationHour { get; set; }

        /// <summary>
        /// 办理时间限制(如：24小时、7个工作日)
        /// </summary>
        [SugarColumn(ColumnDescription = "办理时间限制")]
        public string? TimeLimit { get; set; }

        [SugarColumn(ColumnDescription = "时间限制计数")]
        public int? TimeLimitCount { get; set; }

        [SugarColumn(ColumnDescription = "时间限制单位")]
        public ETimeType? TimeLimitUnit { get; set; }

        #region 会签实际办理对象

        [SugarColumn(ColumnDataType = "json", IsJson = true, ColumnDescription = "会签实际办理对象")]
        public List<string>? CsActualHandleOrgIds { get; set; }

        [SugarColumn(ColumnDataType = "json", IsJson = true, ColumnDescription = "会签实际办理用户ID")]
        public List<string>? CsActualHandleUserIds { get; set; }

        #endregion

        #region 实际办理信息（节点，部门，意见）

        [SugarColumn(ColumnDescription = "实际办理步骤ID")]
        public string? ActualHandleStepId { get; set; }

        /// <summary>
        /// 实际办理节点code（会签状态此字段保存最外层会签发起节点code）
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理步骤code")]
        public string? ActualHandleStepCode { get; set; }

        /// <summary>
        /// 实际办理节点名称（会签状态此字段保存最外层会签发起节点名称）
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理步骤名称")]
        public string? ActualHandleStepName { get; set; }

        /// <summary>
        /// 到达实际办理节点时间（stepBox创建时间）
        /// </summary>
        [SugarColumn(ColumnDescription = "到达实际办理节点时间")]
        public DateTime? ActualHandleStepCreateTime { get; set; }

        /// <summary>
        /// 实际办理节点签收时间
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理节点签收时间")]
        public DateTime? ActualHandleStepAcceptTime { get; set; }

        /// <summary>
        /// 实际办理时间
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理时间")]
        public DateTime? ActualHandleTime { get; set; }

        /// <summary>
        /// 实际办理人id
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理人ID")]
        public string? ActualHandlerId { get; set; }

        /// <summary>
        /// 实际办理人名称
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理人姓名")]
        public string? ActualHandlerName { get; set; }

        /// <summary>
        /// 实际办理部门名称
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理部门名称")]
        public string? ActualHandleOrgName { get; set; }

        /// <summary>
        /// 实际办理部门编码
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理部门编码")]
        public string? ActualHandleOrgCode { get; set; }

        /// <summary>
        /// 实际办理部门行政区划编码
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理部门行政区划编码")]
        public string? ActualHandleOrgAreaCode { get; set; }

        /// <summary>
        /// 实际办理部门行政区划名称
        /// </summary>
        [SugarColumn(ColumnDescription = "实际办理部门行政区划名称")]
        public string? ActualHandleOrgAreaName { get; set; }

        /// <summary>
        /// 实际办理意见（办理中...or 最终办理意见）
        /// </summary>
        [SugarColumn(ColumnDataType = "text", ColumnDescription = "实际办理意见")]
        public string ActualOpinion { get; set; } = "办理中...";

        /// <summary>
        /// 真实办理人姓名（手动填写）
        /// </summary>
        [SugarColumn(ColumnDescription = "真实办理人姓名")]
        public string? RealHandlerName { get; set; }

        /// <summary>
        /// 真实办理人电话（手动填写）
        /// </summary>
        [SugarColumn(ColumnDescription = "真实办理人电话")]
        public string? RealHandlerPhone { get; set; }

        /// <summary>
        /// 沟通方式（手动填写）
        /// </summary>
        [SugarColumn(ColumnDescription = "沟通方式")]
        public ERealCommunicationMode? RealCommunicationMode { get; set; }

        /// <summary>
        /// 沟通时间（手动填写）
        /// </summary>
        [SugarColumn(ColumnDescription = "沟通时间")]
        public DateTime? RealCommunicationTime { get; set; }

        /// <summary>
        /// 沟通地点（手动填写）
        /// </summary>
        [SugarColumn(ColumnDescription = "沟通地点")]
        public string? RealCommunicationAddress { get; set; }

        /// <summary>
        /// 已与市民沟通
        /// </summary>
        [SugarColumn(ColumnDescription = "已与市民沟通")]
        public bool? RealIsContacted { get; set; }

        /// <summary>
        /// 已与市民现场沟通
        /// </summary>
        [SugarColumn(ColumnDescription = "已与市民现场沟通")]
        public bool? RealContactLocale { get; set; }

        /// <summary>
        /// 其它
        /// </summary>
        [SugarColumn(ColumnDescription = "其它")]
        public bool? IsOther { get; set; }

        /// <summary>
        /// 其它的备注
        /// </summary>
        [SugarColumn(ColumnDescription = "其它的备注")]
        public string? OtherRemark { get; set; }

        #endregion

        #region 当前办理节点信息(指派时赋值)

        [SugarColumn(ColumnDescription = "当前办理节点ID")]
        public string? CurrentStepId { get; set; }

        /// <summary>
        /// 当前办理节点code（非会签：当前被指派节点，会签：会签发起节点）
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理节点code")]
        public string? CurrentStepCode { get; set; }

        /// <summary>
        /// 当前节点名称
        /// </summary>
        [SugarColumn(ColumnDescription = "当前节点名称")]
        public string? CurrentStepName { get; set; }

        /// <summary>
        /// 到达当前节点时间
        /// </summary>
        [SugarColumn(ColumnDescription = "到达当前节点时间")]
        public DateTime? CurrentStepCreateTime { get; set; }

        /// <summary>
        /// 当前办理节点签收时间
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理节点签收时间")]
        public DateTime? CurrentStepAcceptTime { get; set; }

        /// <summary>
        /// 当前办理时间
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理时间")]
        public DateTime? CurrentHandleTime { get; set; }

        /// <summary>
        /// 当前办理人id
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理人ID")]
        public string? CurrentHandlerId { get; set; }

        /// <summary>
        /// 当前办理人名称
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理人姓名")]
        public string? CurrentHandlerName { get; set; }

        /// <summary>
        /// 当前办理部门名称
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理部门名称")]
        public string? CurrentHandleOrgName { get; set; }

        /// <summary>
        /// 当前办理部门编码
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理部门编码")]
        public string? CurrentHandleOrgId { get; set; }

        /// <summary>
        /// 当前办理部门等级
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理部门等级")]
        public int? CurrentHandleOrgLevel { get; set; }

        /// <summary>
        /// 当前办理部门行政区划编码
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理部门行政区划编码")]
        public string? CurrentHandleOrgAreaCode { get; set; }

        /// <summary>
        /// 当前办理部门行政区划名称
        /// </summary>
        [SugarColumn(ColumnDescription = "当前办理部门行政区划名称")]
        public string? CurrentHandleOrgAreaName { get; set; }

        #endregion

        #region 一级部门

        /// <summary>
        /// 一级部门code
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "一级部门编码")]
        public string? OrgLevelOneCode { get; set; }

        /// <summary>
        /// 一级部门名称
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "一级部门名称")]
        public string? OrgLevelOneName { get; set; }

        #endregion

        #region 二级部门

        /// <summary>
        /// 二级部门code
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "二级部门编码")]
        public string? OrgLevelTwoCode { get; set; }

        /// <summary>
        /// 二级部门名称
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "二级部门名称")]
        public string? OrgLevelTwoName { get; set; }

        #endregion

        #region 受理人(开启流程的话务员)

        /// <summary>
        /// 受理人id
        /// </summary>
        [SugarColumn(ColumnDescription = "受理人ID")]
        public string? AcceptorId { get; set; }

        /// <summary>
        /// 受理人名称
        /// </summary>
        [SugarColumn(ColumnDescription = "受理人姓名")]
        public string? AcceptorName { get; set; }

        /// <summary>
        /// 受理人工号
        /// </summary>
        [SugarColumn(ColumnDescription = "受理人工号")]
        public string? AcceptorStaffNo { get; set; }

        /// <summary>
        /// 受理人部门编码
        /// </summary>
        [SugarColumn(ColumnDescription = "受理人部门编码")]
        public string? AcceptorOrgCode { get; set; }

        /// <summary>
        /// 受理人部门名称
        /// </summary>
        [SugarColumn(ColumnDescription = "受理人部门名称")]
        public string? AcceptorOrgName { get; set; }

        #endregion

        #region 派单人

        /// <summary>
        /// 派单次数
        /// </summary>
        [SugarColumn(ColumnDescription = "派单次数")]
        public int? SendOrderNumber { get; set; } = 0;

        #endregion

        /// <summary>
        /// 会签类型
        /// </summary>
        [SugarColumn(ColumnDescription = "会签类型")]
        public ECounterSignType? CounterSignType { get; set; }

        #region 签收

        /// <summary>
        /// 签收人id
        /// </summary>
        [SugarColumn(ColumnDescription = "签收人ID")]
        public string? SignerId { get; set; }

        /// <summary>
        /// 签收人名称
        /// </summary>
        [SugarColumn(ColumnDescription = "签收人姓名")]
        public string? SignerName { get; set; }

        #endregion

        #region 归档冗余字段

        /// <summary>
        /// 归档人名称
        /// </summary>
        [SugarColumn(ColumnDescription = "归档人姓名")]
        public string? FileUserName { get; set; }

        /// <summary>
        /// 归档人ID
        /// </summary>
        [SugarColumn(ColumnDescription = "归档人ID")]
        public string? FileUserId { get; set; }

        /// <summary>
        /// 归档人部门Id
        /// </summary>
        [SugarColumn(ColumnDescription = "归档人部门ID")]
        public string? FileUserOrgId { get; set; }

        /// <summary>
        /// 归档人部门名称
        /// </summary>
        [SugarColumn(ColumnDescription = "归档人部门名称")]
        public string? FileUserOrgName { get; set; }

        /// <summary>
        /// 归档人部门是否属于中心
        /// </summary>
        [SugarColumn(ColumnDescription = "归档人部门是否为中心")]
        public bool? FileOrgIsCenter { get; set; }

        /// <summary>
        /// 归档人类型
        /// </summary>
        [SugarColumn(ColumnDescription = "归档人类型")]
        public EFileUserType? FileUserRole { get; set; }

        /// <summary>
        /// 归档意见
        /// </summary>
        [SugarColumn(ColumnDataType = "text", ColumnDescription = "归档意见")]
        public string? FileOpinion { get; set; }

        #endregion

        #endregion

        #region 省工单字段

        /// <summary>
        /// 省期满时间（省工单才有）
        /// </summary>
        [SugarColumn(ColumnDescription = "省期满时间")]
        public DateTime? ExpiredTimeProvince { get; set; }

        /// <summary>
        /// 省本地编号
        /// </summary>
        [SugarColumn(ColumnDescription = "省本地编号")]
        public string? ProvinceNo { get; set; }

        /// <summary>
        /// 省交办编号
        /// </summary>
        [SugarColumn(ColumnDescription = "省交办编号")]
        public string? ReceiveProvinceNo { get; set; }

        /// <summary>
        /// 外部工单唯一标识
        /// </summary>
        [SugarColumn(ColumnDescription = "外部工单唯一标识")]
        public string? ExternalId { get; set; }

        /// <summary>
        /// 工单标签
        /// </summary>
        [SugarColumn(ColumnDescription = "工单标签")]
        public string? TagNames { get; set; }

        /// <summary>
        /// 省退回结果
        /// </summary>
        [SugarColumn(ColumnDescription = "省退回结果")]
        public bool? ProvinceSendBack { get; set; }

        /// <summary>
        /// 诉求人意愿是否公开（省政府网站、省政务服务网、天府通办App）
        /// </summary>
        [SugarColumn(ColumnDescription = "诉求人意愿是否公开")]
        public bool? IsPublic { get; set; }

        #endregion

        #region 附件冗余

        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true, ColumnDescription = "附件JSON")]
        public List<FileJson>? FileJson { get; set; }

        //[SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true, ColumnDescription = "附件列表附件JSON")]
        //public List<FileJson>? ListFileJson { get; set; }

        #endregion

        #region 市州工单互转

        /// <summary>
        /// 是否转发
        /// </summary>
        [SugarColumn(ColumnDescription = "是否转发")]
        public bool? Transpond { get; set; }

        /// <summary>
        /// 转发市州Id
        /// </summary>
        [SugarColumn(ColumnDescription = "转发市州ID")]
        public string? TranspondCityId { get; set; }

        /// <summary>
        /// 转发市州名称
        /// </summary>
        [SugarColumn(ColumnDescription = "转发市州名称")]
        public string? TranspondCityName { get; set; }

        /// <summary>
        /// 转发市州Value
        /// </summary>
        [SugarColumn(ColumnDescription = "转发市州Value")]
        public string? TranspondCityValue { get; set; }

        #endregion

        #region 重办

        /// <summary>
        /// 重办次数
        /// </summary>
        [SugarColumn(ColumnDescription = "重办次数")]
        public int? ReTransactNum { get; set; }

        /// <summary>
        /// 回访重办次数
        /// </summary>
        [SugarColumn(ColumnDescription = "重办次数")]
        public int? VisitReTransactNum { get; set; }

        /// <summary>
        /// 派单退回次数
        /// </summary>
        [SugarColumn(ColumnDescription = "派单退回次数")]
        public int? SendBackNum { get; set; }

        /// <summary>
        /// 省重办次数
        /// </summary>
        [SugarColumn(ColumnDescription = "省重办次数")]
        public int? ProvinceReTransactNum { get; set; }

        /// <summary>
        /// 工单交办处理方式 10：直接办结，20：交办，30：派单员重派，40：结果审核重派，50：回访不满意重派
        /// 处理方式为结果审核重派时禁止退单
        /// 处理方式为回访不满意重派时禁止退单
        /// </summary>
        [SugarColumn(ColumnDescription = " 工单交办处理方式 10：直接办结，20：交办，30：派单员重派，40：结果审核重派，50：回访不满意重派")]
        public string? CaseProcessType { get; set; }
        #endregion

        #region 工单标签
        /// <summary>
        /// 敏感标签
        /// </summary>
        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true, ColumnDescription = "敏感标签")]
        public List<string>? Sensitive { get; set; }

        /// <summary>
        /// 是否行政执法类
        /// </summary>
        [SugarColumn(ColumnDescription = "是否行政执法类")]
        public bool? IsEnforcementOrder { get; set; }

        /// <summary>
        /// 形式主义工单
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否形式主义工单")]
        public bool IsFormalistWorkOrder { get; set; }

        /// <summary>
        /// 敏感类工单
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否敏感类工单")]
        public bool IsSensitiveWorkOrders { get; set; }

        /// <summary>
        /// 24小时办结
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否24小时办结")]
        public bool Is24HoursComplete { get; set; }

        /// <summary>
        /// 部门是否解决
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "部门是否解决")]
        public bool IsResolved { get; set; }

        /// <summary>
        /// 是否紧急
        /// 在创单的时候勾选的是否紧急
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否紧急")]
        public bool IsUrgent { get; set; }

        /// <summary>
        /// 是否紧急
        /// 在办理的时候勾选的是否紧急
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "办理勾选是否紧急")]
        public bool IsStepUrgent { get; set; }

        /// <summary>
        /// 是否推诿
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否推诿")]
        public bool IsEvasive { get; set; }

        /// <summary>
        /// 是否不积极
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否不积极")]
        public bool IsInactively { get; set; }

        /// <summary>
        /// 是否三方通话
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否三方通话")]
        public bool IsThreePartyConference { get; set; }

        /// <summary>
        /// 重点关注事件,保存前端选择，用于返回前端数据
        /// </summary>
        [SugarColumn(ColumnDescription = "重点关注事件")]
        public string? FocusOnEvents { get; set; }

        /// <summary>
        /// 重点关注事件名称，保存前端选择，用于返回前端数据
        /// </summary>
        [SugarColumn(ColumnDescription = "重点关注事件名称")]
        public string? FocusOnEventsName { get; set; }

        /// <summary>
        /// 待发布人Id
        /// </summary>
        [SugarColumn(ColumnDescription = "待发布人ID")]
        public string? WaitForPublisherId { get; set; }

        /// <summary>
        /// 是否政民互动公开
        /// </summary>
        [SugarColumn(DefaultValue = "f", ColumnDescription = "是否政民互动公开")]
        public bool IsProvinceZmhd { get; set; }

        /// <summary>
        /// 初审人姓名
        /// </summary>
        [SugarColumn(ColumnDescription = "初审人姓名")]
        public string? AuditFirstName { get; set; }

        /// <summary>
        /// 初审时间
        /// </summary>
        [SugarColumn(ColumnDescription = "初审时间")]
        public DateTime? AuditFirstTime { get; set; }

        /// <summary>
        /// 政民互动公开ID
        /// </summary>
        [SugarColumn(ColumnDescription = "政民互动公开ID")]
        public string? OrderProvinceZmhdId { get; set; }

        /// <summary>
        /// 超期部门
        /// </summary>
        [SugarColumn(IsIgnore = true, ColumnDescription = "超期部门名称")]
        public string? DaysOverdueOrgName { get; set; }

        /// <summary>
        /// 退回截至时间
        /// </summary>
        [SugarColumn(ColumnDescription = "退回截至时间")]
        public DateTime? SendBackAuditEndTime { get; set; }

        /// <summary>
        /// 话务提醒是否转办
        /// </summary>
        [SugarColumn(ColumnDescription = "话务提醒是否转办")]
        public bool? IsForwarded { get; set; }
        #endregion

        #region 回访信息
        /// <summary>
        /// 话务员评价（话务评价）
        /// </summary>
        [SugarColumn(ColumnDescription = "话务员评价")]
        public ESeatEvaluate? SeatEvaluate { get; set; }

        /// <summary>
        /// 部门办件结果
        /// </summary>
        [SugarColumn(ColumnDataType = "json", ColumnDescription = "部门办件结果", IsJson = true, IsNullable = true)]
        public Kv? OrgProcessingResults { get; set; }
        #endregion

        /// <summary>
        /// 老系统工单Id
        /// </summary>
        [SugarColumn(ColumnDescription = "老系统工单Id")]
        public string? OldOrderId { get; set; }

        /// <summary>
        ///知识库引用
        /// </summary>
        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true, ColumnDescription = "知识库引用")]
        public List<Kv>? KnowledgeQuote { get; set; }

    }

    public partial class Order
    {
        /// <summary>
        /// 受理人
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(AcceptorId))]
        public User Acceptor { get; set; }

        /// <summary>
        /// 热点
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(HotspotId))]
        public Hotspot Hotspot { get; set; }

        /// <summary>
        /// 办理流程
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(WorkflowId))]
        public Workflow Workflow { get; set; }

        /// <summary>
        /// 工单扩展信息
        /// </summary>
		[Navigate(NavigateType.OneToOne, nameof(Id))]
        public OrderExtension OrderExtension { get; set; }

        /// <summary>
        /// 已发布工单
        /// </summary>
		[Navigate(NavigateType.OneToOne, nameof(Id), nameof(Orders.OrderPublish.OrderId))]
        public OrderPublish OrderPublish { get; set; }

        /// <summary>
        /// 预警信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(Id), nameof(OrderEarlyWarning.OrderId))]
        public OrderEarlyWarning OrderEarlyWarning { get; set; }

        /// <summary>
        /// 已回访工单
        /// </summary>
		[Navigate(NavigateType.OneToMany, nameof(OrderVisit.OrderId))]
        public List<OrderVisit> OrderVisits { get; set; }

        /// <summary>
        /// 甄别
        /// </summary>
		[Navigate(NavigateType.OneToMany, nameof(OrderScreen.OrderId))]
        public List<OrderScreen> OrderScreens { get; set; }

        /// <summary>
        /// 终止
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(OrderTerminate.OrderId))]
        public List<OrderTerminate> OrderTerminates { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(OrderSpecial.OrderId))]
        public List<OrderSpecial> OrderSpecials { get; set; }

        /// <summary>
        /// 延期
        /// </summary>
		[Navigate(NavigateType.OneToMany, nameof(OrderDelay.OrderId))]
        public List<OrderDelay> OrderDelays { get; set; }

        /// <summary>
        /// 工单补充
        /// </summary>
		[Navigate(NavigateType.OneToMany, nameof(OrderComplement.OrderId))]
        public List<OrderComplement> OrderComplements { get; set; }

        /// <summary>
        /// 工单推送分类
        /// </summary>
		[Navigate(NavigateType.OneToMany, nameof(OrderPushType.OrderId))]
        public List<OrderPushType> OrderPushTypes { get; set; }

        /// <summary>
        /// 通话记录
        /// </summary>
        //[Navigate(NavigateType.OneToOne, nameof(CallId), nameof(TrCallRecord.CallAccept))] //由CallAccept改成OtherAccept
        [Navigate(NavigateType.OneToOne, nameof(CallId), nameof(TrCallRecord.OtherAccept))]
        public TrCallRecord CallRecord { get; set; }

        /// <summary>
        /// 兴唐通话记录
        /// </summary>
        //[Navigate(NavigateType.OneToOne, nameof(CallId), nameof(TrCallRecord.CallAccept))] //由CallAccept改成OtherAccept
        [Navigate(NavigateType.OneToOne, nameof(CallId), nameof(CallNative.Id))]
        public CallNative FwCallRecord { get; set; }

        [Navigate(NavigateType.OneToMany, nameof(WorkflowStep.ExternalId))]
        public List<WorkflowStep> WorkflowSteps { get; set; }

        [Navigate(NavigateType.OneToMany, nameof(WorkflowTrace.ExternalId))]
        public List<WorkflowTrace> WorkflowTraces { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(Id), nameof(OrderSnapshot.Id))]
        public OrderSnapshot OrderSnapshot { get; set; }

        /// <summary>
        /// 工单督办
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(OrderSupervise.OrderId))]
        public List<OrderSupervise> OrderSupervises { get; set; }

        #region Method

        public void Cancel()
        {
            IsCancel = true;
        }

        public void Redo()
        {
            Status = EOrderStatus.Handling;
            ExpiredStatus = EExpiredStatus.Normal;
        }

        public void CheckIfFiled()
        {
            if (Status is EOrderStatus.Filed)
                throw UserFriendlyException.SameMessage("工单已归档");
        }

        public void Init()
        {
            if (!string.IsNullOrEmpty(Contact))
                ContactMask = Contact.MaskPhoneNumber();
            Status = EOrderStatus.WaitForAccept;
            ExpiredStatus = EExpiredStatus.Normal;
        }

        public void AutoAccept(string userId, string? userName, string? staffNo)
        {
            AcceptorId = userId;
            AcceptorName = userName;
            AcceptorStaffNo = staffNo;
        }

        /// <summary>
        /// 开始工单办理流程
        /// </summary>
        public void StartManageFlow() => Status = EOrderStatus.Handling;

        /// <summary>
        /// 更新工单办理中状态
        /// </summary>
        public void UpdateHandlingStatus(bool isInCountersign) =>
            Status = isInCountersign && Status < EOrderStatus.Filed ? EOrderStatus.Countersigning : EOrderStatus.Handling;

        /// <summary>
        /// 归档
        /// </summary>
        public void File(DateTime filedTime, double handleDurationWorkday, double fileDurationWorkday, double allDurationWorkday
            , double creationTimeHandleDurationWorkday, double centerToOrgHandleDurationWorkday, double? secondaryHandlingDurationWorkday,
            DateTime? secondaryHandlingAuditTime)
        {
            if (Status is EOrderStatus.Filed) return;
            Status = EOrderStatus.Filed;
            FiledTime = filedTime;
            HandleDurationWorkday = handleDurationWorkday;
            FileDurationWorkday = fileDurationWorkday;
            AllDurationWorkday = allDurationWorkday;
            CreationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday;
            CenterToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday;
            SecondaryHandlingDurationWorkday = secondaryHandlingDurationWorkday;

            //计算实际办结时长
            SetHandleDuration();
            SetFileDuration();
            SetAllDuration();
            SetCreationTimeHandleDurationWorkday();
            SetCenterToOrgHandleDurationWorkday();
            SetSecondaryHandlingDuration(secondaryHandlingAuditTime);
        }

        /// <summary>
        /// 特提之后 归档信息清空
        /// </summary>
        public void FileEmpty()
        {
            FiledTime = null;
            FileOpinion = string.Empty;
            HandleDurationWorkday = 0;
            HandleDuration = 0;
            FileDurationWorkday = 0;
            FileDuration = 0;
            AllDurationWorkday = 0;
            AllDuration = 0;
            CreationTimeHandleDurationWorkday = 0;
            CreationTimeHandleDuration = 0;
            CenterToOrgHandleDurationWorkday = 0;
            CenterToOrgHandleDuration = 0;
        }

        /// <summary>
        /// 发布
        /// </summary>
        /// <param name="isPublicity"></param>
        public void Publish(bool isPublicity)
        {
            //Progress = EProgress.Published;
            Status = EOrderStatus.Published;
            IsPublicity = isPublicity;
        }

        /// <summary>
        /// 已回访
        /// </summary>
        public void Visited(string resultCode, string result)
        {
            if (string.IsNullOrEmpty(resultCode) || string.IsNullOrEmpty(result))
                return;
            if (!string.IsNullOrEmpty(FirstVisitResultCode)) return;
            FirstVisitResultCode = resultCode;
            FirstVisitResult = result;

            //Progress = EProgress.Visited;
            if (Status >= EOrderStatus.Filed)
                Status = EOrderStatus.Visited;
        }

        public void CenterToOrg(string timelimit, int timelimitCount, ETimeType timilimitUnit,
            DateTime expiredTime, DateTime nearlyExpiredTime, DateTime nearlyExpiredTimeOne,
            string opinion, string handlerId, string handlerName,
            bool canUpdateOrderSender)
        {
            ProcessType = EProcessType.Jiaoban;
            TimeLimit = timelimit;
            TimeLimitCount = timelimitCount;
            TimeLimitUnit = timilimitUnit;
            ExpiredTime = expiredTime;
            if (CenterToOrgTime is null || canUpdateOrderSender)
            {
                CenterToOrgTime = DateTime.Now;
                CenterToOrgOpinion = opinion;
                CenterToOrgHandlerId = handlerId;
                CenterToOrgHandlerName = handlerName;
            }
            NearlyExpiredTime = nearlyExpiredTime;
            NearlyExpiredTimeOne = nearlyExpiredTimeOne;
            SendOrderNumber += 1;

            if (string.IsNullOrEmpty(WaitForPublisherId))
                WaitForPublisherId = handlerId;
        }

        public void OrgToCenter(string timelimit, int timelimitCount, ETimeType timilimitUnit, DateTime expiredTime, DateTime nearlyExpiredTime, DateTime nearlyExpiredTimeOne)
        {
            ProcessType = EProcessType.Zhiban;
            TimeLimit = timelimit;
            TimeLimitCount = timelimitCount;
            TimeLimitUnit = timilimitUnit;
            ExpiredTime = expiredTime;
            NearlyExpiredTime = nearlyExpiredTime;
            NearlyExpiredTimeOne = nearlyExpiredTimeOne;
            CenterToOrgTime = null;
            CenterToOrgOpinion = null;
            CenterToOrgHandlerId = null;
            CenterToOrgHandlerName = null;
        }

        public void CenterToCenter(string timelimit, int timelimitCount, ETimeType timilimitUnit, DateTime expiredTime, DateTime nearlyExpiredTime, DateTime nearlyExpiredTimeOne)
        {
            TimeLimit = timelimit;
            TimeLimitCount = timelimitCount;
            TimeLimitUnit = timilimitUnit;
            ExpiredTime = expiredTime;
            NearlyExpiredTime = nearlyExpiredTime;
            NearlyExpiredTimeOne = nearlyExpiredTimeOne;
        }

        public void SetHandleDuration()
        {
            if (!ActualHandleTime.HasValue) return;
            if (!CenterToOrgTime.HasValue) return;
            HandleDuration = Math.Round((ActualHandleTime - CenterToOrgTime).Value.TotalSeconds);
        }

        public void SetAllDuration()
        {
            if (!FiledTime.HasValue) return;
            if (!StartTime.HasValue) return;
            AllDuration = Math.Round((FiledTime - StartTime).Value.TotalSeconds);
        }

        public void SetFileDuration()
        {
            if (!FiledTime.HasValue) return;
            if (!CenterToOrgTime.HasValue) return;
            FileDuration = Math.Round((FiledTime - CenterToOrgTime).Value.TotalSeconds);
        }

        /// <summary>
        /// 自贡 任务 390【标】综合查询增加“重办时长”数据列
        /// </summary>
        /// <param name="SecondaryHandlingAuditTime"></param>
        public void SetSecondaryHandlingDuration(DateTime? SecondaryHandlingAuditTime)
        {
            if (!FiledTime.HasValue || !SecondaryHandlingAuditTime.HasValue)
                SecondaryHandlingDuration = null;
            else
                SecondaryHandlingDuration = Math.Round((FiledTime - SecondaryHandlingAuditTime).Value.TotalSeconds);
        }

        /// <summary>
        /// 办结时长（秒） 归档时间-受理时间（工单创建时间）
        /// </summary>
        public void SetCreationTimeHandleDurationWorkday()
        {
            if (!FiledTime.HasValue)
                CreationTimeHandleDuration = 0;
            else
            {
                var count = Math.Round((FiledTime - CreationTime).Value.TotalSeconds);
                CreationTimeHandleDuration = count <= 0 ? 1 : count;
            }

        }

        /// <summary>
        /// 办结时长（秒） 归档时间-派单时间（中心到部门时间）
        /// </summary>
        public void SetCenterToOrgHandleDurationWorkday()
        {
            if (FiledTime.HasValue && CenterToOrgTime.HasValue)
            {
                var count = Math.Round((FiledTime - CenterToOrgTime).Value.TotalSeconds);
                CenterToOrgHandleDuration = count <= 0 ? 1 : count;
            }
            else
                CenterToOrgHandleDuration = 0;
        }

        /// <summary>
        /// 是否已签收
        /// </summary>
        public bool IsSigned() => !string.IsNullOrEmpty(SignerId);

        /// <summary>
        /// 签收
        /// </summary>
        public void Sign(string userId, string userName)
        {
            if (string.IsNullOrEmpty(SignerId))
            {
                SignerId = userId;
                SignerName = userName;
            }
        }

        /// <summary>
        /// 自动发布条件检测
        /// </summary>
        /// <returns></returns>
        public string AutoPublishCheck()
        {
            if (CounterSignType != null)
                return "会签工单自动发布失败;";
            if (IsProvince)
                return "省工单自动发布失败;";
            if (Status != EOrderStatus.Filed)
                return "工单状态非 已归档, " + Status.GetDescription();
            return "";
        }
        #endregion
    }

    public class UnsignedOrder
    {
        public Order Order { get; set; }

        public WorkflowStep WorkflowStep { get; set; }
    }
}
