fix se bug
Showing
5 changed files
with
105 additions
and
86 deletions
| ... | @@ -1413,7 +1413,7 @@ SE_GB_USED_FIELD = ['customerName', 'idNum', 'date'] | ... | @@ -1413,7 +1413,7 @@ SE_GB_USED_FIELD = ['customerName', 'idNum', 'date'] |
| 1413 | SE_BS_FIELD = ['户名', '打印日期', '流水日期', '(担保人1)户名', '(担保人1)打印日期', '(担保人1)流水日期', '(担保人2)户名', '(担保人2)打印日期', '(担保人2)流水日期'] | 1413 | SE_BS_FIELD = ['户名', '打印日期', '流水日期', '(担保人1)户名', '(担保人1)打印日期', '(担保人1)流水日期', '(担保人2)户名', '(担保人2)打印日期', '(担保人2)流水日期'] |
| 1414 | SE_HMH_FIELD = ['借款人/承租人姓名', '借款人/承租人证件号', '申请号', '渠道', '签字'] | 1414 | SE_HMH_FIELD = ['借款人/承租人姓名', '借款人/承租人证件号', '申请号', '渠道', '签字'] |
| 1415 | SE_BD_FIELD = ['被保险人姓名', '被保险人证件号码', '车架号', '机动车损失保险金额', '第三者责任保险金额', '绝对免赔率', '保险起始日期', '保险截止日期', '保单章', '第一受益人', '保险费合计'] | 1415 | SE_BD_FIELD = ['被保险人姓名', '被保险人证件号码', '车架号', '机动车损失保险金额', '第三者责任保险金额', '绝对免赔率', '保险起始日期', '保险截止日期', '保单章', '第一受益人', '保险费合计'] |
| 1416 | JDMPV_VALUE = ['-', '--', '0%', '0.00', '/', '0'] | 1416 | JDMPV_VALUE = ['-', '--', '0%', '0.00', '/', '0', ''] |
| 1417 | 1417 | ||
| 1418 | SE_BANK_FIELD = ['accountNo', 'bankName'] | 1418 | SE_BANK_FIELD = ['accountNo', 'bankName'] |
| 1419 | SE_DDA_FIELD = ['applicationId(1)', 'applicationId(2)', 'bankName', 'companyName', 'customerName', 'idNum', 'accountHolderName', 'accountNo'] | 1419 | SE_DDA_FIELD = ['applicationId(1)', 'applicationId(2)', 'bankName', 'companyName', 'customerName', 'idNum', 'accountHolderName', 'accountNo'] |
| ... | @@ -1568,15 +1568,15 @@ ROLE_LIST = [ | ... | @@ -1568,15 +1568,15 @@ ROLE_LIST = [ |
| 1568 | ('保证人日期2', 'Guarantor', 1, '有', False, False), | 1568 | ('保证人日期2', 'Guarantor', 1, '有', False, False), |
| 1569 | ] | 1569 | ] |
| 1570 | 1570 | ||
| 1571 | # key, app_type, id_idx, field_idx, is_force, e_write | 1571 | # key, app_type, id_idx, field_idx, is_force, e_write, 公户跳过 |
| 1572 | ROLE_LIST_2 = [ | 1572 | ROLE_LIST_2 = [ |
| 1573 | ('抵押人', 'Borrower', 0, 0, True, True), | 1573 | ('抵押人', 'Borrower', 0, 0, True, True, False), |
| 1574 | ('抵押人证件号码', 'Borrower', 0, 2, True, True), | 1574 | ('抵押人证件号码', 'Borrower', 0, 2, True, True, False), |
| 1575 | ('抵押人签字', 'Borrower', 0, 0, True, False), | 1575 | ('抵押人签字', 'Borrower', 0, 0, True, False, False), |
| 1576 | 1576 | ||
| 1577 | ('抵押人配偶', 'Co-Borrower', 0, 0, False, True), | 1577 | ('抵押人配偶', 'Co-Borrower', 0, 0, False, True, True), |
| 1578 | ('抵押人配偶证件号码', 'Co-Borrower', 0, 2, False, True), | 1578 | ('抵押人配偶证件号码', 'Co-Borrower', 0, 2, False, True, True), |
| 1579 | ('抵押人配偶签字', 'Co-Borrower', 0, 0, False, False), | 1579 | ('抵押人配偶签字', 'Co-Borrower', 0, 0, False, False, True), |
| 1580 | ] | 1580 | ] |
| 1581 | 1581 | ||
| 1582 | ROLE_LIST_1 = [ | 1582 | ROLE_LIST_1 = [ |
| ... | @@ -1770,7 +1770,7 @@ HMH_COMPARE_LOGIC = { | ... | @@ -1770,7 +1770,7 @@ HMH_COMPARE_LOGIC = { |
| 1770 | 1770 | ||
| 1771 | BD_COMPARE_LOGIC = { | 1771 | BD_COMPARE_LOGIC = { |
| 1772 | '被保险人姓名': ('被保险人姓名', 'se_name_compare', {}, '保单被保险人姓名与系统不一致'), | 1772 | '被保险人姓名': ('被保险人姓名', 'se_name_compare', {}, '保单被保险人姓名与系统不一致'), |
| 1773 | '被保险人证件号码': ('被保险人证件号码', 'se_common_compare', {}, '保单身份证号需人工核查'), | 1773 | '被保险人证件号码': ('被保险人证件号码', 'se_common_compare', {'is_bd_id': True}, '保单身份证号需人工核查'), |
| 1774 | '车架号': ('车架号', 'se_common_compare', {}, '保单车架号与系统不一致'), | 1774 | '车架号': ('车架号', 'se_common_compare', {}, '保单车架号与系统不一致'), |
| 1775 | '机动车损失保险金额': ('机动车损失保险金额', 'se_amount_lte_compare', {}, '保单车损险异常'), | 1775 | '机动车损失保险金额': ('机动车损失保险金额', 'se_amount_lte_compare', {}, '保单车损险异常'), |
| 1776 | '第三者责任保险金额': ('机动车第三者责任保险金额', 'se_amount_lte_compare', {}, '保单三者险异常'), | 1776 | '第三者责任保险金额': ('机动车第三者责任保险金额', 'se_amount_lte_compare', {}, '保单三者险异常'), |
| ... | @@ -1789,9 +1789,9 @@ BS_COMPARE_LOGIC = { | ... | @@ -1789,9 +1789,9 @@ BS_COMPARE_LOGIC = { |
| 1789 | '打印日期': ('print_time', 'se_bs_print_date_compare', {}, '主共借人银行流水打印日期超过15天'), | 1789 | '打印日期': ('print_time', 'se_bs_print_date_compare', {}, '主共借人银行流水打印日期超过15天'), |
| 1790 | '(担保人1)打印日期': ('print_time', 'se_bs_print_date_compare', {}, '担保人1银行流水打印日期超过15天'), | 1790 | '(担保人1)打印日期': ('print_time', 'se_bs_print_date_compare', {}, '担保人1银行流水打印日期超过15天'), |
| 1791 | '(担保人2)打印日期': ('print_time', 'se_bs_print_date_compare', {}, '担保人2银行流水打印日期超过15天'), | 1791 | '(担保人2)打印日期': ('print_time', 'se_bs_print_date_compare', {}, '担保人2银行流水打印日期超过15天'), |
| 1792 | '流水日期': ('date', 'se_bs_date_compare', {}, '主共借人银行流水日期不满足3个月'), | 1792 | '流水日期': ('timedelta', 'se_bs_date_compare', {}, '主共借人银行流水日期不满足3个月'), |
| 1793 | '(担保人1)流水日期': ('date', 'se_bs_date_compare', {}, '担保人1银行流水日期不满足3个月'), | 1793 | '(担保人1)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人1银行流水日期不满足3个月'), |
| 1794 | '(担保人2)流水日期': ('date', 'se_bs_date_compare', {}, '担保人2银行流水日期不满足3个月'), | 1794 | '(担保人2)流水日期': ('timedelta', 'se_bs_date_compare', {}, '担保人2银行流水日期不满足3个月'), |
| 1795 | } | 1795 | } |
| 1796 | 1796 | ||
| 1797 | SPECIAL_REASON = '主共借人未提供银行流水,含担保人需人工查看直系亲属关系' | 1797 | SPECIAL_REASON = '主共借人未提供银行流水,含担保人需人工查看直系亲属关系' | ... | ... |
| ... | @@ -329,12 +329,18 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -329,12 +329,18 @@ class Command(BaseCommand, LoggerMixin): |
| 329 | # 保单 | 329 | # 保单 |
| 330 | if classify == consts.INSURANCE_CLASSIFY: | 330 | if classify == consts.INSURANCE_CLASSIFY: |
| 331 | product_result = ['', '', ''] | 331 | product_result = ['', '', ''] |
| 332 | min_char_count_1 = 1000 | ||
| 333 | min_char_count_2 = 1000 | ||
| 332 | for product in license_data.get('result', {}).get('productList', []): | 334 | for product in license_data.get('result', {}).get('productList', []): |
| 333 | name = product.get('name', {}).get('words', '') | 335 | name = product.get('name', {}).get('words', '') |
| 334 | if name.find('机动车损失') != -1: | 336 | if name.find('机动车损失') != -1 or name.find('汽车损失') != -1: |
| 337 | if len(name) < min_char_count_1: | ||
| 338 | min_char_count_1 = len(name) | ||
| 335 | product_result[0] = product.get('coverage', {}).get('words', '') | 339 | product_result[0] = product.get('coverage', {}).get('words', '') |
| 336 | product_result[2] = product.get('deductible_franchise', {}).get('words', '') | 340 | product_result[2] = product.get('deductible_franchise', {}).get('words', '') |
| 337 | elif name.find('第三者责任') != -1: | 341 | elif name.find('第三者责任') != -1: |
| 342 | if len(name) < min_char_count_2: | ||
| 343 | min_char_count_2 = len(name) | ||
| 338 | product_result[1] = product.get('coverage', {}).get('words', '') | 344 | product_result[1] = product.get('coverage', {}).get('words', '') |
| 339 | 345 | ||
| 340 | special_str = license_data.get('result', {}).get('1stBeneficiary', {}).get('words', '') | 346 | special_str = license_data.get('result', {}).get('1stBeneficiary', {}).get('words', '') |
| ... | @@ -840,19 +846,11 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -840,19 +846,11 @@ class Command(BaseCommand, LoggerMixin): |
| 840 | print_date = bs_info.get('print_time', '').strftime("%Y-%m-%d") | 846 | print_date = bs_info.get('print_time', '').strftime("%Y-%m-%d") |
| 841 | except Exception as e: | 847 | except Exception as e: |
| 842 | print_date = '' | 848 | print_date = '' |
| 843 | try: | ||
| 844 | start_date = bs_info.get('start_date', '').strftime("%Y-%m-%d") | ||
| 845 | except Exception as e: | ||
| 846 | start_date = '' | ||
| 847 | try: | ||
| 848 | end_date = bs_info.get('end_date', '').strftime("%Y-%m-%d") | ||
| 849 | except Exception as e: | ||
| 850 | end_date = '' | ||
| 851 | res.append( | 849 | res.append( |
| 852 | { | 850 | { |
| 853 | 'role': bs_info.get('role', ''), | 851 | 'role': bs_info.get('role', ''), |
| 854 | 'print_time': print_date, | 852 | 'print_time': print_date, |
| 855 | 'date': [start_date, end_date], | 853 | 'timedelta': bs_info.get('timedelta', ''), |
| 856 | } | 854 | } |
| 857 | ) | 855 | ) |
| 858 | return res | 856 | return res | ... | ... |
| ... | @@ -334,7 +334,7 @@ class BSWorkbook(Workbook): | ... | @@ -334,7 +334,7 @@ class BSWorkbook(Workbook): |
| 334 | metadata_rows.extend(code) | 334 | metadata_rows.extend(code) |
| 335 | 335 | ||
| 336 | if start_date is None or end_date is None: | 336 | if start_date is None or end_date is None: |
| 337 | timedelta = None | 337 | timedelta = '' |
| 338 | else: | 338 | else: |
| 339 | timedelta = (end_date - start_date).days | 339 | timedelta = (end_date - start_date).days |
| 340 | metadata_rows.extend( | 340 | metadata_rows.extend( |
| ... | @@ -344,11 +344,11 @@ class BSWorkbook(Workbook): | ... | @@ -344,11 +344,11 @@ class BSWorkbook(Workbook): |
| 344 | self.blank_row, | 344 | self.blank_row, |
| 345 | self.interest_keyword_header] | 345 | self.interest_keyword_header] |
| 346 | ) | 346 | ) |
| 347 | return metadata_rows, verify_highlight_row | 347 | return metadata_rows, verify_highlight_row, timedelta |
| 348 | 348 | ||
| 349 | def build_meta_sheet(self, role_name, card, confidence, code, verify_list, print_time, start_date, end_date, | 349 | def build_meta_sheet(self, role_name, card, confidence, code, verify_list, print_time, start_date, end_date, |
| 350 | res_count_tuple, is_verify_classify): | 350 | res_count_tuple, is_verify_classify): |
| 351 | metadata_rows, verify_highlight_row = self.build_metadata_rows( | 351 | metadata_rows, verify_highlight_row, timedelta = self.build_metadata_rows( |
| 352 | confidence, code, verify_list, print_time, start_date, end_date, res_count_tuple, is_verify_classify) | 352 | confidence, code, verify_list, print_time, start_date, end_date, res_count_tuple, is_verify_classify) |
| 353 | if not isinstance(role_name, str): | 353 | if not isinstance(role_name, str): |
| 354 | role_name = consts.UNKNOWN_ROLE | 354 | role_name = consts.UNKNOWN_ROLE |
| ... | @@ -367,7 +367,7 @@ class BSWorkbook(Workbook): | ... | @@ -367,7 +367,7 @@ class BSWorkbook(Workbook): |
| 367 | cell.fill = self.amount_fill | 367 | cell.fill = self.amount_fill |
| 368 | for cell in ms[4]: | 368 | for cell in ms[4]: |
| 369 | cell.fill = self.amount_fill | 369 | cell.fill = self.amount_fill |
| 370 | return ms | 370 | return ms, timedelta |
| 371 | 371 | ||
| 372 | @staticmethod | 372 | @staticmethod |
| 373 | def amount_format(amount_str): | 373 | def amount_format(amount_str): |
| ... | @@ -682,7 +682,7 @@ class BSWorkbook(Workbook): | ... | @@ -682,7 +682,7 @@ class BSWorkbook(Workbook): |
| 682 | # 2.元信息提取表 | 682 | # 2.元信息提取表 |
| 683 | confidence = self.get_confidence(max_find_count) | 683 | confidence = self.get_confidence(max_find_count) |
| 684 | is_verify_classify = classify in consts.BS_VERIFY_CLASSIFY | 684 | is_verify_classify = classify in consts.BS_VERIFY_CLASSIFY |
| 685 | ms = self.build_meta_sheet(role_name, | 685 | ms, timedelta = self.build_meta_sheet(role_name, |
| 686 | new_card, | 686 | new_card, |
| 687 | confidence, | 687 | confidence, |
| 688 | summary.get('code'), | 688 | summary.get('code'), |
| ... | @@ -693,6 +693,8 @@ class BSWorkbook(Workbook): | ... | @@ -693,6 +693,8 @@ class BSWorkbook(Workbook): |
| 693 | res_count_tuple, | 693 | res_count_tuple, |
| 694 | is_verify_classify) | 694 | is_verify_classify) |
| 695 | 695 | ||
| 696 | summary['timedelta'] = timedelta | ||
| 697 | |||
| 696 | # 3.创建月份表、提取/高亮关键行 | 698 | # 3.创建月份表、提取/高亮关键行 |
| 697 | # 倒序处理 | 699 | # 倒序处理 |
| 698 | is_reverse = True if sum(reverse_trend_list) > 0 else False | 700 | is_reverse = True if sum(reverse_trend_list) > 0 else False | ... | ... |
| ... | @@ -898,16 +898,11 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -898,16 +898,11 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 898 | license_en, is_prc = consts.SE_CMS_FIRST_ID_FIELD_MAPPING[id_info['idType']] | 898 | license_en, is_prc = consts.SE_CMS_FIRST_ID_FIELD_MAPPING[id_info['idType']] |
| 899 | # ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince'] | 899 | # ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince'] |
| 900 | id_num = decode_des(id_info.get('idNum', ''), des_key) | 900 | id_num = decode_des(id_info.get('idNum', ''), des_key) |
| 901 | field_input = [ | 901 | field_input = [('customerName', customer_name), ('idNum', id_num), |
| 902 | ('customerName', customer_name), | 902 | ('idExpiryDate', id_info.get('idExpiryDate', ''))] |
| 903 | ('idNum', id_num), | ||
| 904 | # ('dateOfBirth', date_of_birth), | ||
| 905 | # ('idExpiryDate', id_info.get('idExpiryDate', '')), | ||
| 906 | ] | ||
| 907 | if is_prc: | 903 | if is_prc: |
| 908 | # field_input.append(('hukouProvince', province)) | 904 | # field_input.append(('hukouProvince', province)) |
| 909 | field_input.append(('真伪', consts.IC_RES_MAPPING.get(1))) | 905 | # field_input.append(('真伪', consts.IC_RES_MAPPING.get(1))) |
| 910 | field_input.append(('idExpiryDate', id_info.get('idExpiryDate', ''))) | ||
| 911 | license_dict[license_en] = field_input | 906 | license_dict[license_en] = field_input |
| 912 | all_id_num.append(id_num) | 907 | all_id_num.append(id_num) |
| 913 | # 营业执照 -------------------------------------------------------------------------------------------------- | 908 | # 营业执照 -------------------------------------------------------------------------------------------------- |
| ... | @@ -979,7 +974,8 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -979,7 +974,8 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 979 | # 新车发票---------------------------------------------------------------------------------------------------------- | 974 | # 新车发票---------------------------------------------------------------------------------------------------------- |
| 980 | if vehicle_status == 'New': | 975 | if vehicle_status == 'New': |
| 981 | vehicle_field_input.append(('vinNo', vin_no)) | 976 | vehicle_field_input.append(('vinNo', vin_no)) |
| 982 | vehicle_field_input.append(('dealer', '、'.join([cms_info.get('dealerName', ''), cms_info.get('fapiaoIssuerDealer', '')]))) | 977 | vehicle_field_input.append( |
| 978 | ('dealer', '、'.join([cms_info.get('dealerName', ''), cms_info.get('fapiaoIssuerDealer', '')]))) | ||
| 983 | vehicle_field_input.append(('vehicleTransactionAmount', amount)) | 979 | vehicle_field_input.append(('vehicleTransactionAmount', amount)) |
| 984 | 980 | ||
| 985 | if isinstance(company_info, tuple): | 981 | if isinstance(company_info, tuple): |
| ... | @@ -1025,7 +1021,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1025,7 +1021,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1025 | # gb34_field_input.append((consts.SE_GB_USED_FIELD[1], main_num)) | 1021 | # gb34_field_input.append((consts.SE_GB_USED_FIELD[1], main_num)) |
| 1026 | # gb34_field_input.append((consts.SE_GB_USED_FIELD[2], first_submission_date)) | 1022 | # gb34_field_input.append((consts.SE_GB_USED_FIELD[2], first_submission_date)) |
| 1027 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[2], first_submission_date)) | 1023 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[2], first_submission_date)) |
| 1028 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) | 1024 | # # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) |
| 1029 | # jypz_field_input.append(('vinNo', vin_no)) | 1025 | # jypz_field_input.append(('vinNo', vin_no)) |
| 1030 | # jypz_field_input.append(('vehicleTransactionAmount', amount)) | 1026 | # jypz_field_input.append(('vehicleTransactionAmount', amount)) |
| 1031 | # jypz_field_input.append((consts.SE_GB_USED_FIELD[-1], first_submission_date)) | 1027 | # jypz_field_input.append((consts.SE_GB_USED_FIELD[-1], first_submission_date)) |
| ... | @@ -1044,7 +1040,12 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1044,7 +1040,12 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1044 | bank_info = {} | 1040 | bank_info = {} |
| 1045 | bank_name = cms_info.get('bankAccountDetails', {}).get('bankName', '') | 1041 | bank_name = cms_info.get('bankAccountDetails', {}).get('bankName', '') |
| 1046 | account_no = decode_des(cms_info.get('bankAccountDetails', {}).get('accountNo', ''), des_key) | 1042 | account_no = decode_des(cms_info.get('bankAccountDetails', {}).get('accountNo', ''), des_key) |
| 1043 | account_holder_name = cms_info.get('bankAccountDetails', {}).get('accountHolderName', '') | ||
| 1047 | is_gsyh = True if '工商' in bank_name else False | 1044 | is_gsyh = True if '工商' in bank_name else False |
| 1045 | |||
| 1046 | if isinstance(company_info, tuple) and company_info[0] == account_holder_name: | ||
| 1047 | pass | ||
| 1048 | else: | ||
| 1048 | bank_field_input = [ | 1049 | bank_field_input = [ |
| 1049 | ('accountNo', account_no), | 1050 | ('accountNo', account_no), |
| 1050 | ('bankName', bank_name), | 1051 | ('bankName', bank_name), |
| ... | @@ -1058,14 +1059,16 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1058,14 +1059,16 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1058 | # ('applicationId(1)', last_obj.application_id), | 1059 | # ('applicationId(1)', last_obj.application_id), |
| 1059 | # ('applicationId(2)', last_obj.application_id), | 1060 | # ('applicationId(2)', last_obj.application_id), |
| 1060 | # ('bankName', bank_name), | 1061 | # ('bankName', bank_name), |
| 1061 | # ('companyName', consts.HIL_COMPANY_NAME if application_entity in consts.HIL_SET else consts.AFC_COMPANY_NAME), | 1062 | # ('companyName', |
| 1063 | # consts.HIL_COMPANY_NAME if application_entity in consts.HIL_SET else consts.AFC_COMPANY_NAME), | ||
| 1062 | # ('customerName', dda_name), | 1064 | # ('customerName', dda_name), |
| 1063 | # ('idNum', dda_num), | 1065 | # ('idNum', dda_num), |
| 1064 | # ('accountHolderName', cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')), | 1066 | # ('accountHolderName', account_holder_name), |
| 1065 | # ('accountNo', account_no), | 1067 | # ('accountNo', account_no), |
| 1066 | # ] | 1068 | # ] |
| 1067 | # bank_info[consts.DDA_EN] = dda_field_input | 1069 | # bank_info[consts.DDA_EN] = dda_field_input |
| 1068 | compare_info['bankInfo'] = bank_info | 1070 | # if len(bank_info) > 0: |
| 1071 | # compare_info['bankInfo'] = bank_info | ||
| 1069 | 1072 | ||
| 1070 | # 银行流水 -------------------------------------------------------------------- | 1073 | # 银行流水 -------------------------------------------------------------------- |
| 1071 | if cms_info.get('autoApprovedDetails', {}).get('aaType', '') in ['CAA1', 'CAA2']: | 1074 | if cms_info.get('autoApprovedDetails', {}).get('aaType', '') in ['CAA1', 'CAA2']: |
| ... | @@ -1079,7 +1082,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1079,7 +1082,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1079 | bs_field_input = [ | 1082 | bs_field_input = [ |
| 1080 | (consts.SE_BS_FIELD[0], bs_role_list), | 1083 | (consts.SE_BS_FIELD[0], bs_role_list), |
| 1081 | (consts.SE_BS_FIELD[1], first_submission_date), | 1084 | (consts.SE_BS_FIELD[1], first_submission_date), |
| 1082 | (consts.SE_BS_FIELD[2], '90天'), | 1085 | (consts.SE_BS_FIELD[2], 90), |
| 1083 | ] | 1086 | ] |
| 1084 | 1087 | ||
| 1085 | dbr_bs_role_list = [] | 1088 | dbr_bs_role_list = [] |
| ... | @@ -1090,13 +1093,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1090,13 +1093,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1090 | bs_field_input.extend([ | 1093 | bs_field_input.extend([ |
| 1091 | (consts.SE_BS_FIELD[3], dbr_bs_role_list[0]), | 1094 | (consts.SE_BS_FIELD[3], dbr_bs_role_list[0]), |
| 1092 | (consts.SE_BS_FIELD[4], first_submission_date), | 1095 | (consts.SE_BS_FIELD[4], first_submission_date), |
| 1093 | (consts.SE_BS_FIELD[5], '90天'), | 1096 | (consts.SE_BS_FIELD[5], 90), |
| 1094 | ]) | 1097 | ]) |
| 1095 | if len(dbr_bs_role_list) >= 2: | 1098 | if len(dbr_bs_role_list) >= 2: |
| 1096 | bs_field_input.extend([ | 1099 | bs_field_input.extend([ |
| 1097 | (consts.SE_BS_FIELD[6], dbr_bs_role_list[1]), | 1100 | (consts.SE_BS_FIELD[6], dbr_bs_role_list[1]), |
| 1098 | (consts.SE_BS_FIELD[7], first_submission_date), | 1101 | (consts.SE_BS_FIELD[7], first_submission_date), |
| 1099 | (consts.SE_BS_FIELD[8], '90天'), | 1102 | (consts.SE_BS_FIELD[8], 90), |
| 1100 | ]) | 1103 | ]) |
| 1101 | bs_info[consts.BS_EN] = bs_field_input | 1104 | bs_info[consts.BS_EN] = bs_field_input |
| 1102 | compare_info['Bank Statement'] = bs_info | 1105 | compare_info['Bank Statement'] = bs_info |
| ... | @@ -1158,6 +1161,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1158,6 +1161,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1158 | ) | 1161 | ) |
| 1159 | 1162 | ||
| 1160 | # CMS Vehicle Price / 1.13 * 10 % | 1163 | # CMS Vehicle Price / 1.13 * 10 % |
| 1164 | gzs_list = [gzs_status] | ||
| 1161 | if gzs_status != consts.GZS_STATUS[1]: | 1165 | if gzs_status != consts.GZS_STATUS[1]: |
| 1162 | gzs_value = float(amount) * 0.1 / 1.13 | 1166 | gzs_value = float(amount) * 0.1 / 1.13 |
| 1163 | gzs_list.append(gzs_value) | 1167 | gzs_list.append(gzs_value) |
| ... | @@ -1219,11 +1223,12 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1219,11 +1223,12 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1219 | (consts.SE_HIL_CON_1_FIELD[2], vin_no), | 1223 | (consts.SE_HIL_CON_1_FIELD[2], vin_no), |
| 1220 | (consts.SE_HIL_CON_1_FIELD[3], cms_info.get('dealerName', '')), | 1224 | (consts.SE_HIL_CON_1_FIELD[3], cms_info.get('dealerName', '')), |
| 1221 | (consts.SE_HIL_CON_1_FIELD[4], amount), | 1225 | (consts.SE_HIL_CON_1_FIELD[4], amount), |
| 1222 | (consts.SE_HIL_CON_1_FIELD[5], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | 1226 | (consts.SE_HIL_CON_1_FIELD[5], |
| 1227 | str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | ||
| 1223 | (consts.SE_HIL_CON_1_FIELD[6], str(cms_info.get('terms', '0'))), | 1228 | (consts.SE_HIL_CON_1_FIELD[6], str(cms_info.get('terms', '0'))), |
| 1224 | (consts.SE_HIL_CON_1_FIELD[7], schedule_list_str), | 1229 | (consts.SE_HIL_CON_1_FIELD[7], schedule_list_str), |
| 1225 | (consts.SE_HIL_CON_1_FIELD[11], account_no), | 1230 | (consts.SE_HIL_CON_1_FIELD[11], account_no), |
| 1226 | (consts.SE_HIL_CON_1_FIELD[12], cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')), | 1231 | (consts.SE_HIL_CON_1_FIELD[12], account_holder_name), |
| 1227 | (consts.SE_HIL_CON_1_FIELD[13], bank_name), | 1232 | (consts.SE_HIL_CON_1_FIELD[13], bank_name), |
| 1228 | ] | 1233 | ] |
| 1229 | 1234 | ||
| ... | @@ -1239,7 +1244,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1239,7 +1244,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1239 | continue | 1244 | continue |
| 1240 | is_find = False | 1245 | is_find = False |
| 1241 | if app_type in main_role_info: | 1246 | if app_type in main_role_info: |
| 1242 | if len(main_role_info[app_type]) >= id_idx+1: | 1247 | if len(main_role_info[app_type]) >= id_idx + 1: |
| 1243 | is_find = True | 1248 | is_find = True |
| 1244 | if isinstance(field_idx, int): | 1249 | if isinstance(field_idx, int): |
| 1245 | hil_contract_1_input.append((key, main_role_info[app_type][id_idx][field_idx])) | 1250 | hil_contract_1_input.append((key, main_role_info[app_type][id_idx][field_idx])) |
| ... | @@ -1273,12 +1278,14 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1273,12 +1278,14 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1273 | (consts.SE_HIL_CON_2_FIELD[4], str(cms_info.get('terms', '0'))), | 1278 | (consts.SE_HIL_CON_2_FIELD[4], str(cms_info.get('terms', '0'))), |
| 1274 | ] | 1279 | ] |
| 1275 | 1280 | ||
| 1276 | for key, app_type, id_idx, field_idx, is_force, e_write in consts.ROLE_LIST_2: | 1281 | for key, app_type, id_idx, field_idx, is_force, e_write, co_skip in consts.ROLE_LIST_2: |
| 1282 | if co_skip and isinstance(company_info, tuple): | ||
| 1283 | continue | ||
| 1277 | if not e_write and not online_sign: | 1284 | if not e_write and not online_sign: |
| 1278 | continue | 1285 | continue |
| 1279 | is_find = False | 1286 | is_find = False |
| 1280 | if app_type in main_role_info: | 1287 | if app_type in main_role_info: |
| 1281 | if len(main_role_info[app_type]) >= id_idx+1: | 1288 | if len(main_role_info[app_type]) >= id_idx + 1: |
| 1282 | is_find = True | 1289 | is_find = True |
| 1283 | if isinstance(field_idx, int): | 1290 | if isinstance(field_idx, int): |
| 1284 | hil_contract_2_input.append((key, main_role_info[app_type][id_idx][field_idx])) | 1291 | hil_contract_2_input.append((key, main_role_info[app_type][id_idx][field_idx])) |
| ... | @@ -1290,25 +1297,29 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1290,25 +1297,29 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1290 | compare_info['contract'] = contract_info | 1297 | compare_info['contract'] = contract_info |
| 1291 | return compare_info, cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh | 1298 | return compare_info, cms_info.get('autoApprovedDetails', {}).get('aaType', ''), is_gsyh |
| 1292 | else: | 1299 | else: |
| 1293 | # AFC合同----------------------------------------------------------------------------------------------------------- | 1300 | # AFC合同------------------------------------------------------------------------------------------------------ |
| 1294 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) | 1301 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) |
| 1295 | afc_contract_input = [ | 1302 | afc_contract_input = [ |
| 1296 | (consts.SE_AFC_CON_FIELD[0], full_no), | 1303 | (consts.SE_AFC_CON_FIELD[0], full_no), |
| 1297 | (consts.SE_AFC_CON_FIELD[1], amount), | 1304 | (consts.SE_AFC_CON_FIELD[1], amount), |
| 1298 | (consts.SE_AFC_CON_FIELD[2], vin_no), | 1305 | (consts.SE_AFC_CON_FIELD[2], vin_no), |
| 1299 | (consts.SE_AFC_CON_FIELD[3], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | 1306 | (consts.SE_AFC_CON_FIELD[3], |
| 1307 | str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | ||
| 1300 | (consts.SE_AFC_CON_FIELD[4], str(cms_info.get('terms', '0'))), | 1308 | (consts.SE_AFC_CON_FIELD[4], str(cms_info.get('terms', '0'))), |
| 1301 | (consts.SE_AFC_CON_FIELD[5], vehicle_principal_str), | 1309 | (consts.SE_AFC_CON_FIELD[5], vehicle_principal_str), |
| 1302 | (consts.SE_AFC_CON_FIELD[6], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), | 1310 | (consts.SE_AFC_CON_FIELD[6], |
| 1311 | str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), | ||
| 1303 | (consts.SE_AFC_CON_FIELD[7], amount), | 1312 | (consts.SE_AFC_CON_FIELD[7], amount), |
| 1304 | (consts.SE_AFC_CON_FIELD[8], vin_no), | 1313 | (consts.SE_AFC_CON_FIELD[8], vin_no), |
| 1305 | (consts.SE_AFC_CON_FIELD[9], cms_info.get('dealerName', '')), | 1314 | (consts.SE_AFC_CON_FIELD[9], cms_info.get('dealerName', '')), |
| 1306 | (consts.SE_AFC_CON_FIELD[10], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | 1315 | (consts.SE_AFC_CON_FIELD[10], |
| 1316 | str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | ||
| 1307 | (consts.SE_AFC_CON_FIELD[11], vehicle_principal_str), | 1317 | (consts.SE_AFC_CON_FIELD[11], vehicle_principal_str), |
| 1308 | (consts.SE_AFC_CON_FIELD[12], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), | 1318 | (consts.SE_AFC_CON_FIELD[12], |
| 1319 | str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), | ||
| 1309 | (consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))), | 1320 | (consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))), |
| 1310 | (consts.SE_AFC_CON_FIELD[14], account_no), | 1321 | (consts.SE_AFC_CON_FIELD[14], account_no), |
| 1311 | (consts.SE_AFC_CON_FIELD[15], cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')), | 1322 | (consts.SE_AFC_CON_FIELD[15], account_holder_name), |
| 1312 | (consts.SE_AFC_CON_FIELD[16], bank_name), | 1323 | (consts.SE_AFC_CON_FIELD[16], bank_name), |
| 1313 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), | 1324 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), |
| 1314 | ] | 1325 | ] |
| ... | @@ -1329,7 +1340,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): | ... | @@ -1329,7 +1340,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity): |
| 1329 | continue | 1340 | continue |
| 1330 | is_find = False | 1341 | is_find = False |
| 1331 | if app_type in main_role_info: | 1342 | if app_type in main_role_info: |
| 1332 | if len(main_role_info[app_type]) >= id_idx+1: | 1343 | if len(main_role_info[app_type]) >= id_idx + 1: |
| 1333 | is_find = True | 1344 | is_find = True |
| 1334 | if isinstance(field_idx, int): | 1345 | if isinstance(field_idx, int): |
| 1335 | afc_contract_input.append((key, main_role_info[app_type][id_idx][field_idx])) | 1346 | afc_contract_input.append((key, main_role_info[app_type][id_idx][field_idx])) |
| ... | @@ -1373,16 +1384,11 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1373,16 +1384,11 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1373 | license_en, is_prc = consts.SE_CMS_FIRST_ID_FIELD_MAPPING[id_info['idType']] | 1384 | license_en, is_prc = consts.SE_CMS_FIRST_ID_FIELD_MAPPING[id_info['idType']] |
| 1374 | # ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince'] | 1385 | # ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince'] |
| 1375 | id_num = decode_des(id_info.get('idNum', ''), des_key) | 1386 | id_num = decode_des(id_info.get('idNum', ''), des_key) |
| 1376 | field_input = [ | 1387 | field_input = [('customerName', customer_name), ('idNum', id_num), |
| 1377 | ('customerName', customer_name), | 1388 | ('idExpiryDate', id_info.get('idExpiryDate', ''))] |
| 1378 | ('idNum', id_num), | 1389 | # if is_prc: |
| 1379 | # ('dateOfBirth', date_of_birth), | ||
| 1380 | # ('idExpiryDate', id_info.get('idExpiryDate', '')), | ||
| 1381 | ] | ||
| 1382 | if is_prc: | ||
| 1383 | # field_input.append(('hukouProvince', province)) | 1390 | # field_input.append(('hukouProvince', province)) |
| 1384 | field_input.append(('真伪', consts.IC_RES_MAPPING.get(1))) | 1391 | # field_input.append(('真伪', consts.IC_RES_MAPPING.get(1))) |
| 1385 | field_input.append(('idExpiryDate', id_info.get('idExpiryDate', ''))) | ||
| 1386 | license_dict[license_en] = field_input | 1392 | license_dict[license_en] = field_input |
| 1387 | all_id_num.append(id_num) | 1393 | all_id_num.append(id_num) |
| 1388 | # 营业执照 -------------------------------------------------------------------------------------------------- | 1394 | # 营业执照 -------------------------------------------------------------------------------------------------- |
| ... | @@ -1405,12 +1411,12 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1405,12 +1411,12 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1405 | company_info_list.append((customer_name, id_num, legal_name)) | 1411 | company_info_list.append((customer_name, id_num, legal_name)) |
| 1406 | 1412 | ||
| 1407 | # SME营业执照--------------------------------------------------------------------------------------------------- | 1413 | # SME营业执照--------------------------------------------------------------------------------------------------- |
| 1408 | if individual_info.get('customersubType', '').startswith('Self Employed'): | 1414 | # if individual_info.get('customersubType', '').startswith('Self Employed'): |
| 1409 | sep_field_input = [ | 1415 | # sep_field_input = [ |
| 1410 | ('legalRepName', customer_name), | 1416 | # ('legalRepName', customer_name), |
| 1411 | ('businessLicenseDueDate', ''), | 1417 | # ('businessLicenseDueDate', ''), |
| 1412 | ] | 1418 | # ] |
| 1413 | license_dict[consts.SME_BL_EN] = sep_field_input | 1419 | # license_dict[consts.SME_BL_EN] = sep_field_input |
| 1414 | 1420 | ||
| 1415 | if len(all_id_num) > 0: | 1421 | if len(all_id_num) > 0: |
| 1416 | main_role_info.setdefault(individual_info['applicantType'], []).append( | 1422 | main_role_info.setdefault(individual_info['applicantType'], []).append( |
| ... | @@ -1518,7 +1524,12 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1518,7 +1524,12 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1518 | bank_info = {} | 1524 | bank_info = {} |
| 1519 | bank_name = cms_info.get('bankAccountDetails', {}).get('bankName', '') | 1525 | bank_name = cms_info.get('bankAccountDetails', {}).get('bankName', '') |
| 1520 | account_no = decode_des(cms_info.get('bankAccountDetails', {}).get('accountNo', ''), des_key) | 1526 | account_no = decode_des(cms_info.get('bankAccountDetails', {}).get('accountNo', ''), des_key) |
| 1527 | account_holder_name = cms_info.get('bankAccountDetails', {}).get('accountHolderName', '') | ||
| 1521 | is_gsyh = True if '工商' in bank_name else False | 1528 | is_gsyh = True if '工商' in bank_name else False |
| 1529 | |||
| 1530 | if isinstance(company_info, tuple) and company_info[0] == account_holder_name: | ||
| 1531 | pass | ||
| 1532 | else: | ||
| 1522 | bank_field_input = [ | 1533 | bank_field_input = [ |
| 1523 | ('accountNo', account_no), | 1534 | ('accountNo', account_no), |
| 1524 | ('bankName', bank_name), | 1535 | ('bankName', bank_name), |
| ... | @@ -1535,10 +1546,11 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1535,10 +1546,11 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1535 | ('companyName', consts.HIL_COMPANY_NAME if application_entity in consts.HIL_SET else consts.AFC_COMPANY_NAME), | 1546 | ('companyName', consts.HIL_COMPANY_NAME if application_entity in consts.HIL_SET else consts.AFC_COMPANY_NAME), |
| 1536 | ('customerName', dda_name), | 1547 | ('customerName', dda_name), |
| 1537 | ('idNum', dda_num), | 1548 | ('idNum', dda_num), |
| 1538 | ('accountHolderName', cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')), | 1549 | ('accountHolderName', account_holder_name), |
| 1539 | ('accountNo', account_no), | 1550 | ('accountNo', account_no), |
| 1540 | ] | 1551 | ] |
| 1541 | bank_info[consts.DDA_EN] = dda_field_input | 1552 | bank_info[consts.DDA_EN] = dda_field_input |
| 1553 | if len(bank_info) > 0: | ||
| 1542 | compare_info['bankInfo'] = bank_info | 1554 | compare_info['bankInfo'] = bank_info |
| 1543 | 1555 | ||
| 1544 | # 银行流水 -------------------------------------------------------------------- | 1556 | # 银行流水 -------------------------------------------------------------------- |
| ... | @@ -1553,7 +1565,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1553,7 +1565,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1553 | bs_field_input = [ | 1565 | bs_field_input = [ |
| 1554 | (consts.SE_BS_FIELD[0], bs_role_list), | 1566 | (consts.SE_BS_FIELD[0], bs_role_list), |
| 1555 | (consts.SE_BS_FIELD[1], first_submission_date), | 1567 | (consts.SE_BS_FIELD[1], first_submission_date), |
| 1556 | (consts.SE_BS_FIELD[2], '90天'), | 1568 | (consts.SE_BS_FIELD[2], 90), |
| 1557 | ] | 1569 | ] |
| 1558 | 1570 | ||
| 1559 | dbr_bs_role_list = [] | 1571 | dbr_bs_role_list = [] |
| ... | @@ -1564,13 +1576,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1564,13 +1576,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1564 | bs_field_input.extend([ | 1576 | bs_field_input.extend([ |
| 1565 | (consts.SE_BS_FIELD[3], dbr_bs_role_list[0]), | 1577 | (consts.SE_BS_FIELD[3], dbr_bs_role_list[0]), |
| 1566 | (consts.SE_BS_FIELD[4], first_submission_date), | 1578 | (consts.SE_BS_FIELD[4], first_submission_date), |
| 1567 | (consts.SE_BS_FIELD[5], '90天'), | 1579 | (consts.SE_BS_FIELD[5], 90), |
| 1568 | ]) | 1580 | ]) |
| 1569 | if len(dbr_bs_role_list) >= 2: | 1581 | if len(dbr_bs_role_list) >= 2: |
| 1570 | bs_field_input.extend([ | 1582 | bs_field_input.extend([ |
| 1571 | (consts.SE_BS_FIELD[6], dbr_bs_role_list[1]), | 1583 | (consts.SE_BS_FIELD[6], dbr_bs_role_list[1]), |
| 1572 | (consts.SE_BS_FIELD[7], first_submission_date), | 1584 | (consts.SE_BS_FIELD[7], first_submission_date), |
| 1573 | (consts.SE_BS_FIELD[8], '90天'), | 1585 | (consts.SE_BS_FIELD[8], 90), |
| 1574 | ]) | 1586 | ]) |
| 1575 | bs_info[consts.BS_EN] = bs_field_input | 1587 | bs_info[consts.BS_EN] = bs_field_input |
| 1576 | compare_info['Bank Statement'] = bs_info | 1588 | compare_info['Bank Statement'] = bs_info |
| ... | @@ -1632,6 +1644,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1632,6 +1644,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1632 | ) | 1644 | ) |
| 1633 | 1645 | ||
| 1634 | # CMS Vehicle Price / 1.13 * 10 % | 1646 | # CMS Vehicle Price / 1.13 * 10 % |
| 1647 | gzs_list = [gzs_status] | ||
| 1635 | if gzs_status != consts.GZS_STATUS[1]: | 1648 | if gzs_status != consts.GZS_STATUS[1]: |
| 1636 | gzs_value = float(amount) * 0.1 / 1.13 | 1649 | gzs_value = float(amount) * 0.1 / 1.13 |
| 1637 | gzs_list.append(gzs_value) | 1650 | gzs_list.append(gzs_value) |
| ... | @@ -1656,7 +1669,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1656,7 +1669,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1656 | dszx_amount = '500000' | 1669 | dszx_amount = '500000' |
| 1657 | bd_field_input = [ | 1670 | bd_field_input = [ |
| 1658 | (consts.SE_BD_FIELD[0], hmh_name), | 1671 | (consts.SE_BD_FIELD[0], hmh_name), |
| 1659 | # (consts.SE_BD_FIELD[1], hmh_id), | 1672 | (consts.SE_BD_FIELD[1], hmh_id), |
| 1660 | (consts.SE_BD_FIELD[2], vin_no), | 1673 | (consts.SE_BD_FIELD[2], vin_no), |
| 1661 | (consts.SE_BD_FIELD[3], ssx_amount), | 1674 | (consts.SE_BD_FIELD[3], ssx_amount), |
| 1662 | (consts.SE_BD_FIELD[4], dszx_amount), | 1675 | (consts.SE_BD_FIELD[4], dszx_amount), |
| ... | @@ -1697,7 +1710,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1697,7 +1710,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1697 | (consts.SE_HIL_CON_1_FIELD[6], str(cms_info.get('terms', '0'))), | 1710 | (consts.SE_HIL_CON_1_FIELD[6], str(cms_info.get('terms', '0'))), |
| 1698 | (consts.SE_HIL_CON_1_FIELD[7], schedule_list_str), | 1711 | (consts.SE_HIL_CON_1_FIELD[7], schedule_list_str), |
| 1699 | (consts.SE_HIL_CON_1_FIELD[11], account_no), | 1712 | (consts.SE_HIL_CON_1_FIELD[11], account_no), |
| 1700 | (consts.SE_HIL_CON_1_FIELD[12], cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')), | 1713 | (consts.SE_HIL_CON_1_FIELD[12], account_holder_name), |
| 1701 | (consts.SE_HIL_CON_1_FIELD[13], bank_name), | 1714 | (consts.SE_HIL_CON_1_FIELD[13], bank_name), |
| 1702 | ] | 1715 | ] |
| 1703 | 1716 | ||
| ... | @@ -1747,7 +1760,9 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1747,7 +1760,9 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1747 | (consts.SE_HIL_CON_2_FIELD[4], str(cms_info.get('terms', '0'))), | 1760 | (consts.SE_HIL_CON_2_FIELD[4], str(cms_info.get('terms', '0'))), |
| 1748 | ] | 1761 | ] |
| 1749 | 1762 | ||
| 1750 | for key, app_type, id_idx, field_idx, is_force, e_write in consts.ROLE_LIST_2: | 1763 | for key, app_type, id_idx, field_idx, is_force, e_write, co_skip in consts.ROLE_LIST_2: |
| 1764 | if co_skip and isinstance(company_info, tuple): | ||
| 1765 | continue | ||
| 1751 | if not e_write and not online_sign: | 1766 | if not e_write and not online_sign: |
| 1752 | continue | 1767 | continue |
| 1753 | is_find = False | 1768 | is_find = False |
| ... | @@ -1764,7 +1779,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1764,7 +1779,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1764 | compare_info['contract'] = contract_info | 1779 | compare_info['contract'] = contract_info |
| 1765 | return compare_info, cms_info.get('applicationVersion', 1), is_gsyh | 1780 | return compare_info, cms_info.get('applicationVersion', 1), is_gsyh |
| 1766 | else: | 1781 | else: |
| 1767 | # AFC合同----------------------------------------------------------------------------------------------------------- | 1782 | # AFC合同------------------------------------------------------------------------------------------------------ |
| 1768 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) | 1783 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) |
| 1769 | afc_contract_input = [ | 1784 | afc_contract_input = [ |
| 1770 | (consts.SE_AFC_CON_FIELD[0], full_no), | 1785 | (consts.SE_AFC_CON_FIELD[0], full_no), |
| ... | @@ -1782,7 +1797,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1782,7 +1797,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1782 | (consts.SE_AFC_CON_FIELD[12], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), | 1797 | (consts.SE_AFC_CON_FIELD[12], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), |
| 1783 | (consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))), | 1798 | (consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))), |
| 1784 | (consts.SE_AFC_CON_FIELD[14], account_no), | 1799 | (consts.SE_AFC_CON_FIELD[14], account_no), |
| 1785 | (consts.SE_AFC_CON_FIELD[15], cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')), | 1800 | (consts.SE_AFC_CON_FIELD[15], account_holder_name), |
| 1786 | (consts.SE_AFC_CON_FIELD[16], bank_name), | 1801 | (consts.SE_AFC_CON_FIELD[16], bank_name), |
| 1787 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), | 1802 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), |
| 1788 | ] | 1803 | ] | ... | ... |
| ... | @@ -258,6 +258,9 @@ class Comparison: | ... | @@ -258,6 +258,9 @@ class Comparison: |
| 258 | return self.build_res(input_s == ocr_s) | 258 | return self.build_res(input_s == ocr_s) |
| 259 | 259 | ||
| 260 | def se_common_compare(self, input_str, ocr_str, **kwargs): | 260 | def se_common_compare(self, input_str, ocr_str, **kwargs): |
| 261 | if kwargs.get('is_bd_id', False): | ||
| 262 | if ocr_str == '': | ||
| 263 | return self.RESULT_Y | ||
| 261 | if kwargs.get('is_gsyh', False): | 264 | if kwargs.get('is_gsyh', False): |
| 262 | if ocr_str == '' or ocr_str is None: | 265 | if ocr_str == '' or ocr_str is None: |
| 263 | return self.RESULT_Y | 266 | return self.RESULT_Y |
| ... | @@ -517,16 +520,17 @@ class Comparison: | ... | @@ -517,16 +520,17 @@ class Comparison: |
| 517 | except Exception as e: | 520 | except Exception as e: |
| 518 | return self.RESULT_N | 521 | return self.RESULT_N |
| 519 | 522 | ||
| 520 | def se_bs_date_compare(self, input_str, ocr_str_list, **kwargs): | 523 | def se_bs_date_compare(self, input_str, ocr_str, **kwargs): |
| 521 | if isinstance(ocr_str_list, list) and len(ocr_str_list) == 2: | 524 | if not isinstance(ocr_str, int): |
| 522 | try: | 525 | try: |
| 523 | start_date = datetime.strptime(ocr_str_list[0], "%Y-%m-%d") | 526 | ocr_int = int(ocr_str) |
| 524 | end_date = datetime.strptime(ocr_str_list[1], "%Y-%m-%d") | ||
| 525 | if end_date >= start_date + relativedelta(months=3): | ||
| 526 | return self.RESULT_Y | ||
| 527 | return self.RESULT_N | ||
| 528 | except Exception as e: | 527 | except Exception as e: |
| 529 | return self.RESULT_N | 528 | return self.RESULT_N |
| 529 | else: | ||
| 530 | ocr_int = ocr_str | ||
| 531 | if ocr_int >= input_str: | ||
| 532 | return self.RESULT_Y | ||
| 533 | else: | ||
| 530 | return self.RESULT_N | 534 | return self.RESULT_N |
| 531 | 535 | ||
| 532 | 536 | ... | ... |
-
Please register or sign in to post a comment