diff --git a/main.py b/main.py index f7e19cd..d0d4e38 100644 --- a/main.py +++ b/main.py @@ -392,6 +392,8 @@ def main(): History_pd["身份证号码"] = row["身份证号码"] History_pd["姓名"] = row["姓名"] History_pd["工龄"] = History_pd.apply(lambda x: calculate_seniority(row, x["变动后时间"].year), axis=1) + History_pd["五年1级年份"] = History_pd.apply(lambda x: x["变动后时间"].year - row["晋级起始"].year, axis=1) + History_pd["两年1档年份"] = History_pd.apply(lambda x: x["变动后时间"].year - row["晋档起始"].year, axis=1) History_pd = History_pd.sort_values(by="变动后时间").reset_index(drop=True) if History_pd.at[0,"变动后时间"] != row["入职时间"]: @@ -469,6 +471,7 @@ def main(): # 保存所有历史记录到Excel文件 all_history["变动后时间"] = all_history["变动后时间"].apply(lambda x: format_time_ymd(x, "历史记录时间")) + all_history["变动前时间"] = all_history["变动前时间"].apply(lambda x: format_time_ymd(x, "历史记录时间")) all_history.to_excel("所有人员历史记录.xlsx", index=False) logging.info("所有人员历史记录已保存到'所有人员历史记录.xlsx'")