fix(fulfillment): 增加待映射队列
- 待映射任务未配置商品映射时不再被列表过滤掉 - 工作台新增待映射标签,显示同步后尚未映射的订单 - 补充未映射任务列表测试
This commit is contained in:
@@ -216,12 +216,14 @@ def list_tasks(
|
||||
cutoff = _order_match_started_at(db)
|
||||
query = db.query(PlatformFulfillmentTask)
|
||||
query = _apply_order_match_cutoff(query, cutoff)
|
||||
query = query.filter(
|
||||
or_(
|
||||
PlatformFulfillmentTask.commodity_mapping_id.isnot(None),
|
||||
PlatformFulfillmentTask.commodity_id != "",
|
||||
# 待映射队列本身就是要展示“还没有映射”的任务,不能再套映射存在条件。
|
||||
if queue_bucket != "pending_mapping":
|
||||
query = query.filter(
|
||||
or_(
|
||||
PlatformFulfillmentTask.commodity_mapping_id.isnot(None),
|
||||
PlatformFulfillmentTask.commodity_id != "",
|
||||
)
|
||||
)
|
||||
)
|
||||
mode_filter = classification.normalize_sale_mode(sale_mode)
|
||||
if sale_mode and mode_filter != "unknown":
|
||||
query = query.filter(PlatformFulfillmentTask.sale_mode == mode_filter)
|
||||
|
||||
@@ -122,6 +122,7 @@ const MANUAL_REASON_LABELS: Record<string, string> = {
|
||||
|
||||
const QUEUE_BUCKET_OPTIONS = [
|
||||
{ value: 'current', label: '当前待办' },
|
||||
{ value: 'pending_mapping', label: '待映射' },
|
||||
{ value: 'presale_waiting', label: '预售待开放' },
|
||||
{ value: 'ready_for_fulfillment', label: '可履约' },
|
||||
{ value: 'needs_action', label: '需要人工' },
|
||||
@@ -537,7 +538,12 @@ export default function PlatformFulfillmentPage() {
|
||||
const queueBackedStatus = queueBucket === 'current'
|
||||
? 'unfinished'
|
||||
: (['completed', 'cancelled'].includes(queueBucket) ? queueBucket : undefined);
|
||||
const backendBucket = ['presale_waiting', 'ready_for_fulfillment', 'needs_action'].includes(queueBucket)
|
||||
const backendBucket = [
|
||||
'pending_mapping',
|
||||
'presale_waiting',
|
||||
'ready_for_fulfillment',
|
||||
'needs_action',
|
||||
].includes(queueBucket)
|
||||
? queueBucket
|
||||
: undefined;
|
||||
const result = await platformFulfillmentApi.listTasks({
|
||||
|
||||
Reference in New Issue
Block a user