June SE part 2
Showing
3 changed files
with
33 additions
and
205 deletions
... | @@ -1409,7 +1409,7 @@ SE_CORPORATE_ALL_FIELD = ['companyName', 'legalRepName', 'firstIdNo', 'businessL | ... | @@ -1409,7 +1409,7 @@ SE_CORPORATE_ALL_FIELD = ['companyName', 'legalRepName', 'firstIdNo', 'businessL |
1409 | 'taxRegistrationCertificateNo', 'establishmentDate', 'businessLicenseDueDate'] | 1409 | 'taxRegistrationCertificateNo', 'establishmentDate', 'businessLicenseDueDate'] |
1410 | SE_NEW_FIELD = ['vinNo', 'dealer', 'vehicleTransactionAmount'] | 1410 | SE_NEW_FIELD = ['vinNo', 'dealer', 'vehicleTransactionAmount'] |
1411 | SE_USED_FIELD = ['vinNo', 'vehicleTransactionAmount'] | 1411 | SE_USED_FIELD = ['vinNo', 'vehicleTransactionAmount'] |
1412 | SE_NEW_ADD_FIELD = ['customerName', 'idNum', 'dateOfInvoice', 'stamp', '发票联', '发票真伪校验', '新旧版式'] | 1412 | SE_NEW_ADD_FIELD = ['customerName', 'idNum', 'dateOfInvoice', 'stamp', '发票联', '发票真伪校验', '新旧版式', '不含税价校验', '增值税额校验', '价税合计大小写检验'] |
1413 | SE_FPL_VALUE = '发票联' | 1413 | SE_FPL_VALUE = '发票联' |
1414 | SE_STAMP_VALUE = '有' | 1414 | SE_STAMP_VALUE = '有' |
1415 | SE_DYSYR_VALUE = '无' | 1415 | SE_DYSYR_VALUE = '无' |
... | @@ -1717,6 +1717,12 @@ SME_BL_COMPARE_LOGIC = { | ... | @@ -1717,6 +1717,12 @@ SME_BL_COMPARE_LOGIC = { |
1717 | 'businessLicenseDueDate': ('营业期限', 'se_date_compare', {'ocr_split': True, 'long': True, 'ocr_replace': True, 'today': True}, '公司营业期限疑似过期'), | 1717 | 'businessLicenseDueDate': ('营业期限', 'se_date_compare', {'ocr_split': True, 'long': True, 'ocr_replace': True, 'today': True}, '公司营业期限疑似过期'), |
1718 | } | 1718 | } |
1719 | 1719 | ||
1720 | ZW_METHOD = 'mvi_special' | ||
1721 | LOWER_AMOUNT_FIELD = '价税合计小写' | ||
1722 | UPPER_AMOUNT_FIELD = '价税合计大写' | ||
1723 | BHSJ_FIELD = '不含税价' | ||
1724 | ZZSSE_FIELD = '增值税税额' | ||
1725 | |||
1720 | MVI_COMPARE_LOGIC = { | 1726 | MVI_COMPARE_LOGIC = { |
1721 | 'vinNo': ('车辆识别代码', 'se_common_compare', {}, '发票车架号与系统不一致'), | 1727 | 'vinNo': ('车辆识别代码', 'se_common_compare', {}, '发票车架号与系统不一致'), |
1722 | 'dealer': ('销方名称', 'se_contain_compare_2', {'brackets_replace': True}, '发票销货单位名称与系统不一致'), | 1728 | 'dealer': ('销方名称', 'se_contain_compare_2', {'brackets_replace': True}, '发票销货单位名称与系统不一致'), |
... | @@ -1726,14 +1732,13 @@ MVI_COMPARE_LOGIC = { | ... | @@ -1726,14 +1732,13 @@ MVI_COMPARE_LOGIC = { |
1726 | 'dateOfInvoice': ('开票日期', 'se_date_compare_2', {'three_month': True}, '发票开票日期早于首次提交申请日期'), | 1732 | 'dateOfInvoice': ('开票日期', 'se_date_compare_2', {'three_month': True}, '发票开票日期早于首次提交申请日期'), |
1727 | 'stamp': ('销售单位章', 'se_common_compare', {}, '发票无章'), | 1733 | 'stamp': ('销售单位章', 'se_common_compare', {}, '发票无章'), |
1728 | '发票联': ('发票类型', 'se_common_compare', {}, '发票疑似非发票联'), | 1734 | '发票联': ('发票类型', 'se_common_compare', {}, '发票疑似非发票联'), |
1729 | '发票真伪校验': ('发票真伪校验', 'se_common_compare', {}, '发票疑似造假,需人工核算'), | 1735 | # '发票真伪校验': ('发票真伪校验', 'se_common_compare', {}, '发票疑似造假,需人工核算'), |
1736 | '不含税价校验': (BHSJ_FIELD, 'se_common_compare', {}, '发票不含税价疑似错误,需人工核算'), | ||
1737 | '增值税额校验': (ZZSSE_FIELD, 'se_common_compare', {}, '发票增值税额疑似错误,需人工核算'), | ||
1738 | '价税合计大小写检验': ('价税合计大小写检验', 'se_common_compare', {}, '发票价税合计大小写校验疑似错误,需人工核算'), | ||
1730 | '新旧版式': ('新旧版式', 'se_contain_compare_2', {}, '发票版本与打印版式不符'), | 1739 | '新旧版式': ('新旧版式', 'se_contain_compare_2', {}, '发票版本与打印版式不符'), |
1731 | } | 1740 | } |
1732 | ZW_METHOD = 'mvi_special' | 1741 | |
1733 | LOWER_AMOUNT_FIELD = '价税合计小写' | ||
1734 | UPPER_AMOUNT_FIELD = '价税合计大写' | ||
1735 | BHSJ_FIELD = '不含税价' | ||
1736 | ZZSSE_FIELD = '增值税税额' | ||
1737 | 1742 | ||
1738 | UCI_COMPARE_LOGIC = { | 1743 | UCI_COMPARE_LOGIC = { |
1739 | 'vinNo': ('车架号', 'se_common_compare', {}, '二手车发票车架号与系统不一致'), | 1744 | 'vinNo': ('车架号', 'se_common_compare', {}, '二手车发票车架号与系统不一致'), | ... | ... |
... | @@ -1022,11 +1022,14 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True): | ... | @@ -1022,11 +1022,14 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True): |
1022 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) | 1022 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) |
1023 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[4], consts.SE_FPL_VALUE)) | 1023 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[4], consts.SE_FPL_VALUE)) |
1024 | bhsj = float(amount) / 1.13 | 1024 | bhsj = float(amount) / 1.13 |
1025 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[5], consts.SPLIT_STR.join([ | 1025 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[5], consts.SPLIT_STR.join([ |
1026 | format(bhsj, '.2f'), | 1026 | # format(bhsj, '.2f'), |
1027 | format(float(amount) - bhsj, '.2f'), | 1027 | # format(float(amount) - bhsj, '.2f'), |
1028 | consts.RESULT_Y | 1028 | # consts.RESULT_Y |
1029 | ]))) | 1029 | # ]))) |
1030 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[7], format(bhsj, '.2f'))) | ||
1031 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[8], format(float(amount) - bhsj, '.2f'))) | ||
1032 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[9], consts.RESULT_Y)) | ||
1030 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[6], consts.SE_LAYOUT_VALUE)) | 1033 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[6], consts.SE_LAYOUT_VALUE)) |
1031 | vehicle_info[consts.MVI_EN] = vehicle_field_input | 1034 | vehicle_info[consts.MVI_EN] = vehicle_field_input |
1032 | # 二手车发票、交易凭证、绿本------------------------------------------------------------------------------------------ | 1035 | # 二手车发票、交易凭证、绿本------------------------------------------------------------------------------------------ |
... | @@ -1536,11 +1539,14 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals | ... | @@ -1536,11 +1539,14 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1536 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) | 1539 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) |
1537 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[4], consts.SE_FPL_VALUE)) | 1540 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[4], consts.SE_FPL_VALUE)) |
1538 | bhsj = float(amount) / 1.13 | 1541 | bhsj = float(amount) / 1.13 |
1539 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[5], consts.SPLIT_STR.join([ | 1542 | # vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[5], consts.SPLIT_STR.join([ |
1540 | format(bhsj, '.2f'), | 1543 | # format(bhsj, '.2f'), |
1541 | format(float(amount) - bhsj, '.2f'), | 1544 | # format(float(amount) - bhsj, '.2f'), |
1542 | consts.RESULT_Y | 1545 | # consts.RESULT_Y |
1543 | ]))) | 1546 | # ]))) |
1547 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[7], format(bhsj, '.2f'))) | ||
1548 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[8], format(float(amount) - bhsj, '.2f'))) | ||
1549 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[9], consts.RESULT_Y)) | ||
1544 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[6], consts.SE_LAYOUT_VALUE)) | 1550 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[6], consts.SE_LAYOUT_VALUE)) |
1545 | vehicle_info[consts.MVI_EN] = vehicle_field_input | 1551 | vehicle_info[consts.MVI_EN] = vehicle_field_input |
1546 | # 二手车发票、交易凭证、绿本------------------------------------------------------------------------------------------ | 1552 | # 二手车发票、交易凭证、绿本------------------------------------------------------------------------------------------ |
... | @@ -1906,182 +1912,6 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals | ... | @@ -1906,182 +1912,6 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1906 | return compare_info, cms_info.get('applicationVersion', 1), is_gsyh | 1912 | return compare_info, cms_info.get('applicationVersion', 1), is_gsyh |
1907 | 1913 | ||
1908 | 1914 | ||
1909 | def get_se_compare_info(last_obj, application_entity, detect_list): | ||
1910 | compare_info = {} | ||
1911 | individual_info_dict = {} | ||
1912 | main_role_info = {} | ||
1913 | for individual_info in json.loads(last_obj.individual_cus_info): | ||
1914 | if isinstance(individual_info.get('secondIdNum'), str): | ||
1915 | id_num = '{0}、{1}'.format(individual_info['idNum'], individual_info['secondIdNum']) | ||
1916 | else: | ||
1917 | id_num = individual_info['idNum'] | ||
1918 | main_role_info.setdefault(individual_info['applicantType'], []).append( | ||
1919 | (individual_info['customerName'], id_num, individual_info['idNum'])) | ||
1920 | |||
1921 | license_dict = {} | ||
1922 | |||
1923 | if individual_info['idType'] in consts.SE_FIRST_ID_FIELD_MAPPING: | ||
1924 | license_en, field_list = consts.SE_FIRST_ID_FIELD_MAPPING[individual_info['idType']] | ||
1925 | field_input = [] | ||
1926 | for field in field_list: | ||
1927 | if field in individual_info: | ||
1928 | field_input.append((field, individual_info[field])) | ||
1929 | license_dict[license_en] = field_input | ||
1930 | |||
1931 | if individual_info.get('secondIdType') in consts.SE_SECOND_ID_FIELD_MAPPING: | ||
1932 | second_license_en, second_field_list = consts.SE_SECOND_ID_FIELD_MAPPING[individual_info['secondIdType']] | ||
1933 | if second_license_en not in license_dict: | ||
1934 | second_field_input = [] | ||
1935 | for second_field, write_field in second_field_list: | ||
1936 | if second_field in individual_info: | ||
1937 | second_field_input.append((write_field, individual_info[second_field])) | ||
1938 | license_dict[second_license_en] = second_field_input | ||
1939 | |||
1940 | if individual_info['customerType'] == consts.CUSTOMER_TYPE[5]: | ||
1941 | sep_field_input = [] | ||
1942 | for sep_field, sep_write_field in consts.SE_SEP_FIELD: | ||
1943 | if sep_field in individual_info: | ||
1944 | sep_field_input.append((sep_write_field, individual_info[sep_field])) | ||
1945 | license_dict[consts.BL_EN] = sep_field_input | ||
1946 | |||
1947 | if len(license_dict) > 0: | ||
1948 | individual_info_dict.setdefault(individual_info['applicantType'], []).append(license_dict) | ||
1949 | |||
1950 | compare_info['individualCusInfo'] = individual_info_dict | ||
1951 | |||
1952 | dda_name_list = [] | ||
1953 | dda_num_list = [] | ||
1954 | for applicant_type in consts.APPLICANT_TYPE: | ||
1955 | if applicant_type in main_role_info: | ||
1956 | main_name, main_num, _ = main_role_info[applicant_type][0] | ||
1957 | hmh_name, _, hmh_id = main_role_info[applicant_type][0] | ||
1958 | break | ||
1959 | for applicant_type in consts.APPLICANT_TYPE[:2]: | ||
1960 | if applicant_type in main_role_info: | ||
1961 | for dda_name_part, _, dda_num_part in main_role_info[applicant_type]: | ||
1962 | dda_name_list.append(dda_name_part) | ||
1963 | dda_num_list.append(dda_num_part) | ||
1964 | dda_name = '、'.join(dda_name_list) | ||
1965 | dda_num = '、'.join(dda_num_list) | ||
1966 | del main_role_info | ||
1967 | |||
1968 | company_info = None | ||
1969 | if isinstance(last_obj.corporate_cus_info, str): | ||
1970 | corporate_info_dict = json.loads(last_obj.corporate_cus_info) | ||
1971 | corporate_info = {} | ||
1972 | company_info = (corporate_info_dict['companyName'], corporate_info_dict['businessLicenseNo']) | ||
1973 | if corporate_info_dict['firstIdType'] == consts.ID_TYPE[6]: | ||
1974 | bl_field_input = [] | ||
1975 | for bl_field in consts.SE_CORPORATE_ALL_FIELD: | ||
1976 | bl_field_input.append((bl_field, corporate_info_dict[bl_field])) | ||
1977 | corporate_info[consts.BL_EN] = bl_field_input | ||
1978 | else: | ||
1979 | if corporate_info_dict['firstIdType'] in consts.SE_FIRST_ID_FIELD_MAPPING: | ||
1980 | license_en, _ = consts.SE_FIRST_ID_FIELD_MAPPING[corporate_info_dict['firstIdType']] | ||
1981 | first_id_field_input = [] | ||
1982 | for first_id_field, first_id_write_field in consts.SE_CORPORATE_ID_FIELD: | ||
1983 | first_id_field_input.append((first_id_write_field, corporate_info_dict[first_id_field])) | ||
1984 | corporate_info[license_en] = first_id_field_input | ||
1985 | bl_field_input = [] | ||
1986 | for bl_field in consts.SE_CORPORATE_FIELD: | ||
1987 | bl_field_input.append((bl_field, corporate_info_dict[bl_field])) | ||
1988 | corporate_info[consts.BL_EN] = bl_field_input | ||
1989 | |||
1990 | compare_info['corporateCusInfo'] = corporate_info | ||
1991 | |||
1992 | vehicle_info_dict = json.loads(last_obj.vehicle_info) # TODO 车辆登记证 | ||
1993 | vehicle_info = {} | ||
1994 | vehicle_field_input = [] | ||
1995 | if vehicle_info_dict['vehicleStatus'] == 'New': | ||
1996 | for vehicle_field in consts.SE_NEW_FIELD: | ||
1997 | vehicle_field_input.append((vehicle_field, vehicle_info_dict[vehicle_field])) | ||
1998 | if isinstance(company_info, tuple): | ||
1999 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], company_info[0])) | ||
2000 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], company_info[1])) | ||
2001 | else: | ||
2002 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], main_name)) | ||
2003 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], main_num)) | ||
2004 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[2], last_obj.first_submmison_date)) | ||
2005 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) | ||
2006 | vehicle_info[consts.MVI_EN] = vehicle_field_input | ||
2007 | else: | ||
2008 | gb_field_input = [] | ||
2009 | gb34_field_input = [] | ||
2010 | jypz_field_input = [] | ||
2011 | for vehicle_field in consts.SE_USED_FIELD: | ||
2012 | vehicle_field_input.append((vehicle_field, vehicle_info_dict[vehicle_field])) | ||
2013 | for gb_field in consts.SE_GB_NEW_FIELD: | ||
2014 | gb_field_input.append((gb_field, vehicle_info_dict[gb_field])) | ||
2015 | if isinstance(company_info, tuple): | ||
2016 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], company_info[0])) | ||
2017 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], company_info[1])) | ||
2018 | jypz_field_input.append((consts.SE_NEW_ADD_FIELD[0], company_info[0])) | ||
2019 | jypz_field_input.append((consts.SE_NEW_ADD_FIELD[1], company_info[1])) | ||
2020 | gb34_field_input.append((consts.SE_GB_USED_FIELD[0], company_info[0])) | ||
2021 | gb34_field_input.append((consts.SE_GB_USED_FIELD[1], company_info[1])) | ||
2022 | else: | ||
2023 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[0], main_name)) | ||
2024 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[1], main_num)) | ||
2025 | jypz_field_input.append((consts.SE_NEW_ADD_FIELD[0], main_name)) | ||
2026 | jypz_field_input.append((consts.SE_NEW_ADD_FIELD[1], main_num)) | ||
2027 | gb34_field_input.append((consts.SE_GB_USED_FIELD[0], main_name)) | ||
2028 | gb34_field_input.append((consts.SE_GB_USED_FIELD[1], main_num)) | ||
2029 | gb34_field_input.append((consts.SE_GB_USED_FIELD[2], last_obj.first_submmison_date)) | ||
2030 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[2], last_obj.first_submmison_date)) | ||
2031 | vehicle_field_input.append((consts.SE_NEW_ADD_FIELD[3], consts.SE_STAMP_VALUE)) | ||
2032 | for jypz_field in consts.SE_USED_FIELD: | ||
2033 | jypz_field_input.append((jypz_field, vehicle_info_dict[jypz_field])) | ||
2034 | jypz_field_input.append((consts.SE_GB_USED_FIELD[-1], last_obj.first_submmison_date)) | ||
2035 | vehicle_info[consts.MVC_EN] = gb_field_input | ||
2036 | vehicle_info[consts.MVC34_EN] = gb34_field_input | ||
2037 | if not detect_list[0]: | ||
2038 | vehicle_info[consts.UCI_EN] = vehicle_field_input | ||
2039 | if not detect_list[1]: | ||
2040 | vehicle_info[consts.JYPZ_EN] = jypz_field_input | ||
2041 | if detect_list[0] and detect_list[1]: | ||
2042 | vehicle_info[consts.UCI_EN] = vehicle_field_input | ||
2043 | compare_info['vehicleInfo'] = vehicle_info | ||
2044 | |||
2045 | bank_info_dict = json.loads(last_obj.bank_info) | ||
2046 | bank_info = {} | ||
2047 | bank_field_input = [] | ||
2048 | for bank_field in consts.SE_BANK_FIELD: | ||
2049 | bank_field_input.append((bank_field, bank_info_dict[bank_field])) | ||
2050 | if '工商' in bank_info_dict.get(consts.SE_BANK_FIELD[-1], ''): | ||
2051 | is_gsyh = True | ||
2052 | else: | ||
2053 | is_gsyh = False | ||
2054 | bank_info[consts.BC_EN] = bank_field_input | ||
2055 | |||
2056 | if is_gsyh or not detect_list[-1]: | ||
2057 | dda_field_input = [] | ||
2058 | for dda_field in consts.SE_DDA_FIELD: | ||
2059 | if dda_field.startswith('applicationId'): | ||
2060 | dda_field_input.append((dda_field, last_obj.application_id)) | ||
2061 | elif dda_field == 'companyName': | ||
2062 | company_name = consts.HIL_COMPANY_NAME if application_entity in consts.HIL_SET else consts.AFC_COMPANY_NAME | ||
2063 | dda_field_input.append((dda_field, company_name)) | ||
2064 | elif dda_field == 'customerName': | ||
2065 | dda_field_input.append((dda_field, dda_name)) | ||
2066 | elif dda_field == 'idNum': | ||
2067 | dda_field_input.append((dda_field, dda_num)) | ||
2068 | else: | ||
2069 | dda_field_input.append((dda_field, bank_info_dict[dda_field])) | ||
2070 | bank_info[consts.DDA_EN] = dda_field_input | ||
2071 | compare_info['bankInfo'] = bank_info | ||
2072 | |||
2073 | if not detect_list[2]: | ||
2074 | other_info = {} | ||
2075 | hmh_field_input = [] | ||
2076 | hmh_field_input.append((consts.SE_HMH_FIELD[0], hmh_name)) | ||
2077 | hmh_field_input.append((consts.SE_HMH_FIELD[1], hmh_id)) | ||
2078 | hmh_field_input.append((consts.SE_HMH_FIELD[2], last_obj.application_id)) | ||
2079 | other_info[consts.HMH_EN] = hmh_field_input | ||
2080 | compare_info['other'] = other_info | ||
2081 | |||
2082 | return compare_info, is_gsyh | ||
2083 | |||
2084 | |||
2085 | def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto): | 1915 | def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto): |
2086 | # 主共借至少提供一个 | 1916 | # 主共借至少提供一个 |
2087 | # 有担保人,担保人必须提供。主共借没有时,修改comment:人工查看担保人亲属关系 | 1917 | # 有担保人,担保人必须提供。主共借没有时,修改comment:人工查看担保人亲属关系 |
... | @@ -2322,12 +2152,10 @@ def se_compare_license(license_en, ocr_res_dict, field_list): | ... | @@ -2322,12 +2152,10 @@ def se_compare_license(license_en, ocr_res_dict, field_list): |
2322 | break | 2152 | break |
2323 | 2153 | ||
2324 | for idx, (name, value) in enumerate(field_list): | 2154 | for idx, (name, value) in enumerate(field_list): |
2325 | if ocr_field == consts.MVI_OCR_FIELD and name == consts.SE_NEW_ADD_FIELD[5]: | 2155 | if ocr_field == consts.MVI_OCR_FIELD and name == consts.SE_NEW_ADD_FIELD[9]: |
2326 | ocr_str = getattr(cp, consts.ZW_METHOD)( | 2156 | ocr_str = getattr(cp, consts.ZW_METHOD)( |
2327 | ocr_res_list[res_idx].get(consts.LOWER_AMOUNT_FIELD, ''), | 2157 | ocr_res_list[res_idx].get(consts.LOWER_AMOUNT_FIELD, ''), |
2328 | ocr_res_list[res_idx].get(consts.UPPER_AMOUNT_FIELD, ''), | 2158 | ocr_res_list[res_idx].get(consts.UPPER_AMOUNT_FIELD, ''), |
2329 | ocr_res_list[res_idx].get(consts.BHSJ_FIELD, ''), | ||
2330 | ocr_res_list[res_idx].get(consts.ZZSSE_FIELD, '') | ||
2331 | ) | 2159 | ) |
2332 | else: | 2160 | else: |
2333 | ocr_str = ocr_res_list[res_idx].get(compare_logic[name][0]) | 2161 | ocr_str = ocr_res_list[res_idx].get(compare_logic[name][0]) |
... | @@ -2758,8 +2586,9 @@ def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto): | ... | @@ -2758,8 +2586,9 @@ def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto): |
2758 | for name, value, result, ocr_str, img_path, error_type, cn_reason in result_field_list: | 2586 | for name, value, result, ocr_str, img_path, error_type, cn_reason in result_field_list: |
2759 | total_fields += 1 | 2587 | total_fields += 1 |
2760 | if result == consts.RESULT_N: | 2588 | if result == consts.RESULT_N: |
2761 | failed_count += 1 | 2589 | if license_en != consts.MVI_EN or name != consts.SE_NEW_ADD_FIELD[9]: |
2762 | successful_at_this_level = False | 2590 | successful_at_this_level = False |
2591 | failed_count += 1 | ||
2763 | failure_field.append(name) | 2592 | failure_field.append(name) |
2764 | if isinstance(cn_reason, str): | 2593 | if isinstance(cn_reason, str): |
2765 | cn_reason_list.append(cn_reason) | 2594 | cn_reason_list.append(cn_reason) |
... | @@ -2868,14 +2697,8 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res | ... | @@ -2868,14 +2697,8 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res |
2868 | # 比对逻辑 | 2697 | # 比对逻辑 |
2869 | start_time = datetime.now() | 2698 | start_time = datetime.now() |
2870 | detect_list = se_result_detect(ocr_res_dict) | 2699 | detect_list = se_result_detect(ocr_res_dict) |
2871 | # if is_cms: | ||
2872 | # last_obj = rebuild_compare_info(last_obj, application_id) | ||
2873 | if is_cms: | ||
2874 | compare_info, application_version, is_gsyh = get_se_cms_compare_info( | 2700 | compare_info, application_version, is_gsyh = get_se_cms_compare_info( |
2875 | last_obj, application_entity, detect_list) | 2701 | last_obj, application_entity, detect_list) |
2876 | else: | ||
2877 | compare_info, is_gsyh = get_se_compare_info(last_obj, application_entity, detect_list) | ||
2878 | application_version = last_obj.application_version | ||
2879 | compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, cn_failure_reason_str, bs_failure_reason_str = se_compare_process(compare_info, ocr_res_dict, is_gsyh, False) | 2702 | compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, cn_failure_reason_str, bs_failure_reason_str = se_compare_process(compare_info, ocr_res_dict, is_gsyh, False) |
2880 | compare_log.info('{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format( | 2703 | compare_log.info('{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format( |
2881 | log_base, application_entity, application_id, ocr_res_id, compare_result)) | 2704 | log_base, application_entity, application_id, ocr_res_id, compare_result)) | ... | ... |
... | @@ -123,7 +123,7 @@ class Comparison: | ... | @@ -123,7 +123,7 @@ class Comparison: |
123 | ocr_output = None | 123 | ocr_output = None |
124 | return self.build_res(input_str == ocr_str), ocr_output | 124 | return self.build_res(input_str == ocr_str), ocr_output |
125 | 125 | ||
126 | def mvi_special(self, amount_lower_str, amount_upper_str, bhsj_str, zzsse_str): | 126 | def mvi_special(self, amount_lower_str, amount_upper_str): |
127 | # 不含税价, 增值税税额 | 127 | # 不含税价, 增值税税额 |
128 | try: | 128 | try: |
129 | if float(amount_lower_str) != rmb_handler.to_rmb_lower(amount_upper_str): | 129 | if float(amount_lower_str) != rmb_handler.to_rmb_lower(amount_upper_str): |
... | @@ -131,7 +131,7 @@ class Comparison: | ... | @@ -131,7 +131,7 @@ class Comparison: |
131 | except Exception: | 131 | except Exception: |
132 | return self.RESULT_N | 132 | return self.RESULT_N |
133 | else: | 133 | else: |
134 | return self.SPLIT_STR.join([bhsj_str, zzsse_str, self.RESULT_Y]) | 134 | return self.RESULT_Y |
135 | 135 | ||
136 | def rmb_compare(self, input_str, ocr_str, idx, **kwargs): | 136 | def rmb_compare(self, input_str, ocr_str, idx, **kwargs): |
137 | if not isinstance(ocr_str, str) or not isinstance(input_str, str): | 137 | if not isinstance(ocr_str, str) or not isinstance(input_str, str): | ... | ... |
-
Please register or sign in to post a comment