using Hotline.Share.Dtos.Settings;
using Hotline.Share.Enums;
using Hotline.Share.Enums.Order;
using Hotline.Share.Enums.Snapshot;
using Hotline.Share.Requests;
using Hotline.Share.Tools;
using System.ComponentModel.DataAnnotations;
using XF.Utility.EnumExtensions;

namespace Hotline.Share.Dtos.Snapshot;

public class OrderInDto : QueryFixedDto
{
    /// <summary>
    /// 关键字
    /// </summary>
    public string? KeyWords { get; set; }

    /// <summary>
    /// 工单状态;
    /// 0: 全部;
    /// 1: 未回复;
    /// 2: 已回复;
    /// 3: 已评价;
    /// </summary>
    public EOrderQueryStatus Status { get; set; }
}

public class OrderDetailOutDto : OrderOutDto
{
}

public class OrderOutDto
{
    public string Id { get; set; }

    /// <summary>
    /// 工单编号
    /// </summary>
    public string OrderNo { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 工单状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 行业名字
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 工单状态描述
    /// </summary>
    public string StatusText
    {
        get
        {
            if (Status == EOrderStatus.Published || Status == EOrderStatus.Filed)
            {
                return "办理完成";
            }
            return Status.GetDescription();
        }
    }

    /// <summary>
    /// 时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 时间文本
    /// </summary>
    public string CreationTimeText => this.CreationTime.ToString("yyyy-MM-dd hh:mm:ss");

    /// <summary>
    /// 区域
    /// </summary>
    public string Area { get; set; }
}
public class OrderDto
{
}

public class AddSnapshotOrderOutDto
{
    public string Id { get; set; }
    public string No { get; set; }
    public string Password { get; set; }
}

public class AddSnapshotOrderInDto : Position
{
    /// <summary>
    /// 行业Id
    /// </summary>
    [Required(ErrorMessage = "行业Id不能为空")]
    public string IndustryId { get; set; }

    /// <summary>
    /// 作业类型;
    /// 0: 电焊;
    /// 1: 气割;
    /// 2: 其他;
    /// </summary>
    public int? JobType { get; set; }

    /// <summary>
    /// 经营单位类别
    /// </summary>
    public string? BusinessUnitType { get; set; }

    /// <summary>
    /// 作业场所
    /// </summary>
    public string? Workplace { get; set; }

    /// <summary>
    /// 场所名称(多个场所使用 - 连接)
    /// </summary>
    public string? WorkplaceName { get; set; }

    /// <summary>
    /// 作业区域
    /// </summary>
    public string WorkArea { get; set; }

    /// <summary>
    /// 作业区域Id
    /// </summary>
    public string WorkAreaId { get; set; }

    /// <summary>
    /// 作业时间
    /// </summary>
    public string? StartWorkTime { get; set; }

    /// <summary>
    /// 作业结束时间
    /// </summary>
    public string? EndWorkTime { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    [Required(ErrorMessage = "姓名不能为空")]
    public string Name { get; set; }

    /// <summary>
    /// 联系方式
    /// </summary>
    [Required(ErrorMessage = "联系方式不能为空")]
    public string PhoneNumber { get; set; }

    /// <summary>
    /// 是否保密
    /// </summary>
    public bool? IsSecret { get; set; }

    /// <summary>
    /// 附件信息
    /// </summary>
    public IList<SnapshotFileInDto> Files { get; set; }

    /// <summary>
    /// 事件描述
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// 购买单位/个人名称
    /// </summary>
    public string CompanyName { get; set; }

    /// <summary>
    /// 扩展字段
    /// </summary>
    public string? Attach { get; set; }

    public string GetContent(EIndustryType industryType, IReadOnlyList<SystemDicDataOutDto> dic)
    {
        var name = (dic.FirstOrDefault(m => m.DicDataValue == JobType.ToString()) ?? new SystemDicDataOutDto()).DicDataName;
        if (industryType == EIndustryType.Declare)
        {
            return $"经营单位类别: {this.BusinessUnitType}\r\n" + // 个人
                    $"作业场所:{this.Workplace}\r\n" + // 化工、民爆物品生产经营企业
                    $"场所名称:{this.WorkplaceName}\r\n" + // 多业态混合经营场所 - 存储多种功能的劳动密集型企业
                    $"作业区域: {this.WorkArea}\r\n" + // 自流井区舒坪街道
                    $"作业类型: {name}\r\n" + // 电焊
                    $"{(this.CompanyName.NotNullOrEmpty() ? "购气单位/个人名称: " + this.CompanyName + "\r\n" : string.Empty)}" +
                    $"作业时间:{this.StartWorkTime}~{this.EndWorkTime}\r\n" +
                    $"作业地点: {Address}{FullAddress}"; // 舒平(自流井区)（油库）"
        }
        return $"{Description}";
    }

    public string GetTitle(EIndustryType industryType, string titleSuffix)
    {
        return $"【随手拍】关于{Address}" + titleSuffix;
    }
}


/// <summary>
/// 红包审核入参
/// </summary>
/// <param name="No"></param>
/// <param name="Title"></param>
/// <param name="FromPhone">来电人电话</param>
/// <param name="BeginCreationTime">受理开始时间</param>
/// <param name="EndCreationTime">受理结束时间</param>
/// <param name="IsDeal">是否办理</param>
/// <param name="IsTruth">网格员是否属实</param>
/// <param name="IsTruthDepartment">部门是否属实</param>
/// <param name="BeginAuditTime">审批开始时间</param>
/// <param name="EndAuditTime">审批结束时间</param>
/// <param name="BeginFiledTime">办结开始时间</param>
/// <param name="EndFiledTime">办结结束时间</param>
/// <param name="IsIssued">是否发放红包</param>
/// <param name="IndustryId">行业Id</param>
/// <param name="ConfigAmount">配置金额</param>
/// <param name="AcutalAmount">实际发放金额</param>
/// <param name="ApprovedAmount">审批金额</param>
/// <param name="IsDanger">是否安全生成</param>
/// <param name="Status">审核状态: -1: 全部; 0: 待审批; 1: 同意; 2: 拒绝;</param>
public record SnapshotOrderAuditItemsInDto : PagedRequest
{
    public SnapshotOrderAuditItemsInDto() { }

    public SnapshotOrderAuditItemsInDto(string? no, string? title,
        string? fromPhone,
        DateTime? beginCreationTime,
        DateTime? endCreationTime,
        bool? isDeal,
        bool? isTruth,
        bool? isTruthDepartment,
        DateTime? beginAuditTime,
        DateTime? endAuditTime,
        DateTime? beginFiledTime,
        DateTime? endFiledTime,
        bool? isIssued,
        string? industryId,
        double? configAmount,
        double? acutalAmount,
        double? approvedAmount,
        bool? isDanger,
        int? status)
    {
        No = no;
        Title = title;
        FromPhone = fromPhone;
        BeginCreationTime = beginCreationTime;
        EndCreationTime = endCreationTime;
        IsDeal = isDeal;
        IsTruth = isTruth;
        IsTruthDepartment = isTruthDepartment;
        BeginAuditTime = beginAuditTime;
        EndAuditTime = endAuditTime;
        BeginFiledTime = beginFiledTime;
        EndFiledTime = endFiledTime;
        IsIssued = isIssued;
        IndustryId = industryId;
        ConfigAmount = configAmount;
        AcutalAmount = acutalAmount;
        ApprovedAmount = approvedAmount;
        IsDanger = isDanger;
        Status = status;
    }

    public string? No { get; set; }
    public string? Title { get; set; }
    public string? FromPhone { get; set; }
    public DateTime? BeginCreationTime { get; set; }
    public DateTime? EndCreationTime { get; set; }
    public bool? IsDeal { get; set; }
    public bool? IsTruth { get; set; }
    public bool? IsTruthDepartment { get; set; }
    public DateTime? BeginAuditTime { get; set; }
    public DateTime? EndAuditTime { get; set; }
    public DateTime? BeginFiledTime { get; set; }
    public DateTime? EndFiledTime { get; set; }
    public bool? IsIssued { get; set; }
    public string? IndustryId { get; set; }
    public double? ConfigAmount { get; set; }
    public double? AcutalAmount { get; set; }
    public double? ApprovedAmount { get; set; }
    public bool? IsDanger { get; set; }
    public int? Status { get; set; }
}


public class SnapshotOrderAuditItemsOutDto
{
    /// <summary>
    /// 红包审核Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 红包审核Id
    /// </summary>
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// OrderId
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// No
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 行业Id
    /// </summary>
    public string IndustryId { get; set; }

    /// <summary>
    /// 来源渠道（电话、网站、APP等）
    /// </summary>
    public string? SourceChannel { get; set; }

    /// <summary>
    /// 来源渠道代码
    /// </summary>
    public string? SourceChannelCode { get; set; }

    /// <summary>
    /// 工单状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 线索分类
    /// </summary>
    public string IndustryCase { get; set; }

    /// <summary>
    /// 线索分类
    /// </summary>
    public string IndustryCaseId { get; set; }

    /// <summary>
    /// 标记为安全生产
    /// </summary>
    public bool? IsDanger { get; set; }

    /// <summary>
    /// 来电号码
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 来电/信人姓名
    /// </summary>
    public string? FromName { get; set; }

    /// <summary>
    /// 审批时间
    /// </summary>
    public DateTime? AuditTime { get; set; }

    /// <summary>
    /// 审批金额
    /// </summary>
    public double? ApprovedAmount { get; set; }

    /// <summary>
    /// 实发金额
    /// </summary>
    public double? AcutalAmount { get; set; }

    /// <summary>
    /// 补充发放金额
    /// </summary>
    public double? ReplenishAmount { get; set; }

    /// <summary>
    /// 市民奖励发放结果
    /// 是否已发放
    /// </summary>
    public bool? IsIssued { get; set; }

    /// <summary>
    /// 市民奖励
    /// </summary>
    public string CitizenAward { get; set; }

    /// <summary>
    /// 市民奖励发放备注
    /// </summary>
    public string RecordRemark { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 部门是否整改完成;
    /// 是否整改
    /// </summary>
    public bool IsRectify { get; set; }

    /// <summary>
    /// 网格员是否办理
    /// </summary>
    public bool? IsDeal { get; set; }

    /// <summary>
    /// 网格E通编号
    /// </summary>
    public string? NetworkENumber { get; set; }

    /// <summary>
    /// 网格员是否属实
    /// </summary>
    public bool? IsTruth { get; set; }

    /// <summary>
    /// 部门是否属实
    /// </summary>
    public bool? IsTruthDepartment { get; set; }

    /// <summary>
    /// 是否重复
    /// </summary>
    public bool? IsRepetition { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 一级部门code
    /// </summary>
    public string? OrgLevelOneCode { get; set; }

    /// <summary>
    /// 一级部门名称
    /// </summary>
    public string? OrgLevelOneName { get; set; }

    /// <summary>
    /// 审批人
    /// </summary>
    public string? AuditId { get; set; }

    /// <summary>
    /// 审批人
    /// </summary>
    public string? AuditName { get; set; }

    /// <summary>
    /// 审批部门
    /// </summary>
    public string? AuditOrgId { get; set; }

    /// <summary>
    /// 审批部门名称
    /// </summary>
    public string? AuditOrgName { get; set; }

    /// <summary>
    /// 审批意见
    /// </summary>
    public string? AuditRemark { get; set; }

    /// <summary>
    /// 银行卡号
    /// </summary>
    public string? BankCardNo { get; set; }

    /// <summary>
    /// 开户行
    /// </summary>
    public string? OpenBank { get; set; }

    /// <summary>
    /// 红包审核状态
    /// </summary>
    public ERedPackAuditStatus AuditStatus { get; set; }

    /// <summary>
    /// 红包审核状态
    /// </summary>
    public string AuditStatusTxt => AuditStatus.GetDescription();

    /// <summary>
    /// 奖励人姓名
    /// </summary>
    public string? AwardName { get; set; }

    /// <summary>
    /// 标记是否安全生产
    /// </summary>
    public bool? IsSafetyDepartment { get; set; }

    public string? IsSafetyDepartmentTxt => IsSafetyDepartment.HasValue ? (IsSafetyDepartment.Value ? "是" : "否") : string.Empty;

    /// <summary>
    /// 特殊红包审核,审批类型
    /// </summary>
    public string? AuditType { get; set; }
}

/// <summary>
/// 红包审核入参
/// </summary>
/// <param name="No"></param>
/// <param name="Title"></param>
/// <param name="Status">审核状态: -1: 全部; 0: 审批中; 1: 审批同意; 2: 审批拒绝;</param>
public record SnapshotOrderGuiderAuditItemsInDto(
    string? No,
    string? Title,
    int? Status) : PagedRequest;

public class SnapshotOrderGuiderAuditItemsOutDto
{
    /// <summary>
    /// 红包审核Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 红包审核Id
    /// </summary>
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// OrderId
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// No
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 来源渠道（电话、网站、APP等）
    /// </summary>
    public string? SourceChannel { get; set; }

    /// <summary>
    /// 来源渠道代码
    /// </summary>
    public string? SourceChannelCode { get; set; }

    /// <summary>
    /// 工单状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 来电号码
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 来电/信人姓名
    /// </summary>
    public string? FromName { get; set; }

    /// <summary>
    /// 网格员奖励金额
    /// </summary>
    public double? ApprovedAmount { get; set; }

    /// <summary>
    /// 网格员奖励发放结果
    /// </summary>
    public bool? IsIssued { get; set; }

    /// <summary>
    /// 网格员奖励发放结果
    /// </summary>
    public string? IsIssuedTxt => IsIssued.HasValue == false ? "" : IsIssued.Value ? "已发放" : "未发放";

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 部门是否整改完成;
    /// 是否整改
    /// </summary>
    public bool? IsRectify { get; set; }

    /// <summary>
    /// 部门是否整改完成
    /// </summary>
    public string? IsRectifyTxt => IsRectify.HasValue == false ? "" : IsRectify.Value ? "是" : "否";

    /// <summary>
    /// 部门是否属实
    /// </summary>
    public bool? IsTruthDepartment { get; set; }

    /// <summary>
    /// 部门是否属实
    /// </summary>
    public string? IsTruthDepartmentTxt => IsTruthDepartment.HasValue == false ? "" : IsTruthDepartment.Value ? "是" : "否";

    /// <summary>
    /// 网格员是否属实
    /// </summary>
    public bool? IsTruth { get; set; }

    /// <summary>
    /// 网格员是否属实
    /// </summary>
    public string? IsTruthTxt => IsTruth.HasValue == false ? "" : IsTruth.Value ? "是" : "否";

    /// <summary>
    /// 是否重复
    /// </summary>
    public bool? IsRepetition { get; set; }

    /// <summary>
    /// 是否重复
    /// </summary>
    public string? IsRepetitionTxt => IsRepetition.HasValue == false ? "" : IsRepetition.Value ? "是" : "否";

    /// <summary>
    /// 网格员是否办理
    /// </summary>
    public bool? IsDeal { get; set; }

    /// <summary>
    /// 网格员是否办理
    /// </summary>
    public string? IsDealTxt => IsDeal.HasValue == false ? "" : IsDeal.Value ? "是" : "否";

    /// <summary>
    /// 网格E通编号
    /// </summary>
    public string? NetworkENumber { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 区县审批状态
    /// </summary>
    public string LevelOneStatusTxt => LevelOneStatus.GetDescription();

    /// <summary>
    /// 区县审批状态
    /// </summary>
    public ERedPackAuditStatus LevelOneStatus { get; set; }

    /// <summary>
    /// 区县审批人
    /// </summary>
    public string? LevelOneAuditName { get; set; }

    /// <summary>
    /// 区县审批部门
    /// </summary>
    public string? LevelOneAuditOrgName { get; set; }

    /// <summary>
    /// 区县审批时间
    /// </summary>
    public DateTime? LevelOneAuditTime { get; set; }

    /// <summary>
    /// 网格员办理状态
    /// </summary>
    public string NetworkRemark { get; set; }

    /// <summary>
    /// 区县审批意见
    /// </summary>
    public string? LevelOneAuditRemark { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    public string LevelTwoStatusTxt => LevelTwoStatus?.GetDescription() ?? "";

    /// <summary>
    /// 审核状态
    /// </summary>
    public ERedPackAuditStatus? LevelTwoStatus { get; set; }

    /// <summary>
    /// 审批时间
    /// </summary>
    public DateTime? LevelTwoAuditTime { get; set; }

    /// <summary>
    /// 审批意见
    /// </summary>
    public string? LevelTwoAuditRemark { get; set; }
}

public class GetRedPackAuditSMSTemplateOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 内容
    /// </summary>
    public string Content { get; set; }
}

public class GetRedPackAuditSMSTemplateInDto
{
    public GetRedPackAuditSMSTemplateInDto()
    {

    }

    public GetRedPackAuditSMSTemplateInDto(string id, ESnapshotSMSStatus status)
    {
        OrderId = id;
        Status = status;
    }

    /// <summary>
    /// OrderId
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public ESnapshotSMSStatus Status { get; set; }
}

public class SnapshotOrderAuditSpecialDetailOutDto
{
    /// <summary>
    /// 工单信息
    /// </summary>
    public SnapshotOrderAuditOrderDetailOutDto Order { get; set; }

    /// <summary>
    /// 审核信息
    /// </summary>
    public SnapshotOrderAuditSpecialAuditDetailOutDto AuditDetail { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    public IEnumerable<KeyValuePair<int, string>> AuditComBox { get; set; }

    /// <summary>
    /// 审核类型
    /// </summary>
    public IEnumerable<SystemDicDataAmountOutDto> AuditType { get; set; }
}

public class SystemDicDataAmountOutDto : SystemDicDataOutDto
{
    /// <summary>
    /// 价格
    /// </summary>
    public int Amount => int.TryParse(_dicDataName.Split('|').ElementAtOrDefault(1), out var result) ? result : 100;

    private string _dicDataName;
    new public string DicDataName
    {
        get
        {
            return _dicDataName.Split('|')[0];
        }
        set { _dicDataName = value; }
    }
}

public class SnapshotOrderAuditSpecialAuditDetailOutDto
{
    /// <summary>
    /// 审批人
    /// </summary>
    public string? AuditId { get; set; }

    /// <summary>
    /// 审批人
    /// </summary>
    public string? AuditName { get; set; }

    /// <summary>
    /// 审批部门
    /// </summary>
    public string? AuditOrgId { get; set; }

    /// <summary>
    /// 审批部门名称
    /// </summary>
    public string? AuditOrgName { get; set; }

    /// <summary>
    /// 审批意见
    /// </summary>
    public string? AuditRemark { get; set; }

}

public class SnapshotOrderAuditDetailOutDto
{
    /// <summary>
    /// 工单信息
    /// </summary>
    public SnapshotOrderAuditOrderDetailOutDto Order { get; set; }

    /// <summary>
    /// 市民红包金额
    /// </summary>
    public double Amount { get; set; }

    /// <summary>
    /// 红包发放
    /// </summary>
    public string RedPackTxt { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    public IEnumerable<KeyValuePair<int, string>> AuditComBox { get; set; }

    /// <summary>
    /// 是否开启积分
    /// </summary>
    public bool? IsPoints { get; set; }

    /// <summary>
    /// 额外扣除积分类型
    /// </summary>
    public IReadOnlyCollection<SystemDicDataOutDto> ExtraDeductionPointsType { get; set; }

    /// <summary>
    /// 审核同意积分
    /// </summary>
    public int? ArgeePoints { get; set; }

    /// <summary>
    /// 审核不同意扣除积分
    /// </summary>
    public int? RefusePoints { get; set; }

    /// <summary>
    /// 额外扣除积分
    /// </summary>
    public int? ExtraDeductedPoints { get; set; }

}

public class SnapshotOrderAuditOrderDetailOutDto
{
    /// <summary>
    /// 受理人id
    /// </summary>
    public string? AcceptorId { get; set; }

    /// <summary>
    /// 受理人名称
    /// </summary>
    public string? AcceptorName { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// No
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 所属区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 来源方式
    /// </summary>
    public string SourceChannel { get; set; }

    /// <summary>
    /// 来源渠道代码
    /// </summary>
    public string? SourceChannelCode { get; set; }

    /// <summary>
    /// 受理类型
    /// </summary>
    public string? AcceptType { get; set; }

    /// <summary>
    /// 受理类型代码
    /// </summary>
    public string? AcceptTypeCode { get; set; }

    /// <summary>
    /// 热点分类类目名称
    /// </summary>
    public string? HotspotSpliceName { get; set; }

    /// <summary>
    /// 来电人
    /// </summary>
    public string FromPhone { get; set; }

    /// <summary>
    /// 来电/信人姓名
    /// </summary>
    public string? FromName { get; set; }


    private bool _isSecret;
    /// <summary>
    /// 是否保密
    /// </summary>
    public bool IsSecret
    {
        get
        {
            if (_isSecret == true)
            {
                FullAddress = "*";
                WorkUnit = "*";
                LicenceNo = "*";
                FromName = "*";
                FromPhone = "*";
            }
            return _isSecret;
        }
        set { _isSecret = value; }
    }

    /// <summary>
    /// 性别
    /// </summary>
    public string FromGenderTxt
    {
        get
        {
            if (_isSecret == true)
                return "*";
            return FromGender.GetDescription();
        }
    }
    /// <summary>
    /// 来电/信人性别
    /// </summary>
    public EGender FromGender { get; set; }

    /// <summary>
    /// 地址
    /// </summary>
    public string FullAddress { get; set; }

    /// <summary>
    /// 工作单位
    /// </summary>
    public string WorkUnit { get; set; }

    /// <summary>
    /// 证件号码
    /// </summary>
    public string LicenceNo { get; set; }
}

public class UpdateRedPackGuiderAuditInDto
{
    /// <summary>
    /// 审核Id
    /// </summary>
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    public ESnapshotSMSStatus Status { get; set; }

    /// <summary>
    /// 审核意见
    /// </summary>
    public string Opinion { get; set; }
}

public class UpdateRedPackSpecialAuditInDto
{
    /// <summary>
    /// 审核Id
    /// </summary>
    [Required]
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    public ERedPackAuditStatus Status { get; set; }

    /// <summary>
    /// 审批类型
    /// </summary>
    public string? AuditTypeId { get; set; }

    /// <summary>
    /// 审核意见
    /// </summary>
    public string Opinion { get; set; }

    /// <summary>
    /// 审批金额
    /// </summary>
    public double? ApprovedAmount { get; set; }

}

public class UpdateRedPackAuditInDto
{
    /// <summary>
    /// 审核Id
    /// </summary>
    public string RedPackAuditId { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    public ESnapshotSMSStatus Status { get; set; }

    /// <summary>
    /// 审核意见
    /// </summary>
    public string Opinion { get; set; }

    /// <summary>
    /// 短信模板Id
    /// </summary>
    [Required]
    public string SMSTemplateId { get; set; }

    /// <summary>
    /// 是否发送短信
    /// </summary>
    public bool IsSendSms { get; set; }

    /// <summary>
    /// 积分审核状态
    /// </summary>
    public ESnapshotSMSStatus? PointsStatus { get; set; }

    /// <summary>
    /// 积分
    /// </summary>
    public int? Points { get; set; }

    /// <summary>
    /// 额外扣除积分类型
    /// </summary>
    public string? ExtraDeductionPointsTypeId { get; set; }

    public string? ExtraDeductionPointsTypeName { get; set; }

    /// <summary>
    /// 额外扣除积分
    /// </summary>
    public int? ExtraDeductedPoints { get; set; }

    /// <summary>
    /// 积分审核意见
    /// </summary>
    public string? PointsOpinion { get; set; }
}

public class GetRedPackRecordBaseDataOutDto
{
    /// <summary>
    /// 金额
    /// </summary>
    public double? Amount { get; set; }

    /// <summary>
    /// 名字
    /// </summary>
    public string? Name { get; set; }

    /// <summary>
    /// 开户银行
    /// </summary>
    public string? OpenBank { get; set; }

    /// <summary>
    /// 银行卡号
    /// </summary>
    public string? BankCardNo { get; set; }

    /// <summary>
    /// 补充奖励类型
    /// </summary>
    public string? AuditType { get; set; }

    /// <summary>
    /// 补充奖励类型
    /// </summary>
    public string? AuditTypeCode { get; set; }
    public string OrderId { get; set; }

    public IReadOnlyCollection<SystemDicDataOutDto> ReplenishType { get; set; }

    public string? RedPackAuditId { get; set; }
}
public class GetAuditBackBaseDataOutDto
{
    /// <summary>
    /// 流程Id
    /// </summary>
    public string WorkflowId { get; set; }

    /// <summary>
    /// 特提次数
    /// </summary>
    public int SpecialNum { get; set; }

    /// <summary>
    /// 实际办理节点code（会签状态此字段保存最外层会签发起节点code）
    /// </summary>
    public string ActualHandleStepCode { get; set; }

    /// <summary>
    /// 实际办理节点名称（会签状态此字段保存最外层会签发起节点名称）
    /// </summary>
    public string ActualHandleStepName { get; set; }

    /// <summary>
    /// 受理类型代码
    /// </summary>
    public string AcceptTypeCode { get; set; }
}

public record GuiderReplyItemsInDto : PagedRequest
{
    /// <summary>
    /// No
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 网格员姓名
    /// </summary>
    public string? GuiderName { get; set; }

    /// <summary>
    /// 网格员电话
    /// </summary>
    public string? GuiderPhoneNumber { get; set; }

    /// <summary>
    /// E网通编号
    /// </summary>
    public string? NewtorkENumber { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public EGuiderSystemReplyType? Satus { get; set; }

    /// <summary>
    /// 受理时间开始
    /// </summary>
    public DateTime? BeginCreationTime { get; set; }

    /// <summary>
    /// 受理时间结束
    /// </summary>
    public DateTime? EndCreationTime { get; set; }
}

public class GuiderReplyItemsOutDto
{
    /// <summary>
    /// OrderId
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    public string ReplyResultTypeTxt => ReplyResultType.
        GetDescription();

    /// <summary>
    /// 办理状态 1，7：流转 2：办结 3：退回 4：网格员签收 5：消息推送 6: 超时自动退单
    /// </summary>
    public EGuiderSystemReplyType? ReplyResultType { get; set; }

    /// <summary>
    /// 网格员回复内容
    /// </summary>
    public string? NetworkRemark { get; set; }

    /// <summary>
    /// 网格员回复时间
    /// </summary>
    public DateTime? ReplyDate { get; set; }

    /// <summary>
    /// 网格员姓名
    /// </summary>
    public string? MemberName { get; set; }

    /// <summary>
    /// 网格员电话
    /// </summary>
    public string? MemberMobile { get; set; }

    /// <summary>
    /// 编号
    /// </summary>
    public string? NetworkENumber { get; set; }
}

public record LabeledOrderSnapshotItemsInDto : PagedRequest
{
    /// <summary>
    /// 受理编号
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 来电人
    /// </summary>
    public string? FromName { get; set; }

    /// <summary>
    /// 来电人电话
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 标注类型
    /// </summary>
    public string? Label { get; set; }

    /// <summary>
    /// 标注开始时间
    /// </summary>
    public DateTime? BeginSignTime { get; set; }

    /// <summary>
    /// 标注结束时间
    /// </summary>
    public DateTime? EndSignTime { get; set; }
}


public class LabeledOrderSnapshotItemsOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 来源
    /// </summary>
    public string SourceChannel { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 来电人姓名
    /// </summary>
    public string FromName { get; set; }

    /// <summary>
    /// 来电人电话
    /// </summary>
    public string FromPhone { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 标注人
    /// </summary>
    public string? LabelUserName { get; set; }

    /// <summary>
    /// 标注类型
    /// </summary>
    public string LabelName { get; set; }

    /// <summary>
    /// 标记时间
    /// </summary>
    public DateTime? LabelTime { get; set; }
}

public record SignOrderSnapshotItemsInDto : PagedRequest
{
    /// <summary>
    /// No
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 状态;
    /// 0: 全部;
    /// 1: 待标签;
    /// 2: 已标签;
    /// </summary>
    public int Status { get; set; }
}

public class SignOrderSnapshotItemsOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 受理内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 地址
    /// </summary>
    public string FullAddress { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 标注状态;
    /// 部门标记是否安全生产
    /// </summary>
    public bool? IsSafetyDepartment { get; set; }

    /// <summary>
    /// 标注状态
    /// </summary>
    public string IsSafetyDepartmentTxt => IsSafetyDepartment == true ? "是" : "否";

    /// <summary>
    /// 回复内容;
    /// 网格员回复内容
    /// </summary>
    public string? NetworkRemark { get; set; }

    /// <summary>
    /// 回复时间
    /// </summary>
    public DateTime? ReplyDate { get; set; }

    /// <summary>
    /// 编号
    /// </summary>
    public string? NetworkENumber { get; set; }

    /// <summary>
    /// 标注人
    /// </summary>
    public string? LabelUserName { get; set; }

    /// <summary>
    /// 标记时间
    /// </summary>
    public DateTime? LabelTime { get; set; }
}

public class GetOrderSnapshotPublishItemsOutDto
{
    /// <summary>
    /// OrderId
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 公开状态
    /// </summary>
    public EOrderSnapshotPublishStatus? PublishStatus { get; set; }

    /// <summary>
    /// 公开状态
    /// </summary>
    public string? PublishStatusTxt =>  PublishStatus.HasValue && PublishStatus.Value == EOrderSnapshotPublishStatus.Agree ? "公开" : PublishStatus?.GetDescription() ?? "";

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 电话
    /// </summary>
    public string FromPhone { get; set; }

    /// <summary>
    /// 受理内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 网格员是否属实
    /// </summary>
    public bool IsTruth { get; set; }

    /// <summary>
    /// 网格员是否属实
    /// </summary>
    public string IsTruthTxt => IsTruth ? "是" : "否";
}

public record GetOrderSnapshotPublishItemsInDto : PagedRequest
{
    /// <summary>
    /// 行业
    /// </summary>
    public string? IndustryId { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 是否公开
    /// </summary>
    public bool? IsPublished { get; set; }

    /// <summary>
    /// 受理类型
    /// </summary>
    public string? AcceptTypeCode { get; set; }

    /// <summary>
    /// 来电号码
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    public string? Contact { get; set; }

    /// <summary>
    /// 受理时间开始
    /// </summary>
    public DateTime? BeginCreationTime { get; set; }

    /// <summary>
    /// 受理时间结束
    /// </summary>
    public DateTime? EndCreationTime { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus? OrderStatus { get; set; }

    /// <summary>
    /// 区域信息
    /// </summary>
    public string? AreaCode { get; set; }
}

public class GetOrderSnapshotPublishAuditItemsOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 审批状态
    /// </summary>
    public EOrderSnapshotPublishStatus Status { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// No
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 原标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 申请人
    /// </summary>
    public string CreatorName { get; set; }

    /// <summary>
    /// 申请时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 公开标题
    /// </summary>
    public string ArrangeTitle { get; set; }

    /// <summary>
    /// 公开地址
    /// </summary>
    public string Address { get; set; }

    /// <summary>
    /// 公开内容
    /// </summary>
    public string ArrangeContent { get; set; }

    /// <summary>
    /// 公开办理信息
    /// </summary>
    public string ArrangeOpinion { get; set; }
}

public record GetOrderSnapshotPublishAuditItemsInDto : PagedRequest
{
    /// <summary>
    /// 状态;
    /// -1: 全部;
    /// 0: 待审批;
    /// 1: 同意;
    /// 2: 拒绝;
    /// </summary>
    public int Status { get; set; }
}

public class GetOrderSnapshotPublishDetailOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 信件标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 事发地点
    /// </summary>
    public string FullAddress { get; set; }

    /// <summary>
    /// 信件内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 办理结果
    /// </summary>
    public string FileOpinion { get; set; }
}

public class UpdateOrderSnapshotPublishStatusInDto
{
    /// <summary>
    /// Id
    /// </summary>
    [Required]
    public string Id { get; set; }

    /// <summary>
    /// 审批状态;
    /// 0: 待审批;
    /// 1: 同意;
    /// 2: 拒绝;
    /// </summary>
    [Required]
    public EOrderSnapshotPublishStatus Status { get; set; }
}

public class GetOrderSnapshotPublishAuditDetailOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 信件标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 标题整改
    /// </summary>
    public string ArrangeTitle { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime HandleTime { get; set; }

    /// <summary>
    /// 事发地点
    /// </summary>
    public string FullAddress { get; set; }

    /// <summary>
    /// 地点整改
    /// </summary>
    public string ArrangeAddress { get; set; }

    /// <summary>
    /// 信件内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 整理内容
    /// </summary>
    public string ArrangeContent { get; set; }

    /// <summary>
    /// 办理结果
    /// </summary>
    public string FileOpinion { get; set; }

    /// <summary>
    /// 整理结果
    /// </summary>
    public string ArrangeOpinion { get; set; }

    /// <summary>
    /// 审批状态
    /// </summary>
    public EOrderSnapshotPublishStatus Status { get; set; }
}

public class OrderSignBathInDto
{
    /// <summary>
    /// OrderIds
    /// </summary>
    public IList<string> OrderIds { get; set; }

    /// <summary>
    /// 是否安全生产
    /// </summary>
    public bool IsSafetyDepartment { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }

    /// <summary>
    /// 状态;
    /// 0: 全部;
    /// 1: 待标签;
    /// 2: 已标签;
    /// </summary>
    public int Status { get; set; }
}

public record LabelOrderSnapshotLogItemsInDto : PagedRequest
{
    /// <summary>
    /// 受理编号
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    public string? Contact { get; set; }

    /// <summary>
    /// 来电人
    /// </summary>
    public string? FromName { get; set; }

    /// <summary>
    /// 标注人
    /// </summary>
    public string? LabelUserName { get; set; }

    /// <summary>
    /// 标注类型
    /// </summary>
    public string? Label { get; set; }

    /// <summary>
    /// 标注开始时间
    /// </summary>
    public DateTime? BeginSignTime { get; set; }

    /// <summary>
    /// 标注结束时间
    /// </summary>
    public DateTime? EndSignTime { get; set; }
}

public class LabelOrderSnapshotLogItemsOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string OrderId { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 来源
    /// </summary>
    public string SourceChannel { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 来电人姓名
    /// </summary>
    public string FromName { get; set; }

    /// <summary>
    /// 来电人电话
    /// </summary>
    public string FromPhone { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 标注人
    /// </summary>
    public string LabelUserName { get; set; }

    /// <summary>
    /// 标注类型
    /// </summary>
    public string LabelName { get; set; }

    /// <summary>
    /// 标注时间
    /// </summary>
    public DateTime LabelTime { get; set; }

}

public record OrderSnapshotItemsInDto : PagedRequest
{
    ///// <summary>
    ///// 资金状态
    ///// 0: 全部;
    ///// 1: 已标记资金申请;
    ///// </summary>
    //public int AmountStatus { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 接办部门
    /// </summary>
    public string? ActualHandleOrgName { get; set; }

    /// <summary>
    /// 受理类型
    /// </summary>
    public string? AcceptType { get; set; }

    /// <summary>
    /// 受理人
    /// </summary>
    public string? AcceptorName { get; set; }

    /// <summary>
    /// 接办人名称
    /// </summary>
    //public string? ActualHandlerName { get; set; }

    /// <summary>
    /// 申报人电话
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 联系号码
    /// </summary>
    //public string? Contact { get; set; }

    /// <summary>
    /// 申报人姓名
    /// </summary>
    public string? FromName { get; set; }

    /// <summary>
    /// 期满时间开始
    /// </summary>
    public DateTime? BeginExpiredTime { get; set; }

    /// <summary>
    /// 期满时间结束
    /// </summary>
    public DateTime? EndExpiredTime { get; set; }

    /// <summary>
    /// 受理时间开始
    /// </summary>
    public DateTime? BeginCreationTime { get; set; }

    /// <summary>
    /// 受理时间结束
    /// </summary>
    public DateTime? EndCreationTime { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus? Status { get; set; }

    /// <summary>
    /// 信件区域
    /// </summary>
    public string? County { get; set; }

    /// <summary>
    /// 是否甄别
    /// </summary>
    public bool? IsScreen { get; set; }

    /// <summary>
    /// 当前节点
    /// </summary>
    public string? CurrentStepName { get; set; }

    /// <summary>
    /// 办结时间开始
    /// </summary>
    public DateTime? BeginFiledTime { get; set; }

    /// <summary>
    /// 办结时间结束
    /// </summary>
    public DateTime? EndFiledTime { get; set; }

    /// <summary>
    /// 热点类型名称
    /// </summary>
    public string? HotspotName { get; set; }

    /// <summary>
    /// 工单标签
    /// </summary>
    public string? OrderTagCode { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public bool? IsUrgent { get; set; }

    /// <summary>
    /// 转接来源
    /// </summary>
    public string? TransferPhone { get; set; }

    /// <summary>
    /// 一级部门
    /// </summary>
    public string? OrgLevelOneCode { get; set; }

    /// <summary>
    /// 一级部门名称
    /// </summary>
    public string? OrgLevelOneName { get; set; }

    /// <summary>
    /// 不满意转办
    /// </summary>
    public bool? DiscontentTurnTo { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string? IndustryId { get; set; }
}

public class UpdateIsEmphasisInDto
{
    /// <summary>
    /// Id集合
    /// </summary>
    public IList<string> Ids { get; set; }
}

public class OrderSnapshotItemsOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 过期状态
    /// </summary>
    public EExpiredStatus? ExpiredStatus => FiledTime.CalculateExpiredState(Status, this.ExpiredTime, this.NearlyExpiredTime, this.NearlyExpiredTimeOne);

    /// <summary>
    /// 过期状态
    /// </summary>
    public string ExpiredStatusText => ExpiredStatus?.GetDescription();

    /// <summary>
    /// 即将超期时间
    /// </summary>
    public DateTime? NearlyExpiredTime { get; set; }

    /// <summary>
    /// 即将超期时间第一级
    /// </summary>
    public DateTime? NearlyExpiredTimeOne { get; set; }


    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 来源
    /// </summary>
    public string SourceChannel { get; set; }

    /// <summary>
    /// 当前节点
    /// </summary>
    public string CurrentStepName { get; set; }

    /// <summary>
    /// 重办次数
    /// </summary>
    public int ReTransactNum { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public bool IsUrgent { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public string IsUrgentTxt => IsUrgent ? "紧急" : "-";

    /// <summary>
    /// 超期时间
    /// </summary>
    public DateTime? ExpiredTime { get; set; }

    /// <summary>
    /// 是否超期
    /// </summary>
    public bool IsExpired
    {
        get
        {
            if (ExpiredTime.HasValue)
                return DateTime.Now > ExpiredTime.Value;
            return false;
        }
    }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 办理时长
    /// </summary>
    public double CreationTimeHandleDuration { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 电话
    /// </summary>
    public string Contact { get; set; }

    /// <summary>
    /// 网格员名称
    /// </summary>
    public string MemberName { get; set; }

    /// <summary>
    /// 网格员电话
    /// </summary>
    public string MemberMobile { get; set; }

    /// <summary>
    /// 网格员回复
    /// </summary>
    public string NetworkRemark { get; set; }

    /// <summary>
    /// 网格E通编号
    /// </summary>
    public string? NetworkENumber { get; set; }

    /// <summary>
    /// 一级部门
    /// </summary>
    public string OrgLevelOneCode { get; set; }

    /// <summary>
    /// 接办部门
    /// </summary>
    public string ActualHandleOrgName { get; set; }

    /// <summary>
    /// 接办时间
    /// </summary>
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 办结时间
    /// </summary>
    public DateTime? FiledTime { get; set; }

    /// <summary>
    /// 受理类型
    /// </summary>
    public string AcceptType { get; set; }

    /// <summary>
    /// 热点类型
    /// </summary>
    public string HotspotName { get; set; }

    /// <summary>
    /// 受理人
    /// </summary>
    public string AcceptorName { get; set; }

    /// <summary>
    /// 受理内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 办理结果
    /// </summary>
    public string FileOpinion { get; set; }
}

public class OrderSnapshotElectrogasItemsOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 过期状态
    /// </summary>
    public EExpiredStatus? ExpiredStatus => FiledTime.CalculateExpiredState(Status, this.ExpiredTime, this.NearlyExpiredTime, this.NearlyExpiredTimeOne);

    /// <summary>
    /// 过期状态
    /// </summary>
    public string ExpiredStatusText => ExpiredStatus?.GetDescription();

    /// <summary>
    /// 即将超期时间
    /// </summary>
    public DateTime? NearlyExpiredTime { get; set; }

    /// <summary>
    /// 即将超期时间第一级
    /// </summary>
    public DateTime? NearlyExpiredTimeOne { get; set; }

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 来源
    /// </summary>
    public string SourceChannel { get; set; }

    /// <summary>
    /// 当前节点
    /// </summary>
    public string CurrentStepName { get; set; }

    /// <summary>
    /// 重办次数
    /// </summary>
    public int ReTransactNum { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public bool IsUrgent { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public string IsUrgentTxt => IsUrgent ? "紧急" : "-";

    /// <summary>
    /// 期满时间
    /// </summary>
    public DateTime? ExpiredTime { get; set; }

    /// <summary>
    /// 是否超期
    /// </summary>
    public bool IsExpired
    {
        get
        {
            if (ExpiredTime.HasValue)
                return DateTime.Now > ExpiredTime.Value;
            return false;
        }
    }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 申报人姓名
    /// </summary>
    public string? FromName { get; set; }

    /// <summary>
    /// 申报人电话
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 作业类型
    /// </summary>
    public int? JobType { get; set; }

    /// <summary>
    /// 作业类型
    /// </summary>
    public string? JobTypeName { get; set; }

    /// <summary>
    /// 作业场所
    /// </summary>
    public string? Workplace { get; set; }

    /// <summary>
    /// 作业区域
    /// </summary>
    public string? WorkArea { get; set; }

    /// <summary>
    /// 作业时间
    /// </summary>
    public DateTime? StartWorkTime { get; set; }

    /// <summary>
    /// 作业结束时间
    /// </summary>
    public DateTime? EndWorkTime { get; set; }

    /// <summary>
    /// 作业地点
    /// </summary>
    public string? Address { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 办理时长
    /// </summary>
    public double CreationTimeHandleDuration { get; set; }

    /// <summary>
    /// 区域
    /// </summary>
    public string County { get; set; }

    /// <summary>
    /// 电话
    /// </summary>
    public string Contact { get; set; }

    /// <summary>
    /// 一级部门
    /// </summary>
    public string OrgLevelOneCode { get; set; }

    /// <summary>
    /// 一级部门名称
    /// </summary>
    public string? OrgLevelOneName { get; set; }

    /// <summary>
    /// 接办部门
    /// </summary>
    public string ActualHandleOrgName { get; set; }

    /// <summary>
    /// 接办时间
    /// </summary>
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 办结时间
    /// </summary>
    public DateTime? FiledTime { get; set; }

    /// <summary>
    /// 受理类型
    /// </summary>
    public string AcceptType { get; set; }

    /// <summary>
    /// 热点类型
    /// </summary>
    public string HotspotName { get; set; }

    /// <summary>
    /// 核实方式
    /// </summary>
    public string? VerifyType { get; set; }

    /// <summary>
    /// 是否按清单检查
    /// </summary>
    public bool? IsCheckList { get; set; }

    /// <summary>
    /// 是否按清单检查
    /// </summary>
    public string? IsCheckListTxt => IsCheckList.HasValue && IsCheckList.Value ? "是" : "否";

    /// <summary>
    /// 是否重复
    /// </summary>
    public bool? IsRepetition { get; set; }

    /// <summary>
    /// 是否重复
    /// </summary>
    public string? IsRepetitionTxt => IsRepetition.HasValue && IsRepetition.Value ? "是" : "否";

    /// <summary>
    /// 受理人
    /// </summary>
    public string AcceptorName { get; set; }

    /// <summary>
    /// 受理内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 办理结果
    /// </summary>
    public string FileOpinion { get; set; }
}

public class NameCodeDto
{
    /// <summary>
    /// Name
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// Code
    /// </summary>
    public string Code { get; set; }
}

public class UpdateLabelOrderSnapshotInDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 随手拍工单标签
    /// </summary>
    public IList<Kv>? SnapshotLabels { get; set; }
}

public class LabelOrderSnapshotDetailOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 已选中的标签
    /// </summary>
    public IList<Kv> Lables { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 基础数据
    /// </summary>
    public IReadOnlyCollection<SystemDicDataOutDto> LabelsBaseData { get; set; }
}
public record CitizenRewardInDto : PagedRequest
{
    /// <summary>
    /// 受理编号
    /// </summary>
    public string? No { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 接办部门
    /// </summary>
    public string? ActualHandleOrgName { get; set; }

    /// <summary>
    /// 受理类型
    /// </summary>
    public string? AcceptType { get; set; }

    /// <summary>
    /// 受理人
    /// </summary>
    public string? AcceptorName { get; set; }

    /// <summary>
    /// 接办人名称
    /// </summary>
    public string? ActualHandlerName { get; set; }

    /// <summary>
    /// 来电号码
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 联系号码
    /// </summary>
    public string? Contact { get; set; }

    /// <summary>
    /// 来电人
    /// </summary>
    public string? FromName { get; set; }

    /// <summary>
    /// 期满时间开始
    /// </summary>
    public DateTime? BeginExpiredTime { get; set; }

    /// <summary>
    /// 期满时间结束
    /// </summary>
    public DateTime? EndExpiredTime { get; set; }

    /// <summary>
    /// 受理时间开始
    /// </summary>
    public DateTime? BeginCreationTime { get; set; }

    /// <summary>
    /// 受理时间结束
    /// </summary>
    public DateTime? EndCreationTime { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus? Status { get; set; }

    /// <summary>
    /// 区域信息
    /// </summary>
    public string? County { get; set; }

    /// <summary>
    /// 是否甄别
    /// </summary>
    public bool? IsScreen { get; set; }

    /// <summary>
    /// 当前节点
    /// </summary>
    public string? CurrentStepName { get; set; }

    /// <summary>
    /// 办结时间开始
    /// </summary>
    public DateTime? BeginFiledTime { get; set; }

    /// <summary>
    /// 办结时间结束
    /// </summary>
    public DateTime? EndFiledTime { get; set; }

    /// <summary>
    /// 热点类型名称
    /// </summary>
    public string? HotspotName { get; set; }

    /// <summary>
    /// 工单标签
    /// </summary>
    public string? OrderTagCode { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public bool? IsUrgent { get; set; }

    /// <summary>
    /// 转接来源
    /// </summary>
    public string? TransferPhone { get; set; }

    /// <summary>
    /// 一级部门
    /// </summary>
    public string? OrgLevelOneCode { get; set; }

    /// <summary>
    /// 一级部门名称
    /// </summary>
    public string? OrgLevelOneName { get; set; }

    /// <summary>
    /// 不满意转办
    /// </summary>
    public bool? DiscontentTurnTo { get; set; }

    /// <summary>
    /// 行业
    /// </summary>
    public string? IndustryId { get; set; }
}

public class CitizenRewardOutDto
{
    /// <summary>
    /// Id
    /// </summary>
    public string Id { get; set; }

    /// <summary>
    /// 过期状态
    /// </summary>
    public EExpiredStatus? ExpiredStatus => FiledTime.CalculateExpiredState(Status, this.ExpiredTime, this.NearlyExpiredTime, this.NearlyExpiredTimeOne);

    /// <summary>
    /// 过期状态
    /// </summary>
    public string ExpiredStatusText => ExpiredStatus?.GetDescription();

    /// <summary>
    /// 受理编号
    /// </summary>
    public string No { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public EOrderStatus Status { get; set; }

    /// <summary>
    /// 信件状态
    /// </summary>
    public string StatusTxt => Status.GetDescription();

    /// <summary>
    /// 来源
    /// </summary>
    public string SourceChannel { get; set; }

    /// <summary>
    /// 当前节点
    /// </summary>
    public string CurrentStepName { get; set; }

    /// <summary>
    /// 重办次数
    /// </summary>
    public int ReTransactNum { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public bool IsUrgent { get; set; }

    /// <summary>
    /// 是否紧急
    /// </summary>
    public string IsUrgentText => IsUrgent ? "紧急" : "-";

    /// <summary>
    /// 期满时间
    /// </summary>
    public DateTime? ExpiredTime { get; set; }

    /// <summary>
    /// 即将超期时间
    /// </summary>
    public DateTime? NearlyExpiredTime { get; set; }

    /// <summary>
    /// 即将超期时间第一级
    /// </summary>
    public DateTime? NearlyExpiredTimeOne { get; set; }

    /// <summary>
    /// 是否超期
    /// </summary>
    public bool IsExpired
    {
        get
        {
            if (ExpiredTime.HasValue)
                return DateTime.Now > ExpiredTime.Value;
            return false;
        }
    }

    /// <summary>
    /// 受理时间
    /// </summary>
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 行业名称
    /// </summary>
    public string IndustryName { get; set; }

    /// <summary>
    /// 是否发放补充奖励
    /// </summary>
    public bool IsAward { get; set; }

    /// <summary>
    /// 是否发放补充奖励
    /// </summary>
    public string? IsAwardTxt => IsAward ? "是" : "否";

    /// <summary>
    /// 追加奖励金额(元)
    /// </summary>
    public double? AwardAmount { get; set; }

    /// <summary>
    /// 发放时间
    /// </summary>
    public DateTime? AwardTime { get; set; }

    /// <summary>
    /// 追加奖励人银行卡号
    /// </summary>
    public string? AwardBankCardNo { get; set; }

    /// <summary>
    /// 追加奖励人开户银行
    /// </summary>
    public string? AwardOpenBank { get; set; }

    /// <summary>
    /// 补充发放人员
    /// </summary>
    public string? AwardName { get; set; }

    /// <summary>
    /// 重点
    /// </summary>
    public string? Emphasis { get; set; }

    /// <summary>
    /// 全流程时长（秒）
    /// </summary>
    public double? AllDuration { get; set; }

    /// <summary>
    /// 办理时长(天)
    /// </summary>
    public string? TotalFieldDay => AllDuration.HasValue ? (AllDuration.Value / 60 / 60 / 24).ToString("f2") : null;

    /// <summary>
    /// 区域
    /// </summary>
    public string? County { get; set; }

    /// <summary>
    /// 电话
    /// </summary>
    public string? FromPhone { get; set; }

    /// <summary>
    /// 网格员姓名
    /// </summary>
    public string? MemberName { get; set; }

    /// <summary>
    /// 网格员电话
    /// </summary>
    public string? MemberMobile { get; set; }

    /// <summary>
    /// 网格员回复内容
    /// </summary>
    public string? NetworkRemark { get; set; }

    /// <summary>
    /// 网格E通编号
    /// </summary>
    public string? NetworkENumber { get; set; }

    /// <summary>
    /// 一级部门名称
    /// </summary>
    public string? OrgLevelOneName { get; set; }

    /// <summary>
    /// 接办部门
    /// </summary>
    public string ActualHandleOrgName { get; set; }

    /// <summary>
    /// 接办时间
    /// </summary>
    public DateTime? ActualHandleTime { get; set; }

    /// <summary>
    /// 办结时间
    /// </summary>
    public DateTime? FiledTime { get; set; }

    /// <summary>
    /// 受理类型
    /// </summary>
    public string AcceptType { get; set; }

    /// <summary>
    /// 热点类型
    /// </summary>
    public string HotspotName { get; set; }

    /// <summary>
    /// 受理人名称
    /// </summary>
    public string? AcceptorName { get; set; }

    /// <summary>
    /// 受理内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 办理结果
    /// </summary>
    public string? FileOpinion { get; set; }
}
