移除历史状态归一化及相关遗留逻辑

- 移除 LegacyStatusNormalizationMigrator,仅保留 AreaLayoutModeDefaultMigrator
- 删除 WmsDispatchStatus 枚举、常量和全局 using
- 统一所有 DbContext 注入为 MiGuDbContext,移除 PlatformDbContext
- 服务实体操作统一用 IEditableRepository<T>,移除本地实现
- 移除 WmsService 的 MigrateLegacyAsync 方法
- 精简接口模型,移除部分字段和请求体
- 前端保存容器时 status 字段取自已有数据,移除写死默认值
- 更新文档,去除旧说明,统一数据库初始化流程
This commit is contained in:
2026-08-03 09:41:03 +08:00
parent 1f72488a8d
commit 125372b157
26 changed files with 63 additions and 183 deletions
+2 -2
View File
@@ -76,7 +76,7 @@ public sealed class AlarmCollector
try
{
using var scope = _scopeFactory.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<PlatformDbContext>();
var db = scope.ServiceProvider.GetRequiredService<MiGuDbContext>();
await ReconcileAsync(db, current, ct);
}
catch (Exception ex)
@@ -161,7 +161,7 @@ public sealed class AlarmCollector
}
}
private static async Task ReconcileAsync(PlatformDbContext db, Dictionary<int, CurrentAlarm> current, CancellationToken ct)
private static async Task ReconcileAsync(MiGuDbContext db, Dictionary<int, CurrentAlarm> current, CancellationToken ct)
{
var now = DateTimeOffset.UtcNow;
var active = await db.VehicleAlarms.Where(a => a.Status == "active").ToListAsync(ct);
+2 -2
View File
@@ -80,7 +80,7 @@ public sealed class CdmTaskSyncer
try
{
using var scope = _scopeFactory.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<PlatformDbContext>();
var db = scope.ServiceProvider.GetRequiredService<MiGuDbContext>();
await UpsertAsync(db, dtos, ct);
}
catch (Exception ex)
@@ -126,7 +126,7 @@ public sealed class CdmTaskSyncer
}
}
private static async Task UpsertAsync(PlatformDbContext db, IReadOnlyList<CdmTaskDto> dtos, CancellationToken ct)
private static async Task UpsertAsync(MiGuDbContext db, IReadOnlyList<CdmTaskDto> dtos, CancellationToken ct)
{
var valid = dtos.Where(d => !string.IsNullOrWhiteSpace(d.id)).ToList();
if (valid.Count == 0) return;