feat(cost-center): 统一商品成本中心为全系统唯一标准价格源并闭环改价与工单同步
- 核心架构:将商品与成本中心确立为全系统唯一标准价格源,接单模板价格在接单平台禁止编辑并提示收敛至成本中心,后端 saveAdminWorkProductRule 严格拦截价格篡改 - 改价与同步:标准商品目录与自动发货专属面板提供统一改价弹窗,支持追溯/立即生效/指定时间;改价后自动或手动将新价格同步至接单大厅待抢单工单,保持下游业务一致 - 缺陷修复:修复 cost_versions 追溯改价时因同生效时间违反 chk_cost_versions_period 检查约束及 uq_cost_versions_scope 唯一索引冲突的问题,采用 active 版本就地更新机制 - 分类树优化:工单二级分类树限定仅在工单来源展示,自动发货与人工客服彻底隐藏分类树并重置过滤条件 - 验证方式:通过后端 784 项全量测试、前后端 tsc 类型检查及前端生产构建打包
This commit is contained in:
@@ -117,6 +117,53 @@ export function backfillAdminAffiliateDashSkus() {
|
||||
}>('/api/v1/admin/cost-center/affiliate-products/backfill')
|
||||
}
|
||||
|
||||
export function importAdminAffiliateDashPricesBaseline() {
|
||||
return apiPost<{
|
||||
total: number
|
||||
createdProductCount: number
|
||||
createdVersionCount: number
|
||||
updatedVersionCount: number
|
||||
skippedCount: number
|
||||
}>('/api/v1/admin/cost-center/affiliate-products/price-baseline')
|
||||
}
|
||||
|
||||
export function setAdminAffiliateProductPrice(
|
||||
productId: number,
|
||||
payload: {
|
||||
amountFen: number
|
||||
effectiveFrom?: string
|
||||
retroactive?: boolean
|
||||
changeReason?: string
|
||||
},
|
||||
) {
|
||||
return apiPost<{
|
||||
success: boolean
|
||||
costVersionId: number
|
||||
amountFen: number
|
||||
effectiveFrom: string
|
||||
message: string
|
||||
}>(`/api/v1/admin/cost-center/affiliate-products/${productId}/price`, payload)
|
||||
}
|
||||
|
||||
export function syncAdminAffiliateDashCostSnapshots() {
|
||||
return apiPost<{
|
||||
snapshotResult: {
|
||||
range: { fromDate: string; toDate: string }
|
||||
createdCount: number
|
||||
exceptionCreatedCount: number
|
||||
resolvedExceptionCount: number
|
||||
}
|
||||
factsResult: {
|
||||
fromDate: string
|
||||
toDate: string
|
||||
deletedCount: number
|
||||
insertedCount: number
|
||||
batchCount: number
|
||||
}
|
||||
}>('/api/v1/admin/cost-center/affiliate-products/sync-snapshots')
|
||||
}
|
||||
|
||||
|
||||
export function updateAdminProductCatalog(productId: number, payload: Record<string, unknown>) {
|
||||
return apiPatch<{ product: ProductCatalogItem }>(
|
||||
`/api/v1/admin/cost-center/products/${productId}`,
|
||||
@@ -417,3 +464,43 @@ export function confirmAdminManualFulfillment(payload: {
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function setAdminProductPrice(
|
||||
productId: number,
|
||||
payload: {
|
||||
amountFen: number
|
||||
effectiveFrom?: string
|
||||
retroactive?: boolean
|
||||
changeReason?: string
|
||||
syncOpenOrders?: boolean
|
||||
},
|
||||
) {
|
||||
return apiPost<{
|
||||
success: boolean
|
||||
costVersionId: number
|
||||
amountFen: number
|
||||
effectiveFrom: string
|
||||
syncedOrders?: {
|
||||
candidateCount: number
|
||||
updatedCount: number
|
||||
updatedNormalCount: number
|
||||
updatedPartialSharingCount: number
|
||||
}
|
||||
message?: string
|
||||
}>(`/api/v1/admin/cost-center/products/${productId}/price`, payload)
|
||||
}
|
||||
|
||||
export function syncAdminProductPrice(productId: number) {
|
||||
return apiPost<{
|
||||
success: boolean
|
||||
type: string
|
||||
synced?: {
|
||||
candidateCount: number
|
||||
updatedCount: number
|
||||
updatedNormalCount: number
|
||||
updatedPartialSharingCount: number
|
||||
}
|
||||
message: string
|
||||
}>(`/api/v1/admin/cost-center/products/${productId}/sync-price`, {})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user