using System.ComponentModel.DataAnnotations; namespace MilitaryTrainingManagement.Models.DTOs; /// /// 提交上报请求 /// public class SubmitReportRequest { /// /// 分配记录ID /// [Required(ErrorMessage = "分配记录ID为必填项")] public int DistributionId { get; set; } /// /// 实际完成数量 /// [Required(ErrorMessage = "实际完成数量为必填项")] [Range(0, double.MaxValue, ErrorMessage = "实际完成数量不能为负数")] public decimal ActualCompletion { get; set; } } /// /// 上报记录响应 /// public class ReportResponse { public int Id { get; set; } public int AllocationId { get; set; } public string Category { get; set; } = string.Empty; public string MaterialName { get; set; } = string.Empty; public string Unit { get; set; } = string.Empty; public int TargetUnitId { get; set; } public string TargetUnitName { get; set; } = string.Empty; public decimal UnitQuota { get; set; } public decimal? ActualCompletion { get; set; } public decimal CompletionRate { get; set; } public DateTime? ReportedAt { get; set; } public int? ReportedByUserId { get; set; } public string? ReportedByUserName { get; set; } } /// /// 汇总数据响应 /// public class AggregatedReportResponse { public int AllocationId { get; set; } public string Category { get; set; } = string.Empty; public string MaterialName { get; set; } = string.Empty; public string Unit { get; set; } = string.Empty; public decimal TotalQuota { get; set; } public decimal TotalActualCompletion { get; set; } public decimal OverallCompletionRate { get; set; } public List UnitSummaries { get; set; } = new(); } /// /// 单位上报汇总 /// public class UnitReportSummary { public int UnitId { get; set; } public string UnitName { get; set; } = string.Empty; public string UnitLevel { get; set; } = string.Empty; public decimal UnitQuota { get; set; } public decimal? ActualCompletion { get; set; } public decimal CompletionRate { get; set; } public DateTime? ReportedAt { get; set; } public string? ReportedByUserName { get; set; } // 新增字段:用于按单位汇总上报数据 public decimal TotalReported { get; set; } public int ReportCount { get; set; } public DateTime? LastReportedAt { get; set; } } /// /// 层级汇总数据响应 /// public class HierarchicalAggregatedResponse { public int UnitId { get; set; } public string UnitName { get; set; } = string.Empty; public string UnitLevel { get; set; } = string.Empty; public decimal TotalQuota { get; set; } public decimal TotalActualCompletion { get; set; } public decimal OverallCompletionRate { get; set; } public List AllocationAggregations { get; set; } = new(); public List SubordinateSummaries { get; set; } = new(); } /// /// 配额汇总 /// public class AllocationAggregation { public int AllocationId { get; set; } public string Category { get; set; } = string.Empty; public string MaterialName { get; set; } = string.Empty; public string Unit { get; set; } = string.Empty; public decimal TotalQuota { get; set; } public decimal TotalActualCompletion { get; set; } public decimal CompletionRate { get; set; } } /// /// 下级单位汇总 /// public class SubordinateUnitSummary { public int UnitId { get; set; } public string UnitName { get; set; } = string.Empty; public string UnitLevel { get; set; } = string.Empty; public decimal TotalQuota { get; set; } public decimal TotalActualCompletion { get; set; } public decimal CompletionRate { get; set; } }