feat(consignment): 停用客服手动入库,寄卖货源只走平台提报

背景:手动入库是唯一会造出「没有提报单的现货」的入口,这类货没有寄卖单号,
统一状态机/凭证链/搜索/卖家端单号锚定都串不起来,只能在界面回退显示内部仓库号 INV,
正是"一件货两个号"的残留。业务定调:寄卖货源只走「打手平台提报 → 客服审核入库」。

- 前端寄售仓库的「手动入库」入口整块删除(按钮 + 入库弹窗 + 提交逻辑 + 服务函数)
- 后端同时挡住,防旧页面缓存或直接调接口绕过:
  POST /worker-platform/consignment/inventories 返回 409 consignment_manual_inbound_disabled;
  死代码一并清掉(服务层原实现、仓库层 createConsignmentInventory)
- 提报审核入库路径不受影响,照旧生成内部仓库号 INV 并写 source_submission_id,
  即每件货都必然挂着寄卖单号,INV 只作为内部编号存在、界面不展示

真实库验证:接口被拒(409),且「没有提报单的现货行数」前后均为 0。
This commit is contained in:
yml2213
2026-09-17 11:41:46 +08:00
parent 47e09d72ce
commit 0c10f0e135
6 changed files with 50 additions and 454 deletions
@@ -321,88 +321,6 @@ export async function getConsignmentInventoryById(
return res.rows[0] || null
}
export async function createConsignmentInventory(input: {
inventoryNo: string
gameName?: string
categoryId?: number | null
itemName: string
system?: string
serverZone?: string
series?: string
diamondLevel?: number
brillianceCount?: number
costPriceFen?: number
buyerName?: string
inboundBatch?: string
sellerContact?: string
sellerGameId?: string
sellerPaymentInfo?: string
sellerPhone?: string
credentialsJson?: Record<string, unknown>
screenshotsJson?: unknown[]
remark?: string
allowMatching?: boolean
sourceType?: 'manual' | 'worker_portal' | 'recycle'
sourceSubmissionId?: number | null
workerId?: number | null
workerName?: string
workerPhone?: string
depositAmountFen?: number
now: string
}): Promise<ConsignmentInventoryRow> {
const sql = `
INSERT INTO consignment_inventories (
inventory_no, game_name, category_id, item_name, system, server_zone,
series, diamond_level, brilliance_count, cost_price_fen, buyer_name,
inbound_batch, seller_contact, seller_game_id, seller_payment_info,
seller_phone, credentials_json, screenshots_json, remark,
allow_matching, status, allocation_status, source_type,
source_submission_id, worker_id, worker_name, worker_phone, deposit_amount_fen,
inbound_at, created_at, updated_at
) VALUES (
$1, $2, $3, $4, $5, $6,
$7, $8, $9, $10, $11,
$12, $13, $14, $15,
$16, $17::jsonb, $18::jsonb, $19,
$20, 'in_stock', '待安排', $21,
$22, $23, $24, $25, $26,
$27, $27, $27
)
RETURNING *
`
const values = [
input.inventoryNo,
input.gameName || '和平精英',
input.categoryId || null,
input.itemName,
input.system || '',
input.serverZone || '',
input.series || '',
input.diamondLevel || 1,
input.brillianceCount || 0,
input.costPriceFen || 0,
input.buyerName || '',
input.inboundBatch || '',
input.sellerContact || '',
input.sellerGameId || '',
input.sellerPaymentInfo || '',
input.sellerPhone || '',
toJsonString(input.credentialsJson || {}),
toJsonString(input.screenshotsJson || []),
input.remark || '',
input.allowMatching !== false,
input.sourceType || 'manual',
input.sourceSubmissionId || null,
input.workerId || null,
input.workerName || '',
input.workerPhone || '',
input.depositAmountFen || 0,
input.now,
]
const res = await query<ConsignmentInventoryRow>(sql, values)
return res.rows[0]!
}
export async function updateConsignmentInventory(
id: number | string,
input: {