using Oms.Domain.Shared; using SqlSugar; namespace Oms.Domain.OrdersAggregate.Entities; /// /// 揽收单(上门取件履约 + 对客收款 + 承运结算)。 /// [SugarTable("t_pickup_order")] public class PickupOrder : OmsAuditedAggregateRoot { [SugarColumn(Length = 32)] public string PickupNo { get; set; } = string.Empty; [SugarColumn(Length = 64, IsNullable = true)] public string? RequestId { get; set; } public int CustomerId { get; set; } [SugarColumn(Length = 36, IsNullable = true)] public string? OrganizationId { get; set; } public int SecretLevel { get; set; } = 2; public int SenderAddressId { get; set; } /// /// 揽收方向:forward 正向(客户→仓)/ reverse 逆向(仓→客户)。 /// [SugarColumn(Length = 16)] public string Direction { get; set; } = "forward"; [SugarColumn(Length = 50)] public string SenderName { get; set; } = string.Empty; [SugarColumn(Length = 255, IsNullable = true)] public string? SenderCompany { get; set; } [SugarColumn(IsNullable = true)] public int? SenderCountry { get; set; } [SugarColumn(Length = 8, IsNullable = true)] public string? SenderCountryCode { get; set; } [SugarColumn(Length = 50, IsNullable = true)] public string? SenderProvince { get; set; } [SugarColumn(Length = 50, IsNullable = true)] public string? SenderCity { get; set; } [SugarColumn(Length = 50, IsNullable = true)] public string? SenderZipCode { get; set; } [SugarColumn(Length = 500)] public string SenderStreetAddress1 { get; set; } = string.Empty; [SugarColumn(Length = 500, IsNullable = true)] public string? SenderStreetAddress2 { get; set; } [SugarColumn(Length = 500, IsNullable = true)] public string? SenderStreetAddress3 { get; set; } [SugarColumn(Length = 50, IsNullable = true)] public string? SenderHouseNumber { get; set; } [SugarColumn(Length = 50, IsNullable = true)] public string? SenderPhone { get; set; } [SugarColumn(Length = 50, IsNullable = true)] public string? SenderTelePhone { get; set; } [SugarColumn(Length = 60, IsNullable = true)] public string? SenderEmail { get; set; } public int WarehouseId { get; set; } [SugarColumn(Length = 64, IsNullable = true)] public string? CarrierCode { get; set; } [SugarColumn(Length = 64, IsNullable = true)] public string? CarrierService { get; set; } [SugarColumn(Length = 64, IsNullable = true)] public string? CarrierWaybillNo { get; set; } public DateTime ExpectPickupTime { get; set; } [SugarColumn(IsNullable = true)] public DateTime? PickupWindowStart { get; set; } [SugarColumn(IsNullable = true)] public DateTime? PickupWindowEnd { get; set; } [SugarColumn(IsNullable = true)] public DateTime? ActualPickupTime { get; set; } [SugarColumn(Length = 32)] public string Status { get; set; } = "draft"; public int ParcelCount { get; set; } [SugarColumn(DecimalDigits = 3, IsNullable = true)] public decimal? TotalActualWeight { get; set; } /// /// 应收计费重(销售产品计重)。 /// [SugarColumn(DecimalDigits = 3, IsNullable = true)] public decimal? ChargeableWeight { get; set; } /// /// 应付计费重(服务渠道计重)。 /// [SugarColumn(DecimalDigits = 3, IsNullable = true)] public decimal? PayableChargeableWeight { get; set; } [SugarColumn(DecimalDigits = 3, IsNullable = true)] public decimal? VolumetricWeight { get; set; } /// /// 承运回传尺寸 JSON(goodsSizeList)。 /// [SugarColumn(ColumnDataType = "text", IsNullable = true)] public string? PackageSizesJson { get; set; } /// /// 承运计费重(仅对照,不算账)。 /// [SugarColumn(DecimalDigits = 3, IsNullable = true)] public decimal? CarrierFreightWeight { get; set; } /// /// 承运报价运费合计(仅对照)。 /// [SugarColumn(DecimalDigits = 2, IsNullable = true)] public decimal? CarrierQuotedFreightAmount { get; set; } /// /// 承运报文应收(仅对照,不是客户应收)。 /// [SugarColumn(DecimalDigits = 2, IsNullable = true)] public decimal? CarrierQuotedReceivableAmount { get; set; } /// /// 承运报价原文(附加费、服务方式等)。 /// [SugarColumn(ColumnDataType = "text", IsNullable = true)] public string? CarrierQuoteJson { get; set; } /// /// 系统卖价费用明细 JSON。 /// [SugarColumn(ColumnDataType = "text", IsNullable = true)] public string? ReceivableFeeJson { get; set; } /// /// 系统买价费用明细 JSON。 /// [SugarColumn(ColumnDataType = "text", IsNullable = true)] public string? PayableFeeJson { get; set; } [SugarColumn(IsNullable = true)] public DateTime? FeePushedAt { get; set; } [SugarColumn(Length = 8)] public string Currency { get; set; } = "CNY"; [SugarColumn(DecimalDigits = 2, IsNullable = true)] public decimal? FreightAmount { get; set; } [SugarColumn(DecimalDigits = 2, IsNullable = true)] public decimal? OtherFeeAmount { get; set; } [SugarColumn(DecimalDigits = 2, IsNullable = true)] public decimal? ReceivableAmount { get; set; } [SugarColumn(Length = 16)] public string PayStatus { get; set; } = "unpaid"; [SugarColumn(IsNullable = true)] public DateTime? PayTime { get; set; } [SugarColumn(Length = 16)] public string PayMode { get; set; } = "prepaid"; [SugarColumn(DecimalDigits = 2, IsNullable = true)] public decimal? CarrierPayableAmount { get; set; } [SugarColumn(Length = 16)] public string SettlementStatus { get; set; } = "none"; [SugarColumn(Length = 64, IsNullable = true)] public string? SettlementBatchNo { get; set; } [SugarColumn(IsNullable = true)] public DateTime? SettledAt { get; set; } [SugarColumn(Length = 512, IsNullable = true)] public string? Remark { get; set; } }