From f3e772e0f34b8f824a2283cdd3ba7926cd622d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=9C=A8=E8=A6=81?= Date: Tue, 30 May 2023 16:25:48 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=98=E4=BD=93=E8=A9=A6=E9=A8=93?= =?UTF-8?q?=E5=AE=9F=E6=96=BD=E4=B8=AD=E3=81=AB=E7=99=BA=E8=A6=8B=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E3=83=87=E3=83=83=E3=83=88=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AE=E5=89=8A=E9=99=A4=E3=80=81=E3=81=BB=E3=81=8B?= =?UTF-8?q?=E3=80=81=E3=83=87=E3=83=BC=E3=82=BF=E3=81=AE=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=81=AE=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dcf_inst_merge/integrate_dcf_inst_merge.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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'])