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
c3261b19
authored
2020-12-21 14:44:02 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
0d9c6f21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
src/apps/doc/ocr/wb.py
src/apps/doc/ocr/wb.py
View file @
c3261b1
...
...
@@ -656,20 +656,24 @@ class BSWorkbook(Workbook):
count_list
.
append
((
field_str
,
count
))
def
simple_license_rebuild
(
self
,
license_summary
,
document_scheme
):
for
ic_license_dict
in
license_summary
.
get
(
consts
.
IC_CLASSIFY
,
[]):
if
ic_license_dict
.
get
(
'类别'
)
==
'1'
:
license_summary
.
setdefault
(
consts
.
RP_CLASSIFY
,
[])
.
append
(
ic_license_dict
)
continue
for
vat_license_dict
in
license_summary
.
get
(
consts
.
VAT_CLASSIFY
,
[]):
if
vat_license_dict
.
get
(
'发票类型'
)
==
'special'
:
license_summary
.
setdefault
(
consts
.
VATS_CLASSIFY
,
[])
.
append
(
vat_license_dict
)
continue
for
classify
,
(
_
,
name
,
field_order
,
side_diff
,
scheme_diff
,
_
)
in
consts
.
FOLDER_LICENSE_ORDER
:
license_list
=
license_summary
.
get
(
classify
)
if
not
license_list
:
continue
ws
=
self
.
create_sheet
(
name
)
if
scheme_diff
and
document_scheme
==
consts
.
DOC_SCHEME_LIST
[
1
]:
classify
=
consts
.
MVC_CLASSIFY_SE
#
if scheme_diff and document_scheme == consts.DOC_SCHEME_LIST[1]:
#
classify = consts.MVC_CLASSIFY_SE
for
license_dict
in
license_list
:
if
classify
==
consts
.
IC_CLASSIFY
and
license_dict
.
get
(
'类别'
)
==
'1'
:
license_summary
.
setdefault
(
consts
.
RP_CLASSIFY
,
[])
.
append
(
license_dict
)
continue
if
classify
==
consts
.
VAT_CLASSIFY
and
license_dict
.
get
(
'发票类型'
)
==
'special'
:
license_summary
.
setdefault
(
consts
.
VATS_CLASSIFY
,
[])
.
append
(
license_dict
)
continue
if
side_diff
:
key
,
field_order_yes
,
field_order_no
=
consts
.
FIELD_ORDER_MAP
.
get
(
classify
)
field_order
=
field_order_yes
if
key
in
license_dict
else
field_order_no
...
...
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