[feat] negodata: 회사 커스터마이징(설정·라벨·커스텀필드·엑셀·상품공급사#20·분류카테고리#17)·일괄삭제·로그export·구분·카드 전체선택·부가정보 표시
This commit is contained in:
1 parent
1e4726f4cc
commit
88edcfed63
75 files changed
+1802
-126
No files matched your search
@@ -5,7 +5,7 @@ from sqlalchemy import select, func, update
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.database.model.models import supplier_items, items
|
||||
from common.database.model.models import supplier_items, items, suppliers
|
||||
from common.enums import ErrorType
|
||||
from common.logger import LOG
|
||||
from common.utils.gtime import GTime
|
||||
@@ -48,7 +48,8 @@ class ISupplierItemCRUD(ABC):
|
||||
|
||||
class SupplierItemCRUD(ISupplierItemCRUD):
|
||||
async def list_by_supplier(self, cdb: AsyncSession, supplier_id) -> Tuple[ErrorType, list]:
|
||||
# 협력사 상세용: 매핑 + 상품명/코드 조인. Row(supplier_item_id, item_id, name, code, supply_type)
|
||||
# 협력사 상세용: 매핑 + 상품명/코드/카테고리/제조사 조인.
|
||||
# Row(supplier_item_id, item_id, name, code, supply_type, category, manufacturer)
|
||||
try:
|
||||
query = (
|
||||
select(
|
||||
@@ -57,6 +58,8 @@ class SupplierItemCRUD(ISupplierItemCRUD):
|
||||
items.name,
|
||||
items.code,
|
||||
supplier_items.supply_type,
|
||||
items.category,
|
||||
items.manufacturer,
|
||||
)
|
||||
.join(items, items.item_id == supplier_items.item_id)
|
||||
.where(
|
||||
@@ -75,11 +78,22 @@ class SupplierItemCRUD(ISupplierItemCRUD):
|
||||
return ErrorType.DB_RUN_FAILED, []
|
||||
|
||||
async def list_by_item(self, cdb: AsyncSession, item_id) -> Tuple[ErrorType, list]:
|
||||
# 견적생성 모달용: 이 상품을 취급하는 협력사별 공급유형. Row(supplier_id, supply_type)
|
||||
# 견적생성 모달·상품 상세 공용: 이 상품을 취급하는 협력사별 공급유형.
|
||||
# Row(supplier_id, supply_type, name, supplier_item_id)
|
||||
try:
|
||||
query = select(supplier_items.supplier_id, supplier_items.supply_type).where(
|
||||
supplier_items.item_id == item_id,
|
||||
supplier_items.deleted == False, # noqa: E712
|
||||
query = (
|
||||
select(
|
||||
supplier_items.supplier_id,
|
||||
supplier_items.supply_type,
|
||||
suppliers.name,
|
||||
supplier_items.supplier_item_id,
|
||||
)
|
||||
.join(suppliers, suppliers.supplier_id == supplier_items.supplier_id)
|
||||
.where(
|
||||
supplier_items.item_id == item_id,
|
||||
supplier_items.deleted == False, # noqa: E712
|
||||
suppliers.deleted == False, # noqa: E712
|
||||
)
|
||||
)
|
||||
err_type, rows = await DB_SESSION_MNG.execute(cdb, query)
|
||||
if err_type != ErrorType.SUCCESS:
|
||||
|
||||
Reference in new issue
Block a user