feat(master_data): 관급 보강 후보 합침 — 다산 같은 품명 줄에 조달청 최저가 · 새 줄 6,239
- 다산에 같은 품명(그레이팅 · 맨홀뚜껑 · 보행매트 · 합성목재 · 용접철망 · 갈매기표지판 · 고무링 · 혼합골재 등): 같은 치수 후보의 최저가를 관급 열에 채움 · 안 맞으면 비움 - 다산에 없는 품명(관 · 안전시설 · 종자·비료·식생 · 골재·경계석 · 매트 · 목재): 새 줄 6,239 · 자재품목 24,353 → 30,592 - update_관급단가_합침.py 신설 · apply 가 부름 · 다시 돌려도 같은 결과 - 설계 문서에 합친 결과 · 시험 추가 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PAdA5ThqmtVSsbzjusk1cJ
This commit is contained in:
@@ -253,3 +253,58 @@ def test_무게수로관_모델_치수():
|
||||
}
|
||||
_, (val, _) = fill_raw(item("u", "무게수로관-관급", "M-400C(400*400*120),680kg"), raw)
|
||||
assert val == 90800
|
||||
|
||||
|
||||
def test_보강_같은_치수만_채움_없으면_비움():
|
||||
import update_관급단가_합침 as boost
|
||||
|
||||
def c(
|
||||
name,
|
||||
spec,
|
||||
price,
|
||||
unit="개",
|
||||
note="관급: 조달청 다수공급자계약 2026-09-20 · 계약 2020-01-01~ · 전지역 · 도착도 · 포함",
|
||||
):
|
||||
return {"이름": name, "규격": spec, "단위": unit, "관급": price, "비고": note}
|
||||
|
||||
def row(name, spec, unit="개"):
|
||||
return {"키": "k", "이름": name, "규격": spec, "단위": unit, "출처": "자재품목 X"}
|
||||
|
||||
P, PV = up.places, up.PROVINCE
|
||||
g = lambda r, *cs: boost._same(r, cs[0], P, PV) # noqa: E731
|
||||
grate = row("스틸그레이팅", "700×1000×75(I-75×7×4)")
|
||||
assert g(grate, c("스틸그레이팅", "700×1000×75mm, 7×4mm, 뚜껑, 격자형", 1))
|
||||
assert not g(grate, c("스틸그레이팅", "700×1000×75mm, 7×4mm, 뚜껑, 투수형", 1)) # 특수형
|
||||
assert not g(grate, c("스틸그레이팅", "700×1000×75mm, 5×3mm, 뚜껑", 1)) # 바 치수 다름
|
||||
assert not g(grate, c("스틸그레이팅", "(부품)700×1000×75mm, 7×4mm, 뚜껑", 1))
|
||||
assert not g(grate, c("스틸그레이팅", "710×1000×75mm, 7×4mm, 뚜껑", 1)) # 가까운 치수로 안 이음
|
||||
assert g(row("갈매기표지판(단면)", "300×450mm", "EA"), c("갈매기표지판", "300×450×2mm", 1))
|
||||
assert not g(
|
||||
row("갈매기표지판(단면)", "300×450mm", "EA"), c("갈매기표지판", "300×450×2mm, 양면", 1)
|
||||
)
|
||||
assert not g(
|
||||
row("갈매기표지판(단면)", "300×450mm", "EA"),
|
||||
c("갈매기표지판", "300×450×23mm, 태양광LED", 1),
|
||||
)
|
||||
assert not g(
|
||||
row("주철맨홀뚜껑(원형)", "Φ648 KS", "EA"), c("주철맨홀뚜껑", "원형, Φ648×110mm", 1)
|
||||
)
|
||||
assert g(row("보행매트(관급)", "1,000×t30mm", "M"), c("보행매트", "1000×t30mm", 1, "m"))
|
||||
assert not g(
|
||||
row("보행매트(관급)", "1,000×t30mm", "M"), c("보행매트", "1000×t30mm", 1, "개")
|
||||
) # 단위 다름
|
||||
|
||||
|
||||
def test_보강_새_줄은_목록_품명만_같은_규격_한_줄():
|
||||
import update_관급단가_합침 as boost
|
||||
|
||||
assert "스틸그레이팅" not in boost.NEW and "주철맨홀뚜껑" not in boost.NEW # 다산에 있는 품명
|
||||
assert boost.NEW["철제가드레일"] == "안전시설"
|
||||
keys = {}
|
||||
rows = boost.new_rows(
|
||||
{"키": {}, "다음": {}},
|
||||
lambda b, t, n, f: keys.setdefault(n, f"MT{len(keys) + 1:06d}"),
|
||||
{("낙석방지책", "존재")},
|
||||
)
|
||||
assert all(r["이름"] in boost.NEW and r["출처"].startswith("자재품목 조달청 ") for r in rows)
|
||||
assert len({r["키"] for r in rows}) == len(rows)
|
||||
|
||||
Reference in New Issue
Block a user