diff --git a/src/Oms.Application/Dtos/Orders/ProductBillingSnapshotDtos.cs b/src/Oms.Application/Dtos/Orders/ProductBillingSnapshotDtos.cs index 660322c..feb4d90 100644 --- a/src/Oms.Application/Dtos/Orders/ProductBillingSnapshotDtos.cs +++ b/src/Oms.Application/Dtos/Orders/ProductBillingSnapshotDtos.cs @@ -116,7 +116,7 @@ public class ServiceChannelPricePublishSnapshotDto { public int ServiceChannelId { get; set; } - public List Prices { get; set; } = []; + public List Prices { get; set; } = []; } /// diff --git a/src/Oms.Application/Dtos/Orders/PublishSnapshotRuleDtos.cs b/src/Oms.Application/Dtos/Orders/PublishSnapshotRuleDtos.cs index a969d50..bd9ba46 100644 --- a/src/Oms.Application/Dtos/Orders/PublishSnapshotRuleDtos.cs +++ b/src/Oms.Application/Dtos/Orders/PublishSnapshotRuleDtos.cs @@ -90,3 +90,31 @@ public class SalesProductPriceSnapshotItemDto public List Details { get; set; } = []; } + +/// +/// 服务渠道卖价项快照(不含创建/更新时间)。 +/// +public class ServiceChannelPriceSnapshotItemDto +{ + public int Id { get; set; } + + public int ServiceChannelId { get; set; } + + public int SerialNumber { get; set; } + + public byte Status { get; set; } + + public string PriceName { get; set; } = string.Empty; + + public string CostItem { get; set; } = string.Empty; + + public string CostUnit { get; set; } = string.Empty; + + public string Currency { get; set; } = string.Empty; + + public string? ChargingCondition { get; set; } + + public List Factors { get; set; } = []; + + public List Details { get; set; } = []; +} diff --git a/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs b/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs index 455fc58..94af99d 100644 --- a/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs +++ b/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs @@ -1,4 +1,5 @@ using Oms.Application.Dtos.Channels; +using Oms.Application.Dtos.Orders; using Oms.Application.Dtos.Shared; using Oms.Application.Shared; using Oms.Domain.ChannelsAggregate.Entities; @@ -479,7 +480,7 @@ public partial class ServiceChannelService } } - private static ServiceChannelPriceSaveInput MapPriceSaveInput(ServiceChannelPriceListOutput output) + private static ServiceChannelPriceSaveInput MapPriceSaveInput(ServiceChannelPriceSnapshotItemDto output) { return new ServiceChannelPriceSaveInput { @@ -525,7 +526,7 @@ public partial class ServiceChannelService { public int ServiceChannelId { get; set; } - public List Prices { get; set; } = []; + public List Prices { get; set; } = []; } private sealed class ServiceChannelRulesPublishSnapshot diff --git a/src/Oms.Application/Services/Orders/OrderService.ParcelBilling.cs b/src/Oms.Application/Services/Orders/OrderService.ParcelBilling.cs index a8393a0..d386942 100644 --- a/src/Oms.Application/Services/Orders/OrderService.ParcelBilling.cs +++ b/src/Oms.Application/Services/Orders/OrderService.ParcelBilling.cs @@ -807,7 +807,7 @@ public partial class OrderService { return new ChannelPriceBinding { - Prices = snapshot.Prices, + Prices = snapshot.Prices.Select(PublishSnapshotSlimmer.ToChannelPriceListOutput).ToList(), PriceVersion = priceRecord.Version, PriceEffectiveTime = priceRecord.PublishTime }; diff --git a/src/Oms.Application/Shared/PublishSnapshotSlimmer.cs b/src/Oms.Application/Shared/PublishSnapshotSlimmer.cs index 8805ebf..bfb2826 100644 --- a/src/Oms.Application/Shared/PublishSnapshotSlimmer.cs +++ b/src/Oms.Application/Shared/PublishSnapshotSlimmer.cs @@ -24,7 +24,23 @@ public static class PublishSnapshotSlimmer Details = price.Details }; - public static ServiceChannelPriceListOutput SlimChannelPrice(ServiceChannelPriceListOutput price) => + public static ServiceChannelPriceSnapshotItemDto SlimChannelPrice(ServiceChannelPriceListOutput price) => + new() + { + Id = price.Id, + ServiceChannelId = price.ServiceChannelId, + SerialNumber = price.SerialNumber, + Status = price.Status, + PriceName = price.PriceName, + CostItem = price.CostItem, + CostUnit = price.CostUnit, + Currency = price.Currency, + ChargingCondition = price.ChargingCondition, + Factors = price.Factors, + Details = price.Details + }; + + public static ServiceChannelPriceListOutput ToChannelPriceListOutput(ServiceChannelPriceSnapshotItemDto price) => new() { Id = price.Id,