feat: 添加五年1级和两年1档年份计算字段
- 在历史记录中新增五年1级年份和两年1档年份的计算逻辑 - 更新变动前时间字段的格式化处理,确保数据一致性
This commit is contained in:
parent
e97448fc51
commit
30867f302c
3
main.py
3
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'")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user