fix: 采集失败不降级有数据分行+任务领取计数对齐实际分发行数
- 采集失败时按 latest_likes 分流:无数据才标 failed,已有历史数据保持 success 并注明沿用上次数据,collection_updated_at 不动;run 行照实记失败 - 种子 seedIfEmpty 末尾统一对账 claimed_quantity,杜绝演示数据口径漂移 - 新增 mysql/0021 对账迁移,修复 0020 物理合并遗留的生产计数漂移 - 运营端展示全面改读实时 dist_total(任务卡双面板/项目树/概览/进度), project-service 查询补 dist_total 子查询 - 走查实证:卡片 7/18 vs 详情已领取 2 两处口径打架;保存采集计划补采 失败会把历史成功行改写为 failed
This commit is contained in:
@@ -2927,6 +2927,7 @@ type ProjectTaskItem = {
|
||||
task_chat_id: string;
|
||||
recovery_enabled: number;
|
||||
recovery_due_at: string;
|
||||
dist_total: number;
|
||||
recovery_submitted: number;
|
||||
};
|
||||
|
||||
@@ -3025,7 +3026,10 @@ function ProjectSection({
|
||||
}, [project.id, setToast]);
|
||||
|
||||
const tasksSignature = tasks
|
||||
.map((task) => `${task.id}:${task.claimed_quantity}:${task.status}`)
|
||||
.map(
|
||||
(task) =>
|
||||
`${task.id}:${task.dist_total}:${task.dist_submitted}:${task.status}`,
|
||||
)
|
||||
.join("|");
|
||||
|
||||
useEffect(() => {
|
||||
@@ -3266,11 +3270,11 @@ function ProjectSection({
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{task.claimed_quantity} / {task.quantity}
|
||||
{task.dist_total} / {task.quantity}
|
||||
</td>
|
||||
<td>
|
||||
{Number(task.recovery_enabled) === 1
|
||||
? `已收 ${task.recovery_submitted} / ${task.claimed_quantity}`
|
||||
? `已收 ${task.recovery_submitted} / ${task.dist_total}`
|
||||
: "—"}
|
||||
</td>
|
||||
<td>
|
||||
@@ -3937,7 +3941,7 @@ function OverviewPage({
|
||||
{
|
||||
label: "正在分发任务",
|
||||
value: stats.activeTasks,
|
||||
hint: `${tasks.reduce((sum, task) => sum + task.claimed_quantity, 0)} 篇已被领取`,
|
||||
hint: `${tasks.reduce((sum, task) => sum + (task.dist_total ?? 0), 0)} 篇已被领取`,
|
||||
tone: "green",
|
||||
},
|
||||
{
|
||||
@@ -4006,7 +4010,7 @@ function OverviewPage({
|
||||
<i />
|
||||
<div className="workflow-step active">
|
||||
<span>02</span>
|
||||
<div><strong>KOC领取</strong><small>{tasks.reduce((sum, task) => sum + task.claimed_quantity, 0)} 篇</small></div>
|
||||
<div><strong>KOC领取</strong><small>{tasks.reduce((sum, task) => sum + (task.dist_total ?? 0), 0)} 篇</small></div>
|
||||
</div>
|
||||
<i />
|
||||
<div className="workflow-step">
|
||||
@@ -4036,7 +4040,7 @@ function OverviewPage({
|
||||
</div>
|
||||
<div className="task-mini-list">
|
||||
{tasks.map((task) => {
|
||||
const progress = Math.round((task.claimed_quantity / task.quantity) * 100);
|
||||
const progress = Math.round(((task.dist_total ?? 0) / task.quantity) * 100);
|
||||
return (
|
||||
<article key={task.id}>
|
||||
<div className="task-mini-top">
|
||||
@@ -4053,7 +4057,7 @@ function OverviewPage({
|
||||
</div>
|
||||
<div className="progress"><span style={{ width: `${progress}%` }} /></div>
|
||||
<div className="task-mini-meta">
|
||||
<span>{task.claimed_quantity}/{task.quantity} 篇已领取</span>
|
||||
<span>{task.dist_total ?? 0}/{task.quantity} 篇已领取</span>
|
||||
<span>{formatDate(task.due_at)}截止</span>
|
||||
</div>
|
||||
</article>
|
||||
@@ -4400,7 +4404,7 @@ function TaskRowCard({
|
||||
<span className="panel-count">{task.quantity} 篇内容</span>
|
||||
</div>
|
||||
<div className="panel-body">
|
||||
{panelMetric(task.claimed_quantity, task.quantity, "已领取", "publish")}
|
||||
{panelMetric(task.dist_total ?? 0, task.quantity, "已领取", "publish")}
|
||||
{panelChat(task, "任务群")}
|
||||
</div>
|
||||
<div className="panel-foot">
|
||||
@@ -4416,11 +4420,11 @@ function TaskRowCard({
|
||||
<span className="panel-count">
|
||||
{task.recovery_due_at && task.recovery_due_at !== task.due_at
|
||||
? `截止 ${formatDate(task.recovery_due_at)}`
|
||||
: `${task.claimed_quantity} 份截图`}
|
||||
: `${task.dist_total ?? 0} 份截图`}
|
||||
</span>
|
||||
</div>
|
||||
<div className="panel-body">
|
||||
{panelMetric(task.dist_submitted ?? 0, task.claimed_quantity, "已收取", "recovery")}
|
||||
{panelMetric(task.dist_submitted ?? 0, task.dist_total ?? 0, "已收取", "recovery")}
|
||||
</div>
|
||||
<div className="panel-foot">
|
||||
<button type="button" className="panel-detail" onClick={() => onDetail(task)}>
|
||||
|
||||
Reference in New Issue
Block a user