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
d74aeab3
authored
2022-10-08 16:08:08 +0800
by
王聪
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
pre settlement pos 接口更新
1 parent
1f9e272b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
65 deletions
src/pos/pos.py
src/pos/pos_consts.py
src/pos/pos.py
View file @
d74aeab
...
...
@@ -293,6 +293,7 @@ class CompareInfoResult:
class
CompareInfo
:
def
__init__
(
self
,
pos_content
):
self
.
dealer_name
=
None
self
.
pos_content
=
pos_content
self
.
compare_info
=
{}
self
.
main_role_info
=
{}
...
...
@@ -305,7 +306,7 @@ class CompareInfo:
self
.
application_version
=
pos_content
.
get
(
'applicationVersion'
,
0
)
self
.
application_entity
=
pos_content
.
get
(
'applicationEntity'
,
''
)
self
.
is_auto_settlement
=
pos_content
.
get
(
'isAutoSettlement'
,
''
)
self
.
first_subm
mis
on_date
=
pos_content
.
get
(
'firstSubmmisonDate'
,
''
)
self
.
first_subm
issi
on_date
=
pos_content
.
get
(
'firstSubmmisonDate'
,
''
)
self
.
product_group_name
=
pos_content
.
get
(
'productGroup'
,
''
)
self
.
account_holder_name
=
''
...
...
@@ -340,14 +341,13 @@ class CompareInfo:
def
getApplicantInformation
(
self
,
individual_cus_info
,
corporate_cus_info
):
individual_info_dict
=
{}
legal_name
=
corporate_cus_info
.
get
(
'legalRepName'
,
''
)
establishment_date
=
corporate_cus_info
.
get
(
'establishmentDate'
,
''
)
for
individual_info
in
individual_cus_info
:
all_id_num
=
[]
license_dict
=
{}
customer_name
=
individual_info
.
get
(
'customerName'
,
''
)
.
strip
()
self
.
customer_name
=
customer_name
legal_name
=
corporate_cus_info
.
get
(
'legalRepName'
,
''
)
establishment_date
=
corporate_cus_info
.
get
(
'establishmentDate'
,
''
)
# 车贷分离判断
is_corporate
=
individual_info
.
get
(
'selfEmployedSubType'
,
''
)
==
'Corporate'
if
individual_info
[
'applicantType'
]
==
consts
.
APPLICANT_TYPE_ORDER
[
1
]
and
is_corporate
:
...
...
@@ -359,6 +359,7 @@ class CompareInfo:
license_en
,
is_prc
=
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
[
individual_info
[
'idType'
]]
# ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince']
id_num
=
decode_des
(
individual_info
.
get
(
'idNum'
,
''
),
des_key
)
# id_num = individual_info.get('idNum', '')
self
.
id_num
=
id_num
field_input
=
[(
'customerName'
,
customer_name
),
(
'idNum'
,
id_num
),
...
...
@@ -415,7 +416,6 @@ class CompareInfo:
vehicle_info
=
{}
vehicle_field_input
=
[]
vehicle_status
=
vehicleInfo
.
get
(
'vehicleStatus'
,
''
)
first_submission_date
=
self
.
first_submmison_date
vin_no
=
vehicleInfo
.
get
(
'vinNo'
,
''
)
self
.
vin_no
=
vin_no
# amount = str(vehicleInfo.get('vehiclePrice', '0.0'))
...
...
@@ -424,11 +424,10 @@ class CompareInfo:
dealer_name_list
=
vehicleInfo
.
get
(
'dealer'
,
''
)
.
split
()
dealer_name
=
''
if
len
(
dealer_name_list
)
==
0
else
dealer_name_list
[
-
1
]
self
.
dealer_name
=
dealer_name
issuer_dealer
=
vehicleInfo
.
get
(
'fapiaoIssuerDealer'
,
''
)
.
strip
()
# 新车发票----------------------------------------------------------------------------------------------------------
if
vehicle_status
==
'New'
:
vehicle_field_input
.
append
((
'vinNo'
,
vin_no
))
vehicle_field_input
.
append
((
'dealer'
,
dealer_name
if
len
(
issuer_dealer
)
==
0
else
issuer_dealer
))
#
vehicle_field_input.append(('dealer', dealer_name if len(issuer_dealer) == 0 else issuer_dealer))
vehicle_field_input
.
append
((
'vehicleTransactionAmount'
,
amount
))
if
isinstance
(
self
.
company_info
,
tuple
):
...
...
@@ -438,7 +437,8 @@ class CompareInfo:
else
:
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[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
))
bhsj
=
float
(
amount
)
/
1.13
...
...
@@ -447,10 +447,10 @@ class CompareInfo:
# format(float(amount) - bhsj, '.2f'),
# consts.RESULT_Y
# ])))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
7
],
format
(
bhsj
,
'.2f'
)))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
8
],
format
(
float
(
amount
)
-
bhsj
,
'.2f'
)))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
9
],
consts
.
RESULT_Y
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
6
],
consts
.
SE_LAYOUT_VALUE
))
#
vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[7], format(bhsj, '.2f')))
#
vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[8], format(float(amount) - bhsj, '.2f')))
#
vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[9], consts.RESULT_Y))
#
vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[6], consts.SE_LAYOUT_VALUE))
vehicle_field_input
.
append
((
"firstSubmmisonDate"
,
self
.
first_submmison_date
))
vehicle_field_input
.
append
((
"productGroupName"
,
self
.
product_group_name
))
...
...
@@ -646,56 +646,56 @@ class CompareInfo:
# AFC合同------------------------------------------------------------------------------------------------------
vehicle_principal_str
=
str
(
quotationtInfo
.
get
(
'vehiclePrincipal'
,
'0.0'
))
afc_contract_input
=
[]
# if is_asp:
# afc_contract_input = [
# (consts.SE_AFC_CON_FIELD[0], full_no),
# ]
# else:
# afc_contract_input = [
# (consts.SE_AFC_CON_FIELD[23], full_no),
# ]
# afc_contract_input.extend([
# (consts.SE_AFC_CON_FIELD[1], self.vehicleTransactionAmount),
# (consts.SE_AFC_CON_FIELD[2], self.vin_no),
# (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(quotationtInfo.get('associatedServicePrincipal', '0.0'))),
# (consts.SE_AFC_CON_FIELD[7], self.vehicleTransactionAmount),
# (consts.SE_AFC_CON_FIELD[8], self.vin_no),
# (consts.SE_AFC_CON_FIELD[9], self.dealer_name),
# (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[13], str(cms_info.get('terms', '0'))),
# (consts.SE_AFC_CON_FIELD[14], self.account_no),
# (consts.SE_AFC_CON_FIELD[15], self.account_holder_name),
# (consts.SE_AFC_CON_FIELD[16], self.bank_name),
# (consts.SE_AFC_CON_FIELD[17], schedule_list_str),
# ])
if
is_asp
:
afc_contract_input
=
[
(
pos_consts
.
SE_AFC_CON_FIELD
[
0
],
full_no
),
]
else
:
afc_contract_input
=
[
(
pos_consts
.
SE_AFC_CON_FIELD
[
23
],
full_no
),
]
# if is_asp:
# afc_contract_input.append((consts.SE_AFC_CON_FIELD[20], asp_list))
# afc_contract_input.append((consts.SE_AFC_CON_FIELD[22], asp_list))
# # 购置税校验
# if isinstance(gzs_price, str):
# afc_contract_input.append(
# (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'))
# else:
# afc_contract_input.pop(5)
# afc_contract_input.pop(5)
# afc_contract_input.pop(9)
# afc_contract_input.pop(9)
# contract_info[consts.AFC_CONTRACT_EN] = afc_contract_input
afc_contract_input
.
extend
([
(
pos_consts
.
SE_AFC_CON_FIELD
[
1
],
self
.
vehicleTransactionAmount
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
2
],
self
.
vin_no
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
3
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
pos_consts
.
SE_AFC_CON_FIELD
[
4
],
str
(
cms_info
.
get
(
'terms'
,
'0'
))),
(
pos_consts
.
SE_AFC_CON_FIELD
[
5
],
vehicle_principal_str
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
6
],
str
(
quotationtInfo
.
get
(
'associatedServicePrincipal'
,
'0.0'
))),
(
pos_consts
.
SE_AFC_CON_FIELD
[
7
],
self
.
vehicleTransactionAmount
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
8
],
self
.
vin_no
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
9
],
self
.
dealer_name
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
10
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'originationPrincipal'
,
'0.0'
))),
(
pos_consts
.
SE_AFC_CON_FIELD
[
11
],
vehicle_principal_str
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
12
],
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'associatedServicePrincipal'
,
'0.0'
))),
(
pos_consts
.
SE_AFC_CON_FIELD
[
13
],
str
(
cms_info
.
get
(
'terms'
,
'0'
))),
(
pos_consts
.
SE_AFC_CON_FIELD
[
14
],
self
.
account_no
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
15
],
self
.
account_holder_name
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
16
],
self
.
bank_name
),
(
pos_consts
.
SE_AFC_CON_FIELD
[
17
],
schedule_list_str
),
])
if
is_asp
:
afc_contract_input
.
append
((
pos_consts
.
SE_AFC_CON_FIELD
[
20
],
asp_list
))
afc_contract_input
.
append
((
pos_consts
.
SE_AFC_CON_FIELD
[
22
],
asp_list
))
# 购置税校验
if
isinstance
(
gzs_price
,
str
):
afc_contract_input
.
append
(
(
pos_consts
.
SE_AFC_CON_FIELD
[
21
],
tmp_gzs_list
))
# 非购置税非车辆保险的其他asp
if
have_other_asp
:
afc_contract_input
.
append
((
pos_consts
.
SE_AFC_CON_FIELD
[
24
],
'N'
))
else
:
afc_contract_input
.
pop
(
5
)
afc_contract_input
.
pop
(
5
)
afc_contract_input
.
pop
(
9
)
afc_contract_input
.
pop
(
9
)
contract_info
[
pos_consts
.
AFC_CONTRACT_EN
]
=
afc_contract_input
self
.
compare_info
[
'contract'
]
=
contract_info
def
getOther
(
self
,
quotationtInfo
,
insurance_info
):
...
...
src/pos/pos_consts.py
View file @
d74aeab
...
...
@@ -45,10 +45,14 @@ HIL_CONTRACT_1_FIELD = 'hil_contract_1_ocr'
HIL_CONTRACT_2_FIELD
=
'hil_contract_2_ocr'
HIL_CONTRACT_3_FIELD
=
'hil_contract_3_ocr'
SE_AFC_CON_FIELD
=
[
'合同编号-每页'
,
'所购车辆价格-小写-重要条款'
,
'车架号-重要条款'
,
'贷款本金金额-重要条款'
,
'贷款期限-重要条款'
,
'车辆贷款本金金额-重要条款'
,
'附加产品融资贷款本金总额-重要条款'
,
'所购车辆价格'
,
'车架号'
,
'经销商'
,
'贷款本金金额'
,
'车辆贷款本金金额'
,
'附加产品融资贷款本金总额'
,
'贷款期限'
,
'还款账号'
,
'户名'
,
'开户行'
,
'还款计划表'
,
'见证人签字'
,
'见证人日期'
,
'ASP项目详情-重要条款'
,
'购置税校验'
,
'ASP项目详情'
,
SE_AFC_CON_FIELD
=
[
'合同编号-每页'
,
'ASP项目详情-重要条款'
,
'贷款本金金额-重要条款'
,
'附加产品融资贷款本金总额-重要条款'
,
'车架号'
,
'还款账号'
,
'户名'
,
'开户行'
,
'ASP项目详情'
,
'贷款本金金额'
,
'附加产品融资贷款本金总额'
,
'见证人签字'
,
'见证人日期'
,
'所购车辆价格-小写-重要条款'
,
'车架号-重要条款'
,
'贷款期限-重要条款'
,
'车辆贷款本金金额-重要条款'
,
'所购车辆价格'
,
'经销商'
,
'车辆贷款本金金额'
,
'贷款期限'
,
'还款计划表'
,
'购置税校验'
,
'合同编号-每页(no-asp)'
,
'无ASP产品'
]
# '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表'
SE_HIL_CON_1_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