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
edb7a19b
authored
2022-08-15 15:10:20 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix gzs input
1 parent
7bb25c16
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
12 deletions
src/apps/doc/views.py
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/apps/doc/views.py
View file @
edb7a19
...
...
@@ -251,10 +251,10 @@ applicant_data_args = {
# 'coApplicantName': fields.Str(required=True, validate=validate.Length(max=16)),
# 'guarantor1Name': fields.Str(required=True, validate=validate.Length(max=16)),
# 'guarantor2Name': fields.Str(required=True, validate=validate.Length(max=16)),
'mainApplicantName'
:
fields
.
Str
(
required
=
Tru
e
),
'coApplicantName'
:
fields
.
Str
(
required
=
Tru
e
),
'guarantor1Name'
:
fields
.
Str
(
required
=
Tru
e
),
'guarantor2Name'
:
fields
.
Str
(
required
=
Tru
e
),
'mainApplicantName'
:
fields
.
Str
(
required
=
Fals
e
),
'coApplicantName'
:
fields
.
Str
(
required
=
Fals
e
),
'guarantor1Name'
:
fields
.
Str
(
required
=
Fals
e
),
'guarantor2Name'
:
fields
.
Str
(
required
=
Fals
e
),
}
document_args
=
{
...
...
@@ -269,7 +269,7 @@ document_args = {
doc_upload_args
=
{
'applicationData'
:
fields
.
Nested
(
application_data_args
,
required
=
True
),
'applicantData'
:
fields
.
Nested
(
applicant_data_args
,
required
=
Tru
e
),
'applicantData'
:
fields
.
Nested
(
applicant_data_args
,
required
=
Fals
e
),
'document'
:
fields
.
Nested
(
document_args
,
required
=
True
),
}
...
...
src/celery_compare/tasks.py
View file @
edb7a19
...
...
@@ -1198,7 +1198,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore
)
# CMS Vehicle Price / 1.13 * 10 %
# gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)]
if
isinstance
(
gzs_price
,
str
):
try
:
tmp_gzs_list
=
[
float
(
amount
)
*
0.1
/
1.13
,
float
(
gzs_price
)]
except
Exception
as
e
:
tmp_gzs_list
=
[
amount
,
gzs_price
]
else
:
tmp_gzs_list
=
[
amount
,
]
# 保单 -----------------------------------------------------------------------------------------------------------
# is_insurance = 0
...
...
@@ -1271,7 +1277,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore
# 购置税校验
if
isinstance
(
gzs_price
,
str
):
hil_contract_1_input
.
append
(
(
consts
.
SE_HIL_CON_1_FIELD
[
9
],
[
amount
,
gzs_price
]
))
(
consts
.
SE_HIL_CON_1_FIELD
[
9
],
tmp_gzs_list
))
# 非购置税非车辆保险的其他asp
if
have_other_asp
:
hil_contract_1_input
.
append
((
consts
.
SE_HIL_CON_1_FIELD
[
15
],
'N'
))
...
...
@@ -1380,7 +1386,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore
# 购置税校验
if
isinstance
(
gzs_price
,
str
):
afc_contract_input
.
append
(
(
consts
.
SE_AFC_CON_FIELD
[
21
],
[
amount
,
gzs_price
]
))
(
consts
.
SE_AFC_CON_FIELD
[
21
],
tmp_gzs_list
))
# 非购置税非车辆保险的其他asp
if
have_other_asp
:
afc_contract_input
.
append
((
consts
.
SE_AFC_CON_FIELD
[
24
],
'N'
))
...
...
@@ -1737,7 +1743,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
)
# CMS Vehicle Price / 1.13 * 10 %
# gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)]
if
isinstance
(
gzs_price
,
str
):
try
:
tmp_gzs_list
=
[
float
(
amount
)
*
0.1
/
1.13
,
float
(
gzs_price
)]
except
Exception
as
e
:
tmp_gzs_list
=
[
amount
,
gzs_price
]
else
:
tmp_gzs_list
=
[
amount
,
]
# 保单 -----------------------------------------------------------------------------------------------------------
is_insurance
=
0
...
...
@@ -1808,7 +1820,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
hil_contract_1_input
.
append
((
consts
.
SE_HIL_CON_1_FIELD
[
8
],
asp_list
))
# 购置税校验
if
isinstance
(
gzs_price
,
str
):
hil_contract_1_input
.
append
((
consts
.
SE_HIL_CON_1_FIELD
[
9
],
[
amount
,
gzs_price
]
))
hil_contract_1_input
.
append
((
consts
.
SE_HIL_CON_1_FIELD
[
9
],
tmp_gzs_list
))
# 非购置税非车辆保险的其他asp
if
have_other_asp
:
hil_contract_1_input
.
append
((
consts
.
SE_HIL_CON_1_FIELD
[
15
],
'N'
))
...
...
@@ -1917,7 +1929,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
# 购置税校验
if
isinstance
(
gzs_price
,
str
):
afc_contract_input
.
append
(
(
consts
.
SE_AFC_CON_FIELD
[
21
],
[
amount
,
gzs_price
]
))
(
consts
.
SE_AFC_CON_FIELD
[
21
],
tmp_gzs_list
))
# 非购置税非车辆保险的其他asp
if
have_other_asp
:
afc_contract_input
.
append
((
consts
.
SE_AFC_CON_FIELD
[
24
],
'N'
))
...
...
src/common/tools/comparison.py
View file @
edb7a19
...
...
@@ -590,7 +590,8 @@ class Comparison:
def
se_self_compare_gzs
(
self
,
input_list
,
ocr_str
,
**
kwargs
):
if
isinstance
(
input_list
,
list
)
and
len
(
input_list
)
==
2
:
try
:
if
float
(
input_list
[
0
])
*
0.1
/
1.13
>=
float
(
input_list
[
1
]):
if
isinstance
(
input_list
[
0
],
float
)
and
isinstance
(
input_list
[
1
],
float
)
\
and
input_list
[
0
]
>=
input_list
[
1
]:
return
self
.
RESULT_Y
except
Exception
as
e
:
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