using System; using System.Collections.Generic; using NPP.SmartSchedue.Api.Contracts.Services.Integration.Models; namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Output { /// /// 人员分配结果 /// public class PersonnelAllocationResult { /// /// 分配是否成功 /// public bool IsSuccess { get; set; } /// /// 分配成功的任务人员匹配 /// public List SuccessfulMatches { get; set; } = new(); /// /// 分配失败的任务 /// public List FailedAllocations { get; set; } = new(); /// /// 人员工作负载分析 /// public List WorkloadAnalysis { get; set; } = new(); /// /// 公平性评分(0-100) /// public int FairnessScore { get; set; } /// /// 分配策略执行摘要 /// public string AllocationSummary { get; set; } /// /// 失败任务列表(为了兼容性) /// public List FailedTasks { get; set; } = new(); /// /// 分配策略 /// public string AllocationStrategy { get; set; } /// /// 处理详情 /// public string ProcessingDetails { get; set; } /// /// 验证结果 - 新增属性支持五层架构 /// public object ValidationResult { get; set; } } /// /// 任务人员匹配 /// public class TaskPersonnelMatch { public long TaskId { get; set; } public string TaskCode { get; set; } public long PersonnelId { get; set; } public string PersonnelName { get; set; } public int MatchScore { get; set; } // 匹配度评分 0-100 public string MatchReason { get; set; } // 匹配原因 public List QualificationMatches { get; set; } = new(); // 匹配的资质 public decimal EstimatedEfficiency { get; set; } // 预估执行效率 } /// /// 失败的人员分配 /// public class FailedPersonnelAllocation { public long TaskId { get; set; } public string TaskCode { get; set; } public string FailureReason { get; set; } public List ConflictDetails { get; set; } = new(); public List ConflictPersonnels { get; set; } = new(); } /// /// 人员冲突信息 /// public class PersonnelConflictInfo { public long PersonnelId { get; set; } public string PersonnelName { get; set; } public string ConflictType { get; set; } // "时间冲突"、"资质不匹配"、"工作量超限"等 public string ConflictDescription { get; set; } } /// /// 设备分配结果 /// public class EquipmentAllocationResult { /// /// 分配成功的任务设备匹配 /// public List SuccessfulMatches { get; set; } = new(); /// /// 分配失败的任务 /// public List FailedAllocations { get; set; } = new(); /// /// 设备利用率分析 /// public List UtilizationAnalysis { get; set; } = new(); /// /// 总体设备利用率(百分比) /// public decimal OverallUtilizationRate { get; set; } /// /// 设备分配策略执行摘要 /// public string AllocationSummary { get; set; } } /// /// 任务设备匹配 /// public class TaskEquipmentMatch { public long TaskId { get; set; } public string TaskCode { get; set; } public long EquipmentId { get; set; } public string EquipmentName { get; set; } public string EquipmentCode { get; set; } public decimal UtilizationRate { get; set; } public string AllocationReason { get; set; } public decimal EstimatedPerformance { get; set; } // 预估性能指标 } /// /// 设备利用率分析 /// public class EquipmentUtilizationAnalysis { public long EquipmentId { get; set; } public string EquipmentName { get; set; } public int AssignedTaskCount { get; set; } public decimal TotalScheduledHours { get; set; } public decimal UtilizationRate { get; set; } public List ScheduledDates { get; set; } = new(); public string UtilizationStatus { get; set; } // "闲置"、"正常"、"高负荷"、"满负荷" } /// /// 失败的设备分配 /// public class FailedEquipmentAllocation { public long TaskId { get; set; } public string TaskCode { get; set; } public string FailureReason { get; set; } public List ConflictDetails { get; set; } = new(); public List ConflictEquipments { get; set; } = new(); } /// /// 设备冲突信息 /// public class EquipmentConflictInfo { public long EquipmentId { get; set; } public string EquipmentName { get; set; } public string ConflictType { get; set; } // "时间冲突"、"能力不匹配"、"维护期间"等 public string ConflictDescription { get; set; } } /// /// 失败任务信息 /// public class FailedTaskInfo { public long TaskId { get; set; } public string TaskCode { get; set; } public string FailureReason { get; set; } public FailureType FailureType { get; set; } public List DetailedErrors { get; set; } = new(); public List ConflictDetails { get; set; } = new(); } /// /// 失败类型枚举 /// public enum FailureType { /// /// 人员分配失败 /// PersonnelAllocationFailed = 1, /// /// 设备分配失败 /// EquipmentAllocationFailed = 2, /// /// 资源不足 /// InsufficientResources = 3, /// /// 规则冲突 /// RuleConflict = 4, /// /// 系统错误 /// SystemError = 5, /// /// 设备不可用 /// EquipmentUnavailable = 6, /// /// 验证失败 /// ValidationFailure = 7, /// /// 时间冲突 /// TimeConflict = 8, /// /// 无可用人员 /// NoAvailablePersonnel = 9 } /// /// 整合记录 /// public class IntegrationRecord { public long Id { get; set; } /// /// 整合批次编码 /// public string IntegrationBatchCode { get; set; } /// /// 整合时间 /// public DateTime IntegrationTime { get; set; } /// /// 操作人员 /// public long OperatorUserId { get; set; } public string OperatorName { get; set; } /// /// 整合的任务ID列表 /// public List TaskIds { get; set; } = new(); /// /// 整合策略描述 /// public string StrategyDescription { get; set; } /// /// 整合结果摘要 /// public string ResultSummary { get; set; } /// /// 成功任务数量 /// public int SuccessTaskCount { get; set; } /// /// 失败任务数量 /// public int FailedTaskCount { get; set; } /// /// 整合耗时(毫秒) /// public long ElapsedMilliseconds { get; set; } /// /// 项目编号列表 /// public string ProjectNumbers { get; set; } /// /// 任务总数 /// public int TaskCount { get; set; } /// /// 成功率 /// public decimal SuccessRate { get; set; } /// /// 人员公平性评分 /// public int PersonnelFairnessScore { get; set; } /// /// 设备利用率 /// public decimal EquipmentUtilizationRate { get; set; } /// /// 备注 /// public string Remarks { get; set; } /// /// 创建时间 /// public DateTime CreatedTime { get; set; } = DateTime.Now; } }