fix(fulfillment): 修复载体重试并完善核销任务列表

This commit is contained in:
yml2213
2026-11-05 18:36:10 +08:00
parent 89a68b5734
commit e8b76b3b73
19 changed files with 945 additions and 104 deletions
@@ -20,6 +20,7 @@ import {
retryPendingCarrierGroup,
switchChannelForOrderItems,
unlockChannel,
unlockPendingChannelGroup,
upsertChannelRule,
} from '../../services/fulfillment/channel-assign-service.js'
import {
@@ -86,6 +87,9 @@ router.get(
createJsonHandler(
(req) =>
listVoucherConsumeJobs({
keyword: String(req.query.keyword || ''),
provider: String(req.query.provider || ''),
channel: String(req.query.channel || ''),
status: String(req.query.status || ''),
page: Number(req.query.page),
pageSize: Number(req.query.pageSize),
@@ -200,6 +204,8 @@ router.post(
(req) =>
retryPendingCarrierGroup({
internalSku: String(bodyOf(req).internalSku || ''),
retryInactiveCarrier: bodyOf(req).retryInactiveCarrier === true,
includeLocked: bodyOf(req).includeLocked === true,
}),
{
successMessage: '履约载体重试完成',
@@ -215,6 +221,31 @@ router.post(
),
)
router.post(
'/fulfillment/pending/unlock',
requireAdminPermission('finance.config'),
createJsonHandler(
(req) => {
const body = bodyOf(req)
return unlockPendingChannelGroup({
groupKey: String(body.groupKey || ''),
internalSku: String(body.internalSku || ''),
})
},
{
successMessage: '运营锁定已解除',
errorMessage: '解除运营锁定失败',
scope: '[admin/fulfillment/pending/unlock]',
audit: (req, data) => ({
action: 'fulfillment.unlock_pending_group',
targetType: 'pending_group',
targetId: String(bodyOf(req).groupKey || bodyOf(req).internalSku || ''),
data: data as Record<string, unknown>,
}),
},
),
)
router.get(
'/fulfillment/internal-sku-mappings',
requireAdminPermission('finance.view'),