feat: 添加晋升校验逻辑

- 新增晋升校验功能,通过读取“晋升校验”工作表来验证职务晋升
This commit is contained in:
Miu Li 2025-06-04 15:34:03 +08:00
parent 7c6bb16d89
commit 9c6ded38c5
2 changed files with 6 additions and 1 deletions

View File

@ -84,6 +84,9 @@ for rule in Rule_Role:
Level_Limit[row["role"]] = Level_Limit_tmp.iloc[index]["limit"] Level_Limit[row["role"]] = Level_Limit_tmp.iloc[index]["limit"]
Promote_Level[row["role"]] = (Promote_Level_tmp.iloc[index]["级别"], Promote_Level_tmp.iloc[index]["档次"]) Promote_Level[row["role"]] = (Promote_Level_tmp.iloc[index]["级别"], Promote_Level_tmp.iloc[index]["档次"])
# 晋升校验
Promote_verify = Level_Limit_tmp = pd.read_excel("原数据.xlsx", sheet_name="晋升校验", usecols="A:B")
logging.info("规则加载完成") logging.info("规则加载完成")
Rule_Role = sorted(Rule_Role, key=lambda x: x['start']) Rule_Role = sorted(Rule_Role, key=lambda x: x['start'])
@ -284,7 +287,9 @@ for index, row in BaseData.iterrows():
else: else:
new_jb = int(new_jb) new_jb = int(new_jb)
new_dc = int(new_dc) new_dc = int(new_dc)
if role_limit(role) == 99: # 99tag if (History_pd.iloc[index-1]["职务"] in Promote_verify.iloc[:,0].values and
role in Promote_verify.iloc[:,1].values):
logging.info(f"[{row['身份证号码']}]命中晋升校验规则[{History_pd.iloc[index-1]['职务']}]->[{role}]")
History_pd.at[index, "级别档次"] = f"{jb}-{dc}" History_pd.at[index, "级别档次"] = f"{jb}-{dc}"
elif new_jb < role_limit(role): elif new_jb < role_limit(role):
History_pd.at[index, "级别档次"] = f"{jb}-{dc+1}" History_pd.at[index, "级别档次"] = f"{jb}-{dc+1}"

View File