fix: 日报措辞改为'已补拉',差异持续存在时提示口径问题

This commit is contained in:
yeuimu
2026-08-27 11:02:24 +00:00
parent 21057ea110
commit 5659c30bd1
+4 -2
View File
@@ -25,7 +25,7 @@ def _verify_section(name: str, report: dict) -> tuple[str, list[str], bool]:
summary = (report.get("verifyReport") or {}).get("summary") or {} summary = (report.get("verifyReport") or {}).get("summary") or {}
diff_days = [d for d in days if not d.get("ok")] diff_days = [d for d in days if not d.get("ok")]
total, n_diff = summary.get("totalDays", len(days)), summary.get("daysWithDiff", len(diff_days)) total, n_diff = summary.get("totalDays", len(days)), summary.get("daysWithDiff", len(diff_days))
head = f"**{name}**: {total} 天中 {total - n_diff} 天一致" + (" ✅" if not diff_days else f", {n_diff} 天有差异已修复") head = f"**{name}**: {total} 天中 {total - n_diff} 天一致" + (" ✅" if not diff_days else f", {n_diff} 天有差异(已补拉)")
detail = [ detail = [
f"- {d['date']}: 本地 {d.get('local', '—')} / 远程 {d.get('remote', '—')}," f"- {d['date']}: 本地 {d.get('local', '—')} / 远程 {d.get('remote', '—')},"
f"差异 {d.get('diff') or '—'},已补拉 订单 {d.get('orders', 0)} / 商品 {d.get('goods', 0)}" f"差异 {d.get('diff') or '—'},已补拉 订单 {d.get('orders', 0)} / 商品 {d.get('goods', 0)}"
@@ -33,7 +33,9 @@ def _verify_section(name: str, report: dict) -> tuple[str, list[str], bool]:
] ]
totals = {k: v for k, v in summary.items() if k not in ("totalDays", "daysWithDiff")} totals = {k: v for k, v in summary.items() if k not in ("totalDays", "daysWithDiff")}
if any(totals.values()): if any(totals.values()):
detail.append(f"- 修复量合计: {totals}") detail.append(f"- 补拉量合计: {totals}")
if diff_days:
detail.append("- 注: 差异日已重新补拉;若同一差异长期存在,多为远程统计口径与本地状态映射不一致(如发货后退款未同步),需单独排查")
return head, detail, bool(diff_days) return head, detail, bool(diff_days)