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 文本。