refactor(fulfillment): 移除飞飞/乐玩通道,仅保留 affiliate_dash
新单只路由 affiliate_dash(未命中走 manual_dispatch);历史飞飞/乐玩任务保留只读 stub,避免订单重同步失败。同步清理 cloudtentacles 调度、Admin 写路径与相关 env。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,10 +4,6 @@ import {
|
||||
CloseCircleOutlined,
|
||||
CopyOutlined,
|
||||
ReloadOutlined,
|
||||
RollbackOutlined,
|
||||
SendOutlined,
|
||||
SwapOutlined,
|
||||
ToolOutlined,
|
||||
UserSwitchOutlined,
|
||||
} from '@ant-design/icons'
|
||||
import {
|
||||
@@ -38,16 +34,11 @@ import {
|
||||
closeAdminTask,
|
||||
completeAdminTaskManualDispatch,
|
||||
consumeAdminTaskKuaishouIndustryVoucher,
|
||||
dispatchAdminTaskKuaishouCloudFulfillment,
|
||||
fetchAdminTaskDetail,
|
||||
fetchAdminTaskScreenshot,
|
||||
markAdminTaskManualReview,
|
||||
prepareAdminTaskKuaishouCloudFulfillment,
|
||||
rebindAdminTaskKuaishouCloudRole,
|
||||
refreshAdminTaskKuaishouCloudRoleInfo,
|
||||
resendAdminTaskKuaishouIndustryVoucherCode,
|
||||
retryAdminTask,
|
||||
returnNumberAdminTaskKuaishouCloudFulfillment,
|
||||
} from '@/services/admin'
|
||||
import type { AdminTaskActionResponse, AdminTaskDetail } from '@/types/admin'
|
||||
import { hasAdminRole } from '@/utils/admin-auth'
|
||||
@@ -275,38 +266,6 @@ export default function AdminTaskDetailPage() {
|
||||
`确认重试任务 ${resolvedDetail.task.taskNo} 吗?`,
|
||||
)
|
||||
}
|
||||
onRebindRole={() =>
|
||||
runTaskAction(
|
||||
'rebind-role',
|
||||
() => rebindAdminTaskKuaishouCloudRole(resolvedDetail.task.taskId),
|
||||
'换绑完成:已生成新的绑定链接',
|
||||
`确认为任务 ${resolvedDetail.task.taskNo} 换绑吗?会退还当前虚拟号并生成新绑链;若旧号已被系统回收会自动跳过退号并直接新取号。原领取链接可继续使用。`,
|
||||
)
|
||||
}
|
||||
onPrepareKuaishouCloud={() =>
|
||||
runTaskAction(
|
||||
'prepare-kuaishou-cloud',
|
||||
() => prepareAdminTaskKuaishouCloudFulfillment(resolvedDetail.task.taskId),
|
||||
'绑定资源已准备完成',
|
||||
`确认开始为任务 ${resolvedDetail.task.taskNo} 准备绑定资源吗?系统会自动检查库存配置并申请虚拟号。`,
|
||||
)
|
||||
}
|
||||
onDispatchKuaishouCloud={() =>
|
||||
runTaskAction(
|
||||
'dispatch-kuaishou-cloud',
|
||||
() => dispatchAdminTaskKuaishouCloudFulfillment(resolvedDetail.task.taskId),
|
||||
'已完成绑定确认并发货',
|
||||
`确认客户已经完成绑定,并立即为任务 ${resolvedDetail.task.taskNo} 执行发货吗?这个动作会把"确认绑定完成"和"发货"合并为一步。`,
|
||||
)
|
||||
}
|
||||
onReturnKuaishouCloud={() =>
|
||||
runTaskAction(
|
||||
'return-kuaishou-cloud',
|
||||
() => returnNumberAdminTaskKuaishouCloudFulfillment(resolvedDetail.task.taskId),
|
||||
'号码已退还',
|
||||
`确认退还任务 ${resolvedDetail.task.taskNo} 当前使用的虚拟号吗?退号后该流程会正式收口。`,
|
||||
)
|
||||
}
|
||||
onResendIndustryVoucher={() =>
|
||||
runTaskAction(
|
||||
'resend-industry-voucher',
|
||||
@@ -419,23 +378,11 @@ export default function AdminTaskDetailPage() {
|
||||
items={[
|
||||
{
|
||||
key: 'cloud',
|
||||
label: 'kuaishou-lewan',
|
||||
label: '乐玩云(历史)',
|
||||
children: flow ? (
|
||||
<KuaishouCloudPanel
|
||||
flow={flow}
|
||||
canRefresh={resolvedDetail.operations.canRefreshKuaishouCloudRoleInfo}
|
||||
actionLoadingKey={actionLoadingKey}
|
||||
onRefreshRole={() =>
|
||||
runTaskAction(
|
||||
'refresh-role',
|
||||
() => refreshAdminTaskKuaishouCloudRoleInfo(resolvedDetail.task.taskId),
|
||||
'角色信息已刷新',
|
||||
`确认刷新任务 ${resolvedDetail.task.taskNo} 当前云绑定角色信息吗?系统会重新查询 kuaishou-lewan 的绑定结果。`,
|
||||
)
|
||||
}
|
||||
/>
|
||||
<KuaishouCloudPanel flow={flow} />
|
||||
) : (
|
||||
<Empty description="无 kuaishou-lewan 履约上下文" />
|
||||
<Empty description="无历史乐玩云履约上下文" />
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -496,10 +443,6 @@ function TaskActionPanel({
|
||||
canCloseTasks,
|
||||
actionLoadingKey,
|
||||
onRetry,
|
||||
onRebindRole,
|
||||
onPrepareKuaishouCloud,
|
||||
onDispatchKuaishouCloud,
|
||||
onReturnKuaishouCloud,
|
||||
onResendIndustryVoucher,
|
||||
onConsumeIndustryVoucher,
|
||||
onMarkManualReview,
|
||||
@@ -511,10 +454,6 @@ function TaskActionPanel({
|
||||
canCloseTasks: boolean
|
||||
actionLoadingKey: string
|
||||
onRetry: () => void
|
||||
onRebindRole: () => void
|
||||
onPrepareKuaishouCloud: () => void
|
||||
onDispatchKuaishouCloud: () => void
|
||||
onReturnKuaishouCloud: () => void
|
||||
onResendIndustryVoucher: () => void
|
||||
onConsumeIndustryVoucher: () => void
|
||||
onMarkManualReview: () => void
|
||||
@@ -522,11 +461,6 @@ function TaskActionPanel({
|
||||
}) {
|
||||
const operations = detail.operations
|
||||
const loading = Boolean(actionLoadingKey)
|
||||
const hasCloudActions =
|
||||
operations.canPrepareKuaishouCloudFulfillment ||
|
||||
operations.canRebindKuaishouCloudRole ||
|
||||
operations.canDispatchKuaishouCloudFulfillment ||
|
||||
operations.canReturnKuaishouCloudFulfillment
|
||||
const hasIndustryVoucherActions =
|
||||
operations.canResendKuaishouIndustryVoucherCode ||
|
||||
operations.canConsumeKuaishouIndustryVoucher ||
|
||||
@@ -560,57 +494,6 @@ function TaskActionPanel({
|
||||
</section>
|
||||
) : null}
|
||||
|
||||
{hasCloudActions ? (
|
||||
<section className="task-action-group">
|
||||
<Typography.Text type="secondary">kuaishou-lewan</Typography.Text>
|
||||
<Space wrap>
|
||||
{canManageTaskLifecycle && operations.canPrepareKuaishouCloudFulfillment ? (
|
||||
<Button
|
||||
type="primary"
|
||||
ghost
|
||||
icon={<ToolOutlined />}
|
||||
disabled={loading}
|
||||
loading={actionLoadingKey === 'prepare-kuaishou-cloud'}
|
||||
onClick={onPrepareKuaishouCloud}
|
||||
>
|
||||
准备资源
|
||||
</Button>
|
||||
) : null}
|
||||
{operations.canRebindKuaishouCloudRole ? (
|
||||
<Button
|
||||
icon={<SwapOutlined />}
|
||||
disabled={loading}
|
||||
loading={actionLoadingKey === 'rebind-role'}
|
||||
onClick={onRebindRole}
|
||||
>
|
||||
换绑
|
||||
</Button>
|
||||
) : null}
|
||||
{canManageTaskLifecycle && operations.canDispatchKuaishouCloudFulfillment ? (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<SendOutlined />}
|
||||
disabled={loading}
|
||||
loading={actionLoadingKey === 'dispatch-kuaishou-cloud'}
|
||||
onClick={onDispatchKuaishouCloud}
|
||||
>
|
||||
发货
|
||||
</Button>
|
||||
) : null}
|
||||
{canManageTaskLifecycle && operations.canReturnKuaishouCloudFulfillment ? (
|
||||
<Button
|
||||
icon={<RollbackOutlined />}
|
||||
disabled={loading}
|
||||
loading={actionLoadingKey === 'return-kuaishou-cloud'}
|
||||
onClick={onReturnKuaishouCloud}
|
||||
>
|
||||
退号
|
||||
</Button>
|
||||
) : null}
|
||||
</Space>
|
||||
</section>
|
||||
) : null}
|
||||
|
||||
{canOperateIndustryVoucher && hasIndustryVoucherActions ? (
|
||||
<section className="task-action-group">
|
||||
<Typography.Text type="secondary">电子凭证</Typography.Text>
|
||||
@@ -652,10 +535,7 @@ function TaskActionPanel({
|
||||
</section>
|
||||
) : null}
|
||||
|
||||
{!canManageTaskLifecycle &&
|
||||
!canOperateIndustryVoucher &&
|
||||
!canCloseTasks &&
|
||||
!hasCloudActions ? (
|
||||
{!canManageTaskLifecycle && !canOperateIndustryVoucher && !canCloseTasks ? (
|
||||
<Typography.Text type="secondary">当前账号没有可执行的任务操作</Typography.Text>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -964,14 +844,17 @@ function resolveDeliveryStepSummary(detail: AdminTaskDetail) {
|
||||
|
||||
function resolveTaskExecutorDisplay(value: unknown) {
|
||||
const executorKey = String(value || '').trim()
|
||||
if (executorKey === 'affiliate_dash') {
|
||||
return { label: 'Affiliate Dash', color: 'green' }
|
||||
}
|
||||
if (executorKey === 'kuaishou_ct_assisted') {
|
||||
return { label: 'kuaishou-lewan', color: 'blue' }
|
||||
return { label: '乐玩云(已下线)', color: 'default' }
|
||||
}
|
||||
if (executorKey === 'kuaishou-industry') {
|
||||
return { label: '行业电子凭证', color: 'cyan' }
|
||||
}
|
||||
if (executorKey === 'kuaishou_feifei') {
|
||||
return { label: 'kuaishou-feifei', color: 'purple' }
|
||||
return { label: '飞飞(已下线)', color: 'default' }
|
||||
}
|
||||
if (executorKey === 'manual_dispatch') {
|
||||
return { label: '人工履约', color: 'orange' }
|
||||
@@ -1152,14 +1035,8 @@ function KuaishouIndustryVoucherPanel({ voucher }: { voucher: KuaishouIndustryVo
|
||||
|
||||
function KuaishouCloudPanel({
|
||||
flow,
|
||||
canRefresh,
|
||||
actionLoadingKey,
|
||||
onRefreshRole,
|
||||
}: {
|
||||
flow: NonNullable<AdminTaskDetail['kuaishouCloudFulfillment']>
|
||||
canRefresh: boolean
|
||||
actionLoadingKey: string
|
||||
onRefreshRole: () => void
|
||||
}) {
|
||||
const roleInfoEntries = flow.role.rawInfo
|
||||
? Object.entries(flow.role.rawInfo).filter(
|
||||
@@ -1220,19 +1097,7 @@ function KuaishouCloudPanel({
|
||||
|
||||
return (
|
||||
<section className="kuaishou-cloud-stack">
|
||||
<Card
|
||||
title="kuaishou-lewan 履约"
|
||||
extra={
|
||||
<Button
|
||||
icon={<ReloadOutlined />}
|
||||
disabled={Boolean(actionLoadingKey) || !canRefresh}
|
||||
loading={actionLoadingKey === 'refresh-role'}
|
||||
onClick={onRefreshRole}
|
||||
>
|
||||
刷新角色
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<Card title="乐玩云履约(只读历史)">
|
||||
<Descriptions column={{ xs: 1, md: 2, xl: 3 }} bordered size="small">
|
||||
<Descriptions.Item label="来源账号">
|
||||
{flow.binding.resolvedSourceLabel || flow.binding.resolvedSourceKey || '-'}
|
||||
|
||||
Reference in New Issue
Block a user