Pārlūkot izejas kodu

fix(s8): align production detail title and trend

YY968XX 2 mēneši atpakaļ
vecāks
revīzija
41e4662139

+ 1 - 1
Web/package.json

@@ -1,7 +1,7 @@
 {
 	"name": "admin.net",
 	"type": "module",
-	"version": "2.4.150",
+	"version": "2.4.151",
 	"packageManager": "pnpm@10.32.1",
 	"lastBuildTime": "2026.03.15",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",

+ 2 - 1
Web/src/views/aidop/s8/api/s8MonitoringApi.ts

@@ -104,13 +104,14 @@ export interface S8DeliveryTrendData {
 	summary: S8DeliveryTrendSummary;
 }
 
-// S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1
+// S8-PRODUCTION-PAGE-TYPE-TITLE-AND-TREND-ALIGN-1:trend day 扩为 4 类,与右侧 PRODUCTION 明细对齐
 export interface S8ProductionTrendDay {
 	date: string;
 	rawDate: string;
 	equipmentFault: number;
 	materialFault: number;
 	qualityFault: number;
+	bodyProductionDelay: number;
 	total: number;
 }
 

+ 3 - 1
Web/src/views/aidop/s8/api/s8ProductionMonitoringApi.ts

@@ -34,9 +34,11 @@ const PRODUCTION_ANOMALY_SPECS = [
 		totalCellCode: 'PRODUCTION_ANOMALY_QUALITY_FAULT',
 		analysisCellCode: 'PRODUCTION_CAT_QUALITY_FAULT',
 	},
+	// S8-PRODUCTION-PAGE-TYPE-TITLE-AND-TREND-ALIGN-1:大屏显示「本体生产延期」(去预警),
+	// typeCode 保持 BODY_PRODUCTION_DELAY_WARNING,不改 DB type_name。
 	{
 		key: 'body-production-delay-warning',
-		label: '本体生产延期预警',
+		label: '本体生产延期',
 		totalCellCode: 'PRODUCTION_ANOMALY_BODY_PRODUCTION_DELAY_WARNING',
 		analysisCellCode: 'PRODUCTION_CAT_BODY_PRODUCTION_DELAY_WARNING',
 	},

+ 6 - 4
Web/src/views/aidop/s8/monitoring/S8MonitoringProductionPage.vue

@@ -33,7 +33,7 @@
 				<aside class="anomaly-monitor__sidebar glass-panel">
 					<div class="section-title">
 						<div class="section-title__bar" />
-						<h2 class="section-title__text">生产异常类型</h2>
+						<h2 class="section-title__text">生产异常明细</h2>
 						</div>
 
 					<div class="anomaly-monitor__type-list">
@@ -208,10 +208,12 @@ const STAGE_META_FALLBACK = [
 	{ code: 'S6', title: '总装入库', icon: Box as Component,         metricLabel: '异常发生情况' },
 ] as const;
 
+// S8-PRODUCTION-PAGE-TYPE-TITLE-AND-TREND-ALIGN-1:fallback 与后端 specs 对齐为 4 类(含本体生产延期)。
 const ANOMALY_TYPES_FALLBACK: ReadonlyArray<{ key: string; label: string }> = [
-	{ key: 'equipment-fault', label: '设备异常' },
-	{ key: 'material-fault',  label: '物料异常' },
-	{ key: 'quality-fault',   label: '质量异常' },
+	{ key: 'equipment-fault',              label: '设备异常' },
+	{ key: 'material-fault',               label: '物料异常' },
+	{ key: 'quality-fault',                label: '质量异常' },
+	{ key: 'body-production-delay-warning', label: '本体生产延期' },
 ];
 
 // S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:原 CATEGORY_DEFS_FALLBACK 仅服务被替换的多维分析区,已移除。

+ 10 - 6
Web/src/views/aidop/s8/monitoring/components/S8ProductionTrendChart.vue

@@ -64,10 +64,12 @@ const avgText = computed(() => {
 });
 const todayText = computed(() => String(summary.value?.todayValue ?? 0));
 
+// S8-PRODUCTION-PAGE-TYPE-TITLE-AND-TREND-ALIGN-1:series 扩为 4 类(含本体生产延期)。
 const SERIES_META = [
-	{ key: 'equipmentFault', name: '设备异常', color: '#ffc107' },
-	{ key: 'materialFault',  name: '物料异常', color: '#7bd0ff' },
-	{ key: 'qualityFault',   name: '质量异常', color: '#ff9d6c' },
+	{ key: 'equipmentFault',      name: '设备异常',     color: '#ffc107' },
+	{ key: 'materialFault',       name: '物料异常',     color: '#7bd0ff' },
+	{ key: 'qualityFault',        name: '质量异常',     color: '#ff9d6c' },
+	{ key: 'bodyProductionDelay', name: '本体生产延期', color: '#a78bfa' },
 ] as const;
 
 const chartOption = computed(() => {
@@ -100,10 +102,12 @@ const chartOption = computed(() => {
 				const idx = params[0].dataIndex;
 				const day = list[idx];
 				if (!day) return '';
+				const lines = SERIES_META.map((m) => {
+					const v = (day as any)[m.key] ?? 0;
+					return `<div>· ${m.name}:${v}</div>`;
+				}).join('');
 				return `<div style="font-weight:600;margin-bottom:4px;">${day.rawDate}</div>`
-					+ `<div>· 设备异常:${day.equipmentFault}</div>`
-					+ `<div>· 物料异常:${day.materialFault}</div>`
-					+ `<div>· 质量异常:${day.qualityFault}</div>`
+					+ lines
 					+ `<div style="margin-top:4px;color:#ffc107;">合计:${day.total}</div>`;
 			},
 		},

+ 3 - 3
server/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj

@@ -11,9 +11,9 @@
     <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
     <Copyright>Admin.NET</Copyright>
     <Description>Admin.NET 通用权限开发平台</Description>
-    <AssemblyVersion>1.0.115</AssemblyVersion>
-    <FileVersion>1.0.115</FileVersion>
-    <Version>1.0.115</Version>
+    <AssemblyVersion>1.0.116</AssemblyVersion>
+    <FileVersion>1.0.116</FileVersion>
+    <Version>1.0.116</Version>
   </PropertyGroup>
 
   <ItemGroup>

+ 3 - 2
server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S8/AdoS8MonitoringController.cs

@@ -40,8 +40,9 @@ public class AdoS8MonitoringController : ControllerBase
         => Ok(await _svc.GetDeliveryTrendAsync(tenantId, factoryId, days, period));
 
     /// <summary>
-    /// S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Production 页近 N 日生产异常趋势。
-    /// 口径 module_code IN (S2,S6) AND exception_type_code IN (EQUIP_FAULT / MFG_MATERIAL_ABNORMAL / MFG_QUALITY_ABNORMAL)。
+    /// S8-PRODUCTION-PAGE-TYPE-TITLE-AND-TREND-ALIGN-1:Production 页近 N 日生产异常趋势。
+    /// 口径 module_code IN (S2,S6) AND exception_type_code IN
+    /// (EQUIP_FAULT / MFG_MATERIAL_ABNORMAL / MFG_QUALITY_ABNORMAL / BODY_PRODUCTION_DELAY_WARNING)。
     /// </summary>
     [HttpGet("production-trend")]
     public async Task<IActionResult> GetProductionTrendAsync(long tenantId = 1, long factoryId = 1, int days = 7, string? period = null)

+ 2 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S8/AdoS8Dtos.cs

@@ -367,6 +367,8 @@ public class AdoS8ProductionTrendDayDto
     public int EquipmentFault { get; set; }
     public int MaterialFault { get; set; }
     public int QualityFault { get; set; }
+    /// <summary>本体生产延期(BODY_PRODUCTION_DELAY_WARNING)当日计数</summary>
+    public int BodyProductionDelay { get; set; }
     public int Total { get; set; }
 }
 

+ 19 - 13
server/Plugins/Admin.NET.Plugin.AiDOP/Service/S8/S8MonitoringService.cs

@@ -460,9 +460,11 @@ public class S8MonitoringService : ITransient
     }
 
     /// <summary>
-    /// S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Production 页近 N 日生产异常趋势。
-    /// 口径:module_code IN (S2,S6) AND exception_type_code IN (EQUIP_FAULT / MFG_MATERIAL_ABNORMAL / MFG_QUALITY_ABNORMAL);
-    /// 时间字段 created_at;不排除 CLOSED;按日聚合,缺失日期补 0;days 限 1-30。
+    /// S8-PRODUCTION-PAGE-TYPE-TITLE-AND-TREND-ALIGN-1:Production 页近 N 日生产异常趋势。
+    /// 口径:module_code IN (S2,S6) AND exception_type_code IN
+    /// (EQUIP_FAULT / MFG_MATERIAL_ABNORMAL / MFG_QUALITY_ABNORMAL / BODY_PRODUCTION_DELAY_WARNING);
+    /// 时间字段 created_at;不排除 CLOSED;按日聚合,缺失日期补 0;days 限 1-30;
+    /// Total = EquipmentFault + MaterialFault + QualityFault + BodyProductionDelay,与右侧明细对齐。
     /// </summary>
     public async Task<AdoS8ProductionTrendDto> GetProductionTrendAsync(long tenantId = 1, long factoryId = 1, int days = 7, string? period = null)
     {
@@ -505,17 +507,19 @@ public class S8MonitoringService : ITransient
         {
             var d = from.AddDays(i);
             var bucket = byDate.TryGetValue(d, out var list) ? list : new();
-            var ef = bucket.Count(r => r.ExceptionTypeCode == "EQUIP_FAULT");
-            var mf = bucket.Count(r => r.ExceptionTypeCode == "MFG_MATERIAL_ABNORMAL");
-            var qf = bucket.Count(r => r.ExceptionTypeCode == "MFG_QUALITY_ABNORMAL");
+            var ef  = bucket.Count(r => r.ExceptionTypeCode == "EQUIP_FAULT");
+            var mf  = bucket.Count(r => r.ExceptionTypeCode == "MFG_MATERIAL_ABNORMAL");
+            var qf  = bucket.Count(r => r.ExceptionTypeCode == "MFG_QUALITY_ABNORMAL");
+            var bpd = bucket.Count(r => r.ExceptionTypeCode == "BODY_PRODUCTION_DELAY_WARNING");
             dayList.Add(new AdoS8ProductionTrendDayDto
             {
-                Date           = d.ToString("MM/dd"),
-                RawDate        = d.ToString("yyyy-MM-dd"),
-                EquipmentFault = ef,
-                MaterialFault  = mf,
-                QualityFault   = qf,
-                Total          = bucket.Count,
+                Date                = d.ToString("MM/dd"),
+                RawDate             = d.ToString("yyyy-MM-dd"),
+                EquipmentFault      = ef,
+                MaterialFault       = mf,
+                QualityFault        = qf,
+                BodyProductionDelay = bpd,
+                Total               = ef + mf + qf + bpd,
             });
         }
 
@@ -656,7 +660,9 @@ public class S8MonitoringService : ITransient
                 ("equipment-fault",                "设备异常",         "EQUIP_FAULT"),
                 ("material-fault",                 "物料异常",         "MFG_MATERIAL_ABNORMAL"),
                 ("quality-fault",                  "质量异常",         "MFG_QUALITY_ABNORMAL"),
-                ("body-production-delay-warning",  "本体生产延期预警", "BODY_PRODUCTION_DELAY_WARNING"),
+                // S8-PRODUCTION-PAGE-TYPE-TITLE-AND-TREND-ALIGN-1:大屏显示「本体生产延期」(去预警),
+                // typeCode 保持 BODY_PRODUCTION_DELAY_WARNING,不改 ado_s8_exception_type.type_name。
+                ("body-production-delay-warning",  "本体生产延期",     "BODY_PRODUCTION_DELAY_WARNING"),
             },
             "SUPPLY" => new (string, string, string)[]
             {