Add WmsLite monorepo with JWT auth, tenant context, and project READMEs.
Implement API security baseline (sys_user, JWT, audit fields, transactions, unique constraints) and Web real login with 401 handling. Document setup and development workflows in root, WmsLite.Api, and WmsLite.Web README files. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
fa1b286463
241 files changed
+31188
No files matched your search
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("area")]
|
||||
public class Area : BaseEntity
|
||||
{
|
||||
/// <summary>所属仓库编码。</summary>
|
||||
[SugarColumn(ColumnName = "warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string WarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "code", Length = 64, IsNullable = false)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "name", Length = 256, IsNullable = false)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
public class BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = false)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "tenant_id", Length = 64, IsNullable = false)]
|
||||
public string TenantId { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "owner_code", Length = 64, IsNullable = false)]
|
||||
public string OwnerCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "create_time", IsNullable = true)]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "create_by", IsNullable = true)]
|
||||
public string? CreateBy { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "update_by", IsNullable = true)]
|
||||
public string? UpdateBy { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "update_time", IsNullable = true)]
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "is_deleted")]
|
||||
public bool IsDeleted { get; set; } = false;
|
||||
|
||||
[SugarColumn(ColumnName = "delete_time", IsNullable = true)]
|
||||
public DateTime? DeleteTime { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "delete_by", IsNullable = true)]
|
||||
public string? DeleteBy { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("container")]
|
||||
public class Container : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "code", Length = 64, IsNullable = false)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "name", Length = 256, IsNullable = true)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "container_type", Length = 64, IsNullable = true)]
|
||||
public string? ContainerType { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// HTTP 访问日志(仅落库请求/响应文本,不包含 SQL)。
|
||||
/// </summary>
|
||||
[SugarTable("http_access_log")]
|
||||
public class HttpAccessLog
|
||||
{
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = false)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "trace_id", Length = 64, IsNullable = false)]
|
||||
public string TraceId { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "http_method", Length = 16, IsNullable = false)]
|
||||
public string HttpMethod { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "path", Length = 512, IsNullable = false)]
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "query_string", ColumnDataType = "text", IsNullable = true)]
|
||||
public string? QueryString { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "status_code", IsNullable = false)]
|
||||
public int StatusCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "request_body", ColumnDataType = "text", IsNullable = true)]
|
||||
public string? RequestBody { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "response_body", ColumnDataType = "text", IsNullable = true)]
|
||||
public string? ResponseBody { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "duration_ms", IsNullable = true)]
|
||||
public int? DurationMs { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "client_ip", Length = 64, IsNullable = true)]
|
||||
public string? ClientIp { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "user_id", Length = 128, IsNullable = true)]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "create_time", IsNullable = true)]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("inbound_order")]
|
||||
public class InboundOrder : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "order_no", Length = 128, IsNullable = false)]
|
||||
public string OrderNo { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "biz_type", Length = 64, IsNullable = true)]
|
||||
public string? BizType { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "order_status", IsNullable = false)]
|
||||
public OrderStatus OrderStatus { get; set; } = OrderStatus.Draft;
|
||||
|
||||
[SugarColumn(ColumnName = "remark", Length = 512, IsNullable = true)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("inbound_order_line")]
|
||||
public class InboundOrderLine : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "order_id", IsNullable = false)]
|
||||
public long OrderId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "line_no", IsNullable = false)]
|
||||
public int LineNo { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "inventory_kind", IsNullable = false)]
|
||||
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
|
||||
|
||||
[SugarColumn(ColumnName = "material_code", Length = 64, IsNullable = true)]
|
||||
public string? MaterialCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "container_code", Length = 64, IsNullable = true)]
|
||||
public string? ContainerCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string WarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "area_code", Length = 64, IsNullable = false)]
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "location_code", Length = 64, IsNullable = true)]
|
||||
public string? LocationCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "qty", IsNullable = false)]
|
||||
public decimal Qty { get; set; }
|
||||
|
||||
/// <summary>供 CodeFirst 加列时为历史行生成默认值,避免 NOT NULL 无 DEFAULT 失败。</summary>
|
||||
[SugarColumn(ColumnName = "received_qty", IsNullable = false, DefaultValue = "0")]
|
||||
public decimal ReceivedQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "line_status", IsNullable = false, DefaultValue = "1")]
|
||||
public OrderLineStatus LineStatus { get; set; } = OrderLineStatus.Open;
|
||||
|
||||
[SugarColumn(ColumnName = "unit", Length = 32, IsNullable = true)]
|
||||
public string? Unit { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("inventory")]
|
||||
public class Inventory : BaseEntity
|
||||
{
|
||||
/// <summary>1=物料库存,2=空容器库存。</summary>
|
||||
[SugarColumn(ColumnName = "inventory_kind", IsNullable = false)]
|
||||
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
|
||||
|
||||
[SugarColumn(ColumnName = "material_code", Length = 64, IsNullable = true)]
|
||||
public string? MaterialCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "container_code", Length = 64, IsNullable = true)]
|
||||
public string? ContainerCode { get; set; }
|
||||
|
||||
/// <summary>与 location 表一致,便于按仓库-库区-分区-储位查询。</summary>
|
||||
[SugarColumn(ColumnName = "warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string WarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "area_code", Length = 64, IsNullable = false)]
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>分区编码。</summary>
|
||||
[SugarColumn(ColumnName = "zone_code", Length = 64, IsNullable = false)]
|
||||
public string ZoneCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>储位编码,对应 location.code。</summary>
|
||||
[SugarColumn(ColumnName = "location_code", Length = 64, IsNullable = false)]
|
||||
public string LocationCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "qty", IsNullable = false)]
|
||||
public decimal Qty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "pending_inbound_qty", IsNullable = false)]
|
||||
public decimal PendingInboundQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "pending_outbound_qty", IsNullable = false)]
|
||||
public decimal PendingOutboundQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "frozen_qty", IsNullable = false)]
|
||||
public decimal FrozenQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "inventory_status", IsNullable = false)]
|
||||
public InventoryStatus InventoryStatus { get; set; } = InventoryStatus.Available;
|
||||
|
||||
[SugarColumn(ColumnName = "unit", Length = 32, IsNullable = false)]
|
||||
public string Unit { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("inventory_transaction")]
|
||||
public class InventoryTransaction : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "inventory_id", IsNullable = false)]
|
||||
public long InventoryId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "movement_type", IsNullable = false)]
|
||||
public InventoryMovementType MovementType { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "inventory_status", IsNullable = false)]
|
||||
public InventoryStatus InventoryStatus { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "biz_no", Length = 128, IsNullable = true)]
|
||||
public string? BizNo { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "before_qty", IsNullable = false)]
|
||||
public decimal BeforeQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "after_qty", IsNullable = false)]
|
||||
public decimal AfterQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "before_pending_inbound_qty", IsNullable = false)]
|
||||
public decimal BeforePendingInboundQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "after_pending_inbound_qty", IsNullable = false)]
|
||||
public decimal AfterPendingInboundQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "before_pending_outbound_qty", IsNullable = false)]
|
||||
public decimal BeforePendingOutboundQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "after_pending_outbound_qty", IsNullable = false)]
|
||||
public decimal AfterPendingOutboundQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "before_frozen_qty", IsNullable = false)]
|
||||
public decimal BeforeFrozenQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "after_frozen_qty", IsNullable = false)]
|
||||
public decimal AfterFrozenQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "change_qty", IsNullable = false)]
|
||||
public decimal ChangeQty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "material_code", Length = 64, IsNullable = true)]
|
||||
public string? MaterialCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "container_code", Length = 64, IsNullable = true)]
|
||||
public string? ContainerCode { get; set; }
|
||||
|
||||
/// <summary>流水快照。</summary>
|
||||
[SugarColumn(ColumnName = "warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string WarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "area_code", Length = 64, IsNullable = false)]
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "zone_code", Length = 64, IsNullable = false)]
|
||||
public string ZoneCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "location_code", Length = 64, IsNullable = true)]
|
||||
public string? LocationCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("location")]
|
||||
public class Location : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string WarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "area_code", Length = 64, IsNullable = false)]
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>分区编码。</summary>
|
||||
[SugarColumn(ColumnName = "zone_code", Length = 64, IsNullable = false)]
|
||||
public string ZoneCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>伸位编码(可选,批量生成时可写入模板中 Aisle 占位符便于筛选)。</summary>
|
||||
[SugarColumn(ColumnName = "aisle_code", Length = 64, IsNullable = true)]
|
||||
public string? AisleCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "code", Length = 64, IsNullable = false)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "name", Length = 256, IsNullable = true)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>货架/网格行号(可选)。</summary>
|
||||
[SugarColumn(ColumnName = "row_no", IsNullable = true)]
|
||||
public int? RowNo { get; set; }
|
||||
|
||||
/// <summary>货架/网格列号(可选)。</summary>
|
||||
[SugarColumn(ColumnName = "column_no", IsNullable = true)]
|
||||
public int? ColumnNo { get; set; }
|
||||
|
||||
/// <summary>层号(可选)。</summary>
|
||||
[SugarColumn(ColumnName = "layer_no", IsNullable = true)]
|
||||
public int? LayerNo { get; set; }
|
||||
|
||||
/// <summary>储位高度(业务自定单位,如 mm)。</summary>
|
||||
[SugarColumn(ColumnName = "height", IsNullable = true)]
|
||||
public decimal? Height { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "location_status", IsNullable = false)]
|
||||
public LocationStatus LocationStatus { get; set; } = LocationStatus.Empty;
|
||||
|
||||
/// <summary>是否外侧仓位(双伸位等场景,外侧先取货)。</summary>
|
||||
[SugarColumn(ColumnName = "is_outer", IsNullable = false)]
|
||||
public bool IsOuter { get; set; }
|
||||
|
||||
/// <summary>绑定的容器编码(可选)。</summary>
|
||||
[SugarColumn(ColumnName = "container_code", Length = 64, IsNullable = true)]
|
||||
public string? ContainerCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("material")]
|
||||
public class Material : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "code", Length = 64, IsNullable = false)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "name", Length = 256, IsNullable = false)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "spec", Length = 512, IsNullable = true)]
|
||||
public string? Spec { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "unit", Length = 32, IsNullable = false)]
|
||||
public string Unit { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("outbound_order")]
|
||||
public class OutboundOrder : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "order_no", Length = 128, IsNullable = false)]
|
||||
public string OrderNo { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "biz_type", Length = 64, IsNullable = true)]
|
||||
public string? BizType { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "order_status", IsNullable = false)]
|
||||
public OrderStatus OrderStatus { get; set; } = OrderStatus.Draft;
|
||||
|
||||
[SugarColumn(ColumnName = "remark", Length = 512, IsNullable = true)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("outbound_order_line")]
|
||||
public class OutboundOrderLine : InboundOrderLine
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("stocktake_order")]
|
||||
public class StocktakeOrder : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "order_no", Length = 128, IsNullable = false)]
|
||||
public string OrderNo { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "biz_type", Length = 64, IsNullable = true)]
|
||||
public string? BizType { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "order_status", IsNullable = false)]
|
||||
public OrderStatus OrderStatus { get; set; } = OrderStatus.Draft;
|
||||
|
||||
[SugarColumn(ColumnName = "remark", Length = 512, IsNullable = true)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("stocktake_order_line")]
|
||||
public class StocktakeOrderLine : InboundOrderLine
|
||||
{
|
||||
[SugarColumn(ColumnName = "counted_qty", IsNullable = false)]
|
||||
public decimal CountedQty { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("sys_dict_item")]
|
||||
public class SysDictItem : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "category", Length = 128, IsNullable = false)]
|
||||
public string Category { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "code", Length = 128, IsNullable = false)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "label", Length = 512, IsNullable = false)]
|
||||
public string Label { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "sort_order", IsNullable = false)]
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "is_enabled", IsNullable = false)]
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("sys_template")]
|
||||
public class SysTemplate : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "biz_type", Length = 64, IsNullable = false)]
|
||||
public string BizType { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "biz_name", Length = 128, IsNullable = false)]
|
||||
public string BizName { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "config_json", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public string? ConfigJson { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("sys_user")]
|
||||
public class SysUser : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "username", Length = 64, IsNullable = false)]
|
||||
public string Username { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "password_hash", Length = 256, IsNullable = false)]
|
||||
public string PasswordHash { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "display_name", Length = 128, IsNullable = true)]
|
||||
public string? DisplayName { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "is_enabled", IsNullable = false)]
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace WmsLite.Api.Models.Templates;
|
||||
|
||||
/// <summary>
|
||||
/// 模板 configJson 中单项字段(已通过结构校验)。
|
||||
/// </summary>
|
||||
public sealed class TemplateFieldConfig
|
||||
{
|
||||
public string Field { get; init; } = string.Empty;
|
||||
|
||||
public string Label { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>规范化小写:text, number, decimal, int, bool, date, datetime</summary>
|
||||
public string Type { get; init; } = "text";
|
||||
|
||||
public bool Required { get; init; }
|
||||
|
||||
public bool Queryable { get; init; }
|
||||
|
||||
public string? QueryMode { get; init; }
|
||||
|
||||
public object? DefaultValue { get; init; }
|
||||
|
||||
/// <summary>与历史逻辑一致:可查询或显式配置了 queryMode 即可作为搜索条件。</summary>
|
||||
public bool AllowQuery => Queryable || !string.IsNullOrWhiteSpace(QueryMode);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("transfer_order")]
|
||||
public class TransferOrder : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "order_no", Length = 128, IsNullable = false)]
|
||||
public string OrderNo { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "biz_type", Length = 64, IsNullable = true)]
|
||||
public string? BizType { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "order_status", IsNullable = false)]
|
||||
public OrderStatus OrderStatus { get; set; } = OrderStatus.Draft;
|
||||
|
||||
[SugarColumn(ColumnName = "remark", Length = 512, IsNullable = true)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Enums;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("transfer_order_line")]
|
||||
public class TransferOrderLine : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "order_id", IsNullable = false)]
|
||||
public long OrderId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "line_no", IsNullable = false)]
|
||||
public int LineNo { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "inventory_kind", IsNullable = false)]
|
||||
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
|
||||
|
||||
[SugarColumn(ColumnName = "material_code", Length = 64, IsNullable = true)]
|
||||
public string? MaterialCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "container_code", Length = 64, IsNullable = true)]
|
||||
public string? ContainerCode { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "from_warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string FromWarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "from_area_code", Length = 64, IsNullable = false)]
|
||||
public string FromAreaCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "from_location_code", Length = 64, IsNullable = false)]
|
||||
public string FromLocationCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "to_warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string ToWarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "to_area_code", Length = 64, IsNullable = false)]
|
||||
public string ToAreaCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "to_location_code", Length = 64, IsNullable = false)]
|
||||
public string ToLocationCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "qty", IsNullable = false)]
|
||||
public decimal Qty { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "unit", Length = 32, IsNullable = false)]
|
||||
public string Unit { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("warehouse")]
|
||||
public class Warehouse : BaseEntity
|
||||
{
|
||||
[SugarColumn(ColumnName = "code", Length = 64, IsNullable = false)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "name", Length = 256, IsNullable = false)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
|
||||
namespace WmsLite.Api.Models;
|
||||
|
||||
[SugarTable("zone")]
|
||||
public class Zone : BaseEntity
|
||||
{
|
||||
/// <summary>关联仓库编码。</summary>
|
||||
[SugarColumn(ColumnName = "warehouse_code", Length = 64, IsNullable = false)]
|
||||
public string WarehouseCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>隶属库区。<c>Code</c> 为分区编码。</summary>
|
||||
[SugarColumn(ColumnName = "area_code", Length = 64, IsNullable = false)]
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "code", Length = 64, IsNullable = false)]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "name", Length = 256, IsNullable = false)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
|
||||
public Dictionary<string, object>? Attrs { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user