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
01c7aaa5
authored
2021-09-17 13:57:32 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/contract' into feature/0918
2 parents
1aae327e
bec1bbe9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/ocr/wb.py
src/apps/doc/management/commands/ocr_process.py
View file @
01c7aaa
...
...
@@ -209,7 +209,7 @@ class Command(BaseCommand, LoggerMixin):
def
contract_process
(
self
,
ocr_data
,
contract_result
,
res_list
,
pno
,
ino
,
part_idx
,
img_path
):
contract_dict
=
ocr_data
.
get
(
'data'
)
if
not
contract_dict
or
'page_num'
not
in
contract_dict
or
'page_info'
not
in
contract_dict
:
if
not
contract_dict
or
contract_dict
.
get
(
'page_num'
)
is
None
or
contract_dict
.
get
(
'page_info'
)
is
None
:
res_list
.
append
((
pno
,
ino
,
part_idx
,
consts
.
RES_SUCCESS_EMPTY
))
return
res_list
.
append
((
pno
,
ino
,
part_idx
,
consts
.
RES_SUCCESS
))
...
...
src/apps/doc/ocr/wb.py
View file @
01c7aaa
...
...
@@ -706,12 +706,16 @@ class BSWorkbook(Workbook):
if
len
(
contract_result
)
==
0
:
return
ws
=
self
.
create_sheet
(
consts
.
CONTRACT_SHEET_NAME
)
for
page_num
,
info_list
in
contract_result
.
items
():
ws
.
append
((
'page {0}'
.
format
(
page_num
),
))
for
info
in
info_list
:
for
row
in
info
:
ws
.
append
(
row
)
ws
.
append
((
None
,
))
for
i
in
range
(
15
):
if
str
(
i
)
in
contract_result
:
page_num
=
str
(
i
)
info_list
=
contract_result
.
get
(
page_num
)
# for page_num, info_list in contract_result.items():
ws
.
append
((
'page {0}'
.
format
(
page_num
),
))
for
info
in
info_list
:
for
row
in
info
:
ws
.
append
(
row
)
ws
.
append
((
None
,
))
@staticmethod
def
remove_yuan
(
amount_key_set
,
key
,
src_str
):
...
...
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