fix: 改进异常处理以增强时间格式验证

- 更新异常信息,包含“晋级起始”、“晋档起始”、“晋级间隔”和“晋档间隔”字段的格式错误提示
- 确保在处理数据时,能够更清晰地识别时间格式问题
This commit is contained in:
Miu Li 2025-06-09 15:56:00 +08:00
parent 370131c773
commit 4def3c7dc6

View File

@ -259,7 +259,7 @@ for index, row in BaseData.iterrows():
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['晋档起始']}-{row['晋级间隔']}-{row['晋档间隔']}")
for rule in Rule_Level: # 工资调标 for rule in Rule_Level: # 工资调标
if row["入职时间"] < rule["start"]: if row["入职时间"] < rule["start"]:
History_pd.loc[len(History_pd)] = [rule["start"], "", "", "", "", "", "工资调标"] History_pd.loc[len(History_pd)] = [rule["start"], "", "", "", "", "", "工资调标"]