using System;
using System.Collections.Generic;
using NPP.SmartSchedue.Api.Contracts.Domain.Integration;
using NPP.SmartSchedue.Api.Contracts.Services.Integration.Models;
namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Output
{
///
/// 处理任务变更结果
/// 记录变更处理的详细结果和状态信息
///
public class ProcessTaskChangesResult
{
///
/// 处理是否成功
///
public bool IsSuccess { get; set; }
///
/// 成功消息
///
public string SuccessMessage { get; set; } = string.Empty;
///
/// 错误消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 处理时间
///
public DateTime ProcessedTime { get; set; } = DateTime.Now;
///
/// 处理耗时(毫秒)
///
public long ProcessingTime { get; set; }
///
/// 处理消息
///
public string Message { get; set; } = string.Empty;
///
/// 变更分析结果
///
public List ChangeAnalysis { get; set; } = new();
///
/// 影响评估结果
///
public ChangeImpactAnalysisResult ImpactAssessment { get; set; } = new();
///
/// 处理详情
///
public string ProcessingDetails { get; set; } = string.Empty;
///
/// 变更检测结果
///
public ChangeDetectionResult ChangeDetection { get; set; } = new();
///
/// 影响分析结果
///
public ChangeImpactAnalysisResult ImpactAnalysis { get; set; } = new();
///
/// 重新分配结果
/// 如果触发了重新分配
///
public SmartReallocationResult? ReallocationResult { get; set; }
///
/// 新创建的版本信息
/// 如果创建了新版本
///
public IntegrationVersionInfo? NewVersionInfo { get; set; }
///
/// 处理统计信息
///
public ChangeProcessingStatistics Statistics { get; set; } = new();
///
/// 通知发送结果
///
public List NotificationResults { get; set; } = new();
///
/// 警告信息
///
public List WarningMessages { get; set; } = new();
///
/// 建议操作
///
public List RecommendedActions { get; set; } = new();
}
///
/// 变更检测结果
///
public class ChangeDetectionResult
{
///
/// 检测是否成功
///
public bool IsSuccess { get; set; } = true;
///
/// 成功消息
///
public string SuccessMessage { get; set; } = string.Empty;
///
/// 错误消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 检测到的变更总数
///
public int DetectedChangeCount { get; set; }
///
/// 检测到的变更总数
///
public int TotalChangesDetected { get; set; }
///
/// 受影响的任务ID列表
///
public List TaskIds { get; set; } = new();
///
/// 按类型分类的变更统计
///
public Dictionary ChangesByType { get; set; } = new();
///
/// 详细的变更列表
///
public List DetailedChanges { get; set; } = new();
///
/// 检测执行时间
///
public DateTime DetectionTime { get; set; } = DateTime.Now;
///
/// 检测耗时(毫秒)
///
public long DetectionElapsedMilliseconds { get; set; }
///
/// 检测状态
/// Completed-完成, PartiallyCompleted-部分完成, Failed-失败
///
public string DetectionStatus { get; set; } = "Completed";
///
/// 检测覆盖的任务数量
///
public int TasksCovered { get; set; }
///
/// 检测失败的任务
///
public List FailedTaskIds { get; set; } = new();
}
///
/// 详细任务变更信息
///
public class DetailedTaskChange
{
///
/// 任务ID
///
public long TaskId { get; set; }
///
/// 任务代码
///
public string TaskCode { get; set; } = string.Empty;
///
/// 变更类型
///
public string ChangeType { get; set; } = string.Empty;
///
/// 变更描述
///
public string ChangeDescription { get; set; } = string.Empty;
///
/// 变更前的状态快照
///
public TaskStateSnapshot BeforeState { get; set; } = new();
///
/// 变更后的状态快照
///
public TaskStateSnapshot AfterState { get; set; } = new();
///
/// 变更检测时间
///
public DateTime ChangeDetectedTime { get; set; } = DateTime.Now;
///
/// 影响评估
///
public string ImpactAssessment { get; set; } = string.Empty;
///
/// 是否需要重新分配
///
public bool RequiresReallocation { get; set; }
///
/// 建议的处理动作
///
public List SuggestedActions { get; set; } = new();
}
///
/// 任务状态快照
///
public class TaskStateSnapshot
{
///
/// 工作日期
///
public DateTime WorkOrderDate { get; set; }
///
/// 班次ID
///
public long ShiftId { get; set; }
///
/// 优先级
///
public int Priority { get; set; }
///
/// 紧急程度
///
public int Urgency { get; set; }
///
/// 复杂度
///
public int Complexity { get; set; }
///
/// 预估工时
///
public decimal? EstimatedHours { get; set; }
///
/// 分配的人员ID
///
public long? AssignedPersonnelId { get; set; }
///
/// 分配的设备ID
///
public long? AssignedEquipmentId { get; set; }
///
/// 任务状态
///
public string TaskStatus { get; set; } = string.Empty;
///
/// 其他关键属性
///
public Dictionary AdditionalProperties { get; set; } = new();
}
///
/// 变更影响分析结果
///
public class ChangeImpactAnalysisResult
{
///
/// 总体影响评分(0-100)
///
public int OverallImpactScore { get; set; }
///
/// 影响范围评估
///
public ImpactScopeAssessment ScopeAssessment { get; set; } = new();
///
/// 受影响的资源统计
///
public AffectedResourcesStatistics AffectedResources { get; set; } = new();
///
/// 风险评估
///
public RiskAssessment RiskAssessment { get; set; } = new();
///
/// 建议的处理策略
///
public string RecommendedStrategy { get; set; } = string.Empty;
///
/// 预计处理耗时(分钟)
///
public int EstimatedProcessingTimeMinutes { get; set; }
///
/// 业务影响描述
///
public string BusinessImpactDescription { get; set; } = string.Empty;
///
/// 技术影响描述
///
public string TechnicalImpactDescription { get; set; } = string.Empty;
///
/// 分析执行时间
///
public DateTime AnalysisTime { get; set; } = DateTime.Now;
///
/// 分析耗时(毫秒)
///
public long AnalysisElapsedMilliseconds { get; set; }
}
///
/// 影响范围评估
///
public class ImpactScopeAssessment
{
///
/// 影响范围类别
/// Local, Regional, Global
///
public string ScopeCategory { get; set; } = "Local";
///
/// 直接影响的任务数量
///
public int DirectlyAffectedTaskCount { get; set; }
///
/// 间接影响的任务数量
///
public int IndirectlyAffectedTaskCount { get; set; }
///
/// 影响的批次数量
///
public int AffectedBatchCount { get; set; }
///
/// 影响的项目数量
///
public int AffectedProjectCount { get; set; }
///
/// 跨班次影响
///
public bool CrossShiftImpact { get; set; }
///
/// 跨部门影响
///
public bool CrossDepartmentImpact { get; set; }
}
///
/// 受影响的资源统计
///
public class AffectedResourcesStatistics
{
///
/// 受影响的人员数量
///
public int AffectedPersonnelCount { get; set; }
///
/// 受影响的人员列表
///
public List AffectedPersonnel { get; set; } = new();
///
/// 受影响的设备数量
///
public int AffectedEquipmentCount { get; set; }
///
/// 受影响的设备列表
///
public List AffectedEquipment { get; set; } = new();
///
/// 需要重新协调的资源数量
///
public int ResourcesRequiringRecoordination { get; set; }
///
/// 资源冲突数量
///
public int ResourceConflictCount { get; set; }
}
///
/// 受影响的人员信息
///
public class AffectedPersonnelInfo
{
///
/// 人员ID
///
public long PersonnelId { get; set; }
///
/// 人员姓名
///
public string PersonnelName { get; set; } = string.Empty;
///
/// 影响类型
/// WorkloadChanged, TaskReassigned, ScheduleConflict
///
public string ImpactType { get; set; } = string.Empty;
///
/// 影响描述
///
public string ImpactDescription { get; set; } = string.Empty;
///
/// 影响严重程度
/// Low, Medium, High, Critical
///
public string SeverityLevel { get; set; } = "Medium";
///
/// 受影响的任务数量
///
public int AffectedTaskCount { get; set; }
}
///
/// 受影响的设备信息
///
public class AffectedEquipmentInfo
{
///
/// 设备ID
///
public long EquipmentId { get; set; }
///
/// 设备名称
///
public string EquipmentName { get; set; } = string.Empty;
///
/// 影响类型
/// UtilizationChanged, TaskReassigned, MaintenanceConflict
///
public string ImpactType { get; set; } = string.Empty;
///
/// 影响描述
///
public string ImpactDescription { get; set; } = string.Empty;
///
/// 影响严重程度
///
public string SeverityLevel { get; set; } = "Medium";
///
/// 受影响的任务数量
///
public int AffectedTaskCount { get; set; }
}
///
/// 风险项目
///
public class RiskItem
{
///
/// 风险类型
///
public string RiskType { get; set; } = string.Empty;
///
/// 风险描述
///
public string RiskDescription { get; set; } = string.Empty;
///
/// 风险等级
///
public string RiskLevel { get; set; } = string.Empty;
///
/// 风险概率
///
public decimal Probability { get; set; }
///
/// 影响程度
///
public decimal Impact { get; set; }
///
/// 风险值(概率 x 影响)
///
public decimal RiskValue { get; set; }
///
/// 缓解措施
///
public List MitigationActions { get; set; } = new();
}
///
/// 变更处理统计信息
///
public class ChangeProcessingStatistics
{
///
/// 总处理耗时(毫秒)
///
public long TotalElapsedMilliseconds { get; set; }
///
/// 检测阶段耗时(毫秒)
///
public long DetectionElapsedMilliseconds { get; set; }
///
/// 分析阶段耗时(毫秒)
///
public long AnalysisElapsedMilliseconds { get; set; }
///
/// 处理阶段耗时(毫秒)
///
public long ProcessingElapsedMilliseconds { get; set; }
///
/// 处理的变更数量
///
public int ProcessedChangeCount { get; set; }
///
/// 成功处理的变更数量
///
public int SuccessfulChangeCount { get; set; }
///
/// 失败处理的变更数量
///
public int FailedChangeCount { get; set; }
///
/// 创建的新版本数量
///
public int CreatedVersionCount { get; set; }
///
/// 触发的重新分配数量
///
public int ReallocationTriggeredCount { get; set; }
///
/// 发送的通知数量
///
public int NotificationsSentCount { get; set; }
///
/// 处理成功率
///
public decimal ProcessingSuccessRate { get; set; }
}
///
/// 整合版本信息
///
public class IntegrationVersionInfo
{
///
/// 版本ID
///
public long VersionId { get; set; }
///
/// 版本号
///
public int VersionNumber { get; set; }
///
/// 根版本ID
///
public long RootVersionId { get; set; }
///
/// 父版本ID
///
public long? ParentVersionId { get; set; }
///
/// 版本创建时间
///
public DateTime CreatedTime { get; set; }
///
/// 版本创建原因
///
public string CreationReason { get; set; } = string.Empty;
///
/// 变更摘要
///
public string ChangeSummary { get; set; } = string.Empty;
///
/// 是否为活跃版本
///
public bool IsActiveVersion { get; set; }
///
/// 变更影响评分
///
public int ChangeImpactScore { get; set; }
///
/// 创建者信息
///
public string CreatedBy { get; set; } = string.Empty;
///
/// 发布时间
///
public DateTime? PublishedTime { get; set; }
///
/// 版本创建原因
///
public string VersionReason { get; set; } = string.Empty;
///
/// 创建者用户名
///
public string CreatedByUserName { get; set; } = string.Empty;
///
/// 发布者用户名
///
public string PublishedByUserName { get; set; } = string.Empty;
///
/// 任务总数
///
public int TaskCount { get; set; }
///
/// 成功任务数量
///
public int SuccessTaskCount { get; set; }
///
/// 失败任务数量
///
public int FailedTaskCount { get; set; }
///
/// 性能指标
///
public IntegrationPerformanceMetrics PerformanceMetrics { get; set; } = new();
///
/// 发布状态
///
public string PublishStatus { get; set; } = "Draft";
///
/// 创建时间
///
public DateTime CreationTime { get; set; } = DateTime.Now;
}
///
/// 整合版本历史查询结果
///
public class IntegrationVersionHistoryResult
{
///
/// 整合记录ID
///
public long IntegrationRecordId { get; set; }
///
/// 查询时间
///
public DateTime QueryTime { get; set; } = DateTime.Now;
///
/// 是否成功
///
public bool IsSuccess { get; set; } = true;
///
/// 成功消息
///
public string SuccessMessage { get; set; } = string.Empty;
///
/// 错误消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 版本记录列表
///
public List VersionRecords { get; set; } = new();
///
/// 总记录数
///
public int TotalCount { get; set; }
///
/// 版本统计信息
///
public VersionStatistics Statistics { get; set; } = new();
///
/// 变更历史时间线
///
public List ChangeHistory { get; set; } = new();
///
/// 版本历史信息列表
///
public List VersionHistory { get; set; } = new();
///
/// 版本对比结果
///
public VersionComparisonResult? VersionComparison { get; set; }
///
/// 版本统计信息
///
public VersionStatistics VersionStatistics { get; set; } = new();
///
/// 消息
///
public string Message { get; set; } = string.Empty;
///
/// 版本信息列表
///
public List VersionInfos { get; set; } = new();
}
///
/// 版本统计信息
///
public class VersionStatistics
{
///
/// 总版本数
///
public int TotalVersions { get; set; }
///
/// 活跃版本数
///
public int ActiveVersions { get; set; }
///
/// 平均版本间隔时间(分钟)
///
public double AverageVersionInterval { get; set; }
}
///
/// 变更历史项目
///
public class ChangeHistoryItem
{
///
/// 版本ID
///
public long VersionId { get; set; }
///
/// 变更时间
///
public DateTime ChangeTime { get; set; }
///
/// 变更类型
///
public string ChangeType { get; set; } = string.Empty;
///
/// 变更描述
///
public string Description { get; set; } = string.Empty;
///
/// 操作员姓名
///
public string OperatorName { get; set; } = string.Empty;
}
}