94c1d320 by 周伟奇

fix monthly idcard

1 parent cc8a3d91
......@@ -28,6 +28,7 @@ class Command(BaseCommand, LoggerMixin):
return
monthly_wb = Workbook()
monthly_ws = monthly_wb.get_sheet_by_name('Sheet')
for d in range(1, monthrange(pre_mouth.year, pre_mouth.month)[1] + 1):
date_str = '{:04d}-{:02d}-{:02d}'.format(pre_mouth.year, pre_mouth.month, d)
......@@ -36,12 +37,13 @@ class Command(BaseCommand, LoggerMixin):
print('daily excel path not exists: {0}'.format(daily_excel_path))
continue
monthly_ws = monthly_wb.create_sheet(date_str)
# monthly_ws = monthly_wb.create_sheet(date_str)
daily_wb = load_workbook(daily_excel_path)
daily_ws = daily_wb.get_sheet_by_name('身份证')
for row in daily_ws.iter_rows(min_row=1, values_only=True):
monthly_ws.append(row)
monthly_excel_path = os.path.join(excel_dir, 'idcard_{0}.xlsx'.format(pre_mouth.strftime('%Y-%m')))
monthly_wb.remove(monthly_wb.get_sheet_by_name('Sheet'))
# monthly_wb.remove(monthly_wb.get_sheet_by_name('Sheet'))
monthly_ws.title = '身份证'
monthly_wb.save(monthly_excel_path)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!