中性化库存凭据类型

This commit is contained in:
yml
2026-05-25 22:11:30 +08:00
parent 8ce16d9a36
commit 2103416c7b
14 changed files with 42 additions and 28 deletions
@@ -35,7 +35,7 @@ export async function createAdminInventoryItem(
const skuCode = String(payload.skuCode || '').trim()
const displayValue = String(payload.displayValue || '').trim()
const batchNo = String(payload.batchNo || '').trim()
const credentialType = String(payload.credentialType || 'tencent_code').trim() || 'tencent_code'
const credentialType = String(payload.credentialType || 'claim_code').trim() || 'claim_code'
const inventoryGroupCode = String(payload.inventoryGroupCode || '').trim()
if (!skuCode || !displayValue) {
@@ -160,7 +160,7 @@ function normalizeInventoryImportRows(payload: AdminInventoryImportInput): Norma
const skuCode = String(row?.skuCode || '').trim()
const displayValue = String(row?.displayValue || '').trim()
const batchNo = String(row?.batchNo || '').trim()
const credentialType = String(row?.credentialType || payload.credentialType || 'tencent_code').trim() || 'tencent_code'
const credentialType = String(row?.credentialType || payload.credentialType || 'claim_code').trim() || 'claim_code'
const inventoryGroupCode = String(row?.inventoryGroupCode || payload.inventoryGroupCode || '').trim()
if (!skuCode || !displayValue) {
@@ -174,7 +174,7 @@ function normalizeInventoryImportRows(payload: AdminInventoryImportInput): Norma
if (bulkCodes.length > 0) {
const skuCode = String(payload.skuCode || '').trim()
const batchNo = String(payload.batchNo || '').trim()
const credentialType = String(payload.credentialType || 'tencent_code').trim() || 'tencent_code'
const credentialType = String(payload.credentialType || 'claim_code').trim() || 'claim_code'
const inventoryGroupCode = String(payload.inventoryGroupCode || '').trim()
if (!skuCode) {
@@ -201,7 +201,7 @@ function dedupeRows(rows: NormalizedInventoryImportRow[]): NormalizedInventoryIm
const output: NormalizedInventoryImportRow[] = []
for (const row of rows) {
const key = `${row.skuCode}::${row.credentialType || 'tencent_code'}::${row.displayValue}`
const key = `${row.skuCode}::${row.credentialType || 'claim_code'}::${row.displayValue}`
if (seen.has(key)) {
continue
}