8e146fd9 by 周伟奇

add sme bl

1 parent 1d776432
...@@ -1196,6 +1196,8 @@ RESULT_MAPPING = { ...@@ -1196,6 +1196,8 @@ RESULT_MAPPING = {
1196 CONTRACT_CLASSIFY: HT_FIELD, 1196 CONTRACT_CLASSIFY: HT_FIELD,
1197 } 1197 }
1198 1198
1199 CA_ADD_COMPARE_FIELDS = (IC_OCR_FIELD, BL_OCR_FIELD)
1200
1199 COMPARE_FIELDS = (MVI_OCR_FIELD, 1201 COMPARE_FIELDS = (MVI_OCR_FIELD,
1200 IC_OCR_FIELD, 1202 IC_OCR_FIELD,
1201 RP_OCR_FIELD, 1203 RP_OCR_FIELD,
...@@ -1488,6 +1490,7 @@ PP_EN = 'Passport' ...@@ -1488,6 +1490,7 @@ PP_EN = 'Passport'
1488 EEP_EN = 'Resident Permit to Mainland' 1490 EEP_EN = 'Resident Permit to Mainland'
1489 RP_EN = 'Resident ID' 1491 RP_EN = 'Resident ID'
1490 BL_EN = 'Business permit' 1492 BL_EN = 'Business permit'
1493 SME_BL_EN = 'SME Business permit'
1491 MVI_EN = 'newCar Invoice' 1494 MVI_EN = 'newCar Invoice'
1492 UCI_EN = 'usedCar Invoice' 1495 UCI_EN = 'usedCar Invoice'
1493 MVC_EN = 'Green Book(1/2)' 1496 MVC_EN = 'Green Book(1/2)'
...@@ -1498,7 +1501,7 @@ HMH_EN = 'Mortgage Waiver Letter' ...@@ -1498,7 +1501,7 @@ HMH_EN = 'Mortgage Waiver Letter'
1498 JYPZ_EN = 'Used Car Document' 1501 JYPZ_EN = 'Used Car Document'
1499 AFC_CONTRACT_EN = 'AFC Contract' 1502 AFC_CONTRACT_EN = 'AFC Contract'
1500 1503
1501 SKIP_CARD = {ID_EN, RP_EN} 1504 SKIP_CARD = {ID_EN, RP_EN, SME_BL_EN}
1502 1505
1503 1506
1504 ID_COMPARE_LOGIC = { 1507 ID_COMPARE_LOGIC = {
...@@ -1555,6 +1558,11 @@ BL_COMPARE_LOGIC = { ...@@ -1555,6 +1558,11 @@ BL_COMPARE_LOGIC = {
1555 'registeredCapital': ('注册资本', 'se_rmb_compare', {}, '营业执照注册资本与系统不一致'), 1558 'registeredCapital': ('注册资本', 'se_rmb_compare', {}, '营业执照注册资本与系统不一致'),
1556 } 1559 }
1557 1560
1561 BL_COMPARE_LOGIC = {
1562 'legalRepName': ('经营者姓名', 'se_name_compare', {}, '营业执照法定代表人与系统不一致'),
1563 'businessLicenseDueDate': ('营业期限', 'se_date_compare', {'ocr_split': True, 'long': True, 'ocr_replace': True, 'today': True}, '公司营业期限疑似过期'),
1564 }
1565
1558 MVI_COMPARE_LOGIC = { 1566 MVI_COMPARE_LOGIC = {
1559 'vinNo': ('车辆识别代码', 'se_common_compare', {}, '发票车架号与系统不一致'), 1567 'vinNo': ('车辆识别代码', 'se_common_compare', {}, '发票车架号与系统不一致'),
1560 'dealer': ('销方名称', 'se_contain_compare_2', {}, '发票销货单位名称与系统不一致'), 1568 'dealer': ('销方名称', 'se_contain_compare_2', {}, '发票销货单位名称与系统不一致'),
...@@ -1690,6 +1698,7 @@ SE_COMPARE_FIELD = { ...@@ -1690,6 +1698,7 @@ SE_COMPARE_FIELD = {
1690 EEP_EN: (EEP_OCR_FIELD, EEP_COMPARE_LOGIC, False), 1698 EEP_EN: (EEP_OCR_FIELD, EEP_COMPARE_LOGIC, False),
1691 RP_EN: (RP_OCR_FIELD, RP_COMPARE_LOGIC, True), 1699 RP_EN: (RP_OCR_FIELD, RP_COMPARE_LOGIC, True),
1692 BL_EN: (BL_OCR_FIELD, BL_COMPARE_LOGIC, False), 1700 BL_EN: (BL_OCR_FIELD, BL_COMPARE_LOGIC, False),
1701 SME_BL_EN: (BL_OCR_FIELD, SME_BL_COMPARE_LOGIC, False),
1693 MVI_EN: (MVI_OCR_FIELD, MVI_COMPARE_LOGIC, False), 1702 MVI_EN: (MVI_OCR_FIELD, MVI_COMPARE_LOGIC, False),
1694 UCI_EN: (UCI_OCR_FIELD, UCI_COMPARE_LOGIC, False), 1703 UCI_EN: (UCI_OCR_FIELD, UCI_COMPARE_LOGIC, False),
1695 MVC_EN: (MVC_OCR_FIELD, MVC_COMPARE_LOGIC, False), 1704 MVC_EN: (MVC_OCR_FIELD, MVC_COMPARE_LOGIC, False),
......
...@@ -928,10 +928,10 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): ...@@ -928,10 +928,10 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list):
928 928
929 if individual_info.get('customersubType', '').startswith('Self Employed'): 929 if individual_info.get('customersubType', '').startswith('Self Employed'):
930 sep_field_input = [ 930 sep_field_input = [
931 ('companyName', customer_name), 931 ('legalRepName', customer_name),
932 ('organizationType', individual_info.get('selfEmployedSubType', '')), 932 ('businessLicenseDueDate', ''),
933 ] 933 ]
934 license_dict[consts.BL_EN] = sep_field_input 934 license_dict[consts.SME_BL_EN] = sep_field_input
935 935
936 if len(all_id_num) > 0: 936 if len(all_id_num) > 0:
937 main_role_info.setdefault(individual_info['applicantType'], []).append( 937 main_role_info.setdefault(individual_info['applicantType'], []).append(
...@@ -1940,9 +1940,11 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True ...@@ -1940,9 +1940,11 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True
1940 result_class = HILSEOCRResult if application_entity == consts.HIL_PREFIX else AFCSEOCRResult 1940 result_class = HILSEOCRResult if application_entity == consts.HIL_PREFIX else AFCSEOCRResult
1941 ca_result_class = HILOCRResult if application_entity == consts.HIL_PREFIX else AFCOCRResult 1941 ca_result_class = HILOCRResult if application_entity == consts.HIL_PREFIX else AFCOCRResult
1942 if ocr_res_id is None: 1942 if ocr_res_id is None:
1943 ca_ocr_res_dict = ca_result_class.objects.filter(application_id=application_id).values(consts.IC_OCR_FIELD).first() 1943 ca_ocr_res_dict = ca_result_class.objects.filter(application_id=application_id).values(
1944 *consts.CA_ADD_COMPARE_FIELDS).first()
1944 else: 1945 else:
1945 ca_ocr_res_dict = ca_result_class.objects.filter(id=ocr_res_id).values(consts.IC_OCR_FIELD).first() 1946 ca_ocr_res_dict = ca_result_class.objects.filter(id=ocr_res_id).values(
1947 *consts.CA_ADD_COMPARE_FIELDS).first()
1946 if ocr_res_id is None: 1948 if ocr_res_id is None:
1947 ocr_res_dict = result_class.objects.filter(application_id=application_id).values(*consts.COMPARE_FIELDS).first() 1949 ocr_res_dict = result_class.objects.filter(application_id=application_id).values(*consts.COMPARE_FIELDS).first()
1948 else: 1950 else:
...@@ -1956,10 +1958,11 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True ...@@ -1956,10 +1958,11 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True
1956 if is_ca: 1958 if is_ca:
1957 ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict) 1959 ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict)
1958 else: 1960 else:
1959 if isinstance(ca_ocr_res_dict, dict) and isinstance(ca_ocr_res_dict.get(consts.IC_OCR_FIELD), str): 1961 for field_name in consts.CA_ADD_COMPARE_FIELDS:
1960 tmp_ca_result = json.loads(ca_ocr_res_dict.get(consts.IC_OCR_FIELD)) 1962 if isinstance(ca_ocr_res_dict, dict) and isinstance(ca_ocr_res_dict.get(field_name), str):
1961 if isinstance(ocr_res_dict.get(consts.IC_OCR_FIELD), str): 1963 tmp_ca_result = json.loads(ca_ocr_res_dict.get(field_name))
1962 tmp_se_result = json.loads(ocr_res_dict.get(consts.IC_OCR_FIELD)) 1964 if isinstance(ocr_res_dict.get(field_name), str):
1963 tmp_ca_result.extend(tmp_se_result) 1965 tmp_se_result = json.loads(ocr_res_dict.get(field_name))
1964 ocr_res_dict[consts.IC_OCR_FIELD] = json.dumps(tmp_ca_result) 1966 tmp_ca_result.extend(tmp_se_result)
1967 ocr_res_dict[field_name] = json.dumps(tmp_ca_result)
1965 se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict, is_cms) 1968 se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res_dict, is_cms)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!