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
79d15292
authored
2020-06-23 17:32:54 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix args filter
1 parent
703b9f28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
src/apps/doc/management/commands/doc_process.py
src/apps/doc/views.py
src/apps/doc/management/commands/doc_process.py
View file @
79d1529
...
...
@@ -269,7 +269,7 @@ class Command(BaseCommand, LoggerMixin):
loop
=
asyncio
.
get_event_loop
()
tasks
=
[
self
.
img_ocr_excel
(
wb
,
img_path
)
for
img_path
in
img_path_list
]
loop
.
run_until_complete
(
asyncio
.
wait
(
tasks
))
loop
.
close
()
#
loop.close()
wb
.
save
(
excel_path
)
# 整合excel文件上传至EDMS
except
Exception
as
e
:
...
...
src/apps/doc/views.py
View file @
79d1529
...
...
@@ -140,19 +140,18 @@ class DocView(GenericView, DocHandler):
upload_time_end
=
args
.
get
(
'upload_time_end'
)
create_time_start
=
args
.
get
(
'create_time_start'
)
create_time_end
=
args
.
get
(
'create_time_end'
)
status_query
=
Q
(
status
=
status
)
if
status
else
Q
()
application_id_query
=
Q
(
application_id
=
application_id
)
if
application_id
else
Q
()
data_source_query
=
Q
(
data_source
=
data_source
)
if
data_source
else
Q
()
business_type_query
=
Q
(
business_type
=
business_type
)
if
business_type
else
Q
()
status_query
=
Q
(
status
=
status
)
if
status
is
not
None
else
Q
()
application_id_query
=
Q
(
application_id
=
application_id
)
if
application_id
is
not
None
else
Q
()
data_source_query
=
Q
(
data_source
=
data_source
)
if
data_source
is
not
None
else
Q
()
business_type_query
=
Q
(
business_type
=
business_type
)
if
business_type
is
not
None
else
Q
()
upload_finish_time_query
=
Q
(
upload_finish_time__gte
=
upload_time_start
,
upload_finish_time__lt
=
upload_time_end
+
datetime
.
timedelta
(
days
=
1
))
\
if
upload_time_start
and
upload_time_end
else
Q
()
if
upload_time_start
is
not
None
and
upload_time_end
is
not
None
else
Q
()
create_time_query
=
Q
(
create_time__gte
=
create_time_start
,
create_time__lt
=
create_time_end
+
datetime
.
timedelta
(
days
=
1
))
\
if
create_time_start
and
create_time_end
else
Q
()
if
create_time_start
is
not
None
and
create_time_end
is
not
None
else
Q
()
query
=
status_query
&
application_id_query
&
data_source_query
&
business_type_query
\
&
upload_finish_time_query
&
create_time_query
print
(
query
)
val_tuple
=
(
'id'
,
'application_id'
,
'upload_finish_time'
,
'create_time'
,
'business_type'
,
'data_source'
,
'status'
)
doc_queryset
=
UploadDocRecords
.
objects
.
filter
(
query
)
.
values
(
*
val_tuple
)
.
order_by
(
'-upload_finish_time'
)
...
...
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