diff --git a/main.py b/main.py index 1628091..7e0917a 100644 --- a/main.py +++ b/main.py @@ -149,6 +149,12 @@ BaseData["工龄调增"] = BaseData["工龄调增"].apply(to_int) BaseData["工龄调减"] = BaseData["工龄调减"].apply(to_int) BaseData["学龄"] = BaseData["学龄"].apply(to_int) +def fallback(x): + for i in x: + if pd.notna(i) and i != '': + return i + return '' + max_promote = 0 max_history = 0 @@ -332,7 +338,7 @@ for index, row in BaseData.iterrows(): # 汇总 ws.cell(row=6+index, column=3, value=row["性别"]) ws.cell(row=6+index, column=4, value=format_time(row["出生年月"], "出生年月")) ws.cell(row=6+index, column=5, value=format_time(row["参加工作时间"], "参加工作时间")) - ws.cell(row=6+index, column=6, value=row["学历"]) + ws.cell(row=6+index, column=6, value=fallback([row["现学历"],row["学历"]])) ws.cell(row=6+index, column=7, value=nowtime.year-row["参加工作时间"].year+row["工龄调增"]-row["工龄调减"]+1+row["学龄"]) ws.cell(row=6+index, column=8, value=nowtime.year-row["参加工作时间"].year+row["工龄调增"]-row["工龄调减"]+1) ws.cell(row=6+index, column=9, value=row["学龄"])