using System;
using System.Collections.Generic;
using NPP.SmartSchedue.Api.Contracts.Core.Enums;
namespace NPP.SmartSchedue.Api.Contracts.Services.Time.Output;
///
/// 不可用统计信息输出模型
/// 提供各种维度的统计数据
///
public class UnavailabilityStatistics
{
///
/// 员工ID
///
public long PersonnelId { get; set; }
///
/// 开始日期
///
public DateTime StartDate { get; set; }
///
/// 结束日期
///
public DateTime EndDate { get; set; }
///
/// 总天数
///
public int TotalDays { get; set; }
///
/// 总记录数
///
public int TotalRecords { get; set; }
///
/// 总可能时段数
///
public int TotalPossibleSlots { get; set; }
///
/// 员工信息
///
public PersonnelInfo Personnel { get; set; }
///
/// 统计时间范围
///
public StatisticsDateRange DateRange { get; set; }
///
/// 总体统计
///
public OverallStatistics Overall { get; set; } = new();
///
/// 按班次统计
///
public List ShiftStats { get; set; } = new();
///
/// 班次统计(与ShiftStats相同,用于兼容性)
///
public List ShiftStatistics { get; set; } = new();
///
/// 按原因类型统计
///
public List ReasonTypeStats { get; set; } = new();
///
/// 原因类型统计(与ReasonTypeStats相同,用于兼容性)
///
public List ReasonTypeStatistics { get; set; } = new();
///
/// 按分组统计
///
public List CategoryStats { get; set; } = new();
///
/// 分组统计(与CategoryStats相同,用于兼容性)
///
public List CategoryStatistics { get; set; } = new();
///
/// 按月份统计
///
public List MonthlyStats { get; set; } = new();
///
/// 按星期统计
///
public List WeekdayStats { get; set; } = new();
///
/// 星期统计(与WeekdayStats相同,用于兼容性)
///
public List WeekdayStatistics { get; set; } = new();
///
/// 模板生成统计
///
public TemplateStatistics TemplateStatistics { get; set; } = new();
///
/// 月度趋势分析
///
public List MonthlyTrend { get; set; } = new();
///
/// 不可用率(百分比)
///
public double UnavailableRate { get; set; }
}
///
/// 统计时间范围
///
public class StatisticsDateRange
{
///
/// 开始日期
///
public DateTime StartDate { get; set; }
///
/// 结束日期
///
public DateTime EndDate { get; set; }
///
/// 时间范围显示
///
public string Display { get; set; }
///
/// 总天数
///
public int TotalDays { get; set; }
}
///
/// 总体统计
///
public class OverallStatistics
{
///
/// 总不可用次数
///
public int TotalCount { get; set; }
///
/// 不可用天数
///
public int UnavailableDays { get; set; }
///
/// 不可用率(百分比)
///
public decimal UnavailabilityRate { get; set; }
///
/// 模板生成数量
///
public int TemplateGeneratedCount { get; set; }
///
/// 手动创建数量
///
public int ManualCreatedCount { get; set; }
///
/// 平均每天不可用班次数
///
public decimal AverageUnavailableShiftsPerDay { get; set; }
}
///
/// 班次统计
///
public class ShiftStatistics
{
///
/// 班次ID
///
public long ShiftId { get; set; }
///
/// 班次名称
///
public string ShiftName { get; set; }
///
/// 班次时间范围
///
public string TimeRange { get; set; }
///
/// 不可用次数
///
public int Count { get; set; }
///
/// 占比(百分比)
///
public decimal Percentage { get; set; }
///
/// 排名
///
public int Rank { get; set; }
}
///
/// 原因类型统计
///
public class ReasonTypeStatistics
{
///
/// 原因类型
///
public UnavailabilityReasonType ReasonType { get; set; }
///
/// 原因类型名称
///
public string ReasonTypeName { get; set; }
///
/// 分组
///
public UnavailabilityCategory Category { get; set; }
///
/// 显示符号
///
public string Symbol { get; set; }
///
/// 颜色类
///
public string ColorClass { get; set; }
///
/// 不可用次数
///
public int Count { get; set; }
///
/// 占比(百分比)
///
public decimal Percentage { get; set; }
///
/// 影响天数
///
public int AffectedDays { get; set; }
///
/// 排名
///
public int Rank { get; set; }
}
///
/// 分组统计
///
public class CategoryStatistics
{
///
/// 分组类型
///
public UnavailabilityCategory Category { get; set; }
///
/// 分组名称
///
public string CategoryName { get; set; }
///
/// 不可用次数
///
public int Count { get; set; }
///
/// 占比(百分比)
///
public decimal Percentage { get; set; }
///
/// 影响天数
///
public int AffectedDays { get; set; }
///
/// 包含的原因类型列表
///
public List ReasonTypes { get; set; } = new();
}
///
/// 月份统计
///
public class MonthlyStatistics
{
///
/// 年月
///
public DateTime Month { get; set; }
///
/// 月份显示
///
public string MonthDisplay { get; set; }
///
/// 不可用次数
///
public int Count { get; set; }
///
/// 不可用天数
///
public int UnavailableDays { get; set; }
///
/// 该月总天数
///
public int TotalDays { get; set; }
///
/// 不可用率
///
public decimal UnavailabilityRate { get; set; }
}
///
/// 星期统计
///
public class WeekdayStatistics
{
///
/// 星期几 (0=周日, 1=周一, ..., 6=周六)
///
public int Weekday { get; set; }
///
/// 星期几(DayOfWeek枚举)
///
public DayOfWeek DayOfWeek { get; set; }
///
/// 星期显示名称
///
public string WeekdayName { get; set; }
///
/// 星期名称(简短)
///
public string DayName { get; set; }
///
/// 不可用次数
///
public int Count { get; set; }
///
/// 占比(百分比)
///
public decimal Percentage { get; set; }
///
/// 涉及的日期数
///
public int AffectedDates { get; set; }
}
///
/// 模板生成统计
///
public class TemplateStatistics
{
///
/// 总模板记录数
///
public int TotalTemplateRecords { get; set; }
///
/// 模板生成率
///
public decimal TemplateGeneratedRate { get; set; }
///
/// 手动创建记录数
///
public int ManualCreatedRecords { get; set; }
///
/// 手动创建率
///
public decimal ManualCreatedRate { get; set; }
}
///
/// 月度趋势项目
///
public class MonthlyTrendItem
{
///
/// 年份
///
public int Year { get; set; }
///
/// 月份
///
public int Month { get; set; }
///
/// 月份显示
///
public string MonthDisplay { get; set; }
///
/// 不可用次数
///
public int Count { get; set; }
///
/// 不可用天数
///
public int UnavailableDays { get; set; }
///
/// 不可用率
///
public decimal UnavailabilityRate { get; set; }
///
/// 环比变化率
///
public decimal? ChangeRate { get; set; }
}