Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
94c1d320
authored
2021-02-08 10:38:05 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix monthly idcard
1 parent
cc8a3d91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
src/apps/doc/management/commands/idcard_monthly.py
src/apps/doc/management/commands/idcard_monthly.py
View file @
94c1d32
...
...
@@ -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
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment