From c2ac20df0477e8c9f60451a5df691ee8b04eb3c6 Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Wed, 7 Oct 2026 19:14:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B9=B0=E4=BB=B7=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=90=BD=E5=BA=93=E4=B9=9F=E8=B5=B0=20canonical=20JSON?= =?UTF-8?q?=EF=BC=8C=E4=B8=8E=E5=90=8C=E6=AD=A5=E6=80=81=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../Services/Channels/ServiceChannelService.Helpers.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs b/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs index e3c2f22..825dde4 100644 --- a/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs +++ b/src/Oms.Application/Services/Channels/ServiceChannelService.Helpers.cs @@ -337,7 +337,11 @@ public partial class ServiceChannelService ? await BuildPricePublishSnapshotAsync(serviceChannelId) : await BuildRulesPublishSnapshotAsync(serviceChannelId); - // Content 中保存完整快照,回滚时直接从快照恢复。 + var content = operatorType == PriceOperatorType + ? OmsDocHelper.CanonicalizeChannelPriceSnapshotJson(snapshot) + : OmsDocHelper.SerializeSnapshotJson(snapshot); + + // Content 存 canonical 形态,与 sync-status 对比口径一致。 await ServiceChannelRepository.InsertPublishRecordAsync(new ServiceChannelPublishRecord { ServiceChannelId = serviceChannelId, @@ -347,7 +351,7 @@ public partial class ServiceChannelService PublishUser = string.IsNullOrWhiteSpace(CurrentUser.UserName) ? CurrentUser.GetId().ToString() : CurrentUser.UserName!, PublishTime = DateTime.Now, Description = description, - Content = OmsDocHelper.SerializeSnapshotJson(snapshot) + Content = content }); }