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
929f1efe
authored
2021-12-13 17:00:02 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'fix/1213' into feature/se
2 parents
0c5207a0
6e11b40d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
19 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/apps/doc/consts.py
View file @
929f1ef
...
...
@@ -1683,7 +1683,7 @@ BD_COMPARE_LOGIC = {
BS_COMPARE_LOGIC
=
{
'户名'
:
(
'role'
,
'se_one_compare'
,
{},
'主共借人未提供银行流水'
),
'(担保人)户名'
:
(
'role'
,
'se_one_compare'
,
{},
'担保人未提供银行流水
,需人工查看直系亲属关系
'
),
'(担保人)户名'
:
(
'role'
,
'se_one_compare'
,
{},
'担保人未提供银行流水'
),
'打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{},
'主共借人银行流水打印日期异常'
),
'(担保人)打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{},
'担保人银行流水打印日期异常'
),
'流水日期'
:
(
'date'
,
'se_bs_date_compare'
,
{},
'主共借人银行流水日期异常'
),
...
...
@@ -1691,6 +1691,7 @@ BS_COMPARE_LOGIC = {
}
SPECIAL_REASON
=
'主共借人未提供银行流水,含担保人需人工查看直系亲属关系'
SPECIAL_REASON_2
=
'担保人未提供银行流水,需人工查看直系亲属关系'
HT_COMPARE_LOGIC
=
{
'合同编号-每页'
:
(
'合同编号-每页'
,
'se_list_compare'
,
{},
'合同编号与系统不一致'
),
...
...
src/celery_compare/tasks.py
View file @
929f1ef
...
...
@@ -1486,25 +1486,9 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list):
max_correct_count
=
correct_count
pre_best_res
=
pre_tmp_res_part
for
name
,
value
in
pre_field_list
:
if
len
(
pre_best_res
)
>
0
:
result
,
ocr_str
,
reason
=
pre_best_res
[
name
]
else
:
result
=
consts
.
RESULT_N
ocr_str
=
empty_str
if
len
(
suf_field_list
)
>
0
:
reason
=
consts
.
SPECIAL_REASON
else
:
reason
=
compare_logic
[
pre_field_list
[
0
][
0
]][
3
]
img_path
=
empty_str
error_type
=
empty_error_type
if
result
==
consts
.
RESULT_Y
else
ErrorType
.
OCR
.
value
if
isinstance
(
value
,
list
):
value
=
json
.
dumps
(
value
,
ensure_ascii
=
False
)
result_field_list
.
append
((
name
,
value
,
result
,
ocr_str
,
img_path
,
error_type
,
reason
))
# 担保人
if
len
(
suf_field_list
)
>
0
:
suf_best_res
=
{}
if
len
(
suf_field_list
)
>
0
:
max_correct_count
=
0
for
ocr_res
in
ocr_res_list
:
correct_count
=
0
...
...
@@ -1534,18 +1518,39 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list):
max_correct_count
=
correct_count
suf_best_res
=
suf_tmp_res_part
for
name
,
value
in
pre_field_list
:
if
len
(
pre_best_res
)
>
0
:
result
,
ocr_str
,
reason
=
pre_best_res
[
name
]
else
:
result
=
consts
.
RESULT_N
ocr_str
=
empty_str
if
len
(
suf_field_list
)
>
0
and
len
(
suf_best_res
)
>
0
:
reason
=
consts
.
SPECIAL_REASON
else
:
reason
=
compare_logic
[
pre_field_list
[
0
][
0
]][
3
]
img_path
=
empty_str
error_type
=
empty_error_type
if
result
==
consts
.
RESULT_Y
else
ErrorType
.
OCR
.
value
if
isinstance
(
value
,
list
):
value
=
json
.
dumps
(
value
,
ensure_ascii
=
False
)
result_field_list
.
append
((
name
,
value
,
result
,
ocr_str
,
img_path
,
error_type
,
reason
))
if
len
(
suf_field_list
)
>
0
:
for
name
,
value
in
suf_field_list
:
if
len
(
suf_best_res
)
>
0
:
result
,
ocr_str
,
reason
=
suf_best_res
[
name
]
else
:
result
=
consts
.
RESULT_N
ocr_str
=
empty_str
if
len
(
pre_best_res
)
>
0
:
reason
=
consts
.
SPECIAL_REASON_2
else
:
reason
=
compare_logic
[
suf_field_list
[
0
][
0
]][
3
]
img_path
=
empty_str
error_type
=
empty_error_type
if
result
==
consts
.
RESULT_Y
else
ErrorType
.
OCR
.
value
if
isinstance
(
value
,
list
):
value
=
json
.
dumps
(
value
,
ensure_ascii
=
False
)
result_field_list
.
append
((
name
,
value
,
result
,
ocr_str
,
img_path
,
error_type
,
reason
))
else
:
for
name
,
value
in
strip_list
:
if
isinstance
(
value
,
list
):
...
...
@@ -1594,7 +1599,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list):
break
for
idx
,
(
name
,
value
)
in
enumerate
(
field_list
):
if
ocr_field
==
consts
.
MVI_OCR_FIELD
and
name
==
consts
.
SE_NEW_ADD_FIELD
[
-
1
]:
if
ocr_field
==
consts
.
MVI_OCR_FIELD
and
name
==
consts
.
SE_NEW_ADD_FIELD
[
5
]:
ocr_str
=
getattr
(
cp
,
consts
.
ZW_METHOD
)(
ocr_res_list
[
res_idx
]
.
get
(
consts
.
LOWER_AMOUNT_FIELD
,
''
),
ocr_res_list
[
res_idx
]
.
get
(
consts
.
UPPER_AMOUNT_FIELD
,
''
),
...
...
@@ -1923,6 +1928,14 @@ def se_compare_process(compare_info, ocr_res_dict):
for
a
,
b
in
field_list
:
if
isinstance
(
b
,
str
):
strip_list
.
append
((
a
,
b
.
strip
()))
elif
isinstance
(
b
,
list
):
c
=
[]
for
i
in
b
:
if
isinstance
(
i
,
str
):
c
.
append
(
i
.
strip
())
else
:
c
.
append
(
i
)
strip_list
.
append
((
a
,
c
))
else
:
strip_list
.
append
((
a
,
b
))
failure_field
=
[]
...
...
@@ -1957,6 +1970,14 @@ def se_compare_process(compare_info, ocr_res_dict):
for
a
,
b
in
field_list
:
if
isinstance
(
b
,
str
):
strip_list
.
append
((
a
,
b
.
strip
()))
elif
isinstance
(
b
,
list
):
c
=
[]
for
i
in
b
:
if
isinstance
(
i
,
str
):
c
.
append
(
i
.
strip
())
else
:
c
.
append
(
i
)
strip_list
.
append
((
a
,
c
))
else
:
strip_list
.
append
((
a
,
b
))
failure_field
=
[]
...
...
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