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
7890be8a
authored
2021-05-19 14:02:05 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
22582da8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
src/apps/doc/management/commands/dda_daily.py
src/apps/doc/management/commands/dda_daily.py
View file @
7890be8
...
...
@@ -5,7 +5,7 @@ from openpyxl import Workbook
from
django.core.management
import
BaseCommand
from
common.mixins
import
LoggerMixin
from
apps.doc.models
import
DDARecords
from
apps.doc
import
consts
from
settings
import
conf
class
Command
(
BaseCommand
,
LoggerMixin
):
...
...
@@ -42,7 +42,7 @@ class Command(BaseCommand, LoggerMixin):
(
'application_id'
,
'is_dda_found'
,
'is_id_found'
,
'is_bc_found'
,
'dda_found_time'
,
'id_found_time'
,
'bc_found_time'
,
'create_time'
)),
]
self
.
dda_dir
=
os
.
path
.
join
(
'SF5-CL-S-1'
,
'DDA'
)
self
.
dda_dir
=
os
.
path
.
join
(
conf
.
DATA_DIR
,
'HIL'
,
'SF5-CL-S-1'
,
'DDA'
)
self
.
excel_name_base
=
'DDA_Data'
# self.complete_dda_dir = os.path.join(self.dda_dir, 'complete')
# self.wanting_dda_dir = os.path.join(self.dda_dir, 'wanting')
...
...
@@ -73,7 +73,7 @@ class Command(BaseCommand, LoggerMixin):
do_month
=
True
if
next_date
.
day
==
1
else
False
wanting_querysets
=
None
excel_name
=
'{0}({1}).xlsx'
.
format
(
self
.
excel_name_base
,
target_date
)
excel_name
=
'{0}({1}).xlsx'
.
format
(
self
.
excel_name_base
,
date_str
)
excel_path
=
os
.
path
.
join
(
self
.
dda_dir
,
excel_name
)
wb
=
Workbook
()
...
...
@@ -109,9 +109,9 @@ class Command(BaseCommand, LoggerMixin):
)
ws
.
append
(
col_values
)
else
:
querysets
=
DDARecords
.
objects
.
filter
(
all_found
=
Tru
e
)
.
values
(
*
query_fields
)
querysets
=
DDARecords
.
objects
.
filter
(
all_found
=
Fals
e
)
.
values
(
*
query_fields
)
if
do_month
:
wanting_querysets
=
queryset
wanting_querysets
=
queryset
s
for
queryset
in
querysets
:
col_values
=
(
...
...
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