feat(malaysia): 입출고 일자별 낱개 수량 엑셀 다운로드
- '일괄 적용' 버튼명 '입력'으로 변경 - 입력 버튼 우측 '다운로드' 버튼 추가 - GET /malaysia/movements/export: 해당 일자/종류(IN/OUT) 낱개 합계를 엑셀(A=사방넷코드, B=수량, C=이름)로 스트리밍 - db.daily_movement_totals(): 일자/종류별 낱개 합계 집계 - itemcode.sabangnet_code_map(): item_code → 사방넷 코드 매핑 - i18n 사전 '입력'/'다운로드' 추가, malaysia.js 캐시 버전 bump Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -115,6 +115,25 @@ class MalaysiaItemcodeReader:
|
||||
for r in rows
|
||||
}
|
||||
|
||||
def sabangnet_code_map(self) -> dict[str, str]:
|
||||
"""낱개+세트 item_code → 사방넷 코드(itemcode_db). 엑셀 내보내기용."""
|
||||
if not self.enabled or not self._pool:
|
||||
return {}
|
||||
try:
|
||||
with self._pool.connection() as conn:
|
||||
rows = conn.execute(
|
||||
"SELECT item_code, sabangnet_code FROM single_items "
|
||||
"UNION ALL SELECT item_code, sabangnet_code FROM set_items"
|
||||
).fetchall()
|
||||
self.last_error = ""
|
||||
except Exception as exc: # noqa: BLE001
|
||||
self.last_error = f"{type(exc).__name__}: {exc}"
|
||||
return {}
|
||||
return {
|
||||
str(r["item_code"]).strip().upper(): str(r.get("sabangnet_code") or "").strip()
|
||||
for r in rows
|
||||
}
|
||||
|
||||
def close(self) -> None:
|
||||
if self._pool is not None:
|
||||
self._pool.close()
|
||||
|
||||
Reference in New Issue
Block a user