using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 校考成绩上报输出参数
/// </summary>
public class ExamOrgScoreReportOutput : DEntityOutput
{
    /// <summary>
    /// 监测计划ID
    /// </summary>
    [Required]
    public int ExamPlanId { get; set; }
    /// <summary>
    /// 监测年级ID
    /// </summary>
    [Required]
    public int ExamGradeId { get; set; }
    /// <summary>
    /// 年级ID
    /// </summary>
    [Required]
    public short GradeId { get; set; }
    /// <summary>
    /// 科目ID
    /// </summary>
    [Required]
    public short CourseId { get; set; }
    /// <summary>
    /// 文件名
    /// </summary>
    [Required]
    public string FileName { get; set; }
    /// <summary>
    /// 文件路径
    /// </summary>
    [Required]
    public string FilePath { get; set; }
    /// <summary>
    /// 扩展名
    /// </summary>
    [Required]
    public string FileExtName { get; set; }
    /// <summary>
    /// 文件大小
    /// </summary>
    [Required]
    public long FileSize { get; set; } = 0;

    /// <summary>
    /// 科目
    /// </summary>
    public CourseLiteOutput Course { get; set; }
    /// <summary>
    /// 监测年级
    /// </summary>
    public ExamGradeOutput ExamGrade { get; set; }
}

/// <summary>
/// 校考成绩上报输出参数
/// </summary>
public class ExamOrgScoreReportItem
{
    /// <summary>
    /// 监测科目ID
    /// </summary>
    [Required]
    public int ExamCourseId { get; set; }
    /// <summary>
    /// 监测计划ID
    /// </summary>
    [Required]
    public int ExamPlanId { get; set; }
    /// <summary>
    /// 监测年级ID
    /// </summary>
    [Required]
    public int ExamGradeId { get; set; }
    /// <summary>
    /// 入学年份
    /// </summary>
    [Required]
    public short GradeBeginYear { get; set; }
    /// <summary>
    /// 年级ID
    /// </summary>
    [Required]
    public short GradeId { get; set; }
    /// <summary>
    /// 年级
    /// </summary>
    [Required]
    public string GradeName { get; set; }
    /// <summary>
    /// 科目ID
    /// </summary>
    [Required]
    public short CourseId { get; set; }
    /// <summary>
    /// 科目
    /// </summary>
    [Required]
    public string CourseName { get; set; }
    /// <summary>
    /// 成绩模板配置
    /// </summary>
    [Required]
    public string ScoreReportConfig { get; set; }

    /// <summary>
    /// 校考成绩上报ID
    /// </summary>
    public int? Id { get; set; }

    /// <summary>
    /// 文件名
    /// </summary>
    [Required]
    public string FileName { get; set; }
    /// <summary>
    /// 文件路径
    /// </summary>
    [Required]
    public string FilePath { get; set; }
    /// <summary>
    /// 扩展名
    /// </summary>
    [Required]
    public string FileExtName { get; set; }
    /// <summary>
    /// 文件大小
    /// </summary>
    [Required]
    public long FileSize { get; set; } = 0;


    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; }
    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
    /// <summary>
    /// 创建人ID
    /// </summary>
    [Required]
    public int CreateSysUserId { get; set; }
    /// <summary>
    /// 创建人
    /// </summary>
    [Required]
    public string CreateSysUserName { get; set; }
    /// <summary>
    /// 修改者Id
    /// </summary>
    public int? UpdateSysUserId { get; set; }
}

/// <summary>
/// 上传校考成绩输出参数
/// </summary>
public class UploadExamOrgScoreReportOutput
{
    /// <summary>
    /// 模板要求
    /// </summary>
    [Required]
    public ExamCourseScoreReportConfig ScoreReportConfig { get; set; }
    /// <summary>
    /// 标题
    /// </summary>
    [Required]
    public Dictionary<int, ExamOrgScoreReportColumnMatchValue> Columns { get; set; } = new();
    /// <summary>
    /// 行数据
    /// </summary>
    [Required]
    public List<Dictionary<int, object>> Rows { get; set; } = new();
    /// <summary>
    /// 行数
    /// </summary>
    [Required]
    public int RowCount { get; set; } = 0;
    /// <summary>
    /// 列数
    /// </summary>
    [Required]
    public int ColumnsCount { get; set; } = 0;
    /// <summary>
    /// 错误列数
    /// </summary>
    [Required]
    public int ErrorColumnCount { get; set; } = 0;

    /// <summary>
    /// 是否成功
    /// </summary>
    [Required]
    public bool IsSuccess { get; set; } = true;


    /// <summary>
    /// 列匹配结果
    /// </summary>
    public class ExamOrgScoreReportColumnMatchValue
    {
        /// <summary>
        /// 是否匹配
        /// </summary>
        public bool IsMatched { get; set; } = false;
        /// <summary>
        /// 列名
        /// </summary>
        public string Name { get; set; } = "";
    }
}


