* feat: pythonのコード内で呼ばれているSQLのタイムゾーンをJSTに変更(アルトマーク、arisj)
This commit is contained in:
parent
9dbec78cd6
commit
90d9a204f8
@ -60,6 +60,7 @@ def update_batch_processing_flag_in_processing() -> None:
|
||||
"""
|
||||
try:
|
||||
db.connect()
|
||||
db.to_jst()
|
||||
db.execute(sql, {'in_processing': constants.BATCH_ACTF_BATCH_IN_PROCESSING})
|
||||
except DBException as e:
|
||||
raise BatchOperationException(e)
|
||||
@ -87,6 +88,7 @@ def update_batch_process_complete() -> None:
|
||||
"""
|
||||
try:
|
||||
db.connect()
|
||||
db.to_jst()
|
||||
db.execute(sql, {
|
||||
'batch_complete': constants.BATCH_ACTF_BATCH_UNPROCESSED,
|
||||
'dump_unprocessed': constants.DUMP_STATUS_KBN_UNPROCESSED
|
||||
|
||||
@ -13,6 +13,7 @@ def exec():
|
||||
db = Database.get_instance()
|
||||
try:
|
||||
db.connect()
|
||||
db.to_jst()
|
||||
logger.debug('納入先処方元マスタの洗替処理開始')
|
||||
# ult_ident_presc_lauをTruncate
|
||||
_truncate_ult_ident_presc_lau(db)
|
||||
|
||||
@ -37,6 +37,7 @@ class VjskDataLoadManager:
|
||||
try:
|
||||
# データベース接続
|
||||
db.connect()
|
||||
db.to_jst()
|
||||
db.execute("SET SESSION sql_mode = 'TRADITIONAL';")
|
||||
|
||||
# orgをtruncate
|
||||
|
||||
@ -30,6 +30,8 @@ def exec():
|
||||
except Exception as e:
|
||||
logger.info('DB接続エラーです')
|
||||
raise e
|
||||
# タイムゾーンをJSTに変更
|
||||
db.to_jst()
|
||||
|
||||
# トランザクションの開始
|
||||
db.begin()
|
||||
|
||||
@ -167,6 +167,9 @@ class Database:
|
||||
self.__connection.close()
|
||||
self.__connection = None
|
||||
|
||||
def to_jst(self):
|
||||
self.execute('SET time_zone = "+9:00"')
|
||||
|
||||
def __execute_with_transaction(self, query: str, parameters: dict):
|
||||
# トランザクションを開始してクエリを実行する
|
||||
with self.__connection.begin():
|
||||
|
||||
@ -55,6 +55,7 @@ def update_dump_status_kbn_in_processing() -> None:
|
||||
"""
|
||||
try:
|
||||
db.connect()
|
||||
db.to_jst()
|
||||
db.execute(sql, {'in_processing': constants.BATCH_ACTF_BATCH_IN_PROCESSING})
|
||||
except DBException as e:
|
||||
raise BatchOperationException(e)
|
||||
@ -80,6 +81,7 @@ def update_dump_status_kbn_error() -> None:
|
||||
"""
|
||||
try:
|
||||
db.connect()
|
||||
db.to_jst()
|
||||
db.execute(sql, {
|
||||
'dump_unprocessed': constants.DUMP_STATUS_KBN_ERROR
|
||||
})
|
||||
@ -107,6 +109,7 @@ def update_dump_status_kbn_complete() -> None:
|
||||
"""
|
||||
try:
|
||||
db.connect()
|
||||
db.to_jst()
|
||||
db.execute(sql, {
|
||||
'dump_unprocessed': constants.DUMP_STATUS_KBN_COMPLETE
|
||||
})
|
||||
|
||||
@ -165,6 +165,9 @@ class Database:
|
||||
self.__connection.close()
|
||||
self.__connection = None
|
||||
|
||||
def to_jst(self):
|
||||
self.execute('SET time_zone = "+9:00"')
|
||||
|
||||
def __execute_with_transaction(self, query: str, parameters: dict):
|
||||
# トランザクションを開始してクエリを実行する
|
||||
with self.__connection.begin():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user