admin/src/Oms.Application/Dtos/Orders/ProductBillingSnapshotDtos.cs
zzh 2c69e8e5b8 feat: 规则快照固化计重/分区规则并修正卖价公式
规则发布写入黑名单、偏远、计重规则与进位明细;查价/下单优先读快照。修正 unit/total/continue 算价及续单价相邻档位总价基数。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 12:57:34 +08:00

147 lines
4.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Oms.Application.Dtos.Channels;
namespace Oms.Application.Dtos.Orders;
/// <summary>
/// 销售产品价格发布快照(与渠道发布 JSON 同构)。
/// </summary>
public class SalesProductPricePublishSnapshotDto
{
/// <summary>
/// 销售产品主键。
/// </summary>
public int SalesProductId { get; set; }
/// <summary>
/// 价格分区 ID(发布时固化,查价/计费优先用快照内分区规则)。
/// </summary>
public int? PriceAreaId { get; set; }
/// <summary>
/// 价格分区名称。
/// </summary>
public string? PriceAreaName { get; set; }
/// <summary>
/// 价格分区明细(国家/邮编等),发布时从 t_kpi_area_info 固化。
/// </summary>
public List<KpiAreaInfoOutput> PriceAreaInfos { get; set; } = [];
/// <summary>
/// 价格项列表。
/// </summary>
public List<SalesProductPriceListOutput> Prices { get; set; } = [];
}
/// <summary>
/// 销售产品规则发布快照(与渠道发布 JSON 同构)。
/// </summary>
public class SalesProductRulesPublishSnapshotDto
{
/// <summary>
/// 产品基础信息。
/// </summary>
public SalesProductSaveInput? Product { get; set; }
/// <summary>
/// 分配的服务商列表。
/// </summary>
public List<SalesProductAllocationProviderOutput> Providers { get; set; } = [];
/// <summary>
/// 黑名单分区 ID(发布时固化)。
/// </summary>
public int? BlacklistAreaId { get; set; }
/// <summary>
/// 黑名单分区名称。
/// </summary>
public string? BlacklistAreaName { get; set; }
/// <summary>
/// 黑名单分区明细,发布时从 t_kpi_area_info 固化。
/// </summary>
public List<KpiAreaInfoOutput> BlacklistAreaInfos { get; set; } = [];
/// <summary>
/// 偏远分区 ID(发布时固化)。
/// </summary>
public int? RemoteAreaId { get; set; }
/// <summary>
/// 偏远分区名称。
/// </summary>
public string? RemoteAreaName { get; set; }
/// <summary>
/// 偏远分区明细,发布时从 t_kpi_area_info 固化。
/// </summary>
public List<KpiAreaInfoOutput> RemoteAreaInfos { get; set; } = [];
/// <summary>
/// 计重规则 ID(发布时固化)。
/// </summary>
public int? WeightRuleId { get; set; }
/// <summary>
/// 计重规则名称。
/// </summary>
public string? WeightRuleName { get; set; }
/// <summary>
/// 计重规则明细,发布时从 t_weight_rule_info 固化。
/// </summary>
public List<WeightRuleInfoOutput> WeightRuleInfos { get; set; } = [];
/// <summary>
/// 计重进位 ID(发布时固化)。
/// </summary>
public int? WeightRoundingId { get; set; }
/// <summary>
/// 计重进位名称。
/// </summary>
public string? WeightRoundingName { get; set; }
/// <summary>
/// 计重进位区间,发布时从 t_weight_rounding_info 固化。
/// </summary>
public List<WeightRoundingInfoOutput> WeightRoundingInfos { get; set; } = [];
}
/// <summary>
/// 绑定到订单的快照版本信息。
/// </summary>
public class ProductSnapshotBinding
{
/// <summary>
/// 规则快照版本号。
/// </summary>
public string RulesVersion { get; set; } = string.Empty;
/// <summary>
/// 价格快照版本号。
/// </summary>
public string PriceVersion { get; set; } = string.Empty;
/// <summary>
/// 规则快照生效时间。
/// </summary>
public DateTime RulesEffectiveTime { get; set; }
/// <summary>
/// 价格快照生效时间。
/// </summary>
public DateTime PriceEffectiveTime { get; set; }
/// <summary>
/// 规则快照内容。
/// </summary>
public SalesProductRulesPublishSnapshotDto Rules { get; set; } = new();
/// <summary>
/// 价格快照内容。
/// </summary>
public SalesProductPricePublishSnapshotDto Price { get; set; } = new();
}