指摘修正

This commit is contained in:
nik.n 2024-04-18 10:27:08 +09:00
parent e29bbe4455
commit b878ded447
5 changed files with 11 additions and 7 deletions

View File

@ -99,7 +99,7 @@ class MasterMainteCSVItem(metaclass=ABCMeta):
def is_exist_inst_cd(self) -> bool: def is_exist_inst_cd(self) -> bool:
return True if self.mst_inst_repository.fetch_count(self.inst_cd) > 0 else False return True if self.mst_inst_repository.fetch_count(self.inst_cd) > 0 else False
def is_exist_emp_chg_type_cd(self, start_date) -> bool: def is_exist_emp_chg_type_cd(self, start_date: str) -> bool:
return True if self.generic_kbn_mst_repository.fetch_count('emp_chg_type_cd', self.emp_chg_type_cd, start_date) > 0 else False return True if self.generic_kbn_mst_repository.fetch_count('emp_chg_type_cd', self.emp_chg_type_cd, start_date) > 0 else False
def is_exist_ta_cd(self, start_date: str) -> bool: def is_exist_ta_cd(self, start_date: str) -> bool:

View File

@ -29,8 +29,8 @@ class MasterMainteEmpChgInstFunction(metaclass=ABCMeta):
def save(self): def save(self):
error_list = [] error_list = []
try: try:
self.emp_chginst_repository.to_jst()
self.emp_chginst_repository.begin() self.emp_chginst_repository.begin()
self.emp_chginst_repository.to_jst()
(result_message, error_list) = self.write_emp_chg_inst_table() (result_message, error_list) = self.write_emp_chg_inst_table()
if len(error_list) > 0: if len(error_list) > 0:
self.emp_chginst_repository.rollback() self.emp_chginst_repository.rollback()
@ -149,6 +149,7 @@ class ChangeEmpChgInstFunction(MasterMainteEmpChgInstFunction):
self.emp_chginst_repository.end_emp_chg_inst( self.emp_chginst_repository.end_emp_chg_inst(
data['施設コード'], data['施設コード'],
data['領域コード'], data['領域コード'],
data['担当者種別コード'],
data['施設担当_開始日'], data['施設担当_開始日'],
data['終了日の変更'], data['終了日の変更'],
self.user_name, self.user_name,
@ -159,6 +160,7 @@ class ChangeEmpChgInstFunction(MasterMainteEmpChgInstFunction):
data['施設コード'], data['施設コード'],
data['領域コード'], data['領域コード'],
data['施設担当_開始日'], data['施設担当_開始日'],
data['担当者種別コード'],
data['MUID'], data['MUID'],
self.user_name, self.user_name,
self.table_name) self.table_name)

View File

@ -89,13 +89,14 @@ class EmpChgInstRepository(BaseRepository):
and start_date = :start_date and start_date = :start_date
""" """
def end_emp_chg_inst(self, inst_cd, ta_cd, start_date, def end_emp_chg_inst(self, inst_cd, ta_cd, emp_chg_type_cd, start_date,
end_date, update_user_name, table_name): end_date, update_user_name, table_name):
try: try:
query = self.UPDATE_END_DATE_SQL.format(table_name=table_name) query = self.UPDATE_END_DATE_SQL.format(table_name=table_name)
self._database.execute(query, { self._database.execute(query, {
'inst_cd': inst_cd, 'inst_cd': inst_cd,
'ta_cd': ta_cd, 'ta_cd': ta_cd,
'emp_chg_type_cd': emp_chg_type_cd,
'start_date': start_date, 'start_date': start_date,
'end_date': end_date, 'end_date': end_date,
'update_user_name': update_user_name 'update_user_name': update_user_name
@ -117,12 +118,13 @@ class EmpChgInstRepository(BaseRepository):
and start_date = :start_date and start_date = :start_date
""" """
def modify_emp_chg_inst(self, inst_cd, ta_cd, start_date, emp_cd, update_user_name, table_name): def modify_emp_chg_inst(self, inst_cd, ta_cd, start_date, emp_chg_type_cd, emp_cd, update_user_name, table_name):
try: try:
query = self.UPDATE_EMP_CD_SQL.format(table_name=table_name) query = self.UPDATE_EMP_CD_SQL.format(table_name=table_name)
self._database.execute(query, { self._database.execute(query, {
'inst_cd': inst_cd, 'inst_cd': inst_cd,
'ta_cd': ta_cd, 'ta_cd': ta_cd,
'emp_chg_type_cd': emp_chg_type_cd,
'start_date': start_date, 'start_date': start_date,
'emp_cd': emp_cd, 'emp_cd': emp_cd,
'update_user_name': update_user_name 'update_user_name': update_user_name

View File

@ -20,7 +20,7 @@ class GenericKbnMstRepository(BaseRepository):
""" """
def fetch_count(self, generic_kbn_cd, kbn_cd, start_date) -> MasterMenteCountModel: def fetch_count(self, generic_kbn_cd: str, kbn_cd: str, start_date: str) -> MasterMenteCountModel:
try: try:
query = self.FETCH_SQL query = self.FETCH_SQL
result = self._database.execute_select(query, {'generic_kbn_cd': generic_kbn_cd, 'kbn_cd': kbn_cd, 'start_date' : start_date}) result = self._database.execute_select(query, {'generic_kbn_cd': generic_kbn_cd, 'kbn_cd': kbn_cd, 'start_date' : start_date})

View File

@ -73,7 +73,7 @@ class MasterMainteService(BaseService):
raise Exception(f'登録テーブルの選択値が不正です: {csv_upload_form.select_table}') raise Exception(f'登録テーブルの選択値が不正です: {csv_upload_form.select_table}')
(table_name, selected_table_msg) = self.__choose_target_table(csv_upload_form.select_table) (table_name, selected_table_msg) = self.__choose_target_table(csv_upload_form.select_table)
# TODO
csv_items = MasterMainteCSVItems( csv_items = MasterMainteCSVItems(
file, file,
csv_upload_form.select_function, csv_upload_form.select_function,
@ -153,8 +153,8 @@ class MasterMainteService(BaseService):
def copy_data_real_to_dummy(self) -> TableOverrideViewModel: def copy_data_real_to_dummy(self) -> TableOverrideViewModel:
try: try:
self.emp_chginst_repository.to_jst()
self.emp_chginst_repository.begin() self.emp_chginst_repository.begin()
self.emp_chginst_repository.to_jst()
self.emp_chginst_repository.delete_dummy_table() self.emp_chginst_repository.delete_dummy_table()
self.emp_chginst_repository.copy_real_to_dummy() self.emp_chginst_repository.copy_real_to_dummy()
self.emp_chginst_repository.commit() self.emp_chginst_repository.commit()