Merge branch 'dev'

This commit is contained in:
2026-11-02 15:03:01 +08:00
30 changed files with 1922 additions and 50 deletions
@@ -13,6 +13,7 @@ import {
getAdminWorkerPlatformNotificationConfig,
getAdminWorkerPlatformSummary,
getAdminWorkerProductMatchConfig,
getAdminWorkerProductNameSuffixConfig,
listAdminKuaishouMatchSources,
listAdminWorkCategories,
listAdminWorkProductMatchLogs,
@@ -20,6 +21,7 @@ import {
listAdminWorkProductRuleMappings,
listAdminWorkProductRules,
listAdminWorkerLevels,
listWorkerProductNameSuffixSourceOptions,
saveAdminWorkCategory,
saveAdminWorkProductRule,
saveAdminWorkProductRuleMapping,
@@ -29,6 +31,7 @@ import {
saveAdminWorkerLevel,
saveAdminWorkerPlatformNotificationConfig,
saveAdminWorkerProductMatchConfig,
saveAdminWorkerProductNameSuffixConfig,
syncAdminWorkProductRulePrice,
testAdminKuaishouProductMatch,
testAdminProductMatchByOrderItem,
@@ -309,6 +312,44 @@ router.post(
}),
)
router.get(
'/worker-platform/product-name-suffix',
requireAdminRoles(['admin', 'operator', 'support']),
createJsonHandler(() => getAdminWorkerProductNameSuffixConfig(), {
successMessage: 'ok',
errorMessage: '读取商品名来源后缀配置失败',
scope: '[admin/worker-platform/product-name-suffix]',
}),
)
// 下拉选项来自工单资料里的来源标识,低频配置,给浏览器 5 分钟缓存。
router.get(
'/worker-platform/product-name-suffix/sources',
requireAdminRoles(['admin', 'operator', 'support']),
setHttpCache(300),
createJsonHandler(() => listWorkerProductNameSuffixSourceOptions(), {
successMessage: 'ok',
errorMessage: '读取工单来源选项失败',
scope: '[admin/worker-platform/product-name-suffix/sources]',
}),
)
router.post(
'/worker-platform/product-name-suffix',
requireAdminRoles(['admin']),
createJsonHandler((req) => saveAdminWorkerProductNameSuffixConfig(req.body || {}), {
successMessage: '商品名来源后缀已保存',
errorMessage: '保存商品名来源后缀失败',
scope: '[admin/worker-platform/product-name-suffix]',
audit: (_req, data) => ({
action: 'worker_product_name_suffix_saved',
targetType: 'worker_product_name_suffix',
targetId: 'worker_product_name_suffix',
data: data && typeof data === 'object' ? (data as Record<string, unknown>) : {},
}),
}),
)
router.post(
'/worker-platform/product-match-config',
requireAdminRoles(['admin', 'operator']),
@@ -36,6 +36,7 @@ import {
listInventoryMatchableOrders,
listWorkOrderInventoryMatchOptions,
} from '../../../services/worker-platform/consignment-fulfillment-service.js'
import { listPendingPistolMatches } from '../../../services/worker-platform/consignment-pending-match-service.js'
const router = Router()
@@ -266,6 +267,25 @@ router.post(
// ---------------- 匹配与履约 ----------------
// 全局待抢单匹配看板:只看非拼单的待抢单工单 × 在库待匹配现货,只读。
router.get(
'/worker-platform/consignment/pending-pistol-matches',
requireAdminPermission('consignment.view'),
createJsonHandler(
(req) =>
listPendingPistolMatches({
keyword: String(req.query.keyword || ''),
includeConflicts: String(req.query.includeConflicts || '') === 'true',
limit: Number(req.query.limit || 0) || undefined,
}),
{
successMessage: 'ok',
errorMessage: '读取待匹配手枪订单失败',
scope: '[admin/consignment/pending-pistol-matches]',
},
),
)
router.get(
'/worker-platform/consignment/matches/:workOrderId',
requireAdminPermission('consignment.view'),
+12
View File
@@ -8,6 +8,7 @@ import {
getWorkerMyOrderEvents,
getWorkerMyOrderOverview,
getWorkerOrderFeedbackSummary,
getWorkerProductNameSuffixDisplayConfig,
listWorkerMyOrders,
markWorkerOrderRead,
remindWorkerOrderAcceptance,
@@ -90,6 +91,17 @@ router.get(
}),
)
// 商品名来源后缀映射:只下发已启用配置,打手端列表/详情/大厅统一按来源追加(文字),只读。
router.get(
'/product-name-suffix',
requireActiveWorker,
createRouteHandler(() => getWorkerProductNameSuffixDisplayConfig(), {
successMessage: 'ok',
errorMessage: '读取商品名来源后缀配置失败',
scope: '[worker/product-name-suffix]',
}),
)
router.get(
'/orders/feedbacks',
requireActiveWorker,