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
356977cd
authored
2021-12-02 16:09:45 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
f085b3b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
src/apps/doc/management/commands/folder_ltgt_process.py
src/apps/doc/management/commands/folder_ltgt_process.py
View file @
356977c
...
...
@@ -542,12 +542,23 @@ class Command(BaseCommand, LoggerMixin):
else
:
sheet_name
,
key_field
,
side_field_order
,
field_order
=
self
.
field_map
[
result
[
self
.
CLASSIFY_KEY
]]
if
key_field
is
not
None
and
key_field
in
result
[
self
.
RESULT_KEY
]:
head_fields
=
[
a
for
a
,
_
in
side_field_order
]
head_fields
=
[]
for
a
,
b
in
side_field_order
:
if
isinstance
(
b
,
str
):
head_fields
.
append
(
a
)
else
:
head_fields
=
[
a
for
a
,
_
in
field_order
]
head_fields
=
[]
for
a
,
b
in
side_field_order
:
if
isinstance
(
b
,
str
):
head_fields
.
append
(
a
)
row
=
[]
for
field
in
head_fields
:
row
.
append
(
result
[
self
.
RESULT_KEY
]
.
get
(
field
))
ocr_str_or_list
=
result
[
self
.
RESULT_KEY
]
.
get
(
field
,
''
)
if
isinstance
(
ocr_str_or_list
,
list
):
last_ocr_str
=
'、'
.
join
(
ocr_str_or_list
)
else
:
last_ocr_str
=
ocr_str_or_list
row
.
append
(
last_ocr_str
)
if
sheet_name
in
wb
.
sheetnames
:
ws
=
wb
.
get_sheet_by_name
(
sheet_name
)
else
:
...
...
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