指摘修正
This commit is contained in:
parent
e29bbe4455
commit
b878ded447
@ -99,7 +99,7 @@ class MasterMainteCSVItem(metaclass=ABCMeta):
|
||||
def is_exist_inst_cd(self) -> bool:
|
||||
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
|
||||
|
||||
def is_exist_ta_cd(self, start_date: str) -> bool:
|
||||
|
||||
@ -29,8 +29,8 @@ class MasterMainteEmpChgInstFunction(metaclass=ABCMeta):
|
||||
def save(self):
|
||||
error_list = []
|
||||
try:
|
||||
self.emp_chginst_repository.to_jst()
|
||||
self.emp_chginst_repository.begin()
|
||||
self.emp_chginst_repository.to_jst()
|
||||
(result_message, error_list) = self.write_emp_chg_inst_table()
|
||||
if len(error_list) > 0:
|
||||
self.emp_chginst_repository.rollback()
|
||||
@ -149,6 +149,7 @@ class ChangeEmpChgInstFunction(MasterMainteEmpChgInstFunction):
|
||||
self.emp_chginst_repository.end_emp_chg_inst(
|
||||
data['施設コード'],
|
||||
data['領域コード'],
|
||||
data['担当者種別コード'],
|
||||
data['施設担当_開始日'],
|
||||
data['終了日の変更'],
|
||||
self.user_name,
|
||||
@ -159,6 +160,7 @@ class ChangeEmpChgInstFunction(MasterMainteEmpChgInstFunction):
|
||||
data['施設コード'],
|
||||
data['領域コード'],
|
||||
data['施設担当_開始日'],
|
||||
data['担当者種別コード'],
|
||||
data['MUID'],
|
||||
self.user_name,
|
||||
self.table_name)
|
||||
|
||||
@ -89,13 +89,14 @@ class EmpChgInstRepository(BaseRepository):
|
||||
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):
|
||||
try:
|
||||
query = self.UPDATE_END_DATE_SQL.format(table_name=table_name)
|
||||
self._database.execute(query, {
|
||||
'inst_cd': inst_cd,
|
||||
'ta_cd': ta_cd,
|
||||
'emp_chg_type_cd': emp_chg_type_cd,
|
||||
'start_date': start_date,
|
||||
'end_date': end_date,
|
||||
'update_user_name': update_user_name
|
||||
@ -117,12 +118,13 @@ class EmpChgInstRepository(BaseRepository):
|
||||
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:
|
||||
query = self.UPDATE_EMP_CD_SQL.format(table_name=table_name)
|
||||
self._database.execute(query, {
|
||||
'inst_cd': inst_cd,
|
||||
'ta_cd': ta_cd,
|
||||
'emp_chg_type_cd': emp_chg_type_cd,
|
||||
'start_date': start_date,
|
||||
'emp_cd': emp_cd,
|
||||
'update_user_name': update_user_name
|
||||
|
||||
@ -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:
|
||||
query = self.FETCH_SQL
|
||||
result = self._database.execute_select(query, {'generic_kbn_cd': generic_kbn_cd, 'kbn_cd': kbn_cd, 'start_date' : start_date})
|
||||
|
||||
@ -73,7 +73,7 @@ class MasterMainteService(BaseService):
|
||||
raise Exception(f'登録テーブルの選択値が不正です: {csv_upload_form.select_table}')
|
||||
|
||||
(table_name, selected_table_msg) = self.__choose_target_table(csv_upload_form.select_table)
|
||||
# TODO
|
||||
|
||||
csv_items = MasterMainteCSVItems(
|
||||
file,
|
||||
csv_upload_form.select_function,
|
||||
@ -153,8 +153,8 @@ class MasterMainteService(BaseService):
|
||||
|
||||
def copy_data_real_to_dummy(self) -> TableOverrideViewModel:
|
||||
try:
|
||||
self.emp_chginst_repository.to_jst()
|
||||
self.emp_chginst_repository.begin()
|
||||
self.emp_chginst_repository.to_jst()
|
||||
self.emp_chginst_repository.delete_dummy_table()
|
||||
self.emp_chginst_repository.copy_real_to_dummy()
|
||||
self.emp_chginst_repository.commit()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user