20261109 #20

Merged
zzh merged 9 commits from test into master 2026-11-09 10:07:44 +08:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit c847fadd06 - Show all commits

View File

@ -20,6 +20,9 @@ public class SalesProductPublishSyncStatusOutput
/// <summary>线上快照内容哈希。</summary>
public string? OnlineContentHash { get; set; }
/// <summary>是否已启用价格发布审批定义(前端发布弹窗文案切换用)。</summary>
public bool ApprovalRequired { get; set; }
/// <summary>是否存在在途价格审批(Pending)。</summary>
public bool ApprovalPending { get; set; }

View File

@ -38,6 +38,8 @@ public partial class SalesProductService : ApplicationService
LazyServiceProvider.GetRequiredService<IApprovalInstanceRepository>();
private IApprovalTaskRepository ApprovalTaskRepository =>
LazyServiceProvider.GetRequiredService<IApprovalTaskRepository>();
private IApprovalDefinitionRepository ApprovalDefinitionRepository =>
LazyServiceProvider.GetRequiredService<IApprovalDefinitionRepository>();
/// <summary>
/// 查询销售产品列表。
@ -438,7 +440,8 @@ public partial class SalesProductService : ApplicationService
? OmsDocHelper.HashSalesProductPriceSnapshotForSync(currentSnapshot)
: OmsDocHelper.HashSalesProductRulesSnapshotForSync(currentSnapshot));
// 价格:在途审批,或最近一次失败终态(驳回/撤回/执行失败)供重新提交引导
// 价格:是否启用审批定义 + 在途/失败终态
var approvalRequired = false;
var approvalPending = false;
var approvalFailed = false;
int? approvalInstanceId = null;
@ -447,6 +450,10 @@ public partial class SalesProductService : ApplicationService
string? approvalComment = null;
if (normalized == PriceOperatorType)
{
var enabledDef = await ApprovalDefinitionRepository.FirstOrDefaultAsync(x =>
x.OperationCode == ApprovalCodes.SalesProductPublishPrice && x.IsEnabled);
approvalRequired = enabledDef != null;
var approvalState = await ResolvePricePublishApprovalStateAsync(salesProductId);
approvalPending = approvalState.Pending;
approvalFailed = approvalState.Failed;
@ -501,6 +508,7 @@ public partial class SalesProductService : ApplicationService
OnlinePublishTime = onlinePublishTime,
PendingContentHash = currentHash,
OnlineContentHash = onlineContentHash,
ApprovalRequired = approvalRequired,
ApprovalPending = approvalPending,
ApprovalFailed = approvalFailed,
ApprovalInstanceId = approvalInstanceId,