fix(admin): 恢复接单模板计价配置并统一成本价格链路

This commit is contained in:
yml2213
2026-11-02 17:57:49 +08:00
parent d871b93fde
commit a7bac9c1d8
27 changed files with 304 additions and 83 deletions
@@ -288,6 +288,7 @@ export type WorkProductRuleRow = {
auto_create: boolean
reward_amount: number
unit_price_fen: number
pricing_mode: 'fixed' | 'unit'
required_deposit_amount: number
deposit_threshold_amount: number
sharing_enabled: boolean
@@ -356,6 +356,7 @@ export async function upsertWorkProductRule(input: {
autoCreate: boolean
rewardAmount: number
unitPriceFen?: number
pricingMode: 'fixed' | 'unit'
requiredDepositAmount: number
depositThresholdAmount: number
sharingEnabled?: boolean
@@ -385,7 +386,7 @@ export async function upsertWorkProductRule(input: {
timeout_minutes, timeout_policy,
acceptance_mode, gift_cooldown_hours, gift_cooldown_minutes,
requirement_json, match_json,
sort_order, created_at, updated_at
sort_order, pricing_mode, created_at, updated_at
) VALUES (
$1, $2, $3, $4, $5, $6,
$7, $8, $9, $10, $11,
@@ -395,7 +396,7 @@ export async function upsertWorkProductRule(input: {
$19, $20,
$21, $22, $23,
$24::jsonb, $25::jsonb,
$26, $27, $28
$26, $27, $28, $29
)
ON CONFLICT (rule_key) DO UPDATE
SET
@@ -424,6 +425,7 @@ export async function upsertWorkProductRule(input: {
requirement_json = EXCLUDED.requirement_json,
match_json = EXCLUDED.match_json,
sort_order = EXCLUDED.sort_order,
pricing_mode = EXCLUDED.pricing_mode,
updated_at = EXCLUDED.updated_at
RETURNING *
`,
@@ -454,6 +456,7 @@ export async function upsertWorkProductRule(input: {
input.requirementJson,
input.matchJson || '{}',
input.sortOrder,
input.pricingMode,
input.now,
input.now,
],