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
91571bac
authored
2020-12-09 16:56:00 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix card *
1 parent
ea51917a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
src/apps/doc/ocr/wb.py
src/apps/doc/ocr/wb.py
View file @
91571ba
...
...
@@ -295,7 +295,7 @@ class BSWorkbook(Workbook):
def
build_meta_sheet
(
self
,
card
,
confidence
,
code
,
print_time
,
start_date
,
end_date
):
metadata_rows
=
self
.
build_metadata_rows
(
confidence
,
code
,
print_time
,
start_date
,
end_date
)
ms
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
self
.
meta_sheet_title
,
card
[
-
6
:]
))
ms
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
self
.
meta_sheet_title
,
card
))
for
row
in
metadata_rows
:
ms
.
append
(
row
)
return
ms
...
...
@@ -394,7 +394,7 @@ class BSWorkbook(Workbook):
for
month
in
sorted
(
month_mapping
.
keys
()):
# 3.1.拷贝数据
parts
=
month_mapping
.
get
(
month
)
new_ws
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
month
,
card
[
-
6
:]
))
new_ws
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
month
,
card
))
new_ws
.
append
(
header
)
for
part
in
parts
:
ws
=
self
.
get_sheet_by_name
(
part
[
0
])
...
...
@@ -540,6 +540,10 @@ class BSWorkbook(Workbook):
# }
# }
for
card
,
summary
in
bs_summary
.
items
():
try
:
new_card
=
card
[
-
6
:]
.
replace
(
'*'
,
''
)
except
Exception
as
e
:
new_card
=
'异常卡号'
# 1.原表表头收集、按照月份分割
# 1.1 总结首行信息
classify
=
summary
.
get
(
'classify'
,
0
)
...
...
@@ -571,7 +575,7 @@ class BSWorkbook(Workbook):
# 2.元信息提取表
confidence
=
self
.
get_confidence
(
max_find_count
)
ms
=
self
.
build_meta_sheet
(
card
,
ms
=
self
.
build_meta_sheet
(
new_
card
,
confidence
,
summary
.
get
(
'code'
),
summary
.
get
(
'print_time'
),
...
...
@@ -584,7 +588,7 @@ class BSWorkbook(Workbook):
for
month_list
in
month_mapping
.
values
():
month_list
.
sort
(
key
=
lambda
x
:
x
[
-
1
],
reverse
=
is_reverse
)
self
.
build_month_sheet
(
ms
,
card
,
month_mapping
,
is_reverse
,
statistics_header_info
,
max_column
,
classify
)
self
.
build_month_sheet
(
ms
,
new_
card
,
month_mapping
,
is_reverse
,
statistics_header_info
,
max_column
,
classify
)
# 4.删除原表
for
sheet
in
sheets_list
:
...
...
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