diff --git a/MiGu.Server/Fleet/CdmTaskRecord.cs b/MiGu.DB/Domains/Fleet/CdmTaskRecord.cs
similarity index 92%
rename from MiGu.Server/Fleet/CdmTaskRecord.cs
rename to MiGu.DB/Domains/Fleet/CdmTaskRecord.cs
index 69a5973..00097dd 100644
--- a/MiGu.Server/Fleet/CdmTaskRecord.cs
+++ b/MiGu.DB/Domains/Fleet/CdmTaskRecord.cs
@@ -1,9 +1,8 @@
-namespace MiGu.Server.Fleet;
+namespace MiGu.DB.Domains.Fleet;
///
/// CDM 搬运任务的平台侧快照(表 cdm_tasks)。
-/// 以任务 Id 为主键;SimpleLite/StandardScene 把终态任务从自身 JSON 里删除,这里则永久保留=完整历史,
-/// 且 SimpleLite 关闭后平台仍可从本表读取最近快照。
+/// 以任务 Id 为主键;SimpleLite/StandardScene 把终态任务从自身 JSON 里删除,这里则永久保留=完整历史。
///
public sealed class CdmTaskRecord
{
diff --git a/MiGu.DB/Domains/Fleet/FleetConfigurations.cs b/MiGu.DB/Domains/Fleet/FleetConfigurations.cs
new file mode 100644
index 0000000..e70c8ad
--- /dev/null
+++ b/MiGu.DB/Domains/Fleet/FleetConfigurations.cs
@@ -0,0 +1,61 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace MiGu.DB.Domains.Fleet;
+
+public sealed class CdmTaskRecordConfiguration : IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder e)
+ {
+ e.ToTable("cdm_tasks");
+ e.HasKey(x => x.Id);
+ e.Property(x => x.Id).HasColumnName("id").HasMaxLength(64);
+ e.Property(x => x.TaskId).HasColumnName("task_id").HasMaxLength(128).IsRequired(false);
+ e.Property(x => x.MissionId).HasColumnName("mission_id");
+ e.Property(x => x.MissionName).HasColumnName("mission_name").HasMaxLength(128);
+ e.Property(x => x.MissionTypeName).HasColumnName("mission_type").HasMaxLength(128);
+ e.Property(x => x.SrcSiteId).HasColumnName("src_site_id");
+ e.Property(x => x.SrcLabel).HasColumnName("src_label").HasMaxLength(256);
+ e.Property(x => x.DstSiteId).HasColumnName("dst_site_id");
+ e.Property(x => x.DstLabel).HasColumnName("dst_label").HasMaxLength(256);
+ e.Property(x => x.Status).HasColumnName("status").HasMaxLength(32);
+ e.Property(x => x.StatusCode).HasColumnName("status_code").HasMaxLength(32);
+ e.Property(x => x.CarId).HasColumnName("car_id").IsRequired(false);
+ e.Property(x => x.CarName).HasColumnName("car_name").HasMaxLength(128).IsRequired(false);
+ e.Property(x => x.Priority).HasColumnName("priority");
+ e.Property(x => x.CreateTime).HasColumnName("create_time").HasMaxLength(40).IsRequired(false);
+ e.Property(x => x.StartTime).HasColumnName("start_time").HasMaxLength(40).IsRequired(false);
+ e.Property(x => x.FinishTime).HasColumnName("finish_time").HasMaxLength(40).IsRequired(false);
+ e.Property(x => x.StuckReason).HasColumnName("stuck_reason").HasMaxLength(512).IsRequired(false);
+ e.Property(x => x.Overdue).HasColumnName("overdue");
+ e.Property(x => x.FirstSeenAt).HasColumnName("first_seen_at");
+ e.Property(x => x.LastSeenAt).HasColumnName("last_seen_at");
+ e.HasIndex(x => x.StatusCode);
+ e.HasIndex(x => x.CreateTime);
+ }
+}
+
+public sealed class VehicleAlarmRecordConfiguration : IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder e)
+ {
+ e.ToTable("vehicle_alarms");
+ e.HasKey(x => x.Id);
+ e.Property(x => x.Id).HasColumnName("id").HasMaxLength(36);
+ e.Property(x => x.CarId).HasColumnName("car_id");
+ e.Property(x => x.CarName).HasColumnName("car_name").HasMaxLength(128);
+ e.Property(x => x.Info).HasColumnName("info").HasColumnType("text");
+ e.Property(x => x.Level).HasColumnName("level");
+ e.Property(x => x.Status).HasColumnName("status").HasMaxLength(16);
+ e.Property(x => x.FirstAt).HasColumnName("first_at");
+ e.Property(x => x.LastAt).HasColumnName("last_at");
+ e.Property(x => x.ResolvedAt).HasColumnName("resolved_at").IsRequired(false);
+ e.Property(x => x.DurationSecs).HasColumnName("duration_secs").IsRequired(false);
+ e.Property(x => x.Acknowledged).HasColumnName("acknowledged");
+ e.Property(x => x.AcknowledgedAt).HasColumnName("acknowledged_at").IsRequired(false);
+ e.Property(x => x.AcknowledgedBy).HasColumnName("acknowledged_by").HasMaxLength(128).IsRequired(false);
+ e.HasIndex(x => new { x.CarId, x.Status });
+ e.HasIndex(x => x.Status);
+ e.HasIndex(x => x.FirstAt);
+ }
+}
diff --git a/MiGu.Server/Fleet/VehicleAlarmRecord.cs b/MiGu.DB/Domains/Fleet/VehicleAlarmRecord.cs
similarity index 74%
rename from MiGu.Server/Fleet/VehicleAlarmRecord.cs
rename to MiGu.DB/Domains/Fleet/VehicleAlarmRecord.cs
index a24ad3f..e9a0f00 100644
--- a/MiGu.Server/Fleet/VehicleAlarmRecord.cs
+++ b/MiGu.DB/Domains/Fleet/VehicleAlarmRecord.cs
@@ -1,10 +1,8 @@
-namespace MiGu.Server.Fleet;
+namespace MiGu.DB.Domains.Fleet;
///
/// 车辆报警的平台侧记录(表 vehicle_alarms)。
-/// SimpleLite 只在 SSE/状态里给出「当前是否报警 + 文案」,无历史;平台按车对帐:
-/// 出现报警→开一条 active 记录,报警文案变化→更新,报警消失→置为 cleared 并记录恢复时间/持续时长。
-/// 永不删除=完整历史,重启/刷新不丢,SimpleLite 离线也可查。
+/// 出现报警→开一条 active 记录;文案/级别变化→先 clear 再建新 active;消失→cleared。
///
public sealed class VehicleAlarmRecord
{
diff --git a/MiGu.DB/Kernel/Context/MiGuDbContext.Sets.cs b/MiGu.DB/Kernel/Context/MiGuDbContext.Sets.cs
index 5b44021..f938089 100644
--- a/MiGu.DB/Kernel/Context/MiGuDbContext.Sets.cs
+++ b/MiGu.DB/Kernel/Context/MiGuDbContext.Sets.cs
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using MiGu.DB.Domains.Dashboard;
+using MiGu.DB.Domains.Fleet;
using MiGu.DB.Domains.SimpleFields;
using MiGu.DB.Domains.Transport;
using MiGu.DB.Domains.Wms;
@@ -25,4 +26,6 @@ public partial class MiGuDbContext
public DbSet WmsTransportTaskHistories => Set();
public DbSet SimpleFields => Set();
public DbSet UserDashboardShortcuts => Set();
+ public DbSet CdmTasks => Set();
+ public DbSet VehicleAlarms => Set();
}
diff --git a/MiGu.DB/Migrations/Sqlite/20260727070415_AddFleetTables.Designer.cs b/MiGu.DB/Migrations/Sqlite/20260727070415_AddFleetTables.Designer.cs
new file mode 100644
index 0000000..628dd18
--- /dev/null
+++ b/MiGu.DB/Migrations/Sqlite/20260727070415_AddFleetTables.Designer.cs
@@ -0,0 +1,1882 @@
+//
+using System;
+using MiGu.DB.Kernel.Context;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace MiGu.DB.Migrations.Sqlite
+{
+ [DbContext(typeof(MiGuDbContext))]
+ [Migration("20260727070415_AddFleetTables")]
+ partial class AddFleetTables
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.10");
+
+ modelBuilder.Entity("MiGu.DB.Domains.Dashboard.UserDashboardShortcut", b =>
+ {
+ b.Property("UserId")
+ .HasMaxLength(64)
+ .HasColumnType("TEXT")
+ .HasColumnName("user_id");
+
+ b.Property("Scope")
+ .HasMaxLength(32)
+ .HasColumnType("TEXT")
+ .HasColumnName("scope");
+
+ b.Property("KeysJson")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("keys_json");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("updated_at");
+
+ b.HasKey("UserId", "Scope");
+
+ b.ToTable("user_dashboard_shortcuts", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Fleet.CdmTaskRecord", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(64)
+ .HasColumnType("TEXT")
+ .HasColumnName("id");
+
+ b.Property("CarId")
+ .HasColumnType("INTEGER")
+ .HasColumnName("car_id");
+
+ b.Property("CarName")
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("car_name");
+
+ b.Property("CreateTime")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("create_time");
+
+ b.Property("DstLabel")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("TEXT")
+ .HasColumnName("dst_label");
+
+ b.Property("DstSiteId")
+ .HasColumnType("INTEGER")
+ .HasColumnName("dst_site_id");
+
+ b.Property("FinishTime")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("finish_time");
+
+ b.Property("FirstSeenAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("first_seen_at");
+
+ b.Property("LastSeenAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("last_seen_at");
+
+ b.Property("MissionId")
+ .HasColumnType("INTEGER")
+ .HasColumnName("mission_id");
+
+ b.Property("MissionName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("mission_name");
+
+ b.Property("MissionTypeName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("mission_type");
+
+ b.Property("Overdue")
+ .HasColumnType("INTEGER")
+ .HasColumnName("overdue");
+
+ b.Property("Priority")
+ .HasColumnType("INTEGER")
+ .HasColumnName("priority");
+
+ b.Property("SrcLabel")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("TEXT")
+ .HasColumnName("src_label");
+
+ b.Property("SrcSiteId")
+ .HasColumnType("INTEGER")
+ .HasColumnName("src_site_id");
+
+ b.Property("StartTime")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("start_time");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT")
+ .HasColumnName("status");
+
+ b.Property("StatusCode")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT")
+ .HasColumnName("status_code");
+
+ b.Property("StuckReason")
+ .HasMaxLength(512)
+ .HasColumnType("TEXT")
+ .HasColumnName("stuck_reason");
+
+ b.Property("TaskId")
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("task_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateTime");
+
+ b.HasIndex("StatusCode");
+
+ b.ToTable("cdm_tasks", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Fleet.VehicleAlarmRecord", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT")
+ .HasColumnName("id");
+
+ b.Property("Acknowledged")
+ .HasColumnType("INTEGER")
+ .HasColumnName("acknowledged");
+
+ b.Property("AcknowledgedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("acknowledged_at");
+
+ b.Property("AcknowledgedBy")
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("acknowledged_by");
+
+ b.Property("CarId")
+ .HasColumnType("INTEGER")
+ .HasColumnName("car_id");
+
+ b.Property("CarName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("car_name");
+
+ b.Property("DurationSecs")
+ .HasColumnType("INTEGER")
+ .HasColumnName("duration_secs");
+
+ b.Property("FirstAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("first_at");
+
+ b.Property("Info")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("info");
+
+ b.Property("LastAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("last_at");
+
+ b.Property("Level")
+ .HasColumnType("INTEGER")
+ .HasColumnName("level");
+
+ b.Property("ResolvedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT")
+ .HasColumnName("resolved_at");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(16)
+ .HasColumnType("TEXT")
+ .HasColumnName("status");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FirstAt");
+
+ b.HasIndex("Status");
+
+ b.HasIndex("CarId", "Status");
+
+ b.ToTable("vehicle_alarms", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.SimpleFields.SimpleField", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT")
+ .HasColumnName("id");
+
+ b.Property("CarType")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT")
+ .HasColumnName("car_type");
+
+ b.Property("Chinese")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT")
+ .HasColumnName("chinese");
+
+ b.Property("CreateTime")
+ .IsRequired()
+ .HasMaxLength(19)
+ .HasColumnType("TEXT")
+ .HasColumnName("create_time");
+
+ b.Property("DataType")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("data_type");
+
+ b.Property("English")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT")
+ .HasColumnName("english");
+
+ b.Property("FieldType")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT")
+ .HasColumnName("field_type");
+
+ b.Property("IsDefault")
+ .HasColumnType("INTEGER")
+ .HasColumnName("is_default");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT")
+ .HasColumnName("key");
+
+ b.Property("Other")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("TEXT")
+ .HasColumnName("other");
+
+ b.Property("UpdateTime")
+ .IsRequired()
+ .HasMaxLength(19)
+ .HasColumnType("TEXT")
+ .HasColumnName("update_time");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasColumnName("value");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CarType", "FieldType", "Key")
+ .IsUnique();
+
+ b.ToTable("simple_fields", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Transport.WmsTransportReservation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("ContainerId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("ExpiresAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsDeleted")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsLock")
+ .HasColumnType("INTEGER")
+ .HasColumnName("IsLock");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("SourceStorageId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("TargetStorageId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("TaskId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId", "Status");
+
+ b.HasIndex("TargetStorageId", "Status");
+
+ b.ToTable("wms_transport_reservations", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Transport.WmsTransportRule", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Enabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsDeleted")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsLock")
+ .HasColumnType("INTEGER")
+ .HasColumnName("IsLock");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Priority")
+ .HasColumnType("INTEGER");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("SourceSelectorJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("TargetSelectorJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("TaskOptionsJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("TriggerType")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Code")
+ .IsUnique();
+
+ b.HasIndex("TriggerType", "Enabled", "Priority");
+
+ b.ToTable("wms_transport_rules", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Transport.WmsTransportTask", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("BusinessType")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("ContainerId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeliveryId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("DispatchMissionId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("DispatchStatus")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("ErrorMessage")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsDeleted")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsLock")
+ .HasColumnType("INTEGER")
+ .HasColumnName("IsLock");
+
+ b.Property("MaterialId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Quantity")
+ .HasPrecision(18, 4)
+ .HasColumnType("TEXT");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("RuleId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("SnapshotJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("SourceStorageId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("TargetStorageId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("TaskPriority")
+ .HasColumnType("INTEGER");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.HasIndex("Status");
+
+ b.HasIndex("TargetStorageId");
+
+ b.ToTable("wms_transport_tasks", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Transport.WmsTransportTaskHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("ErrorMessage")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("FromStatus")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("OperatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("Operator")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("TEXT");
+
+ b.Property("SnapshotJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("TaskId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("ToStatus")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OperatedAt");
+
+ b.HasIndex("TaskId");
+
+ b.ToTable("wms_transport_task_history", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Wms.Container", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("AreaId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Barcode")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("ContainerType")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Enabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Height")
+ .HasColumnType("REAL");
+
+ b.Property("IsDeleted")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsLock")
+ .HasColumnType("INTEGER")
+ .HasColumnName("IsLock");
+
+ b.Property("Length")
+ .HasColumnType("REAL");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("INTEGER");
+
+ b.Property("Width")
+ .HasColumnType("REAL");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Code")
+ .IsUnique();
+
+ b.ToTable("wms_containers", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Wms.ContainerLocation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("ContainerId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("EnteredAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsDeleted")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsLock")
+ .HasColumnType("INTEGER")
+ .HasColumnName("IsLock");
+
+ b.Property("LocationCode")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("LocationId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("LocationName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("LocationType")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("StorageId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId")
+ .IsUnique();
+
+ b.HasIndex("StorageId");
+
+ b.HasIndex("LocationType", "LocationId");
+
+ b.ToTable("wms_container_locations", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Wms.ContainerLocationHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("AfterJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("BeforeJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ContainerId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("EventType")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("FromLocationId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("FromLocationType")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("OperatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("Operator")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("TEXT");
+
+ b.Property("RelationId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("Source")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("ToLocationId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("ToLocationType")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.HasIndex("EventType");
+
+ b.HasIndex("OperatedAt");
+
+ b.ToTable("wms_container_location_history", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Wms.ContainerMaterial", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("BatchNo")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("BoundAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("ContainerId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsDeleted")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsLock")
+ .HasColumnType("INTEGER")
+ .HasColumnName("IsLock");
+
+ b.Property("LoadedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("MaterialId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Quantity")
+ .HasPrecision(18, 4)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("SerialNo")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("UnloadedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.HasIndex("MaterialId")
+ .IsUnique();
+
+ b.ToTable("wms_container_materials", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Wms.ContainerMaterialHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("AfterJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("BeforeJson")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ContainerId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("EventType")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("MaterialId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("OperatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("Operator")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("QuantityDelta")
+ .HasPrecision(18, 4)
+ .HasColumnType("TEXT");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("TEXT");
+
+ b.Property("RelationId")
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("Source")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.HasIndex("EventType");
+
+ b.HasIndex("OperatedAt");
+
+ b.ToTable("wms_container_material_history", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Wms.Material", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property("Barcode")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Category")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("DeletedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Enabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("Extend")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsDeleted")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsLock")
+ .HasColumnType("INTEGER")
+ .HasColumnName("IsLock");
+
+ b.Property("LifecycleStatus")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("TEXT");
+
+ b.Property("Spec")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("TypeCode")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("TEXT");
+
+ b.Property("UnboundAt")
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("Unit")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedBy")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Barcode");
+
+ b.HasIndex("Code")
+ .IsUnique();
+
+ b.HasIndex("TypeCode");
+
+ b.HasIndex("LifecycleStatus", "UpdatedAt");
+
+ b.ToTable("wms_materials", (string)null);
+ });
+
+ modelBuilder.Entity("MiGu.DB.Domains.Wms.MaterialType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(36)
+ .HasColumnType("TEXT");
+
+ b.Property