add ht image
Showing
4 changed files
with
23 additions
and
59 deletions
| ... | @@ -1798,7 +1798,7 @@ HIL_CONTRACT_1_COMPARE_LOGIC = { | ... | @@ -1798,7 +1798,7 @@ HIL_CONTRACT_1_COMPARE_LOGIC = { |
| 1798 | '车辆卖方': ('车辆卖方', 'se_common_compare', {}, '售后回租合同车辆卖方与系统经销商不一致'), | 1798 | '车辆卖方': ('车辆卖方', 'se_common_compare', {}, '售后回租合同车辆卖方与系统经销商不一致'), |
| 1799 | '车辆原始销售价格': ('车辆原始销售价格', 'se_amount_str_compare', {}, '售后回租合同车辆原始销售价格与系统车辆价格不一致'), | 1799 | '车辆原始销售价格': ('车辆原始销售价格', 'se_amount_str_compare', {}, '售后回租合同车辆原始销售价格与系统车辆价格不一致'), |
| 1800 | '融资成本总额': ('融资成本总额', 'se_amount_str_compare', {}, '售后回租合同ASP融资成本总额与系统不一致'), | 1800 | '融资成本总额': ('融资成本总额', 'se_amount_str_compare', {}, '售后回租合同ASP融资成本总额与系统不一致'), |
| 1801 | '租期': ('租期', 'se_contain_compare_2', {}, '售后回租合同首页中贷款期限系统不一致'), | 1801 | '租期': ('租期', 'se_contain_compare', {}, '售后回租合同首页中贷款期限系统不一致'), |
| 1802 | '还款计划表': ('还款计划表', 'se_schedule_compare', {"value_idx": 3}, '售后回租合同还款计划表与系统不一致'), | 1802 | '还款计划表': ('还款计划表', 'se_schedule_compare', {"value_idx": 3}, '售后回租合同还款计划表与系统不一致'), |
| 1803 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, '售后回租合同ASP名称或者金额与系统不一致'), | 1803 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, '售后回租合同ASP名称或者金额与系统不一致'), |
| 1804 | '承租人法定代表人或授权代表': ('承租人法定代表人或授权代表', 'se_name_compare', {}, '售后回租合同承租人法定代表人或授权代表与系统不一致'), | 1804 | '承租人法定代表人或授权代表': ('承租人法定代表人或授权代表', 'se_name_compare', {}, '售后回租合同承租人法定代表人或授权代表与系统不一致'), | ... | ... |
| ... | @@ -298,62 +298,10 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -298,62 +298,10 @@ class Command(BaseCommand, LoggerMixin): |
| 298 | elif isinstance(sub_value[text_key], str): | 298 | elif isinstance(sub_value[text_key], str): |
| 299 | page_compare_dict[key][sub_key] = sub_value[text_key] | 299 | page_compare_dict[key][sub_key] = sub_value[text_key] |
| 300 | 300 | ||
| 301 | page_compare_dict[consts.IMG_PATH_KEY] = img_path | ||
| 301 | contract_result_compare.setdefault(classify, dict())[consts.ASP_KEY] = contract_dict.get(consts.ASP_KEY, False) | 302 | contract_result_compare.setdefault(classify, dict())[consts.ASP_KEY] = contract_dict.get(consts.ASP_KEY, False) |
| 302 | contract_result_compare.setdefault(classify, dict())[page_num_only] = page_compare_dict | 303 | contract_result_compare.setdefault(classify, dict())[page_num_only] = page_compare_dict |
| 303 | 304 | ||
| 304 | |||
| 305 | # def rebuild_result(self, ocr_data, classify, img_path): | ||
| 306 | # license_data = ocr_data.get('data') | ||
| 307 | # if not license_data: | ||
| 308 | # return | ||
| 309 | # if classify == consts.IC_CLASSIFY: | ||
| 310 | # rebuild_data_dict = {} | ||
| 311 | # card_type = license_data.get('type', '') | ||
| 312 | # is_ic = card_type.startswith('身份证') | ||
| 313 | # is_info_side = card_type.endswith('信息面') | ||
| 314 | # rebuild_data_dict['类别'] = '0' if is_ic else '1' | ||
| 315 | # if is_ic: | ||
| 316 | # field_map = consts.IC_MAP_0 if is_info_side else consts.IC_MAP_1 | ||
| 317 | # else: | ||
| 318 | # field_map = consts.RP_MAP_0 if is_info_side else consts.RP_MAP_1 | ||
| 319 | # for write_field, search_field in field_map: | ||
| 320 | # rebuild_data_dict[write_field] = license_data.get('words_result', {}).get(search_field, {}).get('words', '') | ||
| 321 | # if not is_info_side: | ||
| 322 | # start_time = license_data.get('words_result', {}).get('签发日期', {}).get('words', '') | ||
| 323 | # end_time = license_data.get('words_result', {}).get('失效日期', {}).get('words', '') | ||
| 324 | # rebuild_data_dict['有效期限'] = '{0}-{1}'.format(start_time, end_time) | ||
| 325 | # return [rebuild_data_dict] | ||
| 326 | # elif classify == consts.MVC_CLASSIFY: | ||
| 327 | # # license_data[consts.IMG_PATH_KEY] = img_path | ||
| 328 | # rebuild_data_dict = {} | ||
| 329 | # mvc_page = license_data.pop('page', 'VehicleRCI') | ||
| 330 | # mvc_res = license_data.pop('results', {}) | ||
| 331 | # if mvc_page == 'VehicleRegArea': | ||
| 332 | # rebuild_data_dict['机动车登记证书编号'] = mvc_res.get('机动车登记证书编号', {}).get('words', '') | ||
| 333 | # for register_info in mvc_res.get('登记信息', []): | ||
| 334 | # register_info.pop('register_type', None) | ||
| 335 | # register_info.pop('register_type_name', None) | ||
| 336 | # for cn_key, detail_dict in register_info.items(): | ||
| 337 | # rebuild_data_dict.setdefault(cn_key, []).append( | ||
| 338 | # detail_dict.get('words', '')) | ||
| 339 | # else: | ||
| 340 | # for cn_key, detail_dict in mvc_res.items(): | ||
| 341 | # rebuild_data_dict[cn_key] = detail_dict.get('words', '') | ||
| 342 | # del mvc_res | ||
| 343 | # return [rebuild_data_dict] | ||
| 344 | # elif classify == consts.MVI_CLASSIFY: | ||
| 345 | # rebuild_data_dict = {} | ||
| 346 | # mvi_res = license_data.pop('result', {}) | ||
| 347 | # for en_key, detail_dict in mvi_res.items(): | ||
| 348 | # rebuild_data_dict[detail_dict.get('chinese_key', '')] = detail_dict.get('words', '') | ||
| 349 | # return [rebuild_data_dict] | ||
| 350 | # elif classify == consts.UCI_CLASSIFY: | ||
| 351 | # rebuild_data_dict = {} | ||
| 352 | # mvi_res = license_data.pop('result', {}) | ||
| 353 | # for en_key, detail_dict in mvi_res.items(): | ||
| 354 | # rebuild_data_dict[detail_dict.get('chinese_key', '')] = detail_dict.get('words', '') | ||
| 355 | # return [rebuild_data_dict] | ||
| 356 | |||
| 357 | def license1_process(self, ocr_data, license_summary, classify, res_list, pno, ino, part_idx, img_path, do_dda, | 305 | def license1_process(self, ocr_data, license_summary, classify, res_list, pno, ino, part_idx, img_path, do_dda, |
| 358 | dda_id_bc_mapping): | 306 | dda_id_bc_mapping): |
| 359 | # 类别:'0'身份证, '1'居住证 | 307 | # 类别:'0'身份证, '1'居住证 |
| ... | @@ -924,8 +872,12 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -924,8 +872,12 @@ class Command(BaseCommand, LoggerMixin): |
| 924 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) | 872 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) |
| 925 | elif key2 is None: | 873 | elif key2 is None: |
| 926 | res[key] = page_info_dict.get(str(pno), {}).get(key1, '') | 874 | res[key] = page_info_dict.get(str(pno), {}).get(key1, '') |
| 875 | res.setdefault(consts.IMG_PATH_KEY, dict())[key] = page_info_dict.get(str(pno), {}).get( | ||
| 876 | consts.IMG_PATH_KEY, '') | ||
| 927 | else: | 877 | else: |
| 928 | res[key] = page_info_dict.get(str(pno), {}).get(key1, {}).get(key2, '') | 878 | res[key] = page_info_dict.get(str(pno), {}).get(key1, {}).get(key2, '') |
| 879 | res.setdefault(consts.IMG_PATH_KEY, dict())[key] = page_info_dict.get(str(pno), {}).get( | ||
| 880 | consts.IMG_PATH_KEY, '') | ||
| 929 | 881 | ||
| 930 | license_summary[classify] = [res] | 882 | license_summary[classify] = [res] |
| 931 | else: | 883 | else: |
| ... | @@ -936,14 +888,22 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -936,14 +888,22 @@ class Command(BaseCommand, LoggerMixin): |
| 936 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) | 888 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) |
| 937 | elif key2 is None: | 889 | elif key2 is None: |
| 938 | tmp_res = page_info_dict.get(str(pno1), {}).get(key1) | 890 | tmp_res = page_info_dict.get(str(pno1), {}).get(key1) |
| 891 | img_pno = pno1 | ||
| 939 | if tmp_res is None and isinstance(pno2, int): | 892 | if tmp_res is None and isinstance(pno2, int): |
| 940 | tmp_res = page_info_dict.get(str(pno2), {}).get(key1, '') | 893 | tmp_res = page_info_dict.get(str(pno2), {}).get(key1, '') |
| 894 | img_pno = pno1 | ||
| 941 | res[key] = tmp_res | 895 | res[key] = tmp_res |
| 896 | res.setdefault(consts.IMG_PATH_KEY, dict())[key] = page_info_dict.get(str(img_pno), {}).get( | ||
| 897 | consts.IMG_PATH_KEY, '') | ||
| 942 | else: | 898 | else: |
| 943 | tmp_res = page_info_dict.get(str(pno1), {}).get(key1, {}).get(key2) | 899 | tmp_res = page_info_dict.get(str(pno1), {}).get(key1, {}).get(key2) |
| 900 | img_pno = pno1 | ||
| 944 | if tmp_res is None and isinstance(pno2, int): | 901 | if tmp_res is None and isinstance(pno2, int): |
| 945 | tmp_res = page_info_dict.get(str(pno2), {}).get(key1, {}).get(key2, '') | 902 | tmp_res = page_info_dict.get(str(pno2), {}).get(key1, {}).get(key2, '') |
| 903 | img_pno = pno1 | ||
| 946 | res[key] = tmp_res | 904 | res[key] = tmp_res |
| 905 | res.setdefault(consts.IMG_PATH_KEY, dict())[key] = page_info_dict.get(str(img_pno), {}).get( | ||
| 906 | consts.IMG_PATH_KEY, '') | ||
| 947 | 907 | ||
| 948 | license_summary[classify] = [res] | 908 | license_summary[classify] = [res] |
| 949 | 909 | ||
| ... | @@ -1648,7 +1608,6 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1648,7 +1608,6 @@ class Command(BaseCommand, LoggerMixin): |
| 1648 | else: | 1608 | else: |
| 1649 | raise EDMSException(edms_exc) | 1609 | raise EDMSException(edms_exc) |
| 1650 | except Exception as e: | 1610 | except Exception as e: |
| 1651 | |||
| 1652 | report_list[0] = FailureReason.EDMS.value | 1611 | report_list[0] = FailureReason.EDMS.value |
| 1653 | doc.status = DocStatus.UPLOAD_FAILED.value | 1612 | doc.status = DocStatus.UPLOAD_FAILED.value |
| 1654 | self.online_log.warn('{0} [process failed (edms upload)] [task={1}] [error={2}]'.format( | 1613 | self.online_log.warn('{0} [process failed (edms upload)] [task={1}] [error={2}]'.format( | ... | ... |
| ... | @@ -1212,10 +1212,12 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1212,10 +1212,12 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
| 1212 | (consts.SE_HIL_CON_1_FIELD[5], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), | 1212 | (consts.SE_HIL_CON_1_FIELD[5], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), |
| 1213 | (consts.SE_HIL_CON_1_FIELD[6], str(cms_info.get('terms', '0'))), | 1213 | (consts.SE_HIL_CON_1_FIELD[6], str(cms_info.get('terms', '0'))), |
| 1214 | (consts.SE_HIL_CON_1_FIELD[7], schedule_list_str), | 1214 | (consts.SE_HIL_CON_1_FIELD[7], schedule_list_str), |
| 1215 | (consts.SE_HIL_CON_1_FIELD[8], asp_list), | ||
| 1216 | (consts.SE_HIL_CON_1_FIELD[9], gzs_list), | ||
| 1217 | ] | 1215 | ] |
| 1218 | 1216 | ||
| 1217 | if is_asp: | ||
| 1218 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[8], asp_list)) | ||
| 1219 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[9], gzs_list)) | ||
| 1220 | |||
| 1219 | if isinstance(company_info, tuple): | 1221 | if isinstance(company_info, tuple): |
| 1220 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[10], company_info[2])) | 1222 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[10], company_info[2])) |
| 1221 | 1223 | ||
| ... | @@ -1844,7 +1846,8 @@ def se_contract_compare(license_en, ocr_res_dict, strip_list): | ... | @@ -1844,7 +1846,8 @@ def se_contract_compare(license_en, ocr_res_dict, strip_list): |
| 1844 | ocr_str = empty_str | 1846 | ocr_str = empty_str |
| 1845 | reason = compare_logic[name][3] | 1847 | reason = compare_logic[name][3] |
| 1846 | 1848 | ||
| 1847 | img_path = empty_str | 1849 | # img_path = empty_str |
| 1850 | img_path = ocr_res.get(consts.IMG_PATH_KEY, {}).get(compare_logic[name][0], empty_str) if result == consts.RESULT_N else empty_str | ||
| 1848 | error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value | 1851 | error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value |
| 1849 | if isinstance(value, list): | 1852 | if isinstance(value, list): |
| 1850 | value = json.dumps(value, ensure_ascii=False) | 1853 | value = json.dumps(value, ensure_ascii=False) | ... | ... |
| ... | @@ -183,7 +183,9 @@ class Comparison: | ... | @@ -183,7 +183,9 @@ class Comparison: |
| 183 | schedule_list = [] | 183 | schedule_list = [] |
| 184 | for row_list in ocr_str_or_list: | 184 | for row_list in ocr_str_or_list: |
| 185 | tmp_str = "{1}{0}{2}".format( | 185 | tmp_str = "{1}{0}{2}".format( |
| 186 | self.SPLIT_STR, row_list[0], row_list[kwargs.get('value_idx', 1)].replace(',', '')) | 186 | self.SPLIT_STR, |
| 187 | row_list[0].replace('.', ''), | ||
| 188 | row_list[kwargs.get('value_idx', 1)].replace(',', '')) | ||
| 187 | schedule_list.append(tmp_str) | 189 | schedule_list.append(tmp_str) |
| 188 | return self.build_res(self.SCHEDULE_SPLIT_STR.join(schedule_list) == input_str) | 190 | return self.build_res(self.SCHEDULE_SPLIT_STR.join(schedule_list) == input_str) |
| 189 | else: | 191 | else: | ... | ... |
-
Please register or sign in to post a comment