feat(lme): 落实「骨架不能创造数据」——工料机行采集并导出文字/标志属性,新增分层列集骨架匹配
This commit is contained in:
33
CostReview/app/core/_recheck.py
Normal file
33
CostReview/app/core/_recheck.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""主人指正:单位级和项目级都有这4个槽(ExtKind/Concrete/PriceSource/Delivery)。
|
||||
重新到原文件核实:广联达件单位成员的 LME_SUM 是否真有这4列。"""
|
||||
import sys
|
||||
sys.path.insert(0, '.')
|
||||
import classic_skeleton as cs
|
||||
import sqlite3
|
||||
import zipfile
|
||||
import io
|
||||
import re
|
||||
|
||||
con = sqlite3.connect(r'D:/PricingReview/CostReview/data/history.db')
|
||||
con.row_factory = sqlite3.Row
|
||||
r = con.execute("SELECT blob, original_name FROM classic_skel WHERE original_name LIKE '%广联达导出最新%'").fetchone()
|
||||
src = zipfile.ZipFile(io.BytesIO(r['blob']))
|
||||
|
||||
for nm in src.namelist():
|
||||
if not nm.lower().endswith('.xml'):
|
||||
continue
|
||||
t = src.read(nm).decode('utf-8', errors='replace')
|
||||
if 'LabourMaterialsEquipmentsMachinesSummary' not in t:
|
||||
continue
|
||||
print(f'=== 成员: {nm[:40]} ===')
|
||||
# 找 RGFTZ 行
|
||||
for m in re.finditer(r'<LabourMaterialsEquipmentsMachinesSummary\b[^>]*Number="RGFTZ"[^>]*>', t):
|
||||
line = m.group(0)
|
||||
for col in ('ExtKind', 'Concrete', 'PriceSource', 'Delivery'):
|
||||
hit = re.search(col + r'="([^"]*)"', line)
|
||||
print(f' {col} = {hit.group(1) if hit else "(无属性)"}', end=' ')
|
||||
print()
|
||||
break
|
||||
# 也看第 2 条四列行
|
||||
break
|
||||
Reference in New Issue
Block a user