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
dd5053eb
authored
2022-05-06 15:48:58 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/SE'
2 parents
4abddbe8
ce95c8f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
195 additions
and
152 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/apps/doc/consts.py
View file @
dd5053e
...
...
@@ -1571,55 +1571,55 @@ SE_HIL_CON_3_FIELD = ['合同编号-每页', '承租人姓名', '承租人证件
ROLE_LIST
=
[
(
'借款人签字及时间'
,
'Borrower'
,
0
,
0
,
True
,
False
),
(
'借款人姓名'
,
'Borrower'
,
0
,
0
,
True
,
True
),
(
'借款人证件号'
,
'Borrower'
,
0
,
2
,
True
,
True
),
(
'主借人签字'
,
'Borrower'
,
0
,
0
,
True
,
False
),
(
'主借人日期'
,
'Borrower'
,
0
,
'有'
,
True
,
False
),
(
'共借人姓名'
,
'Co-Borrower'
,
0
,
0
,
False
,
True
),
(
'共借人证件号'
,
'Co-Borrower'
,
0
,
2
,
False
,
True
),
(
'共借人签字'
,
'Co-Borrower'
,
0
,
0
,
False
,
False
),
(
'共借人日期'
,
'Co-Borrower'
,
0
,
'有'
,
False
,
False
),
(
'保证人姓名1'
,
'Guarantor'
,
0
,
0
,
False
,
True
),
(
'保证人证件号1'
,
'Guarantor'
,
0
,
2
,
False
,
True
),
(
'保证人签字1'
,
'Guarantor'
,
0
,
0
,
False
,
False
),
(
'保证人日期1'
,
'Guarantor'
,
0
,
'有'
,
False
,
False
),
(
'保证人姓名2'
,
'Guarantor'
,
1
,
0
,
False
,
True
),
(
'保证人证件号2'
,
'Guarantor'
,
1
,
2
,
False
,
True
),
(
'保证人签字2'
,
'Guarantor'
,
1
,
0
,
False
,
False
),
(
'保证人日期2'
,
'Guarantor'
,
1
,
'有'
,
False
,
False
),
(
'借款人签字及时间'
,
'
借款人签字及时间'
,
'
Borrower'
,
0
,
0
,
True
,
False
),
(
'借款人姓名'
,
'
借款人姓名'
,
'
Borrower'
,
0
,
0
,
True
,
True
),
(
'借款人证件号'
,
'
借款人证件号'
,
'
Borrower'
,
0
,
2
,
True
,
True
),
(
'主借人签字'
,
'
主借人签字'
,
'
Borrower'
,
0
,
0
,
True
,
False
),
(
'主借人日期'
,
'
主借人日期'
,
'
Borrower'
,
0
,
'有'
,
True
,
False
),
(
'共借人姓名'
,
'
共借人&抵押人姓名'
,
'
Co-Borrower'
,
0
,
0
,
False
,
True
),
(
'共借人证件号'
,
'
共借人&抵押人证件号'
,
'
Co-Borrower'
,
0
,
2
,
False
,
True
),
(
'共借人签字'
,
'
共借人签字'
,
'
Co-Borrower'
,
0
,
0
,
False
,
False
),
(
'共借人日期'
,
'
共借人日期'
,
'
Co-Borrower'
,
0
,
'有'
,
False
,
False
),
(
'保证人姓名1'
,
'
保证人姓名1'
,
'
Guarantor'
,
0
,
0
,
False
,
True
),
(
'保证人证件号1'
,
'
保证人证件号1'
,
'
Guarantor'
,
0
,
2
,
False
,
True
),
(
'保证人签字1'
,
'
保证人签字1'
,
'
Guarantor'
,
0
,
0
,
False
,
False
),
(
'保证人日期1'
,
'
保证人日期1'
,
'
Guarantor'
,
0
,
'有'
,
False
,
False
),
(
'保证人姓名2'
,
'
保证人姓名2'
,
'
Guarantor'
,
1
,
0
,
False
,
True
),
(
'保证人证件号2'
,
'
保证人证件号2'
,
'
Guarantor'
,
1
,
2
,
False
,
True
),
(
'保证人签字2'
,
'
保证人签字2'
,
'
Guarantor'
,
1
,
0
,
False
,
False
),
(
'保证人日期2'
,
'
保证人日期2'
,
'
Guarantor'
,
1
,
'有'
,
False
,
False
),
]
# key, app_type, id_idx, field_idx, is_force, e_write, 公户跳过
ROLE_LIST_2
=
[
(
'抵押人'
,
'Borrower'
,
0
,
0
,
True
,
True
,
False
),
(
'抵押人证件号码'
,
'Borrower'
,
0
,
2
,
True
,
True
,
False
),
(
'抵押人签字'
,
'Borrower'
,
0
,
0
,
True
,
False
,
False
),
(
'抵押人'
,
'Borrower'
,
'Co-Borrower'
,
0
,
0
,
True
,
True
,
False
),
(
'抵押人证件号码'
,
'Borrower'
,
'Co-Borrower'
,
0
,
2
,
True
,
True
,
False
),
(
'抵押人签字'
,
'Borrower'
,
'Co-Borrower'
,
0
,
0
,
True
,
False
,
False
),
(
'抵押人配偶'
,
'Co-Borrower'
,
0
,
0
,
False
,
True
,
True
),
(
'抵押人配偶证件号码'
,
'Co-Borrower'
,
0
,
2
,
False
,
True
,
True
),
(
'抵押人配偶签字'
,
'Co-Borrower'
,
0
,
0
,
False
,
False
,
True
),
(
'抵押人配偶'
,
'Co-Borrower'
,
'Co-Borrower'
,
0
,
0
,
False
,
True
,
True
),
(
'抵押人配偶证件号码'
,
'Co-Borrower'
,
'Co-Borrower'
,
0
,
2
,
False
,
True
,
True
),
(
'抵押人配偶签字'
,
'Co-Borrower'
,
'Co-Borrower'
,
0
,
0
,
False
,
False
,
True
),
]
ROLE_LIST_1
=
[
(
'承租人姓名'
,
'Borrower'
,
0
,
0
,
True
,
True
),
(
'承租人证件号'
,
'Borrower'
,
0
,
2
,
True
,
True
),
(
'承租人签字'
,
'Borrower'
,
0
,
0
,
True
,
False
),
(
'承租人姓名'
,
'
承租人姓名'
,
'
Borrower'
,
0
,
0
,
True
,
True
),
(
'承租人证件号'
,
'
承租人证件号'
,
'
Borrower'
,
0
,
2
,
True
,
True
),
(
'承租人签字'
,
'
承租人签字'
,
'
Borrower'
,
0
,
0
,
True
,
False
),
(
'共同承租人姓名'
,
'Co-Borrower'
,
0
,
0
,
False
,
True
),
(
'共同承租人证件号'
,
'Co-Borrower'
,
0
,
2
,
False
,
True
),
(
'共同承租人签字'
,
'Co-Borrower'
,
0
,
0
,
False
,
False
),
(
'共同承租人姓名'
,
'
共同承租人&抵押人姓名'
,
'
Co-Borrower'
,
0
,
0
,
False
,
True
),
(
'共同承租人证件号'
,
'
共同承租人&抵押人证件号'
,
'
Co-Borrower'
,
0
,
2
,
False
,
True
),
(
'共同承租人签字'
,
'
共同承租人签字'
,
'
Co-Borrower'
,
0
,
0
,
False
,
False
),
(
'保证人姓名1'
,
'Guarantor'
,
0
,
0
,
False
,
True
),
(
'保证人证件号1'
,
'Guarantor'
,
0
,
2
,
False
,
True
),
(
'保证人签字1'
,
'Guarantor'
,
0
,
0
,
False
,
False
),
(
'保证人姓名1'
,
'
保证人姓名1'
,
'
Guarantor'
,
0
,
0
,
False
,
True
),
(
'保证人证件号1'
,
'
保证人证件号1'
,
'
Guarantor'
,
0
,
2
,
False
,
True
),
(
'保证人签字1'
,
'
保证人签字1'
,
'
Guarantor'
,
0
,
0
,
False
,
False
),
(
'保证人姓名2'
,
'Guarantor'
,
1
,
0
,
False
,
True
),
(
'保证人证件号2'
,
'Guarantor'
,
1
,
2
,
False
,
True
),
(
'保证人签字2'
,
'Guarantor'
,
1
,
0
,
False
,
False
),
(
'保证人姓名2'
,
'
保证人姓名2'
,
'
Guarantor'
,
1
,
0
,
False
,
True
),
(
'保证人证件号2'
,
'
保证人证件号2'
,
'
Guarantor'
,
1
,
2
,
False
,
True
),
(
'保证人签字2'
,
'
保证人签字2'
,
'
Guarantor'
,
1
,
0
,
False
,
False
),
]
GZS_REASON_1
=
'此申请有ASP产品,需人工核查'
...
...
@@ -1797,8 +1797,8 @@ HMH_COMPARE_LOGIC = {
}
BD_COMPARE_LOGIC
=
{
'被保险人姓名'
:
(
'被保险人姓名'
,
's
e_name_compare'
,
{
},
'保单被保险人姓名与系统不一致'
),
'被保险人证件号码'
:
(
'被保险人证件号码'
,
's
e_common_compare'
,
{
'is_bd_id'
:
True
},
'保单身份证号需人工核查'
),
'被保险人姓名'
:
(
'被保险人姓名'
,
's
uper_list_compare'
,
{
'method'
:
'name'
},
'保单被保险人姓名与系统不一致'
),
'被保险人证件号码'
:
(
'被保险人证件号码'
,
's
uper_list_compare'
,
{
'method'
:
'common'
,
'is_bd_id'
:
True
},
'保单身份证号需人工核查'
),
'车架号'
:
(
'车架号'
,
'se_common_compare'
,
{},
'保单车架号与系统不一致'
),
'机动车损失保险金额'
:
(
'机动车损失保险金额'
,
'se_amount_lte_compare'
,
{},
'保单车损险异常'
),
'第三者责任保险金额'
:
(
'机动车第三者责任保险金额'
,
'se_amount_lte_compare'
,
{},
'保单三者险异常'
),
...
...
@@ -1868,7 +1868,9 @@ HIL_CONTRACT_1_COMPARE_LOGIC = {
'承租人签字'
:
(
'承租人签字'
,
'se_contain_compare'
,
{},
'售后回租合同承租人签字与系统不一致'
),
'共同承租人姓名'
:
(
'共同承租人姓名'
,
'se_name_compare'
,
{},
'售后回租合同共同承租人姓名与系统不一致'
),
'共同承租人&抵押人姓名'
:
(
'共同承租人姓名'
,
'se_name_compare'
,
{},
'售后回租合同共同承租人&抵押人姓名与系统不一致'
),
'共同承租人证件号'
:
(
'共同承租人证件号'
,
'se_common_compare'
,
{},
'售后回租合同共同承租人证件号与系统不一致'
),
'共同承租人&抵押人证件号'
:
(
'共同承租人证件号'
,
'se_common_compare'
,
{},
'售后回租合同共同承租人&抵押人证件号与系统不一致'
),
'共同承租人签字'
:
(
'共同承租人签字'
,
'se_contain_compare'
,
{},
'售后回租合同共同承租人签字与系统不一致'
),
'保证人姓名1'
:
(
'保证人姓名1'
,
'se_name_compare'
,
{},
'售后回租合同保证人姓名1与系统不一致'
),
...
...
@@ -1931,7 +1933,9 @@ HT_COMPARE_LOGIC = {
'借款人姓名'
:
(
'借款人姓名'
,
'se_common_compare'
,
{},
'主合同主借人姓名与系统不一致'
),
'借款人证件号'
:
(
'借款人证件号'
,
'se_common_compare'
,
{},
'主合同主借人证件号码与系统不一致'
),
'共借人姓名'
:
(
'共借人姓名'
,
'se_common_compare'
,
{},
'主合同共借人姓名与系统不一致'
),
'共借人&抵押人姓名'
:
(
'共借人姓名'
,
'se_common_compare'
,
{},
'主合同共借人&抵押人姓名与系统不一致'
),
'共借人证件号'
:
(
'共借人证件号'
,
'se_common_compare'
,
{},
'主合同共借人证件号码与系统不一致'
),
'共借人&抵押人证件号'
:
(
'共借人证件号'
,
'se_common_compare'
,
{},
'主合同共借人&抵押人证件号与系统不一致'
),
'保证人姓名1'
:
(
'保证人姓名1'
,
'se_common_compare'
,
{},
'主合同担保人1姓名与系统不一致'
),
'保证人证件号1'
:
(
'保证人证件号1'
,
'se_common_compare'
,
{},
'主合同担保人1证件号码与系统不一致'
),
'保证人姓名2'
:
(
'保证人姓名2'
,
'se_common_compare'
,
{},
'主合同担保人2姓名与系统不一致'
),
...
...
src/celery_compare/tasks.py
View file @
dd5053e
...
...
@@ -884,18 +884,26 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
dealer_name_list
=
cms_info
.
get
(
'dealerName'
,
''
)
.
split
()
dealer_name
=
''
if
len
(
dealer_name_list
)
==
0
else
dealer_name_list
[
-
1
]
# 个人信息证件---------------------------------------------------------------------------------------------------------
# 个人信息证件------------------------------------------------------------------------------------------------------
is_cdfl
=
True
# 车贷分离
# province = cms_info.get('province', '')
for
individual_info
in
cms_info
.
get
(
'applicantInformation'
,
[]):
all_id_num
=
[]
license_dict
=
{}
customer_name
=
individual_info
.
get
(
'name'
,
''
)
customer_name
=
individual_info
.
get
(
'name'
,
''
)
.
strip
()
legal_name
=
individual_info
.
get
(
'legalRepName'
,
''
)
#
establishment_date = individual_info.get('establishmentDate', '')
establishment_date
=
individual_info
.
get
(
'establishmentDate'
,
''
)
# date_of_birth = individual_info.get('dateOfBirth', '')
# 车贷分离判断
is_corporate
=
individual_info
.
get
(
'customersubType'
,
''
)
==
'Corporate'
if
individual_info
[
'applicantType'
]
==
consts
.
APPLICANT_TYPE_ORDER
[
1
]
and
not
is_corporate
:
is_cdfl
=
False
if
individual_info
[
'applicantType'
]
==
consts
.
APPLICANT_TYPE_ORDER
[
0
]
and
is_corporate
:
is_cdfl
=
False
for
id_info
in
individual_info
.
get
(
'IDInformation'
,
[]):
if
id_info
.
get
(
'idType'
)
in
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
:
license_en
,
is_prc
=
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
[
id_info
[
'idType'
]]
...
...
@@ -903,10 +911,10 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
id_num
=
decode_des
(
id_info
.
get
(
'idNum'
,
''
),
des_key
)
field_input
=
[(
'customerName'
,
customer_name
),
(
'idNum'
,
id_num
),
(
'idExpiryDate'
,
id_info
.
get
(
'idExpiryDate'
,
''
))]
if
is_prc
:
# field_input.append(('hukouProvince', province))
# field_input.append(('真伪', consts.IC_RES_MAPPING.get(1)))
license_dict
[
license_en
]
=
field_input
#
if is_prc:
# field_input.append(('hukouProvince', province))
# field_input.append(('真伪', consts.IC_RES_MAPPING.get(1)))
license_dict
[
license_en
]
=
field_input
all_id_num
.
append
(
id_num
)
# 营业执照 --------------------------------------------------------------------------------------------------
elif
id_info
.
get
(
'idType'
)
in
[
'Unified Social Credit Code'
,
'Tax Number'
,
'Business License Number'
]:
...
...
@@ -919,13 +927,16 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
# ('businessLicenseNo', id_num),
# ('organizationCreditCode', id_num),
# ('taxRegistrationCertificateNo', id_num),
# ('establishmentDate', establishment_date),
# ('businessLicenseDueDate', id_info.get('idExpiryDate', '')),
# ]
if
is_corporate
:
company_info_list
.
append
((
customer_name
,
id_num
,
legal_name
))
# else:
# bl_field_input.append(('establishmentDate', establishment_date))
# license_dict[consts.BL_EN] = bl_field_input
all_id_num
.
append
(
id_num
)
if
individual_info
.
get
(
'customersubType'
,
''
)
==
'Corporate'
:
company_info_list
.
append
((
customer_name
,
id_num
,
legal_name
))
# SME营业执照---------------------------------------------------------------------------------------------------
# if individual_info.get('customersubType', '').startswith('Self Employed'):
...
...
@@ -945,16 +956,28 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
compare_info
[
'applicantInformation'
]
=
individual_info_dict
main_name
=
main_
num
=
hmh_name
=
hmh
_id
=
''
main_name
=
main_
id_all
=
main
_id
=
''
for
applicant_type
in
consts
.
APPLICANT_TYPE_ORDER
:
if
applicant_type
in
main_role_info
:
# main_name, main_num, _
= main_role_info[applicant_type][0]
hmh_name
,
_
,
hmh_id
=
main_role_info
[
applicant_type
][
0
]
main_name
,
main_id_all
,
main_id
=
main_role_info
[
applicant_type
][
0
]
#
hmh_name, _, hmh_id = main_role_info[applicant_type][0]
break
co_name
=
co_id
=
bo_name
=
bo_id
=
''
if
is_cdfl
:
co_name
,
_
,
co_id
=
main_role_info
[
consts
.
APPLICANT_TYPE_ORDER
[
1
]][
0
]
bo_name
,
_
,
bo_id
=
main_role_info
[
consts
.
APPLICANT_TYPE_ORDER
[
0
]][
0
]
# dda_name_list = []
# dda_num_list = []
# for applicant_type in consts.APPLICANT_TYPE_ORDER[:2]:
if
len
(
company_info_list
)
>
0
:
# tmp_idx = 1
company_info
=
company_info_list
[
0
]
else
:
# tmp_idx = 0
company_info
=
None
# for applicant_type in consts.APPLICANT_TYPE_ORDER[tmp_idx: tmp_idx + 2]:
# if applicant_type in main_role_info:
# for dda_name_part, _, dda_num_part in main_role_info[applicant_type]:
# dda_name_list.append(dda_name_part)
...
...
@@ -963,11 +986,6 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
# dda_num = '、'.join(dda_num_list)
# del main_role_info
if
len
(
company_info_list
)
>
0
:
company_info
=
company_info_list
[
0
]
else
:
company_info
=
None
vehicle_info
=
{}
vehicle_field_input
=
[]
vehicle_status
=
cms_info
.
get
(
'vehicleStatus'
,
''
)
...
...
@@ -977,16 +995,15 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
# 新车发票----------------------------------------------------------------------------------------------------------
if
vehicle_status
==
'New'
:
vehicle_field_input
.
append
((
'vinNo'
,
vin_no
))
vehicle_field_input
.
append
(
(
'dealer'
,
'、'
.
join
([
dealer_name
,
cms_info
.
get
(
'fapiaoIssuerDealer'
,
''
)])))
vehicle_field_input
.
append
((
'dealer'
,
'、'
.
join
([
dealer_name
,
cms_info
.
get
(
'fapiaoIssuerDealer'
,
''
)])))
vehicle_field_input
.
append
((
'vehicleTransactionAmount'
,
amount
))
if
isinstance
(
company_info
,
tuple
):
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
mpany_info
[
0
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
mpany_info
[
1
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
_name
if
is_cdfl
else
company_info
[
0
]))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
_id
if
is_cdfl
else
company_info
[
1
]))
# 车贷分离
else
:
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
hmh_name
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
hmh_id
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co_name
if
is_cdfl
else
main_name
))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co_id
if
is_cdfl
else
main_id
))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
2
],
first_submission_date
))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
4
],
consts
.
SE_FPL_VALUE
))
...
...
@@ -998,7 +1015,6 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
])))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
6
],
consts
.
SE_LAYOUT_VALUE
))
vehicle_info
[
consts
.
MVI_EN
]
=
vehicle_field_input
compare_info
[
'vehicleInfo'
]
=
vehicle_info
# 二手车发票、交易凭证、绿本------------------------------------------------------------------------------------------
# else:
# gb_field_input = [
...
...
@@ -1009,22 +1025,23 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
# vehicle_field_input.append(('vinNo', vin_no))
# vehicle_field_input.append(('vehicleTransactionAmount', amount))
# if isinstance(company_info, tuple):
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], co
mpany_info[0]))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], co
mpany_info[1]))
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[0], co
mpany_info[0]))
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[1], co
mpany_info[1]))
# gb34_field_input.append((consts.SE_GB_USED_FIELD[0], co
mpany_info[0]))
# gb34_field_input.append((consts.SE_GB_USED_FIELD[1], co
mpany_info[1]))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], co
_name if is_cdfl else company_info[0])) # 车贷分离
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], co
_id if is_cdfl else company_info[1])) # 车贷分离
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[0], co
_name if is_cdfl else company_info[0])) # 车贷分离
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[1], co
_id if is_cdfl else company_info[1])) # 车贷分离
# gb34_field_input.append((consts.SE_GB_USED_FIELD[0], co
_name if is_cdfl else company_info[0])) # 车贷分离
# gb34_field_input.append((consts.SE_GB_USED_FIELD[1], co
_id if is_cdfl else company_info[1])) # 车贷分离
# else:
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0],
main_name))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1],
main_num))
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[0],
main_name))
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[1],
main_num))
# gb34_field_input.append((consts.SE_GB_USED_FIELD[0],
main_name))
# gb34_field_input.append((consts.SE_GB_USED_FIELD[1],
main_num))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0],
co_name if is_cdfl else main_name)) # 车贷分离
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1],
co_id if is_cdfl else main_id_all)) # 车贷分离
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[0],
co_name if is_cdfl else main_name)) # 车贷分离
# jypz_field_input.append((consts.SE_NEW_ADD_FIELD[1],
co_id if is_cdfl else main_id_all)) # 车贷分离
# gb34_field_input.append((consts.SE_GB_USED_FIELD[0],
co_name if is_cdfl else main_name)) # 车贷分离
# gb34_field_input.append((consts.SE_GB_USED_FIELD[1],
co_id if is_cdfl else main_id_all)) # 车贷分离
# gb34_field_input.append((consts.SE_GB_USED_FIELD[2], first_submission_date))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[2], first_submission_date))
# # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE))
# jypz_field_input.append(('dealerName', dealer_name))
# jypz_field_input.append(('vinNo', vin_no))
# jypz_field_input.append(('vehicleTransactionAmount', amount))
# jypz_field_input.append((consts.SE_GB_USED_FIELD[-1], first_submission_date))
...
...
@@ -1037,7 +1054,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
# vehicle_info[consts.JYPZ_EN] = jypz_field_input
# if detect_list[0] and detect_list[1]:
# vehicle_info[consts.UCI_EN] = vehicle_field_input
#
compare_info['vehicleInfo'] = vehicle_info
compare_info
[
'vehicleInfo'
]
=
vehicle_info
# 银行卡-------------------------------------------------------------------------------------------------------
bank_info
=
{}
...
...
@@ -1062,8 +1079,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
# ('applicationId(1)', last_obj.application_id),
# ('applicationId(2)', last_obj.application_id),
# ('bankName', bank_name),
# ('companyName',
# consts.HIL_COMPANY_NAME if application_entity in consts.HIL_SET else consts.AFC_COMPANY_NAME),
# ('companyName', consts.HIL_COMPANY_NAME if application_entity in consts.HIL_SET else consts.AFC_COMPANY_NAME),
# ('customerName', dda_name),
# ('idNum', dda_num),
# ('accountHolderName', account_holder_name),
...
...
@@ -1113,8 +1129,8 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
full_no
=
cms_info
.
get
(
'settlemnetVerification'
,
{})
.
get
(
'applicationNo'
,
''
)
if
cms_info
.
get
(
'mortgageType'
,
''
)
==
'Mortgage Free'
or
cms_info
.
get
(
'mortgageType'
,
''
)
==
'MortgageFree'
:
hmh_field_input
=
[
(
consts
.
SE_HMH_FIELD
[
0
],
hmh
_name
),
(
consts
.
SE_HMH_FIELD
[
1
],
hmh
_id
),
(
consts
.
SE_HMH_FIELD
[
0
],
main
_name
),
(
consts
.
SE_HMH_FIELD
[
1
],
main
_id
),
(
consts
.
SE_HMH_FIELD
[
2
],
full_no
),
(
consts
.
SE_HMH_FIELD
[
3
],
cms_info
.
get
(
'financeCompany'
,
''
)),
(
consts
.
SE_HMH_FIELD
[
4
],
consts
.
SE_STAMP_VALUE
),
...
...
@@ -1189,8 +1205,8 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
# else:
# dszx_amount = '500000'
# bd_field_input = [
# (consts.SE_BD_FIELD[0],
hmh_name),
# (consts.SE_BD_FIELD[1],
hmh_id),
# (consts.SE_BD_FIELD[0],
[co_name, bo_name] if is_cdfl else [main_name, ]), # 车贷分离
# (consts.SE_BD_FIELD[1],
[co_id, bo_id] if is_cdfl else [main_id, ]), # 车贷分离
# (consts.SE_BD_FIELD[2], vin_no),
# (consts.SE_BD_FIELD[3], ssx_amount),
# (consts.SE_BD_FIELD[4], dszx_amount),
...
...
@@ -1227,8 +1243,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
(
consts
.
SE_HIL_CON_1_FIELD
[
2
],
vin_no
),
(
consts
.
SE_HIL_CON_1_FIELD
[
3
],
dealer_name
),
(
consts
.
SE_HIL_CON_1_FIELD
[
4
],
amount
),
(
consts
.
SE_HIL_CON_1_FIELD
[
5
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
consts
.
SE_HIL_CON_1_FIELD
[
5
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
consts
.
SE_HIL_CON_1_FIELD
[
6
],
str
(
cms_info
.
get
(
'terms'
,
'0'
))),
(
consts
.
SE_HIL_CON_1_FIELD
[
7
],
schedule_list_str
),
(
consts
.
SE_HIL_CON_1_FIELD
[
11
],
account_no
),
...
...
@@ -1243,12 +1258,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
if
isinstance
(
company_info
,
tuple
):
hil_contract_1_input
.
append
((
consts
.
SE_HIL_CON_1_FIELD
[
10
],
company_info
[
2
]))
for
key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST_1
:
for
key
_hil1
,
cdfl_key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST_1
:
if
not
e_write
and
not
online_sign
:
continue
key
=
cdfl_key
if
is_cdfl
else
key_hil1
is_find
=
False
if
app_type
in
main_role_info
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
is_find
=
True
if
isinstance
(
field_idx
,
int
):
hil_contract_1_input
.
append
((
key
,
main_role_info
[
app_type
][
id_idx
][
field_idx
]))
...
...
@@ -1262,15 +1278,15 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
if
fp_campaign
.
find
(
'Joy_Select'
)
!=
-
1
or
fp_campaign
.
find
(
'JoySelect'
)
!=
-
1
:
hil_contract_3_input
=
[
(
consts
.
SE_HIL_CON_3_FIELD
[
0
],
[
full_no
]
if
online_sign
else
full_no
),
(
consts
.
SE_HIL_CON_3_FIELD
[
1
],
hmh
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
2
],
hmh
_id
),
(
consts
.
SE_HIL_CON_3_FIELD
[
1
],
main
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
2
],
main
_id
),
(
consts
.
SE_HIL_CON_3_FIELD
[
3
],
dealer_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
4
],
full_no
),
(
consts
.
SE_HIL_CON_3_FIELD
[
5
],
hmh
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
6
],
hmh
_id
),
(
consts
.
SE_HIL_CON_3_FIELD
[
5
],
main
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
6
],
main
_id
),
]
#
if online_sign:
# hil_contract_3_input.append((consts.SE_HIL_CON_3_FIELD[7], hmh
_name))
if
online_sign
:
hil_contract_3_input
.
append
((
consts
.
SE_HIL_CON_3_FIELD
[
7
],
main
_name
))
contract_info
[
consts
.
HIL_CONTRACT_3_EN
]
=
hil_contract_3_input
# HIL合同 车辆租赁抵押合同 --------------------------------------------------------------------------------------
...
...
@@ -1282,14 +1298,15 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
(
consts
.
SE_HIL_CON_2_FIELD
[
4
],
str
(
cms_info
.
get
(
'terms'
,
'0'
))),
]
for
key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
,
co_skip
in
consts
.
ROLE_LIST_2
:
for
key
,
app_type
_hil2
,
cdfl_app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
,
co_skip
in
consts
.
ROLE_LIST_2
:
if
co_skip
and
isinstance
(
company_info
,
tuple
):
continue
if
not
e_write
and
not
online_sign
:
continue
app_type
=
cdfl_app_type
if
is_cdfl
else
app_type_hil2
is_find
=
False
if
app_type
in
main_role_info
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
is_find
=
True
if
isinstance
(
field_idx
,
int
):
hil_contract_2_input
.
append
((
key
,
main_role_info
[
app_type
][
id_idx
][
field_idx
]))
...
...
@@ -1307,20 +1324,16 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
(
consts
.
SE_AFC_CON_FIELD
[
0
],
full_no
),
(
consts
.
SE_AFC_CON_FIELD
[
1
],
amount
),
(
consts
.
SE_AFC_CON_FIELD
[
2
],
vin_no
),
(
consts
.
SE_AFC_CON_FIELD
[
3
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
3
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
4
],
str
(
cms_info
.
get
(
'terms'
,
'0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
5
],
vehicle_principal_str
),
(
consts
.
SE_AFC_CON_FIELD
[
6
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'associatedServicePrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
6
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'associatedServicePrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
7
],
amount
),
(
consts
.
SE_AFC_CON_FIELD
[
8
],
vin_no
),
(
consts
.
SE_AFC_CON_FIELD
[
9
],
dealer_name
),
(
consts
.
SE_AFC_CON_FIELD
[
10
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
10
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
11
],
vehicle_principal_str
),
(
consts
.
SE_AFC_CON_FIELD
[
12
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'associatedServicePrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
12
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'associatedServicePrincipal'
,
'0.0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
13
],
str
(
cms_info
.
get
(
'terms'
,
'0'
))),
(
consts
.
SE_AFC_CON_FIELD
[
14
],
account_no
),
(
consts
.
SE_AFC_CON_FIELD
[
15
],
account_holder_name
),
...
...
@@ -1339,12 +1352,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True):
afc_contract_input
.
pop
(
9
)
# '借款人签字及时间', 'Borrower', 0, 0, True
for
key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST
:
for
key
_afc1
,
cdfl_key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST
:
if
not
e_write
and
not
online_sign
:
continue
key
=
cdfl_key
if
is_cdfl
else
key_afc1
is_find
=
False
if
app_type
in
main_role_info
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
is_find
=
True
if
isinstance
(
field_idx
,
int
):
afc_contract_input
.
append
((
key
,
main_role_info
[
app_type
][
id_idx
][
field_idx
]))
...
...
@@ -1374,7 +1388,8 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
dealer_name_list
=
cms_info
.
get
(
'dealerName'
,
''
)
.
split
()
dealer_name
=
''
if
len
(
dealer_name_list
)
==
0
else
dealer_name_list
[
-
1
]
# 个人信息证件---------------------------------------------------------------------------------------------------------
# 个人信息证件------------------------------------------------------------------------------------------------------
is_cdfl
=
True
# 车贷分离
# province = cms_info.get('province', '')
for
individual_info
in
cms_info
.
get
(
'applicantInformation'
,
[]):
all_id_num
=
[]
...
...
@@ -1386,6 +1401,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
establishment_date
=
individual_info
.
get
(
'establishmentDate'
,
''
)
# date_of_birth = individual_info.get('dateOfBirth', '')
# 车贷分离判断
is_corporate
=
individual_info
.
get
(
'customersubType'
,
''
)
==
'Corporate'
if
individual_info
[
'applicantType'
]
==
consts
.
APPLICANT_TYPE_ORDER
[
1
]
and
not
is_corporate
:
is_cdfl
=
False
if
individual_info
[
'applicantType'
]
==
consts
.
APPLICANT_TYPE_ORDER
[
0
]
and
is_corporate
:
is_cdfl
=
False
for
id_info
in
individual_info
.
get
(
'IDInformation'
,
[]):
if
id_info
.
get
(
'idType'
)
in
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
:
license_en
,
is_prc
=
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
[
id_info
[
'idType'
]]
...
...
@@ -1412,7 +1434,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
(
'businessLicenseDueDate'
,
id_info
.
get
(
'idExpiryDate'
,
''
)),
]
if
i
ndividual_info
.
get
(
'customersubType'
,
''
)
==
'Corporate'
:
if
i
s_corporate
:
company_info_list
.
append
((
customer_name
,
id_num
,
legal_name
))
else
:
bl_field_input
.
append
((
'establishmentDate'
,
establishment_date
))
...
...
@@ -1420,7 +1442,6 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
license_dict
[
consts
.
BL_EN
]
=
bl_field_input
all_id_num
.
append
(
id_num
)
# SME营业执照---------------------------------------------------------------------------------------------------
# if individual_info.get('customersubType', '').startswith('Self Employed'):
# sep_field_input = [
...
...
@@ -1439,29 +1460,34 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
compare_info
[
'applicantInformation'
]
=
individual_info_dict
main_name
=
main_
num
=
hmh_name
=
hmh
_id
=
''
main_name
=
main_
id_all
=
main
_id
=
''
for
applicant_type
in
consts
.
APPLICANT_TYPE_ORDER
:
if
applicant_type
in
main_role_info
:
main_name
,
main_
num
,
_
=
main_role_info
[
applicant_type
][
0
]
hmh_name
,
_
,
hmh_id
=
main_role_info
[
applicant_type
][
0
]
main_name
,
main_
id_all
,
main_id
=
main_role_info
[
applicant_type
][
0
]
#
hmh_name, _, hmh_id = main_role_info[applicant_type][0]
break
dda_name_list
=
[]
dda_num_list
=
[]
co_name
=
co_id
=
bo_name
=
bo_id
=
''
if
is_cdfl
:
co_name
,
_
,
co_id
=
main_role_info
[
consts
.
APPLICANT_TYPE_ORDER
[
1
]][
0
]
bo_name
,
_
,
bo_id
=
main_role_info
[
consts
.
APPLICANT_TYPE_ORDER
[
0
]][
0
]
# dda_name_list = []
# dda_num_list = []
if
len
(
company_info_list
)
>
0
:
tmp_idx
=
1
#
tmp_idx = 1
company_info
=
company_info_list
[
0
]
else
:
tmp_idx
=
0
#
tmp_idx = 0
company_info
=
None
for
applicant_type
in
consts
.
APPLICANT_TYPE_ORDER
[
tmp_idx
:
tmp_idx
+
2
]:
if
applicant_type
in
main_role_info
:
for
dda_name_part
,
_
,
dda_num_part
in
main_role_info
[
applicant_type
]:
dda_name_list
.
append
(
dda_name_part
)
dda_num_list
.
append
(
dda_num_part
)
dda_name
=
'、'
.
join
(
dda_name_list
)
dda_num
=
'、'
.
join
(
dda_num_list
)
#
for applicant_type in consts.APPLICANT_TYPE_ORDER[tmp_idx: tmp_idx + 2]:
#
if applicant_type in main_role_info:
#
for dda_name_part, _, dda_num_part in main_role_info[applicant_type]:
#
dda_name_list.append(dda_name_part)
#
dda_num_list.append(dda_num_part)
#
dda_name = '、'.join(dda_name_list)
#
dda_num = '、'.join(dda_num_list)
# del main_role_info
vehicle_info
=
{}
...
...
@@ -1477,11 +1503,11 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
vehicle_field_input
.
append
((
'vehicleTransactionAmount'
,
amount
))
if
isinstance
(
company_info
,
tuple
):
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
mpany_info
[
0
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
mpany_info
[
1
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
_name
if
is_cdfl
else
company_info
[
0
]))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
_id
if
is_cdfl
else
company_info
[
1
]))
# 车贷分离
else
:
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
hmh_name
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
hmh_id
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co_name
if
is_cdfl
else
main_name
))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co_id
if
is_cdfl
else
main_id
))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
2
],
first_submission_date
))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
4
],
consts
.
SE_FPL_VALUE
))
...
...
@@ -1503,19 +1529,19 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
vehicle_field_input
.
append
((
'vinNo'
,
vin_no
))
vehicle_field_input
.
append
((
'vehicleTransactionAmount'
,
amount
))
if
isinstance
(
company_info
,
tuple
):
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
mpany_info
[
0
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
mpany_info
[
1
]))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
mpany_info
[
0
]))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
mpany_info
[
1
]))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
0
],
co
mpany_info
[
0
]))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
1
],
co
mpany_info
[
1
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
_name
if
is_cdfl
else
company_info
[
0
]))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
_id
if
is_cdfl
else
company_info
[
1
]))
# 车贷分离
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co
_name
if
is_cdfl
else
company_info
[
0
]))
# 车贷分离
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co
_id
if
is_cdfl
else
company_info
[
1
]))
# 车贷分离
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
0
],
co
_name
if
is_cdfl
else
company_info
[
0
]))
# 车贷分离
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
1
],
co
_id
if
is_cdfl
else
company_info
[
1
]))
# 车贷分离
else
:
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
main_name
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
main_num
))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
main_name
))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
main_num
))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
0
],
main_name
))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
1
],
main_num
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co_name
if
is_cdfl
else
main_name
))
# 车贷分离
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co_id
if
is_cdfl
else
main_id_all
))
# 车贷分离
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
co_name
if
is_cdfl
else
main_name
))
# 车贷分离
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
co_id
if
is_cdfl
else
main_id_all
))
# 车贷分离
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
0
],
co_name
if
is_cdfl
else
main_name
))
# 车贷分离
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
1
],
co_id
if
is_cdfl
else
main_id_all
))
# 车贷分离
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
2
],
first_submission_date
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
2
],
first_submission_date
))
# vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE))
...
...
@@ -1607,8 +1633,8 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
full_no
=
cms_info
.
get
(
'settlemnetVerification'
,
{})
.
get
(
'applicationNo'
,
''
)
if
cms_info
.
get
(
'mortgageType'
,
''
)
==
'Mortgage Free'
or
cms_info
.
get
(
'mortgageType'
,
''
)
==
'MortgageFree'
:
hmh_field_input
=
[
(
consts
.
SE_HMH_FIELD
[
0
],
hmh
_name
),
(
consts
.
SE_HMH_FIELD
[
1
],
hmh
_id
),
(
consts
.
SE_HMH_FIELD
[
0
],
main
_name
),
(
consts
.
SE_HMH_FIELD
[
1
],
main
_id
),
(
consts
.
SE_HMH_FIELD
[
2
],
full_no
),
(
consts
.
SE_HMH_FIELD
[
3
],
cms_info
.
get
(
'financeCompany'
,
''
)),
(
consts
.
SE_HMH_FIELD
[
4
],
consts
.
SE_STAMP_VALUE
),
...
...
@@ -1683,8 +1709,8 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
else
:
dszx_amount
=
'500000'
bd_field_input
=
[
(
consts
.
SE_BD_FIELD
[
0
],
hmh_name
),
(
consts
.
SE_BD_FIELD
[
1
],
hmh_id
),
(
consts
.
SE_BD_FIELD
[
0
],
[
co_name
,
bo_name
]
if
is_cdfl
else
[
main_name
,
]),
# 车贷分离
(
consts
.
SE_BD_FIELD
[
1
],
[
co_id
,
bo_id
]
if
is_cdfl
else
[
main_id
,
]),
# 车贷分离
(
consts
.
SE_BD_FIELD
[
2
],
vin_no
),
(
consts
.
SE_BD_FIELD
[
3
],
ssx_amount
),
(
consts
.
SE_BD_FIELD
[
4
],
dszx_amount
),
...
...
@@ -1736,9 +1762,10 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
if
isinstance
(
company_info
,
tuple
):
hil_contract_1_input
.
append
((
consts
.
SE_HIL_CON_1_FIELD
[
10
],
company_info
[
2
]))
for
key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST_1
:
for
key
_hil1
,
cdfl_key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST_1
:
if
not
e_write
and
not
online_sign
:
continue
key
=
cdfl_key
if
is_cdfl
else
key_hil1
is_find
=
False
if
app_type
in
main_role_info
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
...
...
@@ -1755,15 +1782,15 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
if
fp_campaign
.
find
(
'Joy_Select'
)
!=
-
1
or
fp_campaign
.
find
(
'JoySelect'
)
!=
-
1
:
hil_contract_3_input
=
[
(
consts
.
SE_HIL_CON_3_FIELD
[
0
],
[
full_no
]
if
online_sign
else
full_no
),
(
consts
.
SE_HIL_CON_3_FIELD
[
1
],
hmh
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
2
],
hmh
_id
),
(
consts
.
SE_HIL_CON_3_FIELD
[
1
],
main
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
2
],
main
_id
),
(
consts
.
SE_HIL_CON_3_FIELD
[
3
],
dealer_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
4
],
full_no
),
(
consts
.
SE_HIL_CON_3_FIELD
[
5
],
hmh
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
6
],
hmh
_id
),
(
consts
.
SE_HIL_CON_3_FIELD
[
5
],
main
_name
),
(
consts
.
SE_HIL_CON_3_FIELD
[
6
],
main
_id
),
]
if
online_sign
:
hil_contract_3_input
.
append
((
consts
.
SE_HIL_CON_3_FIELD
[
7
],
hmh
_name
))
hil_contract_3_input
.
append
((
consts
.
SE_HIL_CON_3_FIELD
[
7
],
main
_name
))
contract_info
[
consts
.
HIL_CONTRACT_3_EN
]
=
hil_contract_3_input
# HIL合同 车辆租赁抵押合同 --------------------------------------------------------------------------------------
...
...
@@ -1775,11 +1802,12 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
(
consts
.
SE_HIL_CON_2_FIELD
[
4
],
str
(
cms_info
.
get
(
'terms'
,
'0'
))),
]
for
key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
,
co_skip
in
consts
.
ROLE_LIST_2
:
for
key
,
app_type
_hil2
,
cdfl_app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
,
co_skip
in
consts
.
ROLE_LIST_2
:
if
co_skip
and
isinstance
(
company_info
,
tuple
):
continue
if
not
e_write
and
not
online_sign
:
continue
app_type
=
cdfl_app_type
if
is_cdfl
else
app_type_hil2
is_find
=
False
if
app_type
in
main_role_info
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
...
...
@@ -1828,9 +1856,10 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
afc_contract_input
.
pop
(
9
)
# '借款人签字及时间', 'Borrower', 0, 0, True
for
key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST
:
for
key
_afc1
,
cdfl_key
,
app_type
,
id_idx
,
field_idx
,
is_force
,
e_write
in
consts
.
ROLE_LIST
:
if
not
e_write
and
not
online_sign
:
continue
key
=
cdfl_key
if
is_cdfl
else
key_afc1
is_find
=
False
if
app_type
in
main_role_info
:
if
len
(
main_role_info
[
app_type
])
>=
id_idx
+
1
:
...
...
src/common/tools/comparison.py
View file @
dd5053e
...
...
@@ -180,6 +180,16 @@ class Comparison:
else
:
return
self
.
RESULT_N
def
super_list_compare
(
self
,
input_list
,
ocr_str
,
**
kwargs
):
for
input_str
in
input_list
:
if
kwargs
.
get
(
'method'
,
'common'
)
==
'name'
:
if
self
.
se_name_compare
(
input_str
,
ocr_str
,
**
kwargs
)
==
self
.
RESULT_Y
:
return
self
.
RESULT_Y
else
:
if
self
.
se_common_compare
(
input_str
,
ocr_str
,
**
kwargs
)
==
self
.
RESULT_Y
:
return
self
.
RESULT_Y
return
self
.
RESULT_N
def
se_date_contain_compare
(
self
,
input_str
,
ocr_str_or_list
,
**
kwargs
):
return
self
.
RESULT_Y
...
...
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