using Hotline.Share.Dtos.File;
using Hotline.Share.Enums.Order;
using Hotline.Share.Requests;

namespace Hotline.Share.Dtos.WebPortal
{
    /// <summary>
    /// 
    /// </summary>
    public class GetOrderCodePwd
    {
        /// <summary>
        /// 账号
        /// </summary>
        public string? ClientId { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string? ClientSecret { get; set; }

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

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

    /// <summary>
    /// 获取前几条数据
    /// </summary>
    public class QueryOrderListByNumDto
    {

        /// <summary>
        /// 账号
        /// </summary>
        public string? ClientId { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string? ClientSecret { get; set; }

        public int Num { get; set; }
    }

    /// <summary>
    /// 会员中心查询用户信件
    /// </summary>
    public record QueryOrderListByUserDto : PagedRequest
    {
        /// <summary>
        /// 账号
        /// </summary>
        public string? ClientId { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string? ClientSecret { get; set; }

        /// <summary>
        /// 信件编号
        /// </summary>
        public string? UserId { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        public string? PhoneNum { get; set; }
    }

    /// <summary>
    /// 办件摘编列表查询参数
    /// </summary>
    public record QueryOrderListDto : PagedRequest
    {
        /// <summary>
        /// 账号
        /// </summary>
        public string? ClientId { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string? ClientSecret { get; set; }

        /// <summary>
        /// 来电/信人身份
        /// </summary>
        public EIdentityType? IdentityType { get; set; }

        /// <summary>
        /// 信件编号
        /// </summary>
        public string? FlowCode { get; set; }

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

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

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

        /// <summary>
        /// 开始时间
        /// </summary>
        public string? FlowSDate { get; set; }

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

        /// <summary>
        /// 来信人
        /// </summary>
        public string? FlowFrom { get; set; }
    }

    /// <summary>
    /// 办件摘编列表数据
    /// </summary>
    public class OrderListDto
    {
        /// <summary>
        /// 信件ID
        /// </summary>
        public string FlowID { get; set; }

        /// <summary>
        /// 信件编号
        /// </summary>
        public string FlowCode { get; set; }

        /// <summary>
        /// 查询密码
        /// </summary>
        public string FlowPwd { get; set; }

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

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

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

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

        /// <summary>
        /// 来信时间
        /// </summary>
        public DateTime? FlowAddDate { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime? PubDate { get; set; }

        /// <summary>
        /// 办理状态
        /// </summary>
        public string RSFlagName { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int Source { get; set; } = 1;

    }

    /// <summary>
    /// 办件摘编列表数据
    /// </summary>
    public class OrderListReturnAllDto
    {
        /// <summary>
        /// 总数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 数据对象
        /// </summary>
        public IReadOnlyList<OrderListDto> Data { get; set; }
    }

    /// <summary>
    /// 办件摘编列表数据
    /// </summary>
    public class OrderListReturnDto
    {
        /// <summary>
        /// 页码
        /// </summary>
        public int PageNum { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int PageCount { get; set; }

        /// <summary>
        /// 总条数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 数据对象
        /// </summary>
        public IReadOnlyList<OrderListDto> Data { get; set; }
    }

    /// <summary>
    /// 信件明细
    /// </summary>
    public class OrderDetail
    {
        /// <summary>
        /// 工单ID
        /// </summary>
        public string FlowID { get; set; }

        /// <summary>
        /// 部门id
        /// </summary>
        public string FlowBMID { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string FlowBMName { get; set; }

        /// <summary>
        /// 信件编号
        /// </summary>
        public string FlowCode { get; set; }

        /// <summary>
        /// 查询密码
        /// </summary>
        public string Pwd { get; set; }

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

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

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

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

        /// <summary>
        /// 来信时间
        /// </summary>
        public DateTime? FlowAddDate { get; set; }

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

        /// <summary>
        /// 来信人
        /// </summary>
        public string FlowLKName { get; set; }

        /// <summary>
        /// 办理状态
        /// </summary>
        public string FlowRSFlagName { get; set; }

        /// <summary>
        /// 是否公开
        /// </summary>
        public string FlowPubFlagName { get; set; }

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

        /// <summary>
        /// 办理意见
        /// </summary>
        public string FlowResult { get; set; }

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

        /// <summary>
        /// 是否是省工单或者政民互动工单 0：否，1：是
        /// </summary>
        public string IsProvinceOrder { get; set; }

        /// <summary>
        /// 是否可以评价 0：不能评价，1：可以评价，2：已评价
        /// </summary>
        public string VisitType { get; set; }

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

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

        /// <summary>
        /// 首次评价结果
        /// </summary>
        public string? FirstVisitResult { get; set; }

        /// <summary>
        /// 附件
        /// </summary>
        public List<FileJson>? FileJson { get; set; }
    }

    /// <summary>
    /// 受理信息返回
    /// </summary>
    public class OrderAcceptanceReturnDto
    {
        public string State { get; set; }

        public string Code { get; set; }

        public string PWD { get; set; }
    }

    /// <summary>
    /// 受理类型统计
    /// </summary>
    public class OrderFormCount
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int value { get; set; }
    }

    /// <summary>
    /// 热点统计
    /// </summary>
    public class OrderHotCount
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string typeName { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int num { get; set; }
    }

    /// <summary>
    /// 返回数据
    /// </summary>
    public class GetChartDataDto
    {
        /// <summary>
        /// 受理类型统计
        /// </summary>
        public IReadOnlyList<OrderFormCount> formCount { get; set; }

        /// <summary>
        /// 热点统计
        /// </summary>
        public IReadOnlyList<OrderHotCount> hotCount { get; set; }
    }

    /// <summary>
    /// 办件统计
    /// </summary>
    public class GetStatistDto
    {
        /// <summary>
        /// 累计接件
        /// </summary>
        public int AllCount { get; set; }

        /// <summary>
        /// 累计已办
        /// </summary>
        public int AllTrandCount { get; set; }

        /// <summary>
        /// 今日接件
        /// </summary>
        public int DayCount { get; set; }

        /// <summary>
        /// 今日已办
        /// </summary>
        public int DayTrandCount { get; set; }
    }

    /// <summary>
    /// 返回数据
    /// </summary>
    public class DataListTopDto
    {
        public string DataID { get; set; }

        public string Title { get; set; }

        public DateTime? CreateDate { get; set; }

        public string? Content { get; set; }

        public string? BulletinTypeName { get; set; }
    }

    /// <summary>
    /// 查询条件带时间
    /// </summary>
    public class OrderFormByMonthDto
    {
        /// <summary>
        /// 账号
        /// </summary>
        public string? ClientId { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string? ClientSecret { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public string? StartTime { get; set; }

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

    /// <summary>
    /// 受理类型统计
    /// </summary>
    public class GetOrderFormByMonth
    {
        /// <summary>
        /// 受理类型统计---受理
        /// </summary>
        public IReadOnlyList<OrderFormCount> formAcceptanceCount { get; set; }

        /// <summary>
        /// 受理类型统计--办理
        /// </summary>
        public IReadOnlyList<OrderFormCount> formFileCount { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class GetVailDataDto()
    {
        /// <summary>
        /// 账号
        /// </summary>
        public string? ClientId { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string? ClientSecret { get; set; }

        public string Key { get; set; }

        public string Value { get; set; }
    }

    public class GetFileDto
    {
        public GetResultDto? result { get; set; }
        public int? code { get; set; }
        public string? message { get; set; }
        public string? error { get; set; }
    }

    public class GetResultDto
    {
        public string? id { get; set; }
        public string? fileName { get; set; }
        public string? path { get; set; }
    }

    /// <summary>
    /// 工单信息
    /// </summary>
    public class OrderResultDto
    {
        /// <summary>
        /// 工单唯一标识
        /// </summary>
        public string? Id { get; set; }

        /// <summary>
        /// 办件编号
        /// </summary>
        public string? No { get; set; }

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

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

        /// <summary>
        /// 受理部门（实际办理部门）
        /// </summary>
        public string? ActualHandleOrgName { get; set; }

        /// <summary>
        /// 工单提交(申报)时间（受理时间）
        /// </summary>
        public DateTime? CreationTime { get; set; }

        /// <summary>
        /// 提交人姓名（来电人姓名）
        /// </summary>
        public string? FromName { get; set; }

        /// <summary>
        /// 手机号（来电号码 FromPhone 联系电话 Contact）
        /// </summary>
        public string? FromPhone { get; set; }
    }

    /// <summary>
    /// 评价信息
    /// </summary>
    public class VisitResultDto
    {
        /// <summary>
        /// 工单唯一标识
        /// </summary>
        public string? OrderID { get; set; }

        /// <summary>
        /// 评价满意度(评分)
        /// </summary>
        public Kv? NowEvaluate { get; set; }

        /// <summary>
        /// 评价描述
        /// </summary>
        public string? VisitContent { get; set; }

        /// <summary>
        /// 评价时间
        /// </summary>
        public string? VisitTime { get; set; }

        /// <summary>
        /// 评价人
        /// </summary>
        public string? VisitName { get; set; }

        /// <summary>
        /// 是否公开
        /// </summary>
        public bool PublishState { get; set; } = false;
    }

    /// <summary>
    /// 账号信息
    /// </summary>
    public class UserResultDto
    {
        /// <summary>
        /// 账号信息：uuid（用户唯一标识）
        /// </summary>
        public string? UUID { get; set; }

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

    public class VerificationPic
    {
        /// <summary>
        /// 图片
        /// </summary>
        public string? base64 { get; set; }

        /// <summary>
        /// Guid
        /// </summary>
        public string? guid { get; set; }
    }

    public class VerificationPicDto
    {
        /// <summary>
        /// 验证码
        /// </summary>
        public string verCode { get; set; }

        /// <summary>
        /// Guid
        /// </summary>
        public string guid { get; set; }

        /// <summary>
        /// 号码
        /// </summary>
        public string TelNum { get; set; }
    }

    public class VerificationSms
    {
        /// <summary>
        /// 号码
        /// </summary>
        public string TelNum { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        public string SmsCode { get; set; }
    }
}
