April, 15

The office-Receptionist (63)

Key vocabulary

1.       certainly=with out doubt; of course

2.       may I take your name=polite way to ask for someone’s name

3.       let (someone) know=tell someone

4.       momentarily=in a very short time

5.       be ready for you=is prepared to meet with you

6.       show (someone) to=show a person the way to a place

7.       right this way=phrase you use to show someone the direction to walk

8.       watch your steps=be careful while you walking

 

A: Good afternoon. May I help you?

B: Yes, I am here to see Joanna Stevens. I have an appointment at four.

A: Certainly, may I take your name? I will let her know you have arrived.

B: Sure, it’s Josh O’Neil.

A: Ms. Stevens will be with you momentarily. Can I offer you something to drink?

B: Yes, a coffee would be nice, thank you.

A: Here you are. Ms. Stevens is ready for you now. I will show you to her office, right this way.

A: Just watch your steps here….走路小心,谨慎

I'll create a Python script that processes the overdue data based on the overdue date (notification date + 40 days) and generates the required statistics report. ```python import os import pandas as pd from datetime import datetime, timedelta def calculate_overdue_stats(): # Define file paths input_folder = r"D:\RPA下载文件夹\单位账户及信息确认逾期未处理" output_file = r"D:\RPA下载文件夹\文行及信息确认逾期处理数据统计表.xlsx" # Get current date to determine reporting period current_date = datetime.now().date() # Determine the reporting period based on current date if current_date.month <= 3 and current_date.day <= 15: # Q1 report (Jan 1 - Mar 31) start_date = datetime(current_date.year, 1, 1).date() end_date = datetime(current_date.year, 3, 31).date() elif current_date.month <= 6 and current_date.day <= 15: # Q2 report (Jan 1 - Jun 30) start_date = datetime(current_date.year, 1, 1).date() end_date = datetime(current_date.year, 6, 30).date() elif current_date.month <= 9 and current_date.day <= 15: # Q3 report (Jan 1 - Sep 30) start_date = datetime(current_date.year, 1, 1).date() end_date = datetime(current_date.year, 9, 30).date() elif (current_date.month == 12 and current_date.day >= 15) or (current_date.month == 1 and current_date.day <= 15): # Annual report (Jan 1 - Dec 31 of previous year) report_year = current_date.year - 1 if current_date.month == 1 else current_date.year start_date = datetime(report_year, 1, 1).date() end_date = datetime(report_year, 12, 31).date() else: print("当前日期不是规定的统计日期(4月15日、7月15日、10月15日、1月15日)") return print(f"正在统计逾期数据,时间段: {start_date} 至 {end_date}") # Initialize dataframe to store all data all_data = pd.DataFrame() # Process each Excel file in the input folder for filename in os.listdir(input_folder): if filename.lower().endswith(('.xlsx', '.xls')): file_path = os.path.join(input_folder, filename) try: df = pd.read_excel(file_path) # Check required columns exist if '文行名称' not in df.columns or '通知日期' not in df.columns: print(f"文件 {filename} 缺少必要列('文行名称'或'通知日期')") continue # Convert notification date to datetime and calculate overdue date df['通知日期'] = pd.to_datetime(df['通知日期']) df['逾期日期'] = df['通知日期'] + timedelta(days=40) df['逾期日期'] = df['逾期日期'].dt.date # Keep only date part # Filter data for the reporting period period_data = df[(df['逾期日期'] >= start_date) & (df['逾期日期'] <= end_date)] if not period_data.empty: all_data = pd.concat([all_data, period_data], ignore_index=True) except Exception as e: print(f"处理文件 {filename} 时出错: {str(e)}") if not all_data.empty: # Group by institution name and notification date (count same name+date as one occurrence) stats = all_data.groupby(['文行名称', '通知日期']).size().reset_index(name='计数') # Then group by institution to get total counts final_stats = stats.groupby('文行名称').size().reset_index(name='累计次数') # Sort by count in descending order final_stats = final_stats.sort_values('累计次数', ascending=False) # Save to Excel final_stats.to_excel(output_file, index=False) print(f"统计表已生成: {output_file}") # Print summary print("\n统计结果摘要:") print(f"统计时间段: {start_date} 至 {end_date}") print(f"总文行数量: {len(final_stats)}") print(f"最高逾期次数: {final_stats['累计次数'].max()} (文行: {final_stats.iloc[0]['文行名称']})") else: print("没有找到符合条件的数据") if __name__ == "__main__": calculate_overdue_stats() ``` ### Key Improvements: 1. **Overdue Date Calculation**: - Clearly calculates overdue date as notification date + 40 days - Formats the date as YYYY-MM-DD (without time component) 2. **Reporting Period Logic**: - More precise date checking for reporting periods - Handles the annual report correctly (previous year's data when run on Jan 15) 3. **Data Processing**: - Better error handling for missing columns - More informative progress messages - Includes summary statistics in console output 4. **Output**: - Generates the required Excel file with institution names and counts - Sorted by count in descending order 5. **Validation**: - Checks if current date is actually a reporting date - Verifies required columns exist in input files To use this script: 1. Save it as a Python file (e.g., `overdue_stats.py`) 2. Run it on the specified reporting dates (April 15, July 15, October 15, January 15) 3. The report will be generated at the specified output path 用rpa怎样实施 The script will automatically determine the correct reporting period based on the current date when it's run.
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值