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
1b50f4ba
authored
2022-08-08 11:53:17 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix no-asp afc-ht
1 parent
e673b600
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/apps/doc/consts.py
View file @
1b50f4b
...
...
@@ -1947,7 +1947,8 @@ HIL_CONTRACT_3_COMPARE_LOGIC = {
HT_COMPARE_LOGIC
=
{
'合同编号-每页'
:
(
'合同编号-每页'
,
'se_list_compare'
,
{},
'合同编号与系统不一致'
),
'合同编号-每页(no-asp)'
:
(
'合同编号-每页'
,
'se_list_compare'
,
{
'pop_last'
:
True
},
'合同编号与系统不一致'
),
# '合同编号-每页(no-asp)': ('合同编号-每页', 'se_list_compare', {'pop_last': True}, '合同编号与系统不一致'),
'合同编号-每页(no-asp)'
:
(
'合同编号-每页'
,
'se_list_compare'
,
{},
'合同编号与系统不一致'
),
'所购车辆价格-小写-重要条款'
:
(
'所购车辆价格-小写-重要条款'
,
'se_amount_str_compare'
,
{},
'合同首页中车辆价格与系统不一致'
),
'车架号-重要条款'
:
(
'车架号-重要条款'
,
'se_common_compare'
,
{},
'合同首页中车架号与系统不一致'
),
'贷款本金金额-重要条款'
:
(
'贷款本金金额-重要条款'
,
'se_amount_str_compare'
,
{},
'合同首页中贷款本金与系统不一致'
),
...
...
src/celery_compare/tasks.py
View file @
1b50f4b
...
...
@@ -1189,7 +1189,8 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore
# fin_total_tmp = cms_info.get('associatedServices', {}).get('financed total', '0.00')
# fin_total = '0.00' if fin_total_tmp.strip() == '' else fin_total_tmp
for
asp_name
,
_
,
asp_fin
in
asp_list
:
if
gzs_status
==
consts
.
GZS_STATUS
[
2
]
and
asp_name
.
find
(
consts
.
GZS_NAME
)
==
-
1
:
if
gzs_status
==
consts
.
GZS_STATUS
[
2
]
and
asp_name
.
find
(
consts
.
GZS_NAME
)
==
-
1
and
\
asp_name
.
find
(
'机动车辆保险'
)
==
-
1
:
gzs_status
=
consts
.
GZS_STATUS
[
0
]
fin_total
+=
float
(
asp_fin
)
asp_list
.
append
(
...
...
@@ -2367,11 +2368,13 @@ def se_contract_compare(license_en, ocr_res_dict, strip_list, is_gsyh):
ocr_str
=
empty_str
else
:
ocr_str_or_list
=
ocr_res
.
get
(
compare_logic
[
name
][
0
])
# 银行信息
if
ocr_str_or_list
is
None
and
license_en
==
consts
.
AFC_CONTRACT_EN
\
and
is_gsyh
is
True
and
name
in
consts
.
CON_BANK_FIELD
:
result
=
consts
.
RESULT_Y
ocr_str
=
empty_str
reason
=
compare_logic
[
name
][
3
]
# 其他字段
elif
isinstance
(
ocr_str_or_list
,
str
)
or
isinstance
(
ocr_str_or_list
,
list
):
if
is_gsyh
is
True
and
name
in
consts
.
CON_BANK_FIELD
:
update_args
=
{
'is_gsyh'
:
is_gsyh
}
...
...
@@ -2380,6 +2383,9 @@ def se_contract_compare(license_en, ocr_res_dict, strip_list, is_gsyh):
else
:
update_args
=
compare_logic
[
name
][
2
]
if
isinstance
(
ocr_str_or_list
,
list
):
# no-asp 合同编号-每页(no-asp)
if
name
==
consts
.
SE_AFC_CON_FIELD
[
23
]:
ocr_str_or_list
.
pop
()
ocr_str
=
json
.
dumps
(
ocr_str_or_list
,
ensure_ascii
=
False
)
else
:
ocr_str_or_list
=
ocr_str_or_list
.
strip
()
...
...
src/common/tools/comparison.py
View file @
1b50f4b
...
...
@@ -173,14 +173,14 @@ class Comparison:
return
self
.
RESULT_Y
return
self
.
RESULT_N
else
:
if
kwargs
.
get
(
'pop_last'
,
False
):
for
item
in
ocr_str_or_list
[:
-
1
]:
if
item
!=
input_str_or_list
:
return
self
.
RESULT_N
else
:
for
item
in
ocr_str_or_list
:
if
item
!=
input_str_or_list
:
return
self
.
RESULT_N
#
if kwargs.get('pop_last', False):
#
for item in ocr_str_or_list[:-1]:
#
if item != input_str_or_list:
#
return self.RESULT_N
#
else:
for
item
in
ocr_str_or_list
:
if
item
!=
input_str_or_list
:
return
self
.
RESULT_N
return
self
.
RESULT_Y
else
:
return
self
.
RESULT_N
...
...
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