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
1242adb8
authored
2020-09-27 18:51:58 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
1852dda7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
src/apps/doc/ocr/wb.py
src/apps/doc/ocr/wb.py
View file @
1242adb
...
...
@@ -168,7 +168,7 @@ class BSWorkbook(Workbook):
month_mapping
.
setdefault
(
month_list
[
-
1
],
[])
.
insert
(
0
,
(
ws
.
title
,
idx_list
[
-
1
]
+
min_row
,
ws
.
max_row
,
0
))
def
build_metadata_rows
(
self
,
c
lassify
,
confidence
,
rol
e
,
code
,
print_time
,
start_date
,
end_date
):
def
build_metadata_rows
(
self
,
c
onfidenc
e
,
code
,
print_time
,
start_date
,
end_date
):
if
start_date
is
None
or
end_date
is
None
:
timedelta
=
None
else
:
...
...
@@ -176,10 +176,6 @@ class BSWorkbook(Workbook):
metadata_rows
=
[
(
'流水识别置信度'
,
confidence
),
self
.
blank_row
,
(
'分类结果'
,
classify
),
self
.
blank_row
,
(
'户名'
,
role
),
self
.
blank_row
,
self
.
code_header
,
]
metadata_rows
.
extend
(
code
)
...
...
@@ -200,19 +196,19 @@ class BSWorkbook(Workbook):
ms
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
self
.
meta_sheet_title
,
card
))
return
ms
def
build_meta_sheet
(
self
,
card
,
c
lassify
,
confidence
,
rol
e
,
code
,
print_time
,
start_date
,
end_date
):
metadata_rows
=
self
.
build_metadata_rows
(
c
lassify
,
confidence
,
rol
e
,
code
,
print_time
,
start_date
,
end_date
)
def
build_meta_sheet
(
self
,
card
,
c
onfidenc
e
,
code
,
print_time
,
start_date
,
end_date
):
metadata_rows
=
self
.
build_metadata_rows
(
c
onfidenc
e
,
code
,
print_time
,
start_date
,
end_date
)
ms
=
self
.
create_meta_sheet
(
card
)
for
row
in
metadata_rows
:
ms
.
append
(
row
)
return
ms
def
build_month_sheet
(
self
,
role
,
month_mapping
,
ms
,
is_reverse
):
def
build_month_sheet
(
self
,
card
,
month_mapping
,
ms
,
is_reverse
):
tmp_ws
=
self
.
create_sheet
(
'tmp_ws'
)
for
month
in
sorted
(
month_mapping
.
keys
()):
# 3.1.拷贝数据
parts
=
month_mapping
.
get
(
month
)
new_ws
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
month
,
role
))
new_ws
=
self
.
create_sheet
(
'{0}({1})'
.
format
(
month
,
card
[
-
6
:]
))
new_ws
.
append
(
consts
.
FIXED_HEADERS
)
for
part
in
parts
:
ws
=
self
.
get_sheet_by_name
(
part
[
0
])
...
...
@@ -338,9 +334,7 @@ class BSWorkbook(Workbook):
# 2.元信息提取表
ms
=
self
.
build_meta_sheet
(
card
,
summary
[
'classify'
],
summary
[
'confidence'
],
summary
[
'role'
],
summary
[
'code'
],
summary
[
'print_time'
],
start_date
,
...
...
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