SE
Showing
5 changed files
with
38 additions
and
44 deletions
... | @@ -1582,7 +1582,8 @@ SE_HIL_CON_MAP = { | ... | @@ -1582,7 +1582,8 @@ SE_HIL_CON_MAP = { |
1582 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', | 1582 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', |
1583 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', | 1583 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', |
1584 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', | 1584 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', |
1585 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情'] | 1585 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情', |
1586 | '合同编号-每页(no-asp)'] | ||
1586 | CON_BANK_FIELD = ['还款账号', '户名', '开户行'] | 1587 | CON_BANK_FIELD = ['还款账号', '户名', '开户行'] |
1587 | 1588 | ||
1588 | # '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表' | 1589 | # '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表' |
... | @@ -1943,6 +1944,7 @@ HIL_CONTRACT_3_COMPARE_LOGIC = { | ... | @@ -1943,6 +1944,7 @@ HIL_CONTRACT_3_COMPARE_LOGIC = { |
1943 | 1944 | ||
1944 | HT_COMPARE_LOGIC = { | 1945 | HT_COMPARE_LOGIC = { |
1945 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '合同编号与系统不一致'), | 1946 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '合同编号与系统不一致'), |
1947 | '合同编号-每页(no-asp)': ('合同编号-每页', 'se_list_compare', {'pop_last': True}, '合同编号与系统不一致'), | ||
1946 | '所购车辆价格-小写-重要条款': ('所购车辆价格-小写-重要条款', 'se_amount_str_compare', {}, '合同首页中车辆价格与系统不一致'), | 1948 | '所购车辆价格-小写-重要条款': ('所购车辆价格-小写-重要条款', 'se_amount_str_compare', {}, '合同首页中车辆价格与系统不一致'), |
1947 | '车架号-重要条款': ('车架号-重要条款', 'se_common_compare', {}, '合同首页中车架号与系统不一致'), | 1949 | '车架号-重要条款': ('车架号-重要条款', 'se_common_compare', {}, '合同首页中车架号与系统不一致'), |
1948 | '贷款本金金额-重要条款': ('贷款本金金额-重要条款', 'se_amount_str_compare', {}, '合同首页中贷款本金与系统不一致'), | 1950 | '贷款本金金额-重要条款': ('贷款本金金额-重要条款', 'se_amount_str_compare', {}, '合同首页中贷款本金与系统不一致'), | ... | ... |
... | @@ -310,7 +310,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -310,7 +310,7 @@ class Command(BaseCommand, LoggerMixin): |
310 | elif isinstance(sub_value[text_key], str): | 310 | elif isinstance(sub_value[text_key], str): |
311 | page_compare_dict[key][sub_key] = sub_value[text_key] | 311 | page_compare_dict[key][sub_key] = sub_value[text_key] |
312 | 312 | ||
313 | contract_result_compare.setdefault(classify, dict())[consts.ASP_KEY] = contract_dict.get(consts.ASP_KEY, False) | 313 | # contract_result_compare.setdefault(classify, dict())[consts.ASP_KEY] = contract_dict.get(consts.ASP_KEY, False) |
314 | # "position" = [xmin, ymin, xmax, ymax] | 314 | # "position" = [xmin, ymin, xmax, ymax] |
315 | contract_result_compare.setdefault(classify, dict())[page_num_only] = page_compare_dict | 315 | contract_result_compare.setdefault(classify, dict())[page_num_only] = page_compare_dict |
316 | 316 | ||
... | @@ -927,7 +927,8 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -927,7 +927,8 @@ class Command(BaseCommand, LoggerMixin): |
927 | for classify, page_info_dict in contract_result_compare.items(): | 927 | for classify, page_info_dict in contract_result_compare.items(): |
928 | if classify == consts.CONTRACT_CLASSIFY: | 928 | if classify == consts.CONTRACT_CLASSIFY: |
929 | res = {} | 929 | res = {} |
930 | is_asp = page_info_dict.get(consts.ASP_KEY, False) | 930 | # is_asp = page_info_dict.get(consts.ASP_KEY, False) |
931 | is_asp = True | ||
931 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): | 932 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): |
932 | pno = pno_asp if is_asp else pno_not_asp | 933 | pno = pno_asp if is_asp else pno_not_asp |
933 | if pno is None: | 934 | if pno is None: | ... | ... |
... | @@ -773,37 +773,6 @@ class SECompareView(GenericView): | ... | @@ -773,37 +773,6 @@ class SECompareView(GenericView): |
773 | # auto_obj.save() | 773 | # auto_obj.save() |
774 | return response.ok() | 774 | return response.ok() |
775 | 775 | ||
776 | # uniq_seq = content.get('uniqSeq') | ||
777 | # business_type = content.get('applicationEntity') | ||
778 | # application_id = content.get('applicationId') | ||
779 | # | ||
780 | # individual_cus_info = json.dumps(content.get('individualCusInfo')) | ||
781 | # vehicle_info = json.dumps(content.get('vehicleInfo')) | ||
782 | # insurance_info = json.dumps(content.get('insuranceInfo')) | ||
783 | # bank_info = json.dumps(content.get('bankInfo')) | ||
784 | # quotationt_info = json.dumps(content.get('quotationtInfo')) | ||
785 | # corporate_cus_info = json.dumps(content.get('corporateCusInfo')) if isinstance( | ||
786 | # content.get('corporateCusInfo'), dict) else None | ||
787 | |||
788 | # comparison_class = HILSEComparisonInfo if business_type in consts.HIL_SET else AFCSEComparisonInfo | ||
789 | # comparison_class.objects.create( | ||
790 | # uniq_seq=uniq_seq, | ||
791 | # application_id=application_id, | ||
792 | # application_version=content.get('applicationVersion'), | ||
793 | # customer_type=content.get('customerType'), | ||
794 | # first_submmison_date=content.get('firstSubmmisonDate'), | ||
795 | # property_doc_policy=content.get('propertyDocumentPolicy', None), | ||
796 | # individual_cus_info=individual_cus_info, | ||
797 | # corporate_cus_info=corporate_cus_info, | ||
798 | # vehicle_info=vehicle_info, | ||
799 | # insurance_info=insurance_info, | ||
800 | # bank_info=bank_info, | ||
801 | # quotationt_info=quotationt_info | ||
802 | # ) | ||
803 | # 触发比对 | ||
804 | # compare.apply_async((application_id, business_type, uniq_seq, None, False, False), | ||
805 | # queue='queue_compare') | ||
806 | |||
807 | post.openapi_doc = ''' | 776 | post.openapi_doc = ''' |
808 | tags: [info] | 777 | tags: [info] |
809 | summary: POS上传SE比对信息 | 778 | summary: POS上传SE比对信息 | ... | ... |
... | @@ -1343,8 +1343,17 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True): | ... | @@ -1343,8 +1343,17 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True): |
1343 | else: | 1343 | else: |
1344 | # AFC合同------------------------------------------------------------------------------------------------------ | 1344 | # AFC合同------------------------------------------------------------------------------------------------------ |
1345 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) | 1345 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) |
1346 | afc_contract_input = [ | 1346 | |
1347 | (consts.SE_AFC_CON_FIELD[0], full_no), | 1347 | if is_asp: |
1348 | afc_contract_input = [ | ||
1349 | (consts.SE_AFC_CON_FIELD[0], full_no), | ||
1350 | ] | ||
1351 | else: | ||
1352 | afc_contract_input = [ | ||
1353 | (consts.SE_AFC_CON_FIELD[23], full_no), | ||
1354 | ] | ||
1355 | |||
1356 | afc_contract_input.extend([ | ||
1348 | (consts.SE_AFC_CON_FIELD[1], amount), | 1357 | (consts.SE_AFC_CON_FIELD[1], amount), |
1349 | (consts.SE_AFC_CON_FIELD[2], vin_no), | 1358 | (consts.SE_AFC_CON_FIELD[2], vin_no), |
1350 | (consts.SE_AFC_CON_FIELD[3], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | 1359 | (consts.SE_AFC_CON_FIELD[3], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), |
... | @@ -1362,7 +1371,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True): | ... | @@ -1362,7 +1371,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True): |
1362 | (consts.SE_AFC_CON_FIELD[15], account_holder_name), | 1371 | (consts.SE_AFC_CON_FIELD[15], account_holder_name), |
1363 | (consts.SE_AFC_CON_FIELD[16], bank_name), | 1372 | (consts.SE_AFC_CON_FIELD[16], bank_name), |
1364 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), | 1373 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), |
1365 | ] | 1374 | ]) |
1366 | 1375 | ||
1367 | if is_asp: | 1376 | if is_asp: |
1368 | afc_contract_input.append((consts.SE_AFC_CON_FIELD[20], asp_list)) | 1377 | afc_contract_input.append((consts.SE_AFC_CON_FIELD[20], asp_list)) |
... | @@ -1732,7 +1741,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals | ... | @@ -1732,7 +1741,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1732 | fp_campaign = cms_info.get('fpCampaign', '') | 1741 | fp_campaign = cms_info.get('fpCampaign', '') |
1733 | fp_group = cms_info.get('fpGroup', '') | 1742 | fp_group = cms_info.get('fpGroup', '') |
1734 | insurance_type = cms_info.get('insuranceDetails', {}).get('insuranceType', '') | 1743 | insurance_type = cms_info.get('insuranceDetails', {}).get('insuranceType', '') |
1735 | if insurance_type == 'Waive Insurance' and isinstance(insurance_price, str): | 1744 | if isinstance(insurance_price, str): |
1736 | is_insurance = 1 | 1745 | is_insurance = 1 |
1737 | elif insurance_type == 'Comprehensive Insurance': | 1746 | elif insurance_type == 'Comprehensive Insurance': |
1738 | is_insurance = 2 | 1747 | is_insurance = 2 |
... | @@ -1864,8 +1873,16 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals | ... | @@ -1864,8 +1873,16 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1864 | else: | 1873 | else: |
1865 | # AFC合同------------------------------------------------------------------------------------------------------ | 1874 | # AFC合同------------------------------------------------------------------------------------------------------ |
1866 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) | 1875 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) |
1867 | afc_contract_input = [ | 1876 | if is_asp: |
1868 | (consts.SE_AFC_CON_FIELD[0], full_no), | 1877 | afc_contract_input = [ |
1878 | (consts.SE_AFC_CON_FIELD[0], full_no), | ||
1879 | ] | ||
1880 | else: | ||
1881 | afc_contract_input = [ | ||
1882 | (consts.SE_AFC_CON_FIELD[23], full_no), | ||
1883 | ] | ||
1884 | |||
1885 | afc_contract_input.extend([ | ||
1869 | (consts.SE_AFC_CON_FIELD[1], amount), | 1886 | (consts.SE_AFC_CON_FIELD[1], amount), |
1870 | (consts.SE_AFC_CON_FIELD[2], vin_no), | 1887 | (consts.SE_AFC_CON_FIELD[2], vin_no), |
1871 | (consts.SE_AFC_CON_FIELD[3], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | 1888 | (consts.SE_AFC_CON_FIELD[3], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), |
... | @@ -1883,7 +1900,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals | ... | @@ -1883,7 +1900,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1883 | (consts.SE_AFC_CON_FIELD[15], account_holder_name), | 1900 | (consts.SE_AFC_CON_FIELD[15], account_holder_name), |
1884 | (consts.SE_AFC_CON_FIELD[16], bank_name), | 1901 | (consts.SE_AFC_CON_FIELD[16], bank_name), |
1885 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), | 1902 | (consts.SE_AFC_CON_FIELD[17], schedule_list_str), |
1886 | ] | 1903 | ]) |
1887 | 1904 | ||
1888 | if is_asp: | 1905 | if is_asp: |
1889 | afc_contract_input.append((consts.SE_AFC_CON_FIELD[20], asp_list)) | 1906 | afc_contract_input.append((consts.SE_AFC_CON_FIELD[20], asp_list)) | ... | ... |
... | @@ -173,9 +173,14 @@ class Comparison: | ... | @@ -173,9 +173,14 @@ class Comparison: |
173 | return self.RESULT_Y | 173 | return self.RESULT_Y |
174 | return self.RESULT_N | 174 | return self.RESULT_N |
175 | else: | 175 | else: |
176 | for item in ocr_str_or_list: | 176 | if kwargs.get('pop_last', False): |
177 | if item != input_str_or_list: | 177 | for item in ocr_str_or_list[:-1]: |
178 | return self.RESULT_N | 178 | if item != input_str_or_list: |
179 | return self.RESULT_N | ||
180 | else: | ||
181 | for item in ocr_str_or_list: | ||
182 | if item != input_str_or_list: | ||
183 | return self.RESULT_N | ||
179 | return self.RESULT_Y | 184 | return self.RESULT_Y |
180 | else: | 185 | else: |
181 | return self.RESULT_N | 186 | return self.RESULT_N | ... | ... |
-
Please register or sign in to post a comment