Merge pull request #250 feature-NEWDWH2021-1176 into develop

This commit is contained in:
朝倉 明日香 2023-08-09 11:13:29 +09:00
commit c40a1b1b14
2 changed files with 7 additions and 4 deletions

View File

@ -4,6 +4,7 @@ from src.logging.get_logger import get_logger
from src.model.db.bio_sales_lot import BioSalesLotDBModel
from src.model.request.bio import BioModel
from src.repositories.base_repository import BaseRepository
from src.system_var import environment
from src.util.string_util import is_not_empty
logger = get_logger('生物由来参照')
@ -58,7 +59,8 @@ class BioSalesLotRepository(BaseRepository):
rec_whs_sub_cd,
rev_hsdnymd_srk,
slip_mgt_num
ASC\
ASC
LIMIT {limit}\
"""
def fetch_many(self, parameter: BioModel) -> list[BioSalesLotDBModel]:
@ -66,7 +68,8 @@ class BioSalesLotRepository(BaseRepository):
self._database.connect()
logger.debug('DB参照実行')
where_clause = self.__build_condition(parameter)
query = self.FETCH_SQL.format(where_clause=where_clause)
# システムとしての最大取得件数 +1 まで取る
query = self.FETCH_SQL.format(where_clause=where_clause, limit=environment.BIO_SEARCH_RESULT_MAX_COUNT + 1)
logger.debug(f'SQL: {query}')
result = self._database.execute_select(query, parameter.model_dump())
logger.debug(f'count= {len(result)}')
@ -83,7 +86,7 @@ class BioSalesLotRepository(BaseRepository):
self._database.connect()
logger.debug('DB参照実行')
where_clause = self.__build_condition(parameter)
query = self.FETCH_SQL.format(where_clause=where_clause)
query = self.FETCH_SQL.format(where_clause=where_clause, limit=environment.BIO_SEARCH_RESULT_MAX_COUNT + 1)
logger.debug(f'SQL: {query}')
df = self._to_data_frame(query, parameter)
logger.debug(f'count= {len(df.index)}')

View File

@ -19,7 +19,7 @@ DB_USERNAME = os.environ['DB_USERNAME']
DB_PASSWORD = os.environ['DB_PASSWORD']
DB_SCHEMA = os.environ['DB_SCHEMA']
BIO_SEARCH_RESULT_MAX_COUNT = int(os.environ['BIO_SEARCH_RESULT_MAX_COUNT'])
BIO_SEARCH_RESULT_MAX_COUNT = int(os.environ.get('BIO_SEARCH_RESULT_MAX_COUNT', 35000))
ULTMARC_SEARCH_RESULT_MAX_COUNT = int(os.environ['ULTMARC_SEARCH_RESULT_MAX_COUNT'])
SESSION_EXPIRE_MINUTE = int(os.environ['SESSION_EXPIRE_MINUTE'])