feat: 更新晋档和晋级记录描述

- 修改晋档和晋级记录的描述,分别更新为“两年晋档”和“五年晋级”
- 确保在处理历史记录时,相关字段的值设置符合新的数据结构
This commit is contained in:
Miu Li 2025-06-03 22:16:44 +08:00
parent 018981f42f
commit 4b72174a32

View File

@ -240,13 +240,13 @@ for index, row in BaseData.iterrows():
calctime += relativedelta(years=row["晋档间隔"]) calctime += relativedelta(years=row["晋档间隔"])
if calctime > nowtime: if calctime > nowtime:
break break
History_pd.loc[len(History_pd)] = [calctime, "", "", "", "", "", "晋档"] History_pd.loc[len(History_pd)] = [calctime, "", "", "", "", "", "两年晋档"]
calctime=row["晋级起始"] calctime=row["晋级起始"]
while True: # 添加晋级记录 while True: # 添加晋级记录
calctime += relativedelta(years=row["晋级间隔"]) calctime += relativedelta(years=row["晋级间隔"])
if calctime > nowtime: if calctime > nowtime:
break break
History_pd.loc[len(History_pd)] = [calctime, "", "", "", "", "", "晋级"] History_pd.loc[len(History_pd)] = [calctime, "", "", "", "", "", "五年晋级"]
except: except:
raise Exception(f"晋级、档起始时间格式错误:{row['晋档起始']}{row['晋级起始']}") raise Exception(f"晋级、档起始时间格式错误:{row['晋档起始']}{row['晋级起始']}")
for rule in Rule_Level: # 工资调标 for rule in Rule_Level: # 工资调标
@ -266,9 +266,9 @@ for index, row in BaseData.iterrows():
History_pd.at[index, "职务"] = rule["rule"][rule["rule"]["原名称"] == History_pd.iloc[index]["职务"]]["现名称"].values[0] History_pd.at[index, "职务"] = rule["rule"][rule["rule"]["原名称"] == History_pd.iloc[index]["职务"]]["现名称"].values[0]
if index > 0 and hrow["级别档次"] == "": if index > 0 and hrow["级别档次"] == "":
jb, dc = split_level(History_pd.iloc[index-1]["级别档次"]) jb, dc = split_level(History_pd.iloc[index-1]["级别档次"])
if hrow["变动原因"] == "晋档": if hrow["变动原因"] == "两年晋档":
History_pd.at[index, "级别档次"] = f"{jb}-{dc+1}" History_pd.at[index, "级别档次"] = f"{jb}-{dc+1}"
elif hrow["变动原因"] == "晋级": elif hrow["变动原因"] == "五年晋级":
History_pd.at[index, "级别档次"] = f"{jb-1}-{dc-1}" History_pd.at[index, "级别档次"] = f"{jb-1}-{dc-1}"
elif hrow["变动原因"] == "工资调标": elif hrow["变动原因"] == "工资调标":
History_pd.at[index, "级别档次"] = f"{jb}-{dc}" History_pd.at[index, "级别档次"] = f"{jb}-{dc}"