- 新增 MiGu.DB 项目,迁移所有领域实体与枚举,统一模型约定 - 实现 Entity/Repository/UoW/Provider/Exception 等接口与实现 - 支持数据修补机制,完善 Sqlite 初始迁移与数据库管理 - Server 侧移除 EF Core 相关,依赖 MiGu.DB,PlatformPersistence 适配 - 业务服务注入 UoW/Repository,状态字段统一用 enum 及辅助类 - 统一异常处理,Controller 映射 HTTP 状态码 - 配置项与文档补充数据库启动、SchemaMode、迁移说明 - 新增 GlobalUsings.Db.cs、WmsStatusAliases.cs 简化类型引用 - 新增 HttpActorContextMiddleware 支持操作者上下文一致性 - 新增 MiGuDbContextModelSnapshot 追踪数据库结构 - 优化代码结构,解耦领域与持久层,提升扩展性与安全性
65 lines
4.0 KiB
C#
65 lines
4.0 KiB
C#
namespace MiGu.Server.Wms;
|
|
|
|
// API / 读模型 DTO(留在 Server,不进 MiGu.DB)。请求字段中的状态仍为 string,由 Service 解析为枚举后写入实体。
|
|
|
|
public sealed record InventoryMaterialRow(
|
|
Guid MaterialId, string MaterialCode, string MaterialName, string MaterialBarcode, string MaterialTypeCode,
|
|
Guid ContainerId, string ContainerCode, string ContainerName,
|
|
Guid? StorageId, string StorageCode, string StorageName,
|
|
Guid? AreaId, string AreaCode, string AreaName,
|
|
string LocationType, DateTimeOffset BoundAt);
|
|
|
|
public sealed record ContainerLocationSnapshot(
|
|
Guid Id, Guid ContainerId, string LocationType, string LocationId, string LocationCode, string LocationName,
|
|
string Status, DateTimeOffset EnteredAt, long Version);
|
|
|
|
public sealed record ContainerMaterialSnapshot(
|
|
Guid Id, Guid ContainerId, Guid MaterialId, decimal Quantity, string BatchNo, string SerialNo, string Status,
|
|
DateTimeOffset BoundAt, DateTimeOffset LoadedAt, DateTimeOffset? UnloadedAt, long Version);
|
|
|
|
public abstract record CommonRequest(Guid? Id, long? Version, bool IsLock, string Remark, string Extend);
|
|
|
|
public sealed record MasterDataRequest(
|
|
Guid? Id, long? Version, string Code, string Name, string Type, string Status, bool Enabled, int SortOrder,
|
|
bool IsLock, string Remark, string Extend) : CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record AreaRequest(
|
|
Guid? Id, long? Version, Guid? WarehouseId, string Code, string Name, string Type, string LayoutMode, string State,
|
|
bool Enabled, int SortOrder, bool IsLock, string Remark, string Extend) : CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record StorageRequest(
|
|
Guid? Id, long? Version, Guid AreaId, string Code, string Name, string StorageType, string LocationKind,
|
|
int ColumnNo, int LevelNo, int DepthNo, string SiteId, string SiteCode, string Barcode, int Capacity,
|
|
string Status, string Usage, int Priority, string ZoneCode, bool AllowInbound, bool AllowOutbound, bool Enabled,
|
|
bool IsLock, string Remark, string Extend) : CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record GenerateBinsRequest(int ColumnFrom, int ColumnTo, int LevelFrom, int LevelTo, int DepthFrom, int DepthTo, string? CodePattern);
|
|
|
|
public sealed record ContainerRequest(
|
|
Guid? Id, long? Version, Guid? AreaId, string Code, string Name, string Type, string Status, string Barcode,
|
|
double Length, double Width, double Height, bool Enabled, bool IsLock, string Remark, string Extend)
|
|
: CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record MaterialTypeRequest(
|
|
Guid? Id, long? Version, string Code, string Name, string Spec, string Unit, string Category, string BarcodePrefix,
|
|
bool Enabled, bool IsLock, string Remark, string Extend) : CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record MaterialRequest(
|
|
Guid? Id, long? Version, string Code, string Name, string TypeCode, string Barcode, string Spec, string Unit,
|
|
string Category, string LifecycleStatus, bool Enabled, bool IsLock, string Remark, string Extend)
|
|
: CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record ContainerLocationRequest(
|
|
Guid? Id, long? Version, Guid ContainerId, string LocationType, string LocationId, string Status,
|
|
DateTimeOffset? EnteredAt, string Source, string Reason, bool IsLock, string Remark, string Extend)
|
|
: CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record BindMaterialRequest(
|
|
Guid? Id, long? Version, Guid ContainerId, Guid MaterialId, string Source, string Reason,
|
|
bool IsLock, string Remark, string Extend) : CommonRequest(Id, Version, IsLock, Remark, Extend);
|
|
|
|
public sealed record ContainerMaterialRequest(
|
|
Guid? Id, long? Version, Guid ContainerId, Guid MaterialId, decimal Quantity, string BatchNo, string SerialNo,
|
|
string Status, DateTimeOffset? LoadedAt, DateTimeOffset? UnloadedAt, string Source, string Reason,
|
|
bool IsLock, string Remark, string Extend) : CommonRequest(Id, Version, IsLock, Remark, Extend);
|