diff --git a/ecs/jskult-webapp/src/model/internal/master_mainte_csv.py b/ecs/jskult-webapp/src/model/internal/master_mainte_csv.py index a547ee18..57b5c7c7 100644 --- a/ecs/jskult-webapp/src/model/internal/master_mainte_csv.py +++ b/ecs/jskult-webapp/src/model/internal/master_mainte_csv.py @@ -102,12 +102,16 @@ class MasterMainteCSVItem(metaclass=ABCMeta): def is_exist_emp_chg_type_cd(self, start_date: str) -> bool: if start_date is None or len(start_date) == 0: return 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 + if self.generic_kbn_mst_repository.fetch_count('emp_chg_type_cd', self.emp_chg_type_cd, start_date) > 0: + return True + return False def is_exist_ta_cd(self, start_date: str) -> bool: if start_date is None or len(start_date) == 0: return False - return True if self.generic_kbn_mst_repository.fetch_count('ta_cd', self.ta_cd, start_date) > 0 else False + if self.generic_kbn_mst_repository.fetch_count('ta_cd', self.ta_cd, start_date) > 0: + return True + return False def is_exist_bu_cd(self) -> bool: return True if self.bu_master_repository.fetch_count(self.bu_cd) > 0 else False @@ -309,6 +313,9 @@ class MasterMainteNewInstEmpCSVItem(MasterMainteCSVItem): def check_emp_chg_type_cd_exists(self) -> list[str]: error_list = [] + if not self.start_date or not self.emp_chg_type_cd: + return error_list + if is_not_empty(self.emp_chg_type_cd) and super().is_exist_emp_chg_type_cd(self.start_date) is False: error_list.append(f'{self.line_num}行目の{constants.NEW_INST_EMP_CSV_LOGICAL_NAMES[constants.CSV_NEW_EMP_CHG_TYPE_CD_COL_NO]}\ は汎用区分マスタに存在しない もしくは 適用期間外のコードです。') @@ -316,6 +323,9 @@ class MasterMainteNewInstEmpCSVItem(MasterMainteCSVItem): def check_ta_cd_exists(self) -> list[str]: error_list = [] + if not self.start_date or not self.ta_cd: + return error_list + if is_not_empty(self.ta_cd) and super().is_exist_ta_cd(self.start_date) is False: error_list.append(f'{self.line_num}行目の{constants.NEW_INST_EMP_CSV_LOGICAL_NAMES[constants.CSV_NEW_TA_CD_COL_NO]}\ は汎用区分マスタに存在しない もしくは 適用期間外のコードです。') @@ -494,6 +504,9 @@ class MasterMainteChangeInstEmpCSVItem(MasterMainteCSVItem): def check_emp_chg_type_cd_exists(self) -> list[str]: error_list = [] + if not self.inst_emp_start_date or not self.emp_chg_type_cd: + return error_list + if is_not_empty(self.emp_chg_type_cd) and super().is_exist_emp_chg_type_cd(self.inst_emp_start_date) is False: error_list.append(f'{self.line_num}行目の{constants.CHANGE_INST_CSV_LOGICAL_NAMES[constants.CSV_CHANGE_EMP_CHG_TYPE_CD_COL_NO]}\ は汎用区分マスタに存在しない もしくは 適用期間外のコードです。') @@ -501,6 +514,10 @@ class MasterMainteChangeInstEmpCSVItem(MasterMainteCSVItem): def check_ta_cd_exists(self) -> list[str]: error_list = [] + + if not self.inst_emp_start_date or not self.ta_cd: + return error_list + if is_not_empty(self.ta_cd) and super().is_exist_ta_cd(self.inst_emp_start_date) is False: error_list.append(f'{self.line_num}行目の{constants.CHANGE_INST_CSV_LOGICAL_NAMES[constants.CSV_CHANGE_TA_CD_COL_NO]}\ は汎用区分マスタに存在しない もしくは 適用期間外のコードです。')