namespace Admin.NET.Plugin.AiDOP.Dto.S8; public class AdoS8ExceptionQueryDto { public long TenantId { get; set; } = 1; public long FactoryId { get; set; } = 1; public string? Keyword { get; set; } public string? Status { get; set; } public string? StatusBucket { get; set; } public string? Severity { get; set; } public string? SceneCode { get; set; } /// 模块码过滤(S1-S7),用于监控页下钻 public string? ModuleCode { get; set; } public long? DeptId { get; set; } public bool? TimeoutFlag { get; set; } public string? ProcessNodeCode { get; set; } public string? RelatedObjectCode { get; set; } public DateTime? BeginTime { get; set; } public DateTime? EndTime { get; set; } /// 是否包含 exception_type_code 为 NULL 的未分类历史异常;默认 false(隐藏)。 public bool? IncludeUnclassified { get; set; } /// 恢复状态筛选:RECOVERED / ACTIVE / 空=不限。 public string? RecoveredStatus { get; set; } /// 规则类型筛选:OUT_OF_RANGE / TIMEOUT / SHORTAGE / 空=不限;通过 source_rule_code join watch_rule.rule_type。 public string? RuleType { get; set; } /// S8-DASHBOARD-DATA-ALIGN-S1S7-1:仅返回 module_code IN S1-S7 的异常;看板明细表传 true 与 KPI 口径对齐。 /// 默认 false 以保证异常列表页(/aidop/s8/exceptions)行为不变。 public bool? OnlyS1S7Modules { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } public class AdoS8ExceptionListItemDto { public long Id { get; set; } public long FactoryId { get; set; } public string ExceptionCode { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; public string Status { get; set; } = string.Empty; public string? StatusLabel { get; set; } public string Severity { get; set; } = string.Empty; public string? SeverityLabel { get; set; } public decimal PriorityScore { get; set; } public string PriorityLevel { get; set; } = string.Empty; public string SceneCode { get; set; } = string.Empty; public string? SceneName { get; set; } /// S8-EXCEPTION-MODULE-DISPLAY-1:业务展示主口径(S1-S7)。SceneCode/SceneName 保留兼容期。 public string? ModuleCode { get; set; } public string? ModuleName { get; set; } public long ResponsibleDeptId { get; set; } public string? ResponsibleDeptName { get; set; } public long OccurrenceDeptId { get; set; } public string? OccurrenceDeptName { get; set; } public long? AssigneeId { get; set; } public string? AssigneeName { get; set; } public DateTime? SlaDeadline { get; set; } public bool TimeoutFlag { get; set; } public DateTime CreatedAt { get; set; } public DateTime? ClosedAt { get; set; } public string? ExceptionTypeCode { get; set; } public DateTime? RecoveredAt { get; set; } public string? SourceRuleCode { get; set; } public string? SourceObjectType { get; set; } public string? SourceObjectId { get; set; } public string? DedupKey { get; set; } public DateTime? LastDetectedAt { get; set; } public string? RuleType { get; set; } } public class AdoS8ExceptionDetailDto : AdoS8ExceptionListItemDto { public string? Description { get; set; } public string SourceType { get; set; } = string.Empty; public long? ResponsibleGroupId { get; set; } public long? ReporterId { get; set; } public string? ReporterName { get; set; } public DateTime? AssignedAt { get; set; } public DateTime? UpdatedAt { get; set; } public long? ActiveFlowInstanceId { get; set; } public string? ActiveFlowBizType { get; set; } public long? VerifierId { get; set; } public string? VerifierName { get; set; } public DateTime? VerificationAssignedAt { get; set; } public DateTime? VerifiedAt { get; set; } public string? VerificationResult { get; set; } public string? VerificationRemark { get; set; } public long? SourceRuleId { get; set; } public string? RelatedObjectCode { get; set; } } public class AdoS8ManualReportCreateDto { public long TenantId { get; set; } = 1; public long FactoryId { get; set; } = 1; public string Title { get; set; } = string.Empty; public string? Description { get; set; } public string SceneCode { get; set; } = string.Empty; public string Severity { get; set; } = "FOLLOW"; public long OccurrenceDeptId { get; set; } public long ResponsibleDeptId { get; set; } public long? ReporterId { get; set; } } public class AdoS8ManualReportResultDto { public long ExceptionId { get; set; } public string ExceptionCode { get; set; } = string.Empty; public long TaskId { get; set; } } public class AdoS8TimelineItemDto { public long Id { get; set; } public string ActionCode { get; set; } = string.Empty; public string ActionLabel { get; set; } = string.Empty; public string? FromStatus { get; set; } public string? ToStatus { get; set; } public long? OperatorId { get; set; } public string? OperatorName { get; set; } public string? ActionRemark { get; set; } public DateTime CreatedAt { get; set; } } public class AdoS8DecisionItemDto { public long Id { get; set; } public string DecisionType { get; set; } = string.Empty; public long DecisionMakerId { get; set; } public string DecisionMakerName { get; set; } = string.Empty; public string? DecisionBasis { get; set; } public string? DecisionResult { get; set; } public string? DecisionRemark { get; set; } public DateTime DecisionTime { get; set; } } public class AdoS8EvidenceItemDto { public long Id { get; set; } public string EvidenceType { get; set; } = string.Empty; public string FileName { get; set; } = string.Empty; public string FileUrl { get; set; } = string.Empty; public string? SourceSystem { get; set; } public long? UploadedBy { get; set; } public DateTime UploadedAt { get; set; } } public class AdoS8CommentDto { public string? Remark { get; set; } } public class AdoS8TransferDto { public long AssigneeId { get; set; } public string? Remark { get; set; } } public class AdoS8AttachmentCreateDto { public string EvidenceType { get; set; } = "file"; public string FileName { get; set; } = string.Empty; public string FileUrl { get; set; } = string.Empty; public string? SourceSystem { get; set; } public long? UploadedBy { get; set; } } // ── 监控汇总 DTO ───────────────────────────────────────────────────────────── public class AdoS8MonitoringSummaryQueryDto { public long TenantId { get; set; } = 1; public long FactoryId { get; set; } = 1; /// 场景码过滤(不传 = 全部) public string? SceneCode { get; set; } /// 模块码过滤(不传 = 全部) public string? ModuleCode { get; set; } public DateTime? BizDateFrom { get; set; } public DateTime? BizDateTo { get; set; } } /// 单个模块的异常汇总行 public class AdoS8ModuleSummaryItem { public string ModuleCode { get; set; } = string.Empty; public string ModuleLabel { get; set; } = string.Empty; public string SceneCode { get; set; } = string.Empty; public string SceneLabel { get; set; } = string.Empty; public int Total { get; set; } public int Red { get; set; } public int Yellow { get; set; } public int Green { get; set; } public int Timeout { get; set; } } /// 监控汇总出参(综合全景页顶部 + 表格数据) public class AdoS8MonitoringSummaryDto { public int Total { get; set; } public int Red { get; set; } public int Yellow { get; set; } public int Green { get; set; } public int Timeout { get; set; } public List ByModule { get; set; } = new(); } // ── 9宫格 OrderGrid DTO ────────────────────────────────────────────────────── /// S1-S7 单个模块的订单健康分布(9宫格前7格) public class AdoS8ModuleOrderSummary { public string ModuleCode { get; set; } = string.Empty; public string ModuleLabel { get; set; } = string.Empty; /// 绿色订单数(来自订单主数据,不从异常 severity 推导)。 public int Green { get; set; } /// 黄色订单数(FOLLOW 关注)。 public int Yellow { get; set; } /// 红色订单数(SERIOUS 严重,或黄色超时)。 public int Red { get; set; } public int Total { get; set; } /// 异常发生频率(每百订单异常数) public double Frequency { get; set; } /// 平均处理时效(小时) public double AvgProcessHours { get; set; } /// 异常关闭百分比 public double CloseRate { get; set; } } /// S8格:按业务类别汇总(第8格) public class AdoS8CategorySummary { public string Category { get; set; } = string.Empty; public int Total { get; set; } public double AvgProcessHours { get; set; } public double CloseRate { get; set; } } /// S9格:按责任部门汇总(第9格) public class AdoS8DeptSummary { public string DeptName { get; set; } = string.Empty; public int Total { get; set; } public double AvgProcessHours { get; set; } public double CloseRate { get; set; } } /// 9宫格完整出参 public class AdoS8OrderGridDto { public List Modules { get; set; } = new(); public List ByCategory { get; set; } = new(); public List ByDept { get; set; } = new(); } /// S8-DELIVERY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Delivery 页近 N 日交付异常趋势出参。 public class AdoS8DeliveryTrendDto { public List Days { get; set; } = new(); public AdoS8DeliveryTrendSummaryDto Summary { get; set; } = new(); } public class AdoS8DeliveryTrendDayDto { /// 日期短格式 MM/dd(图表 X 轴) public string Date { get; set; } = string.Empty; /// 原始日期 yyyy-MM-dd public string RawDate { get; set; } = string.Empty; public int OrderChange { get; set; } public int DeliveryDelay { get; set; } public int PendingShipment { get; set; } public int Total { get; set; } } public class AdoS8DeliveryTrendSummaryDto { public int PeakValue { get; set; } public string? PeakDate { get; set; } public double AvgValue { get; set; } public int TodayValue { get; set; } /// 今日相对昨日变化率(%);昨日为 0 时返回 null。 public double? TodayChangeRate { get; set; } } /// S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Production 页近 N 日生产异常趋势出参。 public class AdoS8ProductionTrendDto { public List Days { get; set; } = new(); public AdoS8DeliveryTrendSummaryDto Summary { get; set; } = new(); } public class AdoS8ProductionTrendDayDto { public string Date { get; set; } = string.Empty; public string RawDate { get; set; } = string.Empty; public int EquipmentFault { get; set; } public int MaterialFault { get; set; } public int QualityFault { get; set; } public int Total { get; set; } } /// S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Supply 页近 N 日供应异常趋势出参。 public class AdoS8SupplyTrendDto { public List Days { get; set; } = new(); public AdoS8DeliveryTrendSummaryDto Summary { get; set; } = new(); } public class AdoS8SupplyTrendDayDto { public string Date { get; set; } = string.Empty; public string RawDate { get; set; } = string.Empty; public int SupplierEtaIssue { get; set; } public int SupplierShipIssue { get; set; } public int WarehouseReceiptAbnormal { get; set; } public int IqcIssue { get; set; } public int WarehousePutawayIssue { get; set; } public int WorkOrderKittingAbnormal { get; set; } public int WorkOrderIssueAbnormal { get; set; } public int Total { get; set; } } /// /// S8-SIDEBAR-TYPE-CARD-WINDOW-TOGGLE-1:右侧异常类型卡按时间窗口切片(LAST_24H / LAST_7D)出参。 /// 同一窗口内 total / open / closed / avgProcessHours / closeRate 共用同一分母,避免跨窗口拼接误读。 /// public class AdoS8DomainTypeMetricsDto { public string Domain { get; set; } = string.Empty; public string Window { get; set; } = string.Empty; public int Total { get; set; } public List Items { get; set; } = new(); } public class AdoS8DomainTypeMetricItemDto { public string Key { get; set; } = string.Empty; public string Label { get; set; } = string.Empty; public string TypeCode { get; set; } = string.Empty; public int Total { get; set; } public int OpenCount { get; set; } public int ClosedCount { get; set; } /// 已关闭样本均时(小时);无 closed 样本时 null,前端展示 --。 public double? AvgProcessHours { get; set; } /// 关闭率 %;total=0 时 null,前端展示 --。 public double? CloseRate { get; set; } } public class AdoS8SubmitVerificationDto { public long VerifierId { get; set; } public string? Remark { get; set; } } public class AdoS8ApproveVerificationDto { public string? Remark { get; set; } } public class AdoS8RejectVerificationDto { public string Remark { get; set; } = string.Empty; }