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
6be9056c
authored
2020-12-28 15:16:27 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix license report
1 parent
bde11ee9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
src/apps/doc/management/commands/license_statistics.py
src/apps/doc/management/commands/license_statistics.py
View file @
6be9056
...
...
@@ -82,6 +82,8 @@ class Command(BaseCommand, LoggerMixin):
wb
=
Workbook
()
for
classify
,
(
_
,
name
,
_
,
_
,
_
,
_
)
in
consts
.
LICENSE_ORDER
:
if
classify
==
consts
.
DL_CLASSIFY
or
classify
==
consts
.
VAT_CLASSIFY
:
continue
ws
=
wb
.
create_sheet
(
name
)
headers
=
self
.
header_map
.
get
(
classify
,
[])
for
header
in
headers
:
...
...
@@ -96,9 +98,16 @@ class Command(BaseCommand, LoggerMixin):
business_type
,
doc_id_str
=
task_str
.
split
(
consts
.
SPLIT_STR
)
doc_id
=
int
(
doc_id_str
)
doc_class
=
HILDoc
if
business_type
==
consts
.
HIL_PREFIX
else
AFCDoc
application_id
=
doc_class
.
objects
.
filter
(
id
=
doc_id
)
.
values_list
(
'application_id'
,
flat
=
True
)
doc_queryset
=
doc_class
.
objects
.
filter
(
id
=
doc_id
)
.
values_list
(
'application_id'
,
'document_scheme'
)
if
len
(
doc_queryset
)
==
0
:
continue
application_id
,
document_scheme
=
doc_queryset
[
0
]
if
document_scheme
!=
consts
.
DOC_SCHEME_LIST
[
1
]:
continue
for
classify
,
(
_
,
name
,
field_order
,
side_diff
,
_
,
_
)
in
consts
.
LICENSE_ORDER
:
if
classify
==
consts
.
DL_CLASSIFY
or
classify
==
consts
.
VAT_CLASSIFY
:
continue
license_list
=
license_summary
.
get
(
classify
)
if
not
license_list
:
continue
...
...
@@ -119,5 +128,5 @@ class Command(BaseCommand, LoggerMixin):
all_value
.
append
(
'
\n
'
.
join
(
field_value
))
else
:
all_value
.
append
(
field_value
)
ws
.
append
((
application_id
[
0
]
,
*
all_value
))
ws
.
append
((
application_id
,
*
all_value
))
wb
.
save
(
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