2548 lines
59 KiB
C#
2548 lines
59 KiB
C#
using OrpaonVision.Core.Results;
|
||
using OrpaonVision.Core.Common;
|
||
|
||
namespace OrpaonVision.Core.ManualOverride;
|
||
|
||
/// <summary>
|
||
/// 人工复位放行服务接口。
|
||
/// </summary>
|
||
public interface IManualOverrideService
|
||
{
|
||
/// <summary>
|
||
/// 获取可复位放行的会话列表。
|
||
/// </summary>
|
||
/// <param name="startTime">开始时间。</param>
|
||
/// <param name="endTime">结束时间。</param>
|
||
/// <param name="productTypeCode">产品类型编码(可选)。</param>
|
||
/// <param name="overrideStatus">复位状态(可选)。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>可复位放行的会话列表。</returns>
|
||
Task<Result<IReadOnlyList<OverrideableSession>>> GetOverrideableSessionsAsync(DateTime startTime, DateTime endTime, string? productTypeCode = null, OverrideStatus? overrideStatus = null, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 获取会话复位放行权限。
|
||
/// </summary>
|
||
/// <param name="sessionId">会话ID。</param>
|
||
/// <param name="operatorId">操作员ID。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位放行权限。</returns>
|
||
Task<Result<OverridePermission>> GetOverridePermissionAsync(Guid sessionId, string operatorId, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 验证复位放行条件。
|
||
/// </summary>
|
||
/// <param name="sessionId">会话ID。</param>
|
||
/// <param name="overrideRequest">复位请求。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>验证结果。</returns>
|
||
Task<Result<OverrideValidationResult>> ValidateOverrideConditionsAsync(Guid sessionId, ManualOverrideRequest overrideRequest, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 执行人工复位放行。
|
||
/// </summary>
|
||
/// <param name="overrideRequest">复位请求。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位结果。</returns>
|
||
Task<Result<ManualOverrideResult>> ExecuteManualOverrideAsync(ManualOverrideRequest overrideRequest, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 批量执行人工复位放行。
|
||
/// </summary>
|
||
/// <param name="overrideRequests">批量复位请求。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>批量复位结果。</returns>
|
||
Task<Result<BatchManualOverrideResult>> ExecuteBatchManualOverrideAsync(IReadOnlyList<ManualOverrideRequest> overrideRequests, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 获取复位放行历史记录。
|
||
/// </summary>
|
||
/// <param name="startTime">开始时间。</param>
|
||
/// <param name="endTime">结束时间。</param>
|
||
/// <param name="operatorId">操作员ID(可选)。</param>
|
||
/// <param name="overrideResult">复位结果(可选)。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位放行历史记录。</returns>
|
||
Task<Result<IReadOnlyList<ManualOverrideHistory>>> GetOverrideHistoryAsync(DateTime startTime, DateTime endTime, string? operatorId = null, OverrideResult? overrideResult = null, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 获取复位放行详细信息。
|
||
/// </summary>
|
||
/// <param name="overrideId">复位ID。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位放行详细信息。</returns>
|
||
Task<Result<ManualOverrideDetail>> GetOverrideDetailAsync(Guid overrideId, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 撤销人工复位放行。
|
||
/// </summary>
|
||
/// <param name="overrideId">复位ID。</param>
|
||
/// <param name="revokeReason">撤销原因。</param>
|
||
/// <param name="operatorId">操作员ID。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>撤销结果。</returns>
|
||
Task<Result<OverrideRevokeResult>> RevokeManualOverrideAsync(Guid overrideId, string revokeReason, string operatorId, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 获取复位放行统计信息。
|
||
/// </summary>
|
||
/// <param name="startTime">开始时间。</param>
|
||
/// <param name="endTime">结束时间。</param>
|
||
/// <param name="productTypeCode">产品类型编码(可选)。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位放行统计信息。</returns>
|
||
Task<Result<ManualOverrideStatistics>> GetOverrideStatisticsAsync(DateTime startTime, DateTime endTime, string? productTypeCode = null, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 获取复位放行审计日志。
|
||
/// </summary>
|
||
/// <param name="sessionId">会话ID(可选)。</param>
|
||
/// <param name="overrideId">复位ID(可选)。</param>
|
||
/// <param name="startTime">开始时间(可选)。</param>
|
||
/// <param name="endTime">结束时间(可选)。</param>
|
||
/// <param name="auditLevel">审计级别(可选)。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位放行审计日志。</returns>
|
||
Task<Result<IReadOnlyList<OverrideAuditLog>>> GetOverrideAuditLogsAsync(Guid? sessionId = null, Guid? overrideId = null, DateTime? startTime = null, DateTime? endTime = null, AuditLevel? auditLevel = null, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 生成复位放行报告。
|
||
/// </summary>
|
||
/// <param name="reportRequest">报告请求。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位放行报告。</returns>
|
||
Task<Result<ManualOverrideReport>> GenerateOverrideReportAsync(OverrideReportRequest reportRequest, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 检查复位放行合规性。
|
||
/// </summary>
|
||
/// <param name="sessionId">会话ID。</param>
|
||
/// <param name="overrideRequest">复位请求。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>合规性检查结果。</returns>
|
||
Task<Result<OverrideComplianceCheck>> CheckOverrideComplianceAsync(Guid sessionId, ManualOverrideRequest overrideRequest, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 获取复位放行模板。
|
||
/// </summary>
|
||
/// <param name="templateType">模板类型。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>复位放行模板。</returns>
|
||
Task<Result<OverrideTemplate>> GetOverrideTemplateAsync(OverrideTemplateType templateType, CancellationToken cancellationToken = default);
|
||
|
||
/// <summary>
|
||
/// 保存复位放行模板。
|
||
/// </summary>
|
||
/// <param name="template">复位放行模板。</param>
|
||
/// <param name="cancellationToken">取消令牌。</param>
|
||
/// <returns>保存结果。</returns>
|
||
Task<Result<OverrideTemplateSaveResult>> SaveOverrideTemplateAsync(OverrideTemplate template, CancellationToken cancellationToken = default);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 可复位放行的会话。
|
||
/// </summary>
|
||
public sealed class OverrideableSession
|
||
{
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 产品序列号。
|
||
/// </summary>
|
||
public string ProductSerialNumber { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 产品类型编码。
|
||
/// </summary>
|
||
public string ProductTypeCode { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 会话状态。
|
||
/// </summary>
|
||
public SessionStatus SessionStatus { get; init; }
|
||
|
||
/// <summary>
|
||
/// 最终判定结果。
|
||
/// </summary>
|
||
public FinalJudgmentResult FinalJudgmentResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话开始时间。
|
||
/// </summary>
|
||
public DateTime SessionStartTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话结束时间。
|
||
/// </summary>
|
||
public DateTime? SessionEndTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位状态。
|
||
/// </summary>
|
||
public OverrideStatus OverrideStatus { get; init; }
|
||
|
||
/// <summary>
|
||
/// 可复位原因。
|
||
/// </summary>
|
||
public IReadOnlyList<OverrideReason> OverrideReasons { get; init; } = Array.Empty<OverrideReason>();
|
||
|
||
/// <summary>
|
||
/// 复位优先级。
|
||
/// </summary>
|
||
public OverridePriority OverridePriority { get; init; }
|
||
|
||
/// <summary>
|
||
/// 需要权限级别。
|
||
/// </summary>
|
||
public OperatorPermissionLevel RequiredPermissionLevel { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话持续时间(分钟)。
|
||
/// </summary>
|
||
public double SessionDurationMinutes => SessionEndTimeUtc.HasValue ? (SessionEndTimeUtc.Value - SessionStartTimeUtc).TotalMinutes : (DateTime.UtcNow - SessionStartTimeUtc).TotalMinutes;
|
||
|
||
/// <summary>
|
||
/// 操作员ID。
|
||
/// </summary>
|
||
public string? OperatorId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 操作员姓名。
|
||
/// </summary>
|
||
public string? OperatorName { get; init; }
|
||
|
||
/// <summary>
|
||
/// 工位ID。
|
||
/// </summary>
|
||
public string? StationId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 工位名称。
|
||
/// </summary>
|
||
public string? StationName { get; init; }
|
||
|
||
/// <summary>
|
||
/// 总层数。
|
||
/// </summary>
|
||
public int TotalLayerCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 已完成层数。
|
||
/// </summary>
|
||
public int CompletedLayerCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// NG原因列表。
|
||
/// </summary>
|
||
public IReadOnlyList<string> NGReasons { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位状态枚举。
|
||
/// </summary>
|
||
public enum OverrideStatus
|
||
{
|
||
/// <summary>
|
||
/// 未复位。
|
||
/// </summary>
|
||
NotOverridden = 0,
|
||
|
||
/// <summary>
|
||
/// 待复位。
|
||
/// </summary>
|
||
Pending = 1,
|
||
|
||
/// <summary>
|
||
/// 已复位。
|
||
/// </summary>
|
||
Overridden = 2,
|
||
|
||
/// <summary>
|
||
/// 复位被拒绝。
|
||
/// </summary>
|
||
Rejected = 3,
|
||
|
||
/// <summary>
|
||
/// 复位已撤销。
|
||
/// </summary>
|
||
Revoked = 4,
|
||
|
||
/// <summary>
|
||
/// 复位已过期。
|
||
/// </summary>
|
||
Expired = 5
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位原因。
|
||
/// </summary>
|
||
public sealed class OverrideReason
|
||
{
|
||
/// <summary>
|
||
/// 原因ID。
|
||
/// </summary>
|
||
public Guid ReasonId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 原因类型。
|
||
/// </summary>
|
||
public OverrideReasonType ReasonType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 原因描述。
|
||
/// </summary>
|
||
public string ReasonDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 原因严重程度。
|
||
/// </summary>
|
||
public OverrideSeverity ReasonSeverity { get; init; }
|
||
|
||
/// <summary>
|
||
/// 建议措施。
|
||
/// </summary>
|
||
public string RecommendedAction { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位原因类型枚举。
|
||
/// </summary>
|
||
public enum OverrideReasonType
|
||
{
|
||
/// <summary>
|
||
/// 设备故障。
|
||
/// </summary>
|
||
EquipmentFailure = 0,
|
||
|
||
/// <summary>
|
||
/// 工艺异常。
|
||
/// </summary>
|
||
ProcessAnomaly = 1,
|
||
|
||
/// <summary>
|
||
/// 材料问题。
|
||
/// </summary>
|
||
MaterialIssue = 2,
|
||
|
||
/// <summary>
|
||
/// 人员操作。
|
||
/// </summary>
|
||
HumanError = 3,
|
||
|
||
/// <summary>
|
||
/// 环境因素。
|
||
/// </summary>
|
||
EnvironmentalFactor = 4,
|
||
|
||
/// <summary>
|
||
/// 系统错误。
|
||
/// </summary>
|
||
SystemError = 5,
|
||
|
||
/// <summary>
|
||
/// 质量标准。
|
||
/// </summary>
|
||
QualityStandard = 6,
|
||
|
||
/// <summary>
|
||
/// 其他原因。
|
||
/// </summary>
|
||
Other = 7
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位严重程度枚举。
|
||
/// </summary>
|
||
public enum OverrideSeverity
|
||
{
|
||
/// <summary>
|
||
/// 低。
|
||
/// </summary>
|
||
Low = 0,
|
||
|
||
/// <summary>
|
||
/// 中。
|
||
/// </summary>
|
||
Medium = 1,
|
||
|
||
/// <summary>
|
||
/// 高。
|
||
/// </summary>
|
||
High = 2,
|
||
|
||
/// <summary>
|
||
/// 严重。
|
||
/// </summary>
|
||
Critical = 3
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位优先级枚举。
|
||
/// </summary>
|
||
public enum OverridePriority
|
||
{
|
||
/// <summary>
|
||
/// 低。
|
||
/// </summary>
|
||
Low = 0,
|
||
|
||
/// <summary>
|
||
/// 中。
|
||
/// </summary>
|
||
Medium = 1,
|
||
|
||
/// <summary>
|
||
/// 高。
|
||
/// </summary>
|
||
High = 2,
|
||
|
||
/// <summary>
|
||
/// 紧急。
|
||
/// </summary>
|
||
Urgent = 3
|
||
}
|
||
|
||
/// <summary>
|
||
/// 操作员权限级别枚举。
|
||
/// </summary>
|
||
public enum OperatorPermissionLevel
|
||
{
|
||
/// <summary>
|
||
/// 操作员。
|
||
/// </summary>
|
||
Operator = 0,
|
||
|
||
/// <summary>
|
||
/// 技术员。
|
||
/// </summary>
|
||
Technician = 1,
|
||
|
||
/// <summary>
|
||
/// 班组长。
|
||
/// </summary>
|
||
TeamLeader = 2,
|
||
|
||
/// <summary>
|
||
/// 主管。
|
||
/// </summary>
|
||
Supervisor = 3,
|
||
|
||
/// <summary>
|
||
/// 经理。
|
||
/// </summary>
|
||
Manager = 4,
|
||
|
||
/// <summary>
|
||
/// 管理员。
|
||
/// </summary>
|
||
Administrator = 5
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位权限。
|
||
/// </summary>
|
||
public sealed class OverridePermission
|
||
{
|
||
/// <summary>
|
||
/// 权限ID。
|
||
/// </summary>
|
||
public Guid PermissionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 操作员ID。
|
||
/// </summary>
|
||
public string OperatorId { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 操作员姓名。
|
||
/// </summary>
|
||
public string OperatorName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 操作员权限级别。
|
||
/// </summary>
|
||
public OperatorPermissionLevel OperatorPermissionLevel { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否有权限。
|
||
/// </summary>
|
||
public bool HasPermission { get; init; }
|
||
|
||
/// <summary>
|
||
/// 权限原因。
|
||
/// </summary>
|
||
public string PermissionReason { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 权限限制。
|
||
/// </summary>
|
||
public IReadOnlyList<string> PermissionRestrictions { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 权限有效期。
|
||
/// </summary>
|
||
public DateTime? PermissionExpiryUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 需要二次确认。
|
||
/// </summary>
|
||
public bool RequireSecondaryConfirmation { get; init; }
|
||
|
||
/// <summary>
|
||
/// 需要审批流程。
|
||
/// </summary>
|
||
public bool RequireApprovalProcess { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审批人列表。
|
||
/// </summary>
|
||
public IReadOnlyList<string> RequiredApprovers { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 人工复位请求。
|
||
/// </summary>
|
||
public sealed class ManualOverrideRequest
|
||
{
|
||
/// <summary>
|
||
/// 请求ID。
|
||
/// </summary>
|
||
public Guid RequestId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 操作员ID。
|
||
/// </summary>
|
||
public string OperatorId { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 操作员姓名。
|
||
/// </summary>
|
||
public string OperatorName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 复位类型。
|
||
/// </summary>
|
||
public OverrideType OverrideType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位原因。
|
||
/// </summary>
|
||
public string OverrideReason { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 复位描述。
|
||
/// </summary>
|
||
public string OverrideDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 复位优先级。
|
||
/// </summary>
|
||
public OverridePriority OverridePriority { get; init; }
|
||
|
||
/// <summary>
|
||
/// 目标状态。
|
||
/// </summary>
|
||
public SessionStatus TargetStatus { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位参数。
|
||
/// </summary>
|
||
public Dictionary<string, object> OverrideParameters { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 附件列表。
|
||
/// </summary>
|
||
public IReadOnlyList<OverrideAttachment> Attachments { get; init; } = Array.Empty<OverrideAttachment>();
|
||
|
||
/// <summary>
|
||
/// 请求时间。
|
||
/// </summary>
|
||
public DateTime RequestTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 期望执行时间。
|
||
/// </summary>
|
||
public DateTime? DesiredExecutionTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否紧急。
|
||
/// </summary>
|
||
public bool IsUrgent { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否需要审批。
|
||
/// </summary>
|
||
public bool RequireApproval { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审批人列表。
|
||
/// </summary>
|
||
public IReadOnlyList<string> Approvers { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位类型枚举。
|
||
/// </summary>
|
||
public enum OverrideType
|
||
{
|
||
/// <summary>
|
||
/// 复位放行。
|
||
/// </summary>
|
||
ResetAndRelease = 0,
|
||
|
||
/// <summary>
|
||
/// 强制通过。
|
||
/// </summary>
|
||
ForcePass = 1,
|
||
|
||
/// <summary>
|
||
/// 跳过检测。
|
||
/// </summary>
|
||
SkipInspection = 2,
|
||
|
||
/// <summary>
|
||
/// 重新处理。
|
||
/// </summary>
|
||
Reprocess = 3,
|
||
|
||
/// <summary>
|
||
/// 人工判定。
|
||
/// </summary>
|
||
ManualJudgment = 4,
|
||
|
||
/// <summary>
|
||
/// 临时放行。
|
||
/// </summary>
|
||
TemporaryRelease = 5,
|
||
|
||
/// <summary>
|
||
/// 条件放行。
|
||
/// </summary>
|
||
ConditionalRelease = 6,
|
||
|
||
/// <summary>
|
||
/// 特殊处理。
|
||
/// </summary>
|
||
SpecialHandling = 7
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位附件。
|
||
/// </summary>
|
||
public sealed class OverrideAttachment
|
||
{
|
||
/// <summary>
|
||
/// 附件ID。
|
||
/// </summary>
|
||
public Guid AttachmentId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 附件名称。
|
||
/// </summary>
|
||
public string AttachmentName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 附件类型。
|
||
/// </summary>
|
||
public string AttachmentType { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 文件路径。
|
||
/// </summary>
|
||
public string FilePath { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 文件大小(字节)。
|
||
/// </summary>
|
||
public long FileSizeBytes { get; init; }
|
||
|
||
/// <summary>
|
||
/// 上传时间。
|
||
/// </summary>
|
||
public DateTime UploadTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 上传者。
|
||
/// </summary>
|
||
public string Uploader { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 附件描述。
|
||
/// </summary>
|
||
public string AttachmentDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位验证结果。
|
||
/// </summary>
|
||
public sealed class OverrideValidationResult
|
||
{
|
||
/// <summary>
|
||
/// 验证ID。
|
||
/// </summary>
|
||
public Guid ValidationId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 请求ID。
|
||
/// </summary>
|
||
public Guid RequestId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 是否通过验证。
|
||
/// </summary>
|
||
public bool IsValid { get; init; }
|
||
|
||
/// <summary>
|
||
/// 验证结果。
|
||
/// </summary>
|
||
public ValidationResult ValidationResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 验证消息。
|
||
/// </summary>
|
||
public string ValidationMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 验证详情。
|
||
/// </summary>
|
||
public IReadOnlyList<ValidationDetail> ValidationDetails { get; init; } = Array.Empty<ValidationDetail>();
|
||
|
||
/// <summary>
|
||
/// 验证警告。
|
||
/// </summary>
|
||
public IReadOnlyList<string> ValidationWarnings { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 验证错误。
|
||
/// </summary>
|
||
public IReadOnlyList<string> ValidationErrors { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 验证时间。
|
||
/// </summary>
|
||
public DateTime ValidationTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 验证耗时(毫秒)。
|
||
/// </summary>
|
||
public long ValidationElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 验证结果枚举。
|
||
/// </summary>
|
||
public enum ValidationResult
|
||
{
|
||
/// <summary>
|
||
/// 通过。
|
||
/// </summary>
|
||
Pass = 0,
|
||
|
||
/// <summary>
|
||
/// 警告。
|
||
/// </summary>
|
||
Warning = 1,
|
||
|
||
/// <summary>
|
||
/// 失败。
|
||
/// </summary>
|
||
Fail = 2,
|
||
|
||
/// <summary>
|
||
/// 需要审批。
|
||
/// </summary>
|
||
RequireApproval = 3,
|
||
|
||
/// <summary>
|
||
/// 需要更多信息。
|
||
/// </summary>
|
||
RequireMoreInfo = 4
|
||
}
|
||
|
||
/// <summary>
|
||
/// 验证详情。
|
||
/// </summary>
|
||
public sealed class ValidationDetail
|
||
{
|
||
/// <summary>
|
||
/// 详情ID。
|
||
/// </summary>
|
||
public Guid DetailId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 验证项目。
|
||
/// </summary>
|
||
public string ValidationItem { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 验证结果。
|
||
/// </summary>
|
||
public ValidationResult ValidationResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 验证消息。
|
||
/// </summary>
|
||
public string ValidationMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 验证值。
|
||
/// </summary>
|
||
public object? ValidationValue { get; init; }
|
||
|
||
/// <summary>
|
||
/// 期望值。
|
||
/// </summary>
|
||
public object? ExpectedValue { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 人工复位结果。
|
||
/// </summary>
|
||
public sealed class ManualOverrideResult
|
||
{
|
||
/// <summary>
|
||
/// 复位ID。
|
||
/// </summary>
|
||
public Guid OverrideId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 请求ID。
|
||
/// </summary>
|
||
public Guid RequestId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位结果。
|
||
/// </summary>
|
||
public OverrideResult OverrideResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位状态。
|
||
/// </summary>
|
||
public OverrideStatus OverrideStatus { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位消息。
|
||
/// </summary>
|
||
public string OverrideMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 执行时间。
|
||
/// </summary>
|
||
public DateTime ExecutionTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 执行耗时(毫秒)。
|
||
/// </summary>
|
||
public long ExecutionElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 执行者。
|
||
/// </summary>
|
||
public string Executor { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 执行详情。
|
||
/// </summary>
|
||
public IReadOnlyList<ExecutionDetail> ExecutionDetails { get; init; } = Array.Empty<ExecutionDetail>();
|
||
|
||
/// <summary>
|
||
/// 影响的会话状态。
|
||
/// </summary>
|
||
public SessionStatus AffectedSessionStatus { get; init; }
|
||
|
||
/// <summary>
|
||
/// 后续操作。
|
||
/// </summary>
|
||
public IReadOnlyList<string> FollowUpActions { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位结果枚举。
|
||
/// </summary>
|
||
public enum OverrideResult
|
||
{
|
||
/// <summary>
|
||
/// 成功。
|
||
/// </summary>
|
||
Success = 0,
|
||
|
||
/// <summary>
|
||
/// 失败。
|
||
/// </summary>
|
||
Failed = 1,
|
||
|
||
/// <summary>
|
||
/// 部分成功。
|
||
/// </summary>
|
||
PartialSuccess = 2,
|
||
|
||
/// <summary>
|
||
/// 被拒绝。
|
||
/// </summary>
|
||
Rejected = 3,
|
||
|
||
/// <summary>
|
||
/// 超时。
|
||
/// </summary>
|
||
Timeout = 4,
|
||
|
||
/// <summary>
|
||
/// 取消。
|
||
/// </summary>
|
||
Cancelled = 5
|
||
}
|
||
|
||
/// <summary>
|
||
/// 执行详情。
|
||
/// </summary>
|
||
public sealed class ExecutionDetail
|
||
{
|
||
/// <summary>
|
||
/// 详情ID。
|
||
/// </summary>
|
||
public Guid DetailId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 执行步骤。
|
||
/// </summary>
|
||
public string ExecutionStep { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 执行结果。
|
||
/// </summary>
|
||
public bool ExecutionResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 执行消息。
|
||
/// </summary>
|
||
public string ExecutionMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 执行时间。
|
||
/// </summary>
|
||
public DateTime ExecutionTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 执行耗时(毫秒)。
|
||
/// </summary>
|
||
public long ExecutionElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 批量人工复位结果。
|
||
/// </summary>
|
||
public sealed class BatchManualOverrideResult
|
||
{
|
||
/// <summary>
|
||
/// 批量操作ID。
|
||
/// </summary>
|
||
public Guid BatchId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 总请求数。
|
||
/// </summary>
|
||
public int TotalRequestCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 成功数量。
|
||
/// </summary>
|
||
public int SuccessCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 失败数量。
|
||
/// </summary>
|
||
public int FailureCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 成功率。
|
||
/// </summary>
|
||
public double SuccessRate => TotalRequestCount > 0 ? (double)SuccessCount / TotalRequestCount * 100 : 0.0;
|
||
|
||
/// <summary>
|
||
/// 批量结果。
|
||
/// </summary>
|
||
public IReadOnlyList<ManualOverrideResult> Results { get; init; } = Array.Empty<ManualOverrideResult>();
|
||
|
||
/// <summary>
|
||
/// 批量消息。
|
||
/// </summary>
|
||
public string BatchMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 批量执行时间。
|
||
/// </summary>
|
||
public DateTime BatchExecutionTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 批量执行耗时(毫秒)。
|
||
/// </summary>
|
||
public long BatchExecutionElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 人工复位历史记录。
|
||
/// </summary>
|
||
public sealed class ManualOverrideHistory
|
||
{
|
||
/// <summary>
|
||
/// 历史记录ID。
|
||
/// </summary>
|
||
public Guid HistoryId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位ID。
|
||
/// </summary>
|
||
public Guid OverrideId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 请求ID。
|
||
/// </summary>
|
||
public Guid RequestId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位类型。
|
||
/// </summary>
|
||
public OverrideType OverrideType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位结果。
|
||
/// </summary>
|
||
public OverrideResult OverrideResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位状态。
|
||
/// </summary>
|
||
public OverrideStatus OverrideStatus { get; init; }
|
||
|
||
/// <summary>
|
||
/// 操作员ID。
|
||
/// </summary>
|
||
public string OperatorId { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 操作员姓名。
|
||
/// </summary>
|
||
public string OperatorName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 复位原因。
|
||
/// </summary>
|
||
public string OverrideReason { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 复位时间。
|
||
/// </summary>
|
||
public DateTime OverrideTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位耗时(毫秒)。
|
||
/// </summary>
|
||
public long OverrideElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位消息。
|
||
/// </summary>
|
||
public string OverrideMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 人工复位详细信息。
|
||
/// </summary>
|
||
public sealed class ManualOverrideDetail
|
||
{
|
||
/// <summary>
|
||
/// 复位ID。
|
||
/// </summary>
|
||
public Guid OverrideId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位结果。
|
||
/// </summary>
|
||
public ManualOverrideResult OverrideResult { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 复位请求。
|
||
/// </summary>
|
||
public ManualOverrideRequest OverrideRequest { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 验证结果。
|
||
/// </summary>
|
||
public OverrideValidationResult? ValidationResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 权限信息。
|
||
/// </summary>
|
||
public OverridePermission? Permission { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审批信息。
|
||
/// </summary>
|
||
public IReadOnlyList<ApprovalInfo> ApprovalInfos { get; init; } = Array.Empty<ApprovalInfo>();
|
||
|
||
/// <summary>
|
||
/// 影响分析。
|
||
/// </summary>
|
||
public OverrideImpactAnalysis ImpactAnalysis { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 合规性检查。
|
||
/// </summary>
|
||
public OverrideComplianceCheck? ComplianceCheck { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 审批信息。
|
||
/// </summary>
|
||
public sealed class ApprovalInfo
|
||
{
|
||
/// <summary>
|
||
/// 审批ID。
|
||
/// </summary>
|
||
public Guid ApprovalId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审批人ID。
|
||
/// </summary>
|
||
public string ApproverId { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 审批人姓名。
|
||
/// </summary>
|
||
public string ApproverName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 审批结果。
|
||
/// </summary>
|
||
public ApprovalResult ApprovalResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审批意见。
|
||
/// </summary>
|
||
public string ApprovalComment { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 审批时间。
|
||
/// </summary>
|
||
public DateTime ApprovalTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 审批结果枚举。
|
||
/// </summary>
|
||
public enum ApprovalResult
|
||
{
|
||
/// <summary>
|
||
/// 批准。
|
||
/// </summary>
|
||
Approved = 0,
|
||
|
||
/// <summary>
|
||
/// 拒绝。
|
||
/// </summary>
|
||
Rejected = 1,
|
||
|
||
/// <summary>
|
||
/// 待审批。
|
||
/// </summary>
|
||
Pending = 2,
|
||
|
||
/// <summary>
|
||
/// 撤回。
|
||
/// </summary>
|
||
Withdrawn = 3
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位影响分析。
|
||
/// </summary>
|
||
public sealed class OverrideImpactAnalysis
|
||
{
|
||
/// <summary>
|
||
/// 分析ID。
|
||
/// </summary>
|
||
public Guid AnalysisId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 影响等级。
|
||
/// </summary>
|
||
public ImpactLevel ImpactLevel { get; init; }
|
||
|
||
/// <summary>
|
||
/// 影响描述。
|
||
/// </summary>
|
||
public string ImpactDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 影响的会话数量。
|
||
/// </summary>
|
||
public int AffectedSessionCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 影响的层数量。
|
||
/// </summary>
|
||
public int AffectedLayerCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 影响的检测数量。
|
||
/// </summary>
|
||
public int AffectedDetectionCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 风险评估。
|
||
/// </summary>
|
||
public RiskAssessment RiskAssessment { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 建议措施。
|
||
/// </summary>
|
||
public IReadOnlyList<string> RecommendedActions { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 影响等级枚举。
|
||
/// </summary>
|
||
public enum ImpactLevel
|
||
{
|
||
/// <summary>
|
||
/// 无影响。
|
||
/// </summary>
|
||
None = 0,
|
||
|
||
/// <summary>
|
||
/// 低影响。
|
||
/// </summary>
|
||
Low = 1,
|
||
|
||
/// <summary>
|
||
/// 中等影响。
|
||
/// </summary>
|
||
Medium = 2,
|
||
|
||
/// <summary>
|
||
/// 高影响。
|
||
/// </summary>
|
||
High = 3,
|
||
|
||
/// <summary>
|
||
/// 严重影响。
|
||
/// </summary>
|
||
Critical = 4
|
||
}
|
||
|
||
/// <summary>
|
||
/// 风险评估。
|
||
/// </summary>
|
||
public sealed class RiskAssessment
|
||
{
|
||
/// <summary>
|
||
/// 风险等级。
|
||
/// </summary>
|
||
public RiskLevel RiskLevel { get; init; }
|
||
|
||
/// <summary>
|
||
/// 风险描述。
|
||
/// </summary>
|
||
public string RiskDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 风险概率。
|
||
/// </summary>
|
||
public double RiskProbability { get; init; }
|
||
|
||
/// <summary>
|
||
/// 风险影响。
|
||
/// </summary>
|
||
public double RiskImpact { get; init; }
|
||
|
||
/// <summary>
|
||
/// 风险值。
|
||
/// </summary>
|
||
public double RiskValue => RiskProbability * RiskImpact;
|
||
|
||
/// <summary>
|
||
/// 缓解措施。
|
||
/// </summary>
|
||
public IReadOnlyList<string> MitigationMeasures { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 风险等级枚举。
|
||
/// </summary>
|
||
public enum RiskLevel
|
||
{
|
||
/// <summary>
|
||
/// 无风险。
|
||
/// </summary>
|
||
None = 0,
|
||
|
||
/// <summary>
|
||
/// 低风险。
|
||
/// </summary>
|
||
Low = 1,
|
||
|
||
/// <summary>
|
||
/// 中等风险。
|
||
/// </summary>
|
||
Medium = 2,
|
||
|
||
/// <summary>
|
||
/// 高风险。
|
||
/// </summary>
|
||
High = 3,
|
||
|
||
/// <summary>
|
||
/// 极高风险。
|
||
/// </summary>
|
||
Critical = 4
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位撤销结果。
|
||
/// </summary>
|
||
public sealed class OverrideRevokeResult
|
||
{
|
||
/// <summary>
|
||
/// 撤销ID。
|
||
/// </summary>
|
||
public Guid RevokeId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位ID。
|
||
/// </summary>
|
||
public Guid OverrideId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 撤销结果。
|
||
/// </summary>
|
||
public RevokeResult RevokeResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 撤销原因。
|
||
/// </summary>
|
||
public string RevokeReason { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 撤销时间。
|
||
/// </summary>
|
||
public DateTime RevokeTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 撤销者。
|
||
/// </summary>
|
||
public string Revoker { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 撤销消息。
|
||
/// </summary>
|
||
public string RevokeMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 撤销结果枚举。
|
||
/// </summary>
|
||
public enum RevokeResult
|
||
{
|
||
/// <summary>
|
||
/// 成功。
|
||
/// </summary>
|
||
Success = 0,
|
||
|
||
/// <summary>
|
||
/// 失败。
|
||
/// </summary>
|
||
Failed = 1,
|
||
|
||
/// <summary>
|
||
/// 已过期。
|
||
/// </summary>
|
||
Expired = 2,
|
||
|
||
/// <summary>
|
||
/// 无权限。
|
||
/// </summary>
|
||
NoPermission = 3,
|
||
|
||
/// <summary>
|
||
/// 已撤销。
|
||
/// </summary>
|
||
AlreadyRevoked = 4
|
||
}
|
||
|
||
/// <summary>
|
||
/// 人工复位统计信息。
|
||
/// </summary>
|
||
public sealed class ManualOverrideStatistics
|
||
{
|
||
/// <summary>
|
||
/// 统计时间范围。
|
||
/// </summary>
|
||
public TimeRange TimeRange { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 产品类型编码。
|
||
/// </summary>
|
||
public string ProductTypeCode { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 总复位次数。
|
||
/// </summary>
|
||
public int TotalOverrideCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 成功复位次数。
|
||
/// </summary>
|
||
public int SuccessfulOverrideCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 失败复位次数。
|
||
/// </summary>
|
||
public int FailedOverrideCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 成功率。
|
||
/// </summary>
|
||
public double SuccessRate => TotalOverrideCount > 0 ? (double)SuccessfulOverrideCount / TotalOverrideCount * 100 : 0.0;
|
||
|
||
/// <summary>
|
||
/// 按复位类型分组的统计。
|
||
/// </summary>
|
||
public Dictionary<OverrideType, int> OverridesByType { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 按操作员分组的统计。
|
||
/// </summary>
|
||
public Dictionary<string, OperatorOverrideStatistics> OverridesByOperator { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 按日期分组的统计。
|
||
/// </summary>
|
||
public Dictionary<DateTime, DailyOverrideStatistics> ByDate { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 平均复位耗时(毫秒)。
|
||
/// </summary>
|
||
public double AverageOverrideElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 最长复位耗时(毫秒)。
|
||
/// </summary>
|
||
public long MaxOverrideElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 最短复位耗时(毫秒)。
|
||
/// </summary>
|
||
public long MinOverrideElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 操作员复位统计。
|
||
/// </summary>
|
||
public sealed class OperatorOverrideStatistics
|
||
{
|
||
/// <summary>
|
||
/// 操作员ID。
|
||
/// </summary>
|
||
public string OperatorId { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 操作员姓名。
|
||
/// </summary>
|
||
public string OperatorName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 复位次数。
|
||
/// </summary>
|
||
public int OverrideCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 成功次数。
|
||
/// </summary>
|
||
public int SuccessCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 失败次数。
|
||
/// </summary>
|
||
public int FailureCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 成功率。
|
||
/// </summary>
|
||
public double SuccessRate => OverrideCount > 0 ? (double)SuccessCount / OverrideCount * 100 : 0.0;
|
||
|
||
/// <summary>
|
||
/// 平均耗时(毫秒)。
|
||
/// </summary>
|
||
public double AverageElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 每日复位统计。
|
||
/// </summary>
|
||
public sealed class DailyOverrideStatistics
|
||
{
|
||
/// <summary>
|
||
/// 日期。
|
||
/// </summary>
|
||
public DateTime Date { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位次数。
|
||
/// </summary>
|
||
public int OverrideCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 成功次数。
|
||
/// </summary>
|
||
public int SuccessCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 失败次数。
|
||
/// </summary>
|
||
public int FailureCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位审计日志。
|
||
/// </summary>
|
||
public sealed class OverrideAuditLog
|
||
{
|
||
/// <summary>
|
||
/// 日志ID。
|
||
/// </summary>
|
||
public Guid LogId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid? SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位ID。
|
||
/// </summary>
|
||
public Guid? OverrideId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审计级别。
|
||
/// </summary>
|
||
public AuditLevel AuditLevel { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审计类型。
|
||
/// </summary>
|
||
public AuditType AuditType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 审计消息。
|
||
/// </summary>
|
||
public string AuditMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 审计详情。
|
||
/// </summary>
|
||
public string AuditDetails { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 操作员ID。
|
||
/// </summary>
|
||
public string OperatorId { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 操作员姓名。
|
||
/// </summary>
|
||
public string OperatorName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 审计时间。
|
||
/// </summary>
|
||
public DateTime AuditTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 客户端IP。
|
||
/// </summary>
|
||
public string? ClientIp { get; init; }
|
||
|
||
/// <summary>
|
||
/// 用户代理。
|
||
/// </summary>
|
||
public string? UserAgent { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 审计级别枚举。
|
||
/// </summary>
|
||
public enum AuditLevel
|
||
{
|
||
/// <summary>
|
||
/// 信息。
|
||
/// </summary>
|
||
Info = 0,
|
||
|
||
/// <summary>
|
||
/// 警告。
|
||
/// </summary>
|
||
Warning = 1,
|
||
|
||
/// <summary>
|
||
/// 错误。
|
||
/// </summary>
|
||
Error = 2,
|
||
|
||
/// <summary>
|
||
/// 严重。
|
||
/// </summary>
|
||
Critical = 3,
|
||
|
||
/// <summary>
|
||
/// 调试。
|
||
/// </summary>
|
||
Debug = 4
|
||
}
|
||
|
||
/// <summary>
|
||
/// 审计类型枚举。
|
||
/// </summary>
|
||
public enum AuditType
|
||
{
|
||
/// <summary>
|
||
/// 请求创建。
|
||
/// </summary>
|
||
RequestCreated = 0,
|
||
|
||
/// <summary>
|
||
/// 权限检查。
|
||
/// </summary>
|
||
PermissionChecked = 1,
|
||
|
||
/// <summary>
|
||
/// 验证执行。
|
||
/// </summary>
|
||
ValidationExecuted = 2,
|
||
|
||
/// <summary>
|
||
/// 复位执行。
|
||
/// </summary>
|
||
OverrideExecuted = 3,
|
||
|
||
/// <summary>
|
||
/// 复位撤销。
|
||
/// </summary>
|
||
OverrideRevoked = 4,
|
||
|
||
/// <summary>
|
||
/// 审批操作。
|
||
/// </summary>
|
||
ApprovalAction = 5,
|
||
|
||
/// <summary>
|
||
/// 状态变更。
|
||
/// </summary>
|
||
StatusChanged = 6,
|
||
|
||
/// <summary>
|
||
/// 异常处理。
|
||
/// </summary>
|
||
ExceptionHandled = 7,
|
||
|
||
/// <summary>
|
||
/// 系统操作。
|
||
/// </summary>
|
||
SystemOperation = 8
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位放行报告。
|
||
/// </summary>
|
||
public sealed class ManualOverrideReport
|
||
{
|
||
/// <summary>
|
||
/// 报告ID。
|
||
/// </summary>
|
||
public Guid ReportId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 报告类型。
|
||
/// </summary>
|
||
public OverrideReportType ReportType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 报告标题。
|
||
/// </summary>
|
||
public string ReportTitle { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 报告时间范围。
|
||
/// </summary>
|
||
public TimeRange TimeRange { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 生成时间。
|
||
/// </summary>
|
||
public DateTime GeneratedAtUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 执行摘要。
|
||
/// </summary>
|
||
public ReportExecutiveSummary ExecutiveSummary { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 统计分析。
|
||
/// </summary>
|
||
public ManualOverrideStatistics Statistics { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 趋势分析。
|
||
/// </summary>
|
||
public OverrideTrendAnalysis TrendAnalysis { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 合规性分析。
|
||
/// </summary>
|
||
public OverrideComplianceAnalysis ComplianceAnalysis { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 风险分析。
|
||
/// </summary>
|
||
public OverrideRiskAnalysis RiskAnalysis { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 改进建议。
|
||
/// </summary>
|
||
public IReadOnlyList<OverrideImprovementSuggestion> ImprovementSuggestions { get; init; } = Array.Empty<OverrideImprovementSuggestion>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位报告类型枚举。
|
||
/// </summary>
|
||
public enum OverrideReportType
|
||
{
|
||
/// <summary>
|
||
/// 日报。
|
||
/// </summary>
|
||
Daily = 0,
|
||
|
||
/// <summary>
|
||
/// 周报。
|
||
/// </summary>
|
||
Weekly = 1,
|
||
|
||
/// <summary>
|
||
/// 月报。
|
||
/// </summary>
|
||
Monthly = 2,
|
||
|
||
/// <summary>
|
||
/// 季报。
|
||
/// </summary>
|
||
Quarterly = 3,
|
||
|
||
/// <summary>
|
||
/// 年报。
|
||
/// </summary>
|
||
Annual = 4,
|
||
|
||
/// <summary>
|
||
/// 自定义。
|
||
/// </summary>
|
||
Custom = 5
|
||
}
|
||
|
||
/// <summary>
|
||
/// 报告执行摘要。
|
||
/// </summary>
|
||
public sealed class ReportExecutiveSummary
|
||
{
|
||
/// <summary>
|
||
/// 总体评分。
|
||
/// </summary>
|
||
public double OverallScore { get; init; }
|
||
|
||
/// <summary>
|
||
/// 关键发现。
|
||
/// </summary>
|
||
public IReadOnlyList<string> KeyFindings { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 主要问题。
|
||
/// </summary>
|
||
public IReadOnlyList<string> MajorIssues { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 改进机会。
|
||
/// </summary>
|
||
public IReadOnlyList<string> ImprovementOpportunities { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 摘要描述。
|
||
/// </summary>
|
||
public string SummaryDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位趋势分析。
|
||
/// </summary>
|
||
public sealed class OverrideTrendAnalysis
|
||
{
|
||
/// <summary>
|
||
/// 趋势方向。
|
||
/// </summary>
|
||
public TrendDirection TrendDirection { get; init; }
|
||
|
||
/// <summary>
|
||
/// 变化率。
|
||
/// </summary>
|
||
public double ChangeRate { get; init; }
|
||
|
||
/// <summary>
|
||
/// 趋势描述。
|
||
/// </summary>
|
||
public string TrendDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 预测下期复位次数。
|
||
/// </summary>
|
||
public int PredictedNextOverrideCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 置信度。
|
||
/// </summary>
|
||
public double Confidence { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位合规性分析。
|
||
/// </summary>
|
||
public sealed class OverrideComplianceAnalysis
|
||
{
|
||
/// <summary>
|
||
/// 合规性评分。
|
||
/// </summary>
|
||
public double ComplianceScore { get; init; }
|
||
|
||
/// <summary>
|
||
/// 合规违规次数。
|
||
/// </summary>
|
||
public int ComplianceViolationCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 合规违规类型。
|
||
/// </summary>
|
||
public IReadOnlyList<ComplianceViolation> Violations { get; init; } = Array.Empty<ComplianceViolation>();
|
||
|
||
/// <summary>
|
||
/// 合规建议。
|
||
/// </summary>
|
||
public IReadOnlyList<string> ComplianceRecommendations { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 合规违规。
|
||
/// </summary>
|
||
public sealed class ComplianceViolation
|
||
{
|
||
/// <summary>
|
||
/// 违规ID。
|
||
/// </summary>
|
||
public Guid ViolationId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 违规类型。
|
||
/// </summary>
|
||
public string ViolationType { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 违规描述。
|
||
/// </summary>
|
||
public string ViolationDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 违规严重程度。
|
||
/// </summary>
|
||
public ViolationSeverity ViolationSeverity { get; init; }
|
||
|
||
/// <summary>
|
||
/// 违规时间。
|
||
/// </summary>
|
||
public DateTime ViolationTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 违规严重程度枚举。
|
||
/// </summary>
|
||
public enum ViolationSeverity
|
||
{
|
||
/// <summary>
|
||
/// 轻微。
|
||
/// </summary>
|
||
Minor = 0,
|
||
|
||
/// <summary>
|
||
/// 一般。
|
||
/// </summary>
|
||
Moderate = 1,
|
||
|
||
/// <summary>
|
||
/// 严重。
|
||
/// </summary>
|
||
Severe = 2,
|
||
|
||
/// <summary>
|
||
/// 极严重。
|
||
/// </summary>
|
||
Critical = 3
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位风险分析。
|
||
/// </summary>
|
||
public sealed class OverrideRiskAnalysis
|
||
{
|
||
/// <summary>
|
||
/// 风险评分。
|
||
/// </summary>
|
||
public double RiskScore { get; init; }
|
||
|
||
/// <summary>
|
||
/// 高风险复位次数。
|
||
/// </summary>
|
||
public int HighRiskOverrideCount { get; init; }
|
||
|
||
/// <summary>
|
||
/// 风险因素。
|
||
/// </summary>
|
||
public IReadOnlyList<RiskFactor> RiskFactors { get; init; } = Array.Empty<RiskFactor>();
|
||
|
||
/// <summary>
|
||
/// 风险缓解建议。
|
||
/// </summary>
|
||
public IReadOnlyList<string> RiskMitigationRecommendations { get; init; } = Array.Empty<string>();
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 风险因素。
|
||
/// </summary>
|
||
public sealed class RiskFactor
|
||
{
|
||
/// <summary>
|
||
/// 因素ID。
|
||
/// </summary>
|
||
public Guid FactorId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 因素名称。
|
||
/// </summary>
|
||
public string FactorName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 因素描述。
|
||
/// </summary>
|
||
public string FactorDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 风险等级。
|
||
/// </summary>
|
||
public RiskLevel RiskLevel { get; init; }
|
||
|
||
/// <summary>
|
||
/// 影响程度。
|
||
/// </summary>
|
||
public double ImpactLevel { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位改进建议。
|
||
/// </summary>
|
||
public sealed class OverrideImprovementSuggestion
|
||
{
|
||
/// <summary>
|
||
/// 建议ID。
|
||
/// </summary>
|
||
public Guid SuggestionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 建议类别。
|
||
/// </summary>
|
||
public SuggestionCategory SuggestionCategory { get; init; }
|
||
|
||
/// <summary>
|
||
/// 建议标题。
|
||
/// </summary>
|
||
public string SuggestionTitle { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 建议描述。
|
||
/// </summary>
|
||
public string SuggestionDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 优先级。
|
||
/// </summary>
|
||
public int Priority { get; init; }
|
||
|
||
/// <summary>
|
||
/// 预期效果。
|
||
/// </summary>
|
||
public string ExpectedImpact { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 实施难度。
|
||
/// </summary>
|
||
public ImplementationDifficulty ImplementationDifficulty { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位合规性检查。
|
||
/// </summary>
|
||
public sealed class OverrideComplianceCheck
|
||
{
|
||
/// <summary>
|
||
/// 检查ID。
|
||
/// </summary>
|
||
public Guid CheckId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 会话ID。
|
||
/// </summary>
|
||
public Guid SessionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 检查结果。
|
||
/// </summary>
|
||
public ComplianceCheckResult CheckResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 合规性评分。
|
||
/// </summary>
|
||
public double ComplianceScore { get; init; }
|
||
|
||
/// <summary>
|
||
/// 检查项。
|
||
/// </summary>
|
||
public IReadOnlyList<ComplianceCheckItem> CheckItems { get; init; } = Array.Empty<ComplianceCheckItem>();
|
||
|
||
/// <summary>
|
||
/// 违规项。
|
||
/// </summary>
|
||
public IReadOnlyList<ComplianceViolation> Violations { get; init; } = Array.Empty<ComplianceViolation>();
|
||
|
||
/// <summary>
|
||
/// 检查时间。
|
||
/// </summary>
|
||
public DateTime CheckTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 检查耗时(毫秒)。
|
||
/// </summary>
|
||
public long CheckElapsedMs { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 合规性检查结果枚举。
|
||
/// </summary>
|
||
public enum ComplianceCheckResult
|
||
{
|
||
/// <summary>
|
||
/// 通过。
|
||
/// </summary>
|
||
Pass = 0,
|
||
|
||
/// <summary>
|
||
/// 警告。
|
||
/// </summary>
|
||
Warning = 1,
|
||
|
||
/// <summary>
|
||
/// 失败。
|
||
/// </summary>
|
||
Fail = 2,
|
||
|
||
/// <summary>
|
||
/// 需要人工审核。
|
||
/// </summary>
|
||
RequireManualReview = 3
|
||
}
|
||
|
||
/// <summary>
|
||
/// 合规性检查项。
|
||
/// </summary>
|
||
public sealed class ComplianceCheckItem
|
||
{
|
||
/// <summary>
|
||
/// 检查项ID。
|
||
/// </summary>
|
||
public Guid ItemId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 检查项名称。
|
||
/// </summary>
|
||
public string ItemName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 检查项描述。
|
||
/// </summary>
|
||
public string ItemDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 检查结果。
|
||
/// </summary>
|
||
public ComplianceCheckResult CheckResult { get; init; }
|
||
|
||
/// <summary>
|
||
/// 检查值。
|
||
/// </summary>
|
||
public object? CheckValue { get; init; }
|
||
|
||
/// <summary>
|
||
/// 标准值。
|
||
/// </summary>
|
||
public object? StandardValue { get; init; }
|
||
|
||
/// <summary>
|
||
/// 检查消息。
|
||
/// </summary>
|
||
public string CheckMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位报告请求。
|
||
/// </summary>
|
||
public sealed class OverrideReportRequest
|
||
{
|
||
/// <summary>
|
||
/// 请求ID。
|
||
/// </summary>
|
||
public Guid RequestId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 报告类型。
|
||
/// </summary>
|
||
public OverrideReportType ReportType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 时间范围。
|
||
/// </summary>
|
||
public TimeRange TimeRange { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 产品类型编码。
|
||
/// </summary>
|
||
public string? ProductTypeCode { get; init; }
|
||
|
||
/// <summary>
|
||
/// 操作员ID。
|
||
/// </summary>
|
||
public string? OperatorId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 复位类型。
|
||
/// </summary>
|
||
public OverrideType? OverrideType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 报告参数。
|
||
/// </summary>
|
||
public Dictionary<string, object> ReportParameters { get; init; } = new();
|
||
|
||
/// <summary>
|
||
/// 请求用户。
|
||
/// </summary>
|
||
public string RequestUser { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 请求时间。
|
||
/// </summary>
|
||
public DateTime RequestTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位模板。
|
||
/// </summary>
|
||
public sealed class OverrideTemplate
|
||
{
|
||
/// <summary>
|
||
/// 模板ID。
|
||
/// </summary>
|
||
public Guid TemplateId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 模板类型。
|
||
/// </summary>
|
||
public OverrideTemplateType TemplateType { get; init; }
|
||
|
||
/// <summary>
|
||
/// 模板名称。
|
||
/// </summary>
|
||
public string TemplateName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 模板描述。
|
||
/// </summary>
|
||
public string TemplateDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 模板内容。
|
||
/// </summary>
|
||
public string TemplateContent { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 模板参数。
|
||
/// </summary>
|
||
public IReadOnlyList<TemplateParameter> TemplateParameters { get; init; } = Array.Empty<TemplateParameter>();
|
||
|
||
/// <summary>
|
||
/// 适用条件。
|
||
/// </summary>
|
||
public IReadOnlyList<TemplateCondition> ApplicableConditions { get; init; } = Array.Empty<TemplateCondition>();
|
||
|
||
/// <summary>
|
||
/// 创建时间。
|
||
/// </summary>
|
||
public DateTime CreatedAtUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 创建者。
|
||
/// </summary>
|
||
public string Creator { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 是否启用。
|
||
/// </summary>
|
||
public bool IsEnabled { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位模板类型枚举。
|
||
/// </summary>
|
||
public enum OverrideTemplateType
|
||
{
|
||
/// <summary>
|
||
/// 设备故障。
|
||
/// </summary>
|
||
EquipmentFailure = 0,
|
||
|
||
/// <summary>
|
||
/// 工艺异常。
|
||
/// </summary>
|
||
ProcessAnomaly = 1,
|
||
|
||
/// <summary>
|
||
/// 质量问题。
|
||
/// </summary>
|
||
QualityIssue = 2,
|
||
|
||
/// <summary>
|
||
/// 紧急放行。
|
||
/// </summary>
|
||
EmergencyRelease = 3,
|
||
|
||
/// <summary>
|
||
/// 条件放行。
|
||
/// </summary>
|
||
ConditionalRelease = 4,
|
||
|
||
/// <summary>
|
||
/// 临时措施。
|
||
/// </summary>
|
||
TemporaryMeasure = 5,
|
||
|
||
/// <summary>
|
||
/// 自定义。
|
||
/// </summary>
|
||
Custom = 6
|
||
}
|
||
|
||
/// <summary>
|
||
/// 模板参数。
|
||
/// </summary>
|
||
public sealed class TemplateParameter
|
||
{
|
||
/// <summary>
|
||
/// 参数ID。
|
||
/// </summary>
|
||
public Guid ParameterId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 参数名称。
|
||
/// </summary>
|
||
public string ParameterName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 参数类型。
|
||
/// </summary>
|
||
public string ParameterType { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 参数描述。
|
||
/// </summary>
|
||
public string ParameterDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 是否必需。
|
||
/// </summary>
|
||
public bool IsRequired { get; init; }
|
||
|
||
/// <summary>
|
||
/// 默认值。
|
||
/// </summary>
|
||
public object? DefaultValue { get; init; }
|
||
|
||
/// <summary>
|
||
/// 验证规则。
|
||
/// </summary>
|
||
public string? ValidationRule { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 模板条件。
|
||
/// </summary>
|
||
public sealed class TemplateCondition
|
||
{
|
||
/// <summary>
|
||
/// 条件ID。
|
||
/// </summary>
|
||
public Guid ConditionId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 条件名称。
|
||
/// </summary>
|
||
public string ConditionName { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 条件表达式。
|
||
/// </summary>
|
||
public string ConditionExpression { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 条件描述。
|
||
/// </summary>
|
||
public string ConditionDescription { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 复位模板保存结果。
|
||
/// </summary>
|
||
public sealed class OverrideTemplateSaveResult
|
||
{
|
||
/// <summary>
|
||
/// 保存结果。
|
||
/// </summary>
|
||
public bool IsSuccess { get; init; }
|
||
|
||
/// <summary>
|
||
/// 模板ID。
|
||
/// </summary>
|
||
public Guid TemplateId { get; init; }
|
||
|
||
/// <summary>
|
||
/// 保存消息。
|
||
/// </summary>
|
||
public string SaveMessage { get; init; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 保存时间。
|
||
/// </summary>
|
||
public DateTime SaveTimeUtc { get; init; }
|
||
|
||
/// <summary>
|
||
/// 扩展属性。
|
||
/// </summary>
|
||
public Dictionary<string, object> ExtendedProperties { get; init; } = new();
|
||
}
|