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
a6d6598e
authored
2021-06-07 16:22:34 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix sep name
1 parent
347d06f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
a6d6598
...
...
@@ -34,33 +34,33 @@ def field_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_set, has
ocr_res_str
=
ocr_res_dict
.
get
(
ocr_field
)
if
ocr_res_str
is
not
None
:
ocr_res_list
=
json
.
loads
(
ocr_res_str
)
length
=
len
(
ocr_res_list
)
#
length = len(ocr_res_list)
#
#
sep营业执照根据法人过滤
#
if isinstance(sep_name, str):
#
tmp_list = []
#
for ocr_res in ocr_res_list:
#
ocr_sep_name = ocr_res.get(consts.LEGAL_REP_NAME)
#
if isinstance(ocr_sep_name, str) and ocr_sep_name == sep_name:
#
tmp_list.append(ocr_res)
#
else:
#
tmp_list = ocr_res_list
#
#
length = len(tmp_list)
# sep营业执照根据法人过滤
if
isinstance
(
sep_name
,
str
):
tmp_list
=
[]
for
ocr_res
in
ocr_res_list
:
ocr_sep_name
=
ocr_res
.
get
(
consts
.
LEGAL_REP_NAME
)
if
isinstance
(
ocr_sep_name
,
str
)
and
ocr_sep_name
==
sep_name
:
tmp_list
.
append
(
ocr_res
)
else
:
tmp_list
=
ocr_res_list
length
=
len
(
tmp_list
)
# 过期期限特殊处理
if
has_expiry_date
:
expiry_dates
=
[]
key
=
compare_list
[
2
][
1
]
#
for ocr_res in tmp_list:
for
ocr_res
in
ocr_res_list
:
for
ocr_res
in
tmp_list
:
#
for ocr_res in ocr_res_list:
if
ocr_res
.
get
(
key
):
expiry_dates
.
append
(
ocr_res
.
get
(
key
))
else
:
expiry_dates
=
[]
#
for ocr_res in tmp_list:
for
ocr_res
in
ocr_res_list
:
for
ocr_res
in
tmp_list
:
#
for ocr_res in ocr_res_list:
if
is_find
:
break
for
idx
,
compare_tuple
in
enumerate
(
compare_list
):
...
...
@@ -208,15 +208,15 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
for
individual_cus_info
in
individual_cus_info_list
:
order_individual_cus_info
=
get_order_dict
(
individual_cus_info
,
consts
.
IN_ORDER
)
#
#
获取sep下营业执照法人代表
#
if order_individual_cus_info.get('customerType') == consts.CUSTOMER_TYPE[5]:
#
sep_name = order_individual_cus_info.get('customerChineseName')
#
if isinstance(sep_name, str):
#
sep_name = sep_name.strip()
#
if sep_name == '':
#
sep_name = None
#
else:
#
sep_name = None
# 获取sep下营业执照法人代表
if
order_individual_cus_info
.
get
(
'customerType'
)
==
consts
.
CUSTOMER_TYPE
[
5
]:
sep_name
=
order_individual_cus_info
.
get
(
'customerChineseName'
)
if
isinstance
(
sep_name
,
str
):
sep_name
=
sep_name
.
strip
()
if
sep_name
==
''
:
sep_name
=
None
else
:
sep_name
=
None
# 个人信息证件
id_type
=
order_individual_cus_info
.
get
(
'idType'
)
...
...
@@ -242,9 +242,9 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
# sep营业执照
if
order_individual_cus_info
.
get
(
'customerType'
)
==
consts
.
CUSTOMER_TYPE
[
5
]:
#
field_compare(order_individual_cus_info, ocr_res_dict, consts.BL_OCR_FIELD, consts.TCSEP, res_set,
#
sep_name=sep_name)
field_compare
(
order_individual_cus_info
,
ocr_res_dict
,
consts
.
BL_OCR_FIELD
,
consts
.
TCSEP
,
res_set
)
field_compare
(
order_individual_cus_info
,
ocr_res_dict
,
consts
.
BL_OCR_FIELD
,
consts
.
TCSEP
,
res_set
,
sep_name
=
sep_name
)
#
field_compare(order_individual_cus_info, ocr_res_dict, consts.BL_OCR_FIELD, consts.TCSEP, res_set)
order_individual_cus_info_list
.
append
(
order_individual_cus_info
)
...
...
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