From 7bbe147e782b82e2a2d56d751048fdc417619361 Mon Sep 17 00:00:00 2001 From: lianjianwei2024 <168657369+lianjianwei2024@users.noreply.github.com> Date: Sun, 25 Oct 2026 18:20:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(export):=20=E5=86=B3=E7=AD=96202=E2=80=94?= =?UTF-8?q?=E2=80=94=E9=87=8D=E5=BB=BA=E8=81=9A=E5=90=88=E9=94=AE=3D?= =?UTF-8?q?=E7=BC=96=E7=A0=81+=E5=90=8D=E8=A7=84=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=90=8CKind/=E4=BB=B7=E6=A0=BC=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=B7=AE=E5=BC=82=E4=B9=9F=E5=9C=A8=E5=90=88=E5=B9=B6=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=EF=BC=88=E9=87=91=E5=AE=9D=E5=90=8C=E7=A0=81=E5=A4=9A?= =?UTF-8?q?=E8=A1=8C=E5=AE=9E=E6=B5=8B=E6=A0=B9=E9=99=A4=EF=BC=8C265=20pas?= =?UTF-8?q?sed=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CostReview/app/core/export_cos.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/CostReview/app/core/export_cos.py b/CostReview/app/core/export_cos.py index 08edd91..2be96b5 100644 --- a/CostReview/app/core/export_cos.py +++ b/CostReview/app/core/export_cos.py @@ -1287,21 +1287,13 @@ def _find_summary_span(txt, code): def _agg_key(opentag): - """聚合键(决策 187 修订,2026-10-24 主人定稿):只按主人六要素—— - 编码+类别+名称+规格+单位+除税价(NoTaxPrice)。Org/Express 是骨架家族内部值, - 不进键(此前进键导致同码同价但 Org 缝合态不同的行被拆成两条——实测 1009 的 - 机上人工-0001 ×2 等 9 组重复的根源)。税率随除税×含税联动,不进键。""" - def num(a): - v = _attr(opentag, a) - if v is None: - return None - try: - return round(float(v), 6) - except (TypeError, ValueError): - return v - return tuple([_attr(opentag, a) or "" for a in ("Number", "Kind", "Name", "Specification", "Unit")] - + [num("NoTaxPrice")]) - + """聚合键(决策 202,2026-10-25 主人定「不同 Kind 属性也是合并的范围,属性不同也是 + 需要合并的」):键=编码+名称+规格+单位——Kind 与价格等属性差异不拆行。 + 金宝实测:同码各单位行 Kind 有填 3/有留空、人工费 Kind=1/8193/空,旧键(含 Kind + 和除税价)把同码拆成多行(机上人工 96.31+4591.25 两行)。原「Org/Express 不进键、 + 税率不进键」继续有效。数量=各单位行之和;属性/价格取最全单位行(best);四 Total + 锚定自算。""" + return tuple([_attr(opentag, a) or "" for a in ("Number", "Name", "Specification", "Unit")]) def _rebuild_project_lme(txt, unit_texts, added_summaries, hidden_codes): """Project 工料机汇总区块由各单位最终文本聚合重建(决策 187)。返回新 Project 文本。