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
939cde2e
authored
2020-11-09 21:42:53 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
a1c7bfd2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
src/apps/doc/mixins.py
src/apps/doc/ocr/wb.py
src/apps/doc/mixins.py
View file @
939cde2
...
...
@@ -8,13 +8,13 @@ class DocHandler:
@staticmethod
def
get_link
(
doc_id
,
business_type
,
file
=
'pdf'
):
if
file
==
'pdf'
:
return
'/data/{1}/{
0}/{2
}/{0}.pdf'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
return
'/data/{1}/{
2}/{0
}/{0}.pdf'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
elif
file
==
'img'
:
return
'/data/{1}/{
0}/{2
}/{0}_img.zip'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
return
'/data/{1}/{
2}/{0
}/{0}_img.zip'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
elif
file
==
'src_excel'
:
return
'/data/{1}/{
0}/{2
}/src.xlsx'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
return
'/data/{1}/{
2}/{0
}/src.xlsx'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
else
:
return
'/data/{1}/{
0}/{2
}/{0}.xlsx'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
return
'/data/{1}/{
2}/{0
}/{0}.xlsx'
.
format
(
doc_id
,
business_type
,
consts
.
TMP_DIR_NAME
)
def
get_doc_list
(
self
,
doc_queryset
,
business_type
):
for
doc_dict
in
doc_queryset
:
...
...
src/apps/doc/ocr/wb.py
View file @
939cde2
...
...
@@ -319,7 +319,7 @@ class BSWorkbook(Workbook):
cn_str
=
''
.
join
(
cn_chars
)
row_value
[
1
]
=
re
.
sub
(
consts
.
CN_RE
,
''
,
row_value
[
1
])
if
isinstance
(
row_value
[
2
],
str
):
row_value
[
2
]
=
cn_str
+
row_value
[
2
]
row_value
[
2
]
=
'{0}
\n
{1}'
.
format
(
cn_str
,
row_value
[
2
])
return
row_value
def
build_month_sheet
(
self
,
ms
,
card
,
month_mapping
,
is_reverse
,
statistics_header_info
,
max_column
,
classify
):
...
...
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