diff --git a/ecs/jskult-batch-daily/src/batch/dcf_inst_merge/integrate_dcf_inst_merge.py b/ecs/jskult-batch-daily/src/batch/dcf_inst_merge/integrate_dcf_inst_merge.py index 182b7232..20ac5fcc 100644 --- a/ecs/jskult-batch-daily/src/batch/dcf_inst_merge/integrate_dcf_inst_merge.py +++ b/ecs/jskult-batch-daily/src/batch/dcf_inst_merge/integrate_dcf_inst_merge.py @@ -91,12 +91,6 @@ def _add_ult_ident_presc(db: Database, enabled_dst_inst_merge_records: list[dict # 重複予定データが存在しない、且つ、適用終了日 ≧ 適用開始日の場合 if not is_exists_duplicate_key: last_end_date = tekiyo_month_first_day - timedelta(days=1) - # 適用開始日 > DCF施設統合マスタの適用月度の前月末日の場合 - if start_date > last_end_date: - # 対象レコードを物理削除する - _delete_ult_ident_presc(db, ult_ident_presc_row['start_date'], ult_ident_presc_row, - '適用終了日更新後 開始日>終了日のため物理削除') - continue # 適用終了日を、DCF施設統合マスタの適用月度の前月末日で更新 _update_ult_ident_presc_end_date(db, _date_time_to_str(last_end_date), ult_ident_presc_row) @@ -121,14 +115,15 @@ def _add_emp_chg_inst(db: Database, enabled_dst_inst_merge_records: list[dict]): _insert_emp_chg_inst(db, enabled_merge_record['dup_opp_cd'], _date_time_to_str(set_start_date), emp_chg_inst_row) - # 適用開始日 < DCF施設統合マスタの適用月度の1日の場合 - if start_date < tekiyo_month_first_day: + # 適用終了日 ≧ 適用開始日の場合 + if _str_to_date_time(emp_chg_inst_row['end_date']) >= start_date: # DCF施設統合マスタの適用月度の前月末日で、適用終了日を更新する last_end_date = tekiyo_month_first_day - timedelta(days=1) _update_emp_chg_inst_end_date(db, enabled_merge_record['dcf_inst_cd'], _date_time_to_str(last_end_date), emp_chg_inst_row) - continue - # 適用開始日 ≧ DCF施設統合マスタの適用月度の1日の場合、N(論理削除レコード)に設定する + if last_end_date >= start_date: + continue + # DCF施設統合マスタの適用月度の前月末日 < 適用開始日、または適用終了日 < 適用開始日の場合、N(論理削除レコード)に設定する _update_emp_chg_inst_disabled(db, enabled_merge_record['dcf_inst_cd'], emp_chg_inst_row['ta_cd'], emp_chg_inst_row['start_date'])