feat(work-order): 新增一次性补资料链接
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
getAdminWorkerPlatformNotificationConfig,
|
||||
getAdminWorkerPlatformSummary,
|
||||
getAdminWorkerProductMatchConfig,
|
||||
getWorkerMaterialLinkConfig,
|
||||
listAdminKuaishouMatchSources,
|
||||
listAdminWorkCategories,
|
||||
listAdminWorkProductMatchLogs,
|
||||
@@ -29,6 +30,7 @@ import {
|
||||
saveAdminWorkerLevel,
|
||||
saveAdminWorkerPlatformNotificationConfig,
|
||||
saveAdminWorkerProductMatchConfig,
|
||||
saveWorkerMaterialLinkConfig,
|
||||
syncAdminWorkProductRulePrice,
|
||||
testAdminKuaishouProductMatch,
|
||||
testAdminProductMatchByOrderItem,
|
||||
@@ -293,6 +295,32 @@ router.post(
|
||||
}),
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/worker-platform/material-link-config',
|
||||
requireAdminRoles(['admin', 'operator']),
|
||||
createJsonHandler(() => getWorkerMaterialLinkConfig(), {
|
||||
successMessage: 'ok',
|
||||
errorMessage: '读取补资料链接配置失败',
|
||||
scope: '[admin/worker-platform/material-link-config]',
|
||||
}),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/worker-platform/material-link-config',
|
||||
requireAdminRoles(['admin', 'operator']),
|
||||
createJsonHandler((req) => saveWorkerMaterialLinkConfig(req.body || {}), {
|
||||
successMessage: '补资料链接配置已保存',
|
||||
errorMessage: '保存补资料链接配置失败',
|
||||
scope: '[admin/worker-platform/material-link-config]',
|
||||
audit: (_req, data) => ({
|
||||
action: 'worker_material_link_config_saved',
|
||||
targetType: 'work_order_material_link_config',
|
||||
targetId: 'work_order_material_link',
|
||||
data: data && typeof data === 'object' ? (data as Record<string, unknown>) : {},
|
||||
}),
|
||||
}),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/worker-platform/announcement',
|
||||
requireAdminRoles(['admin']),
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
completeAdminWorkOrderGiftCooldown,
|
||||
confirmAdminWorkOrderFriendAdded,
|
||||
createAdminMockWorkOrder,
|
||||
createAdminWorkOrderMaterialLink,
|
||||
deleteAdminMockCustomShop,
|
||||
deleteAdminWorkOrder,
|
||||
getAdminWorkOrderEvents,
|
||||
@@ -181,6 +182,36 @@ router.post(
|
||||
),
|
||||
)
|
||||
|
||||
router.post(
|
||||
'/worker-platform/orders/:workOrderId/material-link',
|
||||
requireAdminPermission('worker_order.update_material'),
|
||||
createJsonHandler(
|
||||
(req) =>
|
||||
createAdminWorkOrderMaterialLink(
|
||||
String(req.params.workOrderId || ''),
|
||||
req.adminSession?.displayName || req.adminSession?.username || '',
|
||||
),
|
||||
{
|
||||
successMessage: '补资料链接已生成',
|
||||
errorMessage: '生成补资料链接失败',
|
||||
scope: '[admin/worker-platform/orders/:workOrderId/material-link]',
|
||||
audit: (req, data) => ({
|
||||
action: 'work_order_material_link_created',
|
||||
targetType: 'work_order',
|
||||
targetId: String(req.params.workOrderId || ''),
|
||||
// 审计只记录有效期与是否复用,绝不落 token。
|
||||
data:
|
||||
data && typeof data === 'object'
|
||||
? {
|
||||
expiresAt: (data as Record<string, unknown>).expiresAt,
|
||||
reused: (data as Record<string, unknown>).reused,
|
||||
}
|
||||
: {},
|
||||
}),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
router.put(
|
||||
'/worker-platform/orders/:workOrderId',
|
||||
requireAdminPermission('worker_order.edit'),
|
||||
|
||||
Reference in New Issue
Block a user