pre settlement pos 接口更新
Showing
2 changed files
with
69 additions
and
65 deletions
| ... | @@ -293,6 +293,7 @@ class CompareInfoResult: | ... | @@ -293,6 +293,7 @@ class CompareInfoResult: |
| 293 | 293 | ||
| 294 | class CompareInfo: | 294 | class CompareInfo: |
| 295 | def __init__(self, pos_content): | 295 | def __init__(self, pos_content): |
| 296 | self.dealer_name = None | ||
| 296 | self.pos_content = pos_content | 297 | self.pos_content = pos_content |
| 297 | self.compare_info = {} | 298 | self.compare_info = {} |
| 298 | self.main_role_info = {} | 299 | self.main_role_info = {} |
| ... | @@ -305,7 +306,7 @@ class CompareInfo: | ... | @@ -305,7 +306,7 @@ class CompareInfo: |
| 305 | self.application_version = pos_content.get('applicationVersion', 0) | 306 | self.application_version = pos_content.get('applicationVersion', 0) |
| 306 | self.application_entity = pos_content.get('applicationEntity', '') | 307 | self.application_entity = pos_content.get('applicationEntity', '') |
| 307 | self.is_auto_settlement = pos_content.get('isAutoSettlement', '') | 308 | self.is_auto_settlement = pos_content.get('isAutoSettlement', '') |
| 308 | self.first_submmison_date = pos_content.get('firstSubmmisonDate', '') | 309 | self.first_submission_date = pos_content.get('firstSubmmisonDate', '') |
| 309 | self.product_group_name = pos_content.get('productGroup', '') | 310 | self.product_group_name = pos_content.get('productGroup', '') |
| 310 | self.account_holder_name = '' | 311 | self.account_holder_name = '' |
| 311 | 312 | ||
| ... | @@ -340,14 +341,13 @@ class CompareInfo: | ... | @@ -340,14 +341,13 @@ class CompareInfo: |
| 340 | 341 | ||
| 341 | def getApplicantInformation(self, individual_cus_info, corporate_cus_info): | 342 | def getApplicantInformation(self, individual_cus_info, corporate_cus_info): |
| 342 | individual_info_dict = {} | 343 | individual_info_dict = {} |
| 344 | legal_name = corporate_cus_info.get('legalRepName', '') | ||
| 345 | establishment_date = corporate_cus_info.get('establishmentDate', '') | ||
| 343 | for individual_info in individual_cus_info: | 346 | for individual_info in individual_cus_info: |
| 344 | all_id_num = [] | 347 | all_id_num = [] |
| 345 | license_dict = {} | 348 | license_dict = {} |
| 346 | customer_name = individual_info.get('customerName', '').strip() | 349 | customer_name = individual_info.get('customerName', '').strip() |
| 347 | self.customer_name = customer_name | 350 | self.customer_name = customer_name |
| 348 | legal_name = corporate_cus_info.get('legalRepName', '') | ||
| 349 | establishment_date = corporate_cus_info.get('establishmentDate', '') | ||
| 350 | |||
| 351 | # 车贷分离判断 | 351 | # 车贷分离判断 |
| 352 | is_corporate = individual_info.get('selfEmployedSubType', '') == 'Corporate' | 352 | is_corporate = individual_info.get('selfEmployedSubType', '') == 'Corporate' |
| 353 | if individual_info['applicantType'] == consts.APPLICANT_TYPE_ORDER[1] and is_corporate: | 353 | if individual_info['applicantType'] == consts.APPLICANT_TYPE_ORDER[1] and is_corporate: |
| ... | @@ -359,6 +359,7 @@ class CompareInfo: | ... | @@ -359,6 +359,7 @@ class CompareInfo: |
| 359 | license_en, is_prc = consts.SE_CMS_FIRST_ID_FIELD_MAPPING[individual_info['idType']] | 359 | license_en, is_prc = consts.SE_CMS_FIRST_ID_FIELD_MAPPING[individual_info['idType']] |
| 360 | # ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince'] | 360 | # ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince'] |
| 361 | id_num = decode_des(individual_info.get('idNum', ''), des_key) | 361 | id_num = decode_des(individual_info.get('idNum', ''), des_key) |
| 362 | # id_num = individual_info.get('idNum', '') | ||
| 362 | self.id_num = id_num | 363 | self.id_num = id_num |
| 363 | field_input = [('customerName', customer_name), | 364 | field_input = [('customerName', customer_name), |
| 364 | ('idNum', id_num), | 365 | ('idNum', id_num), |
| ... | @@ -415,7 +416,6 @@ class CompareInfo: | ... | @@ -415,7 +416,6 @@ class CompareInfo: |
| 415 | vehicle_info = {} | 416 | vehicle_info = {} |
| 416 | vehicle_field_input = [] | 417 | vehicle_field_input = [] |
| 417 | vehicle_status = vehicleInfo.get('vehicleStatus', '') | 418 | vehicle_status = vehicleInfo.get('vehicleStatus', '') |
| 418 | first_submission_date = self.first_submmison_date | ||
| 419 | vin_no = vehicleInfo.get('vinNo', '') | 419 | vin_no = vehicleInfo.get('vinNo', '') |
| 420 | self.vin_no = vin_no | 420 | self.vin_no = vin_no |
| 421 | # amount = str(vehicleInfo.get('vehiclePrice', '0.0')) | 421 | # amount = str(vehicleInfo.get('vehiclePrice', '0.0')) |
| ... | @@ -424,11 +424,10 @@ class CompareInfo: | ... | @@ -424,11 +424,10 @@ class CompareInfo: |
| 424 | dealer_name_list = vehicleInfo.get('dealer', '').split() | 424 | dealer_name_list = vehicleInfo.get('dealer', '').split() |
| 425 | dealer_name = '' if len(dealer_name_list) == 0 else dealer_name_list[-1] | 425 | dealer_name = '' if len(dealer_name_list) == 0 else dealer_name_list[-1] |
| 426 | self.dealer_name = dealer_name | 426 | self.dealer_name = dealer_name |
| 427 | issuer_dealer = vehicleInfo.get('fapiaoIssuerDealer', '').strip() | ||
| 428 | # 新车发票---------------------------------------------------------------------------------------------------------- | 427 | # 新车发票---------------------------------------------------------------------------------------------------------- |
| 429 | if vehicle_status == 'New': | 428 | if vehicle_status == 'New': |
| 430 | vehicle_field_input.append(('vinNo', vin_no)) | 429 | vehicle_field_input.append(('vinNo', vin_no)) |
| 431 | vehicle_field_input.append(('dealer', dealer_name if len(issuer_dealer) == 0 else issuer_dealer)) | 430 | # vehicle_field_input.append(('dealer', dealer_name if len(issuer_dealer) == 0 else issuer_dealer)) |
| 432 | vehicle_field_input.append(('vehicleTransactionAmount', amount)) | 431 | vehicle_field_input.append(('vehicleTransactionAmount', amount)) |
| 433 | 432 | ||
| 434 | if isinstance(self.company_info, tuple): | 433 | if isinstance(self.company_info, tuple): |
| ... | @@ -438,7 +437,8 @@ class CompareInfo: | ... | @@ -438,7 +437,8 @@ class CompareInfo: |
| 438 | else: | 437 | else: |
| 439 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], co_name if is_cdfl else main_name)) # 车贷分离 | 438 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], co_name if is_cdfl else main_name)) # 车贷分离 |
| 440 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], co_id if is_cdfl else main_id)) # 车贷分离 | 439 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], co_id if is_cdfl else main_id)) # 车贷分离 |
| 441 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[2], first_submission_date)) | 440 | |
| 441 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[2], first_submission_date)) | ||
| 442 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) | 442 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) |
| 443 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[4], consts.SE_FPL_VALUE)) | 443 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[4], consts.SE_FPL_VALUE)) |
| 444 | bhsj = float(amount) / 1.13 | 444 | bhsj = float(amount) / 1.13 |
| ... | @@ -447,10 +447,10 @@ class CompareInfo: | ... | @@ -447,10 +447,10 @@ class CompareInfo: |
| 447 | # format(float(amount) - bhsj, '.2f'), | 447 | # format(float(amount) - bhsj, '.2f'), |
| 448 | # consts.RESULT_Y | 448 | # consts.RESULT_Y |
| 449 | # ]))) | 449 | # ]))) |
| 450 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[7], format(bhsj, '.2f'))) | 450 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[7], format(bhsj, '.2f'))) |
| 451 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[8], format(float(amount) - bhsj, '.2f'))) | 451 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[8], format(float(amount) - bhsj, '.2f'))) |
| 452 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[9], consts.RESULT_Y)) | 452 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[9], consts.RESULT_Y)) |
| 453 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[6], consts.SE_LAYOUT_VALUE)) | 453 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[6], consts.SE_LAYOUT_VALUE)) |
| 454 | vehicle_field_input.append(("firstSubmmisonDate", self.first_submmison_date)) | 454 | vehicle_field_input.append(("firstSubmmisonDate", self.first_submmison_date)) |
| 455 | vehicle_field_input.append(("productGroupName", self.product_group_name)) | 455 | vehicle_field_input.append(("productGroupName", self.product_group_name)) |
| 456 | 456 | ||
| ... | @@ -646,56 +646,56 @@ class CompareInfo: | ... | @@ -646,56 +646,56 @@ class CompareInfo: |
| 646 | # AFC合同------------------------------------------------------------------------------------------------------ | 646 | # AFC合同------------------------------------------------------------------------------------------------------ |
| 647 | vehicle_principal_str = str(quotationtInfo.get('vehiclePrincipal', '0.0')) | 647 | vehicle_principal_str = str(quotationtInfo.get('vehiclePrincipal', '0.0')) |
| 648 | afc_contract_input = [] | 648 | afc_contract_input = [] |
| 649 | # if is_asp: | 649 | if is_asp: |
| 650 | # afc_contract_input = [ | 650 | afc_contract_input = [ |
| 651 | # (consts.SE_AFC_CON_FIELD[0], full_no), | 651 | (pos_consts.SE_AFC_CON_FIELD[0], full_no), |
| 652 | # ] | 652 | ] |
| 653 | # else: | 653 | else: |
| 654 | # afc_contract_input = [ | 654 | afc_contract_input = [ |
| 655 | # (consts.SE_AFC_CON_FIELD[23], full_no), | 655 | (pos_consts.SE_AFC_CON_FIELD[23], full_no), |
| 656 | # ] | 656 | ] |
| 657 | |||
| 658 | # afc_contract_input.extend([ | ||
| 659 | # (consts.SE_AFC_CON_FIELD[1], self.vehicleTransactionAmount), | ||
| 660 | # (consts.SE_AFC_CON_FIELD[2], self.vin_no), | ||
| 661 | # (consts.SE_AFC_CON_FIELD[3], | ||
| 662 | # str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | ||
| 663 | # (consts.SE_AFC_CON_FIELD[4], str(cms_info.get('terms', '0'))), | ||
| 664 | # (consts.SE_AFC_CON_FIELD[5], vehicle_principal_str), | ||
| 665 | # (consts.SE_AFC_CON_FIELD[6], | ||
| 666 | # str(quotationtInfo.get('associatedServicePrincipal', '0.0'))), | ||
| 667 | # (consts.SE_AFC_CON_FIELD[7], self.vehicleTransactionAmount), | ||
| 668 | # (consts.SE_AFC_CON_FIELD[8], self.vin_no), | ||
| 669 | # (consts.SE_AFC_CON_FIELD[9], self.dealer_name), | ||
| 670 | # (consts.SE_AFC_CON_FIELD[10], | ||
| 671 | # str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | ||
| 672 | # (consts.SE_AFC_CON_FIELD[11], vehicle_principal_str), | ||
| 673 | # (consts.SE_AFC_CON_FIELD[12], | ||
| 674 | # str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), | ||
| 675 | # (consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))), | ||
| 676 | # (consts.SE_AFC_CON_FIELD[14], self.account_no), | ||
| 677 | # (consts.SE_AFC_CON_FIELD[15], self.account_holder_name), | ||
| 678 | # (consts.SE_AFC_CON_FIELD[16], self.bank_name), | ||
| 679 | # (consts.SE_AFC_CON_FIELD[17], schedule_list_str), | ||
| 680 | # ]) | ||
| 681 | 657 | ||
| 682 | # if is_asp: | 658 | afc_contract_input.extend([ |
| 683 | # afc_contract_input.append((consts.SE_AFC_CON_FIELD[20], asp_list)) | 659 | (pos_consts.SE_AFC_CON_FIELD[1], self.vehicleTransactionAmount), |
| 684 | # afc_contract_input.append((consts.SE_AFC_CON_FIELD[22], asp_list)) | 660 | (pos_consts.SE_AFC_CON_FIELD[2], self.vin_no), |
| 685 | # # 购置税校验 | 661 | (pos_consts.SE_AFC_CON_FIELD[3], |
| 686 | # if isinstance(gzs_price, str): | 662 | str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), |
| 687 | # afc_contract_input.append( | 663 | (pos_consts.SE_AFC_CON_FIELD[4], str(cms_info.get('terms', '0'))), |
| 688 | # (consts.SE_AFC_CON_FIELD[21], tmp_gzs_list)) | 664 | (pos_consts.SE_AFC_CON_FIELD[5], vehicle_principal_str), |
| 689 | # # 非购置税非车辆保险的其他asp | 665 | (pos_consts.SE_AFC_CON_FIELD[6], |
| 690 | # if have_other_asp: | 666 | str(quotationtInfo.get('associatedServicePrincipal', '0.0'))), |
| 691 | # afc_contract_input.append((consts.SE_AFC_CON_FIELD[24], 'N')) | 667 | (pos_consts.SE_AFC_CON_FIELD[7], self.vehicleTransactionAmount), |
| 692 | # else: | 668 | (pos_consts.SE_AFC_CON_FIELD[8], self.vin_no), |
| 693 | # afc_contract_input.pop(5) | 669 | (pos_consts.SE_AFC_CON_FIELD[9], self.dealer_name), |
| 694 | # afc_contract_input.pop(5) | 670 | (pos_consts.SE_AFC_CON_FIELD[10], |
| 695 | # afc_contract_input.pop(9) | 671 | str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), |
| 696 | # afc_contract_input.pop(9) | 672 | (pos_consts.SE_AFC_CON_FIELD[11], vehicle_principal_str), |
| 697 | 673 | (pos_consts.SE_AFC_CON_FIELD[12], | |
| 698 | # contract_info[consts.AFC_CONTRACT_EN] = afc_contract_input | 674 | str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), |
| 675 | (pos_consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))), | ||
| 676 | (pos_consts.SE_AFC_CON_FIELD[14], self.account_no), | ||
| 677 | (pos_consts.SE_AFC_CON_FIELD[15], self.account_holder_name), | ||
| 678 | (pos_consts.SE_AFC_CON_FIELD[16], self.bank_name), | ||
| 679 | (pos_consts.SE_AFC_CON_FIELD[17], schedule_list_str), | ||
| 680 | ]) | ||
| 681 | |||
| 682 | if is_asp: | ||
| 683 | afc_contract_input.append((pos_consts.SE_AFC_CON_FIELD[20], asp_list)) | ||
| 684 | afc_contract_input.append((pos_consts.SE_AFC_CON_FIELD[22], asp_list)) | ||
| 685 | # 购置税校验 | ||
| 686 | if isinstance(gzs_price, str): | ||
| 687 | afc_contract_input.append( | ||
| 688 | (pos_consts.SE_AFC_CON_FIELD[21], tmp_gzs_list)) | ||
| 689 | # 非购置税非车辆保险的其他asp | ||
| 690 | if have_other_asp: | ||
| 691 | afc_contract_input.append((pos_consts.SE_AFC_CON_FIELD[24], 'N')) | ||
| 692 | else: | ||
| 693 | afc_contract_input.pop(5) | ||
| 694 | afc_contract_input.pop(5) | ||
| 695 | afc_contract_input.pop(9) | ||
| 696 | afc_contract_input.pop(9) | ||
| 697 | |||
| 698 | contract_info[pos_consts.AFC_CONTRACT_EN] = afc_contract_input | ||
| 699 | self.compare_info['contract'] = contract_info | 699 | self.compare_info['contract'] = contract_info |
| 700 | 700 | ||
| 701 | def getOther(self, quotationtInfo, insurance_info): | 701 | def getOther(self, quotationtInfo, insurance_info): | ... | ... |
| ... | @@ -45,10 +45,14 @@ HIL_CONTRACT_1_FIELD = 'hil_contract_1_ocr' | ... | @@ -45,10 +45,14 @@ HIL_CONTRACT_1_FIELD = 'hil_contract_1_ocr' |
| 45 | HIL_CONTRACT_2_FIELD = 'hil_contract_2_ocr' | 45 | HIL_CONTRACT_2_FIELD = 'hil_contract_2_ocr' |
| 46 | HIL_CONTRACT_3_FIELD = 'hil_contract_3_ocr' | 46 | HIL_CONTRACT_3_FIELD = 'hil_contract_3_ocr' |
| 47 | 47 | ||
| 48 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', | 48 | SE_AFC_CON_FIELD = ['合同编号-每页', 'ASP项目详情-重要条款', '贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', |
| 49 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', | 49 | '车架号', '还款账号', '户名', '开户行', 'ASP项目详情', '贷款本金金额', '附加产品融资贷款本金总额', |
| 50 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', | 50 | '见证人签字', '见证人日期', |
| 51 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情', | 51 | |
| 52 | '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款期限-重要条款', | ||
| 53 | '车辆贷款本金金额-重要条款', '所购车辆价格', '经销商', | ||
| 54 | '车辆贷款本金金额', '贷款期限', | ||
| 55 | '还款计划表', '购置税校验', | ||
| 52 | '合同编号-每页(no-asp)', '无ASP产品'] | 56 | '合同编号-每页(no-asp)', '无ASP产品'] |
| 53 | # '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表' | 57 | # '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表' |
| 54 | SE_HIL_CON_1_FIELD = ['合同编号-每页', '车辆识别代码', '车辆卖方', '车辆原始销售价格', '融资成本总额', '租期', | 58 | SE_HIL_CON_1_FIELD = ['合同编号-每页', '车辆识别代码', '车辆卖方', '车辆原始销售价格', '融资成本总额', '租期', | ... | ... |
-
Please register or sign in to post a comment