From 9c6ded38c5db28c3d6e020c4e553b569fbdf9daf Mon Sep 17 00:00:00 2001 From: mxr612 Date: Wed, 4 Jun 2025 15:34:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=99=8B=E5=8D=87?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增晋升校验功能,通过读取“晋升校验”工作表来验证职务晋升 --- main.py | 7 ++++++- 规则需求.md | 0 2 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 规则需求.md diff --git a/main.py b/main.py index 7a66539..1628091 100644 --- a/main.py +++ b/main.py @@ -84,6 +84,9 @@ for rule in Rule_Role: 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_verify = Level_Limit_tmp = pd.read_excel("原数据.xlsx", sheet_name="晋升校验", usecols="A:B") + logging.info("规则加载完成") Rule_Role = sorted(Rule_Role, key=lambda x: x['start']) @@ -284,7 +287,9 @@ for index, row in BaseData.iterrows(): else: new_jb = int(new_jb) 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}" elif new_jb < role_limit(role): History_pd.at[index, "级别档次"] = f"{jb}-{dc+1}" diff --git a/规则需求.md b/规则需求.md deleted file mode 100644 index e69de29..0000000