303 lines
7.3 KiB
C#
303 lines
7.3 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using WmsLite.Api.Dtos.Common;
|
|
using WmsLite.Api.Enums;
|
|
|
|
namespace WmsLite.Api.Dtos.Orders;
|
|
|
|
public abstract class OrderSaveRequestBase
|
|
{
|
|
[StringLength(128)]
|
|
public string OrderNo { get; set; } = string.Empty;
|
|
|
|
[StringLength(64)]
|
|
public string? BizType { get; set; }
|
|
|
|
[StringLength(512)]
|
|
public string? Remark { get; set; }
|
|
|
|
public Dictionary<string, object>? Attrs { get; set; }
|
|
}
|
|
|
|
public class OrderHeaderCreateRequest : OrderSaveRequestBase
|
|
{
|
|
}
|
|
|
|
public abstract class OrderPagedQueryBase : BasePagedQuery
|
|
{
|
|
[StringLength(128)]
|
|
public string? OrderNo { get; set; }
|
|
|
|
[StringLength(64)]
|
|
public string? BizType { get; set; }
|
|
|
|
public OrderStatus? OrderStatus { get; set; }
|
|
}
|
|
|
|
public class OrderActionRequest
|
|
{
|
|
[Range(1, long.MaxValue)]
|
|
public long Id { get; set; }
|
|
}
|
|
|
|
public class InboundOrderAddLineRequest
|
|
{
|
|
[Range(1, long.MaxValue)]
|
|
public long OrderId { get; set; }
|
|
|
|
[Required]
|
|
public InboundOrderLineSaveRequest Line { get; set; } = new();
|
|
}
|
|
|
|
public class OutboundOrderAddLineRequest
|
|
{
|
|
[Range(1, long.MaxValue)]
|
|
public long OrderId { get; set; }
|
|
|
|
[Required]
|
|
public OutboundOrderLineRequest Line { get; set; } = new();
|
|
}
|
|
|
|
public class PickTaskActionRequest
|
|
{
|
|
[Range(1, long.MaxValue)]
|
|
public long Id { get; set; }
|
|
|
|
[Range(typeof(decimal), "0.000001", "9999999999999999")]
|
|
public decimal? PickedQty { get; set; }
|
|
|
|
[StringLength(512)]
|
|
public string? ExceptionReason { get; set; }
|
|
}
|
|
|
|
public class InventoryOrderLineRequest
|
|
{
|
|
[Required]
|
|
[EnumDataType(typeof(InventoryKind))]
|
|
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
|
|
|
|
[StringLength(64)]
|
|
public string? MaterialCode { get; set; }
|
|
|
|
[StringLength(64)]
|
|
public string? ContainerCode { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string WarehouseCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string AreaCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string LocationCode { get; set; } = string.Empty;
|
|
|
|
[Range(typeof(decimal), "0.000001", "9999999999999999")]
|
|
public decimal Qty { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(32)]
|
|
public string Unit { get; set; } = string.Empty;
|
|
|
|
public Dictionary<string, object>? Attrs { get; set; }
|
|
}
|
|
|
|
public class TransferOrderLineRequest
|
|
{
|
|
[Required]
|
|
[EnumDataType(typeof(InventoryKind))]
|
|
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
|
|
|
|
[StringLength(64)]
|
|
public string? MaterialCode { get; set; }
|
|
|
|
[StringLength(64)]
|
|
public string? ContainerCode { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string FromWarehouseCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string FromAreaCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string FromLocationCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string ToWarehouseCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string ToAreaCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string ToLocationCode { get; set; } = string.Empty;
|
|
|
|
[Range(typeof(decimal), "0.000001", "9999999999999999")]
|
|
public decimal Qty { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(32)]
|
|
public string Unit { get; set; } = string.Empty;
|
|
|
|
public Dictionary<string, object>? Attrs { get; set; }
|
|
}
|
|
|
|
public class StocktakeOrderLineRequest : InventoryOrderLineRequest
|
|
{
|
|
[Range(typeof(decimal), "0", "9999999999999999")]
|
|
public decimal CountedQty { get; set; }
|
|
}
|
|
|
|
/// <summary>?????????????????? JSON?</summary>
|
|
public class InboundOrderCreateRequest : OrderSaveRequestBase
|
|
{
|
|
public List<InboundOrderLineSaveRequest> Lines { get; set; } = new();
|
|
}
|
|
|
|
public class InboundOrderLineSaveRequest
|
|
{
|
|
[Required]
|
|
[EnumDataType(typeof(InventoryKind))]
|
|
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
|
|
|
|
[StringLength(64)]
|
|
public string? MaterialCode { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string WarehouseCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string AreaCode { get; set; } = string.Empty;
|
|
|
|
[Range(typeof(decimal), "0.000001", "9999999999999999")]
|
|
public decimal Qty { get; set; }
|
|
|
|
public Dictionary<string, object>? Attrs { get; set; }
|
|
}
|
|
|
|
public class InboundOrderLineConfirmRequest
|
|
{
|
|
[Required]
|
|
public string LineId { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string LocationCode { get; set; } = string.Empty;
|
|
|
|
[Range(typeof(decimal), "0.000001", "9999999999999999")]
|
|
public decimal Qty { get; set; }
|
|
|
|
/// <summary>???????????????????</summary>
|
|
[StringLength(64)]
|
|
public string? ContainerCode { get; set; }
|
|
|
|
/// <summary>???????????????????????????</summary>
|
|
[StringLength(32)]
|
|
public string? Unit { get; set; }
|
|
}
|
|
|
|
public class InboundConfirmLineResultDto
|
|
{
|
|
public OrderViewDto Order { get; set; } = null!;
|
|
|
|
public InventoryOrderLineViewDto Line { get; set; } = null!;
|
|
}
|
|
|
|
public class OutboundOrderSaveRequest : OrderSaveRequestBase
|
|
{
|
|
public List<OutboundOrderLineRequest> Lines { get; set; } = new();
|
|
}
|
|
|
|
public class OutboundOrderLineRequest
|
|
{
|
|
[Required]
|
|
[EnumDataType(typeof(InventoryKind))]
|
|
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
|
|
|
|
[StringLength(64)]
|
|
public string? MaterialCode { get; set; }
|
|
|
|
[StringLength(64)]
|
|
public string? ContainerCode { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string WarehouseCode { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string AreaCode { get; set; } = string.Empty;
|
|
|
|
/// <summary>可选。为空时由库存分配服务在仓库+库区范围内自动分配;有值时只从指定库位分配。</summary>
|
|
[StringLength(64)]
|
|
public string? LocationCode { get; set; }
|
|
|
|
[Range(typeof(decimal), "0.000001", "9999999999999999")]
|
|
public decimal Qty { get; set; }
|
|
|
|
[StringLength(32)]
|
|
public string? Unit { get; set; }
|
|
|
|
public Dictionary<string, object>? Attrs { get; set; }
|
|
}
|
|
|
|
public class TransferOrderSaveRequest : OrderSaveRequestBase
|
|
{
|
|
[MinLength(1)]
|
|
public List<TransferOrderLineRequest> Lines { get; set; } = new();
|
|
}
|
|
|
|
public class StocktakeOrderSaveRequest : OrderSaveRequestBase
|
|
{
|
|
[MinLength(1)]
|
|
public List<StocktakeOrderLineRequest> Lines { get; set; } = new();
|
|
}
|
|
|
|
public class InboundOrderPagedQuery : OrderPagedQueryBase
|
|
{
|
|
}
|
|
|
|
public class OutboundOrderPagedQuery : OrderPagedQueryBase
|
|
{
|
|
}
|
|
|
|
public class TransferOrderPagedQuery : OrderPagedQueryBase
|
|
{
|
|
}
|
|
|
|
public class StocktakeOrderPagedQuery : OrderPagedQueryBase
|
|
{
|
|
}
|
|
|
|
public class OrderViewDto
|
|
{
|
|
/// <summary>??????????? JSON number + ???????</summary>
|
|
public string Id { get; set; } = string.Empty;
|
|
|
|
public string TenantId { get; set; } = string.Empty;
|
|
|
|
public string OwnerCode { get; set; } = string.Empty;
|
|
|
|
public string OrderNo { get; set; } = string.Empty;
|
|
|
|
public string? BizType { get; set; }
|
|
|
|
public OrderStatus OrderStatus { get; set; }
|
|
|
|
public string? Remark { get; set; }
|
|
|
|
public Dictionary<string, object>? Attrs { get; set; }
|
|
|
|
public DateTime? CreateTime { get; set; }
|
|
}
|