feat(supply-chain): refresh product type in daily archive sync
在每日产品档案同步链路中追加「产品类型」刷新步骤(定厂优先、JST vc_name 兜底),复用既有 timer 与库身份校验,无需单独回填或新增定时任务。
This commit is contained in:
parent
199be5d7cb
commit
7384163a2c
@ -91,11 +91,13 @@ async function main() {
|
||||
const [
|
||||
{ prisma },
|
||||
{ supplyChainProductArchiveEnrichmentSyncService },
|
||||
{ supplyChainProductArchiveProductionTypeFillService },
|
||||
{ supplyChainProductArchiveOpsDirectorSyncService },
|
||||
{ jstSkuProductArchiveFullSyncService },
|
||||
] = await Promise.all([
|
||||
import('../src/lib/prisma'),
|
||||
import('../src/server/services/supply-chain-product-archive-enrichment-sync.service'),
|
||||
import('../src/server/services/supply-chain-product-archive-production-type-fill.service'),
|
||||
import('../src/server/services/supply-chain-product-archive-ops-director-sync.service'),
|
||||
syncJstBase
|
||||
? import('../src/server/services/jst-sku-product-archive-full-sync.service')
|
||||
@ -119,10 +121,18 @@ async function main() {
|
||||
: await supplyChainProductArchiveEnrichmentSyncService.syncAll({
|
||||
batchSize: batchSizeValue,
|
||||
})
|
||||
// 「产品类型」每天跟主档案一起刷新:定厂优先、JST vc_name 兜底。
|
||||
const productionTypeResult = opsDirectorOnly
|
||||
? null
|
||||
: await supplyChainProductArchiveProductionTypeFillService.syncAll({
|
||||
apply: true,
|
||||
batchSize: batchSizeValue,
|
||||
})
|
||||
console.log(JSON.stringify({
|
||||
baseResult,
|
||||
opsDirectorResult,
|
||||
enrichmentResult,
|
||||
productionTypeResult,
|
||||
}, null, 2))
|
||||
} finally {
|
||||
await prisma.$disconnect()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user