using System;
using System.Collections.Generic;
using NPP.SmartSchedue.Api.Contracts.Domain.Integration;
using NPP.SmartSchedue.Api.Contracts.Services.Time.Output;
using NPP.SmartSchedue.Api.Contracts.Services.Work.Output;
namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Output
{
///
/// 版本对比结果
/// 详细记录两个版本之间的差异分析
///
public class VersionComparisonResult
{
///
/// 对比是否成功
///
public bool IsSuccess { get; set; }
///
/// 成功消息
///
public string SuccessMessage { get; set; } = string.Empty;
///
/// 错误消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 对比执行时间
///
public DateTime ComparisonTime { get; set; } = DateTime.Now;
///
/// 源版本信息
///
public IntegrationVersionInfo SourceVersion { get; set; } = new();
///
/// 目标版本信息
///
public IntegrationVersionInfo TargetVersion { get; set; } = new();
///
/// 版本差异摘要
///
public VersionDifferenceSummary DifferenceSummary { get; set; } = new();
///
/// 详细差异列表
///
public List DetailedDifferences { get; set; } = new();
///
/// 性能对比分析
///
public PerformanceComparison PerformanceComparison { get; set; } = new();
///
/// 改进建议
///
public List ImprovementRecommendations { get; set; } = new();
///
/// 回归风险评估
///
public RegressionRiskAssessment RegressionRisk { get; set; } = new();
}
///
/// 版本差异摘要
///
public class VersionDifferenceSummary
{
///
/// 总变更项数量
///
public int TotalChangeCount { get; set; }
///
/// 任务分配变更数量
///
public int TaskAllocationChangeCount { get; set; }
///
/// 人员分配变更数量
///
public int PersonnelAllocationChangeCount { get; set; }
///
/// 设备分配变更数量
///
public int EquipmentAllocationChangeCount { get; set; }
///
/// 新增任务数量
///
public int AddedTaskCount { get; set; }
///
/// 移除任务数量
///
public int RemovedTaskCount { get; set; }
///
/// 配置变更数量
///
public int ConfigurationChangeCount { get; set; }
///
/// 主要变更类型
///
public List MajorChangeTypes { get; set; } = new();
///
/// 变更影响评分
///
public int ChangeImpactScore { get; set; }
///
/// 整体变更趋势
/// Improved, Unchanged, Declined
///
public string OverallTrend { get; set; } = "Unchanged";
}
///
/// 详细差异
///
public class DetailedDifference
{
///
/// 差异类型
/// TaskAssignment, PersonnelAllocation, EquipmentAllocation, Configuration, Statistics
///
public string DifferenceType { get; set; } = string.Empty;
///
/// 差异项目名称
///
public string ItemName { get; set; } = string.Empty;
///
/// 差异项目ID
///
public long? ItemId { get; set; }
///
/// 变更操作类型
/// Added, Removed, Modified, Unchanged
///
public string ChangeOperation { get; set; } = string.Empty;
///
/// 源版本值
///
public string SourceValue { get; set; } = string.Empty;
///
/// 目标版本值
///
public string TargetValue { get; set; } = string.Empty;
///
/// 差异描述
///
public string DifferenceDescription { get; set; } = string.Empty;
///
/// 影响评估
///
public string ImpactAssessment { get; set; } = string.Empty;
///
/// 改进指标
/// 正值表示改进,负值表示退化
///
public decimal ImprovementMetric { get; set; }
///
/// 相关联的其他变更
///
public List RelatedChanges { get; set; } = new();
}
///
/// 回归风险评估
///
public class RegressionRiskAssessment
{
///
/// 整体回归风险等级
///
public string OverallRiskLevel { get; set; } = "Medium";
///
/// 质量回归风险评分
///
public int QualityRegressionRisk { get; set; }
///
/// 性能回归风险评分
///
public int PerformanceRegressionRisk { get; set; }
///
/// 业务连续性风险评分
///
public int BusinessContinuityRisk { get; set; }
///
/// 风险缓解建议
///
public List RiskMitigationSuggestions { get; set; } = new();
}
///
/// 版本回滚输入
///
public class VersionRollbackInput
{
///
/// 当前版本ID
///
public long CurrentVersionId { get; set; }
///
/// 目标回滚版本ID
///
public long TargetVersionId { get; set; }
///
/// 回滚原因
///
public string RollbackReason { get; set; } = string.Empty;
///
/// 操作员用户ID
///
public long OperatorUserId { get; set; }
///
/// 操作员用户名
///
public string OperatorUserName { get; set; } = string.Empty;
///
/// 操作员真实姓名
///
public string OperatorRealName { get; set; } = string.Empty;
///
/// 是否强制回滚
/// 即使存在冲突也强制执行
///
public bool ForceRollback { get; set; } = false;
///
/// 回滚范围
/// Full-完全回滚, Partial-部分回滚, ConfigOnly-仅配置回滚
///
public string RollbackScope { get; set; } = "Full";
///
/// 回滚后是否发布
///
public bool PublishAfterRollback { get; set; } = false;
///
/// 通知相关人员
///
public bool NotifyAffectedPersonnel { get; set; } = true;
///
/// 业务备注
///
public string Remarks { get; set; } = string.Empty;
}
///
/// 版本回滚结果
///
public class VersionRollbackResult
{
///
/// 回滚是否成功
///
public bool IsSuccess { get; set; }
///
/// 成功消息
///
public string SuccessMessage { get; set; } = string.Empty;
///
/// 错误消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 回滚执行时间
///
public DateTime RollbackTime { get; set; } = DateTime.Now;
///
/// 原版本ID
///
public long OriginalVersionId { get; set; }
///
/// 目标版本ID
///
public long TargetVersionId { get; set; }
///
/// 新创建的版本ID(回滚后的当前版本)
///
public long? NewVersionId { get; set; }
///
/// 回滚前验证结果
///
public RollbackValidationResult ValidationResult { get; set; } = new();
///
/// 回滚执行详情
///
public List ExecutionDetails { get; set; } = new();
///
/// 回滚统计信息
///
public RollbackStatistics Statistics { get; set; } = new();
///
/// 通知发送结果
///
public List NotificationResults { get; set; } = new();
///
/// 警告信息
///
public List WarningMessages { get; set; } = new();
///
/// 后续建议操作
///
public List RecommendedNextActions { get; set; } = new();
}
///
/// 回滚验证结果
///
public class RollbackValidationResult
{
///
/// 验证是否通过
///
public bool IsValid { get; set; }
///
/// 验证时间
///
public DateTime ValidationTime { get; set; } = DateTime.Now;
///
/// 阻塞性错误
///
public List BlockingErrors { get; set; } = new();
///
/// 警告信息
///
public List Warnings { get; set; } = new();
///
/// 冲突检测结果
///
public ConflictDetectionResult ConflictDetection { get; set; } = new();
///
/// 数据完整性检查结果
///
public DataIntegrityCheckResult DataIntegrityCheck { get; set; } = new();
}
///
/// 冲突检测结果
///
public class ConflictDetectionResult
{
///
/// 是否存在冲突
///
public bool HasConflicts { get; set; }
///
/// 冲突数量
///
public int ConflictCount { get; set; }
///
/// 具体冲突列表
///
public List Conflicts { get; set; } = new();
}
///
/// 冲突详情
///
public partial class ConflictDetail
{
///
/// 冲突描述
///
public string ConflictDescription { get; set; } = string.Empty;
///
/// 涉及的资源ID
///
public List InvolvedResourceIds { get; set; } = new();
///
/// 严重程度
///
public string SeverityLevel { get; set; } = "Medium";
///
/// 解决建议
///
public List ResolutionSuggestions { get; set; } = new();
}
///
/// 数据完整性检查结果
///
public class DataIntegrityCheckResult
{
///
/// 数据完整性是否通过
///
public bool IsDataIntegrityValid { get; set; }
///
/// 缺失数据项
///
public List MissingDataItems { get; set; } = new();
///
/// 无效数据项
///
public List InvalidDataItems { get; set; } = new();
///
/// 数据一致性问题
///
public List ConsistencyIssues { get; set; } = new();
}
///
/// 回滚执行详情
///
public class RollbackExecutionDetail
{
///
/// 执行步骤
///
public string ExecutionStep { get; set; } = string.Empty;
///
/// 执行时间
///
public DateTime ExecutionTime { get; set; } = DateTime.Now;
///
/// 执行状态
///
public string ExecutionStatus { get; set; } = string.Empty;
///
/// 执行结果描述
///
public string ResultDescription { get; set; } = string.Empty;
///
/// 执行耗时(毫秒)
///
public long ElapsedMilliseconds { get; set; }
///
/// 错误信息(如果有)
///
public string ErrorMessage { get; set; } = string.Empty;
}
///
/// 回滚统计信息
///
public class RollbackStatistics
{
///
/// 总执行耗时(毫秒)
///
public long TotalElapsedMilliseconds { get; set; }
///
/// 回滚的任务数量
///
public int RolledBackTaskCount { get; set; }
///
/// 回滚的人员分配数量
///
public int RolledBackPersonnelAllocationCount { get; set; }
///
/// 回滚的设备分配数量
///
public int RolledBackEquipmentAllocationCount { get; set; }
///
/// 恢复的配置项数量
///
public int RestoredConfigurationCount { get; set; }
///
/// 数据库操作次数
///
public int DatabaseOperationCount { get; set; }
///
/// 回滚成功率
///
public decimal RollbackSuccessRate { get; set; }
}
///
/// 任务变更监听结果
///
public class TaskChangeMonitoringResult
{
///
/// 设置是否成功
///
public bool IsSuccess { get; set; }
///
/// 成功消息
///
public string SuccessMessage { get; set; } = string.Empty;
///
/// 错误消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 整合记录ID
///
public long IntegrationRecordId { get; set; }
///
/// 监听状态
///
public bool MonitoringEnabled { get; set; }
///
/// 监听的任务数量
///
public int MonitoredTaskCount { get; set; }
///
/// 监听配置
///
public TaskChangeMonitoringConfig MonitoringConfig { get; set; } = new();
///
/// 设置时间
///
public DateTime ConfigurationTime { get; set; } = DateTime.Now;
}
///
/// 任务变更监听配置
///
public class TaskChangeMonitoringConfig
{
///
/// 监听的事件类型
///
public List MonitoredEventTypes { get; set; } = new();
///
/// 检查频率(分钟)
///
public int CheckIntervalMinutes { get; set; } = 5;
///
/// 自动处理阈值
/// 影响评分低于此阈值时自动处理
///
public int AutoProcessThreshold { get; set; } = 30;
///
/// 是否启用实时通知
///
public bool EnableRealTimeNotification { get; set; } = true;
///
/// 批量处理大小
///
public int BatchProcessingSize { get; set; } = 10;
}
///
/// 任务变更事件查询输入
///
public class TaskChangeEventQueryInput
{
///
/// 整合记录ID
///
public long? IntegrationRecordId { get; set; }
///
/// 根版本ID
///
public long? RootIntegrationRecordId { get; set; }
///
/// 任务ID列表
///
public List TaskIds { get; set; } = new();
///
/// 事件类型过滤
///
public List EventTypeFilter { get; set; } = new();
///
/// 处理状态过滤
///
public List ProcessingStatusFilter { get; set; } = new();
///
/// 开始时间
///
public DateTime? StartTime { get; set; }
///
/// 结束时间
///
public DateTime? EndTime { get; set; }
///
/// 触发用户过滤
///
public List TriggeredByUserFilter { get; set; } = new();
///
/// 事件优先级过滤
///
public int? MinPriority { get; set; }
///
/// 最小影响评分
///
public int? MinImpactScore { get; set; }
///
/// 是否包含测试事件
///
public bool IncludeTestEvents { get; set; } = false;
///
/// 页码
///
public int PageIndex { get; set; } = 1;
///
/// 页大小
///
public int PageSize { get; set; } = 20;
///
/// 排序字段
///
public string SortBy { get; set; } = "EventTime";
///
/// 排序方向
///
public string SortDirection { get; set; } = "Desc";
}
///
/// 任务变更事件信息
///
public class TaskChangeEventInfo
{
///
/// 事件ID
///
public long EventId { get; set; }
///
/// 任务ID
///
public long TaskId { get; set; }
///
/// 任务代码
///
public string TaskCode { get; set; } = string.Empty;
///
/// 事件类型
///
public string EventType { get; set; } = string.Empty;
///
/// 变更字段
///
public string ChangedFields { get; set; } = string.Empty;
///
/// 事件时间
///
public DateTime EventTime { get; set; }
///
/// 触发用户
///
public string TriggeredByUserName { get; set; } = string.Empty;
///
/// 事件优先级
///
public int EventPriority { get; set; }
///
/// 影响评估评分
///
public int ImpactAssessmentScore { get; set; }
///
/// 处理状态
///
public string ProcessingStatus { get; set; } = string.Empty;
///
/// 处理结果摘要
///
public string ProcessingResultSummary { get; set; } = string.Empty;
///
/// 是否触发了重新分配
///
public bool TriggeredReallocation { get; set; }
///
/// 创建的新版本ID
///
public long? CreatedNewVersionId { get; set; }
///
/// 通知状态
///
public string NotificationStatus { get; set; } = string.Empty;
///
/// 事件标签
///
public string EventTags { get; set; } = string.Empty;
///
/// 错误信息
///
public string ErrorMessage { get; set; } = string.Empty;
}
///
/// 快照创建结果
///
public class SnapshotCreationResult
{
///
/// 创建是否成功
///
public bool IsSuccess { get; set; }
///
/// 成功消息
///
public string SuccessMessage { get; set; } = string.Empty;
///
/// 错误消息
///
public string ErrorMessage { get; set; } = string.Empty;
///
/// 整合记录ID
///
public long IntegrationRecordId { get; set; }
///
/// 快照创建时间
///
public DateTime SnapshotTime { get; set; } = DateTime.Now;
///
/// 快照版本号
///
public int SnapshotVersion { get; set; }
///
/// 快照数据大小(字节)
///
public long SnapshotDataSizeBytes { get; set; }
///
/// 包含的数据类型
///
public List IncludedDataTypes { get; set; } = new();
///
/// 快照统计信息
///
public SnapshotStatistics Statistics { get; set; } = new();
///
/// 创建耗时(毫秒)
///
public long CreationElapsedMilliseconds { get; set; }
///
/// 快照ID
/// 快照的唯一标识符
///
public string SnapshotId { get; set; } = Guid.NewGuid().ToString();
///
/// 创建时间
/// 快照创建的具体时间
///
public DateTime CreationTime { get; set; } = DateTime.Now;
}
///
/// 快照统计信息
///
public class SnapshotStatistics
{
///
/// 任务分配条数
///
public int TaskAssignmentCount { get; set; }
///
/// 人员工作负载条数
///
public int PersonnelWorkloadCount { get; set; }
///
/// 设备利用率条数
///
public int EquipmentUtilizationCount { get; set; }
///
/// 配置项数量
///
public int ConfigurationItemCount { get; set; }
///
/// 业务指标数量
///
public int BusinessMetricCount { get; set; }
///
/// 数据压缩率
///
public decimal CompressionRatio { get; set; }
}
}