806c91b2 by 周伟奇

part 2

1 parent 5ae1abb7
...@@ -1446,20 +1446,20 @@ SKIP_CARD = {ID_EN, RP_EN} ...@@ -1446,20 +1446,20 @@ SKIP_CARD = {ID_EN, RP_EN}
1446 1446
1447 1447
1448 ID_COMPARE_LOGIC = { 1448 ID_COMPARE_LOGIC = {
1449 'customerName': ('姓名', 'se_name_compare', {}), 1449 'customerName': ('姓名', 'se_name_compare', {}, '身份证姓名与系统不一致'),
1450 'idNum': ('公民身份号码', 'se_common_compare', {}), 1450 'idNum': ('公民身份号码', 'se_common_compare', {}, '身份证号码与系统不一致'),
1451 # 'dateOfBirth': ('出生年月', 'se_date_compare', {'input_replace': ''}), 1451 # 'dateOfBirth': ('出生年月', 'se_date_compare', {'input_replace': ''}),
1452 'idExpiryDate': ('有效期限', 'se_date_compare', {'long': True, 'ocr_split': True, 'input_replace': '', 'today': True}), 1452 'idExpiryDate': ('有效期限', 'se_date_compare', {'long': True, 'ocr_split': True, 'input_replace': '', 'today': True}, '身份证有效期疑似过期'),
1453 'hukouProvince': ('住址', 'se_contain_compare', {}), 1453 'hukouProvince': ('住址', 'se_contain_compare', {}, '身份证住址与系统不一致'),
1454 'hukouCity': ('住址', 'se_contain_compare', {}), 1454 'hukouCity': ('住址', 'se_contain_compare', {}, '身份证住址与系统不一致'),
1455 IC_TURE_OR_FALSE: (IC_TURE_OR_FALSE, 'se_common_compare', {}), 1455 IC_TURE_OR_FALSE: (IC_TURE_OR_FALSE, 'se_common_compare', {}, '身份证件疑似造假,需人工判断'),
1456 } 1456 }
1457 1457
1458 PP_COMPARE_LOGIC = { 1458 PP_COMPARE_LOGIC = {
1459 'customerName': ('英文姓名', 'se_name_compare', {'is_passport': True}), # 1 1459 'customerName': ('英文姓名', 'se_name_compare', {'is_passport': True}, '护照姓名与系统不一致'), # 1
1460 'idNum': ('护照号码', 'se_common_compare', {}), # 2 1460 'idNum': ('护照号码', 'se_common_compare', {}, '护照号码与系统不一致'), # 2
1461 'dateOfBirth': ('出生日期', 'se_date_compare', {'input_replace': ''}), # 2 1461 'dateOfBirth': ('出生日期', 'se_date_compare', {'input_replace': ''}, '护照出生日期与系统不一致'), # 2
1462 'idExpiryDate': ('有效期至', 'se_date_compare', {'input_replace': '', 'today': True}), # 2 1462 'idExpiryDate': ('有效期至', 'se_date_compare', {'input_replace': '', 'today': True}, '护照有效期疑似过期'), # 2
1463 } 1463 }
1464 1464
1465 PP_SLICE_MAP = { 1465 PP_SLICE_MAP = {
...@@ -1471,44 +1471,44 @@ PP_SLICE_MAP = { ...@@ -1471,44 +1471,44 @@ PP_SLICE_MAP = {
1471 } 1471 }
1472 1472
1473 EEP_COMPARE_LOGIC = { 1473 EEP_COMPARE_LOGIC = {
1474 'customerName': ('中文名', 'se_common_compare', {}), 1474 'customerName': ('中文名', 'se_common_compare', {}, '港澳台姓名与系统不一致'),
1475 'idNum': ('证件号码', 'se_common_compare', {}), 1475 'idNum': ('证件号码', 'se_common_compare', {}, '港澳台证件号码与系统不一致'),
1476 'dateOfBirth': ('出生日期', 'se_date_compare', {'input_replace': '.'}), 1476 'dateOfBirth': ('出生日期', 'se_date_compare', {'input_replace': '.'}, '港澳台出生日期与系统不一致'),
1477 'idExpiryDate': ('有效期限', 'se_date_compare', {'ocr_split': True, 'input_replace': '.', 'today': True}), 1477 'idExpiryDate': ('有效期限', 'se_date_compare', {'ocr_split': True, 'input_replace': '.', 'today': True}, '港澳台证件有效期疑似过期'),
1478 } 1478 }
1479 1479
1480 RP_COMPARE_LOGIC = { 1480 RP_COMPARE_LOGIC = {
1481 'customerName': ('姓名', 'se_name_compare', {}), 1481 'customerName': ('姓名', 'se_name_compare', {}, '居住证姓名与系统不一致'),
1482 'idNum': ('公民身份号码', 'se_common_compare', {}), 1482 'idNum': ('公民身份号码', 'se_common_compare', {}, '居住证公民号码与系统不一致'),
1483 'dateOfBirth': ('出生年月', 'se_date_compare', {'input_replace': ''}), 1483 'dateOfBirth': ('出生年月', 'se_date_compare', {'input_replace': '居住证出生年月与系统不一致'}),
1484 'idExpiryDate': ('有效期限', 'se_date_compare', {'ocr_split': True, 'input_replace': '', 'today': True}), 1484 'idExpiryDate': ('有效期限', 'se_date_compare', {'ocr_split': True, 'input_replace': '', 'today': True}, '居住证有效期疑似过期'),
1485 'hukouProvince': ('住址', 'se_contain_compare', {}), 1485 'hukouProvince': ('住址', 'se_contain_compare', {}, '居住证住址与系统不一致'),
1486 'hukouCity': ('住址', 'se_contain_compare', {}), 1486 'hukouCity': ('住址', 'se_contain_compare', {}, '居住证住址与系统不一致'),
1487 } 1487 }
1488 1488
1489 BL_COMPARE_LOGIC = { 1489 BL_COMPARE_LOGIC = {
1490 'companyName': ('企业名称', 'se_company_compare', {}), 1490 'companyName': ('企业名称', 'se_company_compare', {}, '营业执照公司名称与系统不一致'),
1491 'legalRepName': ('经营者姓名', 'se_name_compare', {}), 1491 'legalRepName': ('经营者姓名', 'se_name_compare', {}, '营业执照法定代表人与系统不一致'),
1492 'firstIdNo': ('注册号', 'se_common_compare', {}), 1492 'firstIdNo': ('注册号', 'se_common_compare', {}, '营业执照统一社会信用代码与系统不一致'),
1493 'businessLicenseNo': ('注册号', 'se_common_compare', {}), 1493 'businessLicenseNo': ('注册号', 'se_common_compare', {}, '营业执照统一社会信用代码与系统不一致'),
1494 'organizationCreditCode': ('注册号', 'se_common_compare', {}), 1494 'organizationCreditCode': ('注册号', 'se_common_compare', {}, '营业执照统一社会信用代码与系统不一致'),
1495 'taxRegistrationCertificateNo': ('注册号', 'se_common_compare', {}), 1495 'taxRegistrationCertificateNo': ('注册号', 'se_common_compare', {}, '营业执照统一社会信用代码与系统不一致'),
1496 'establishmentDate': ('成立日期', 'se_date_compare', {'ocr_replace': True}), 1496 'establishmentDate': ('成立日期', 'se_date_compare', {'ocr_replace': True}, '营业执照显示公司成立不满足2年'),
1497 'businessLicenseDueDate': ('营业期限', 'se_date_compare', {'ocr_split': True, 'long': True, 'ocr_replace': True, 'today': True}), 1497 'businessLicenseDueDate': ('营业期限', 'se_date_compare', {'ocr_split': True, 'long': True, 'ocr_replace': True, 'today': True}, '公司营业期限疑似过期'),
1498 'organizationType': ('企业类型', 'se_type_compare', {}), 1498 'organizationType': ('企业类型', 'se_type_compare', {}, '营业执照企业类型与系统不一致'),
1499 'registeredCapital': ('注册资本', 'se_rmb_compare', {}), 1499 'registeredCapital': ('注册资本', 'se_rmb_compare', {}, '营业执照注册资本与系统不一致'),
1500 } 1500 }
1501 1501
1502 MVI_COMPARE_LOGIC = { 1502 MVI_COMPARE_LOGIC = {
1503 'vinNo': ('车辆识别代码', 'se_common_compare', {}), 1503 'vinNo': ('车辆识别代码', 'se_common_compare', {}, '发票车架号与系统不一致'),
1504 'dealer': ('销方名称', 'se_contain_compare_2', {}), 1504 'dealer': ('销方名称', 'se_contain_compare_2', {}, '发票销货单位名称与系统不一致'),
1505 'vehicleTransactionAmount': ('价税合计小写', 'se_amount_compare', {}), 1505 'vehicleTransactionAmount': ('价税合计小写', 'se_amount_compare', {}, '发票车辆价格与系统不一致'),
1506 'customerName': ('购方名称', 'se_common_compare', {}), 1506 'customerName': ('购方名称', 'se_common_compare', {}, '发票购买方姓名与系统不一致'),
1507 'idNum': ('购买方身份证号或组织机构代码', 'se_common_compare', {}), 1507 'idNum': ('购买方身份证号或组织机构代码', 'se_common_compare', {}, '发票购买方证件号码与系统不一致'),
1508 'dateOfInvoice': ('开票日期', 'se_date_compare_2', {'three_month': True}), 1508 'dateOfInvoice': ('开票日期', 'se_date_compare_2', {'three_month': True}, '发票开票日期早于首次提交申请日期'),
1509 'stamp': ('销售单位章', 'se_common_compare', {}), 1509 'stamp': ('销售单位章', 'se_common_compare', {}, '发票无章'),
1510 '发票联': ('发票类型', 'se_common_compare', {}), 1510 '发票联': ('发票类型', 'se_common_compare', {}, '发票疑似非发票联'),
1511 '发票真伪校验': ('发票真伪校验', 'se_common_compare', {}), 1511 '发票真伪校验': ('发票真伪校验', 'se_common_compare', {}, '发票疑似造假,需人工核算'),
1512 } 1512 }
1513 ZW_METHOD = 'mvi_special' 1513 ZW_METHOD = 'mvi_special'
1514 LOWER_AMOUNT_FIELD = '价税合计小写' 1514 LOWER_AMOUNT_FIELD = '价税合计小写'
...@@ -1517,16 +1517,16 @@ BHSJ_FIELD = '不含税价' ...@@ -1517,16 +1517,16 @@ BHSJ_FIELD = '不含税价'
1517 ZZSSE_FIELD = '增值税税额' 1517 ZZSSE_FIELD = '增值税税额'
1518 1518
1519 UCI_COMPARE_LOGIC = { 1519 UCI_COMPARE_LOGIC = {
1520 'vinNo': ('车架号', 'se_common_compare', {}), 1520 'vinNo': ('车架号', 'se_common_compare', {}, '二手车发票车架号与系统不一致'),
1521 'vehicleTransactionAmount': ('价税合计小写', 'se_amount_compare', {}), 1521 'vehicleTransactionAmount': ('价税合计小写', 'se_amount_compare', {}, '二手车发票车价合计与系统车辆价格不一致'),
1522 'customerName': ('购方名称', 'se_name_compare', {'is_passport': True}), 1522 'customerName': ('购方名称', 'se_name_compare', {'is_passport': True}, '二手车发票买方姓名与系统不一致'),
1523 'idNum': ('购方纳税人识别号', 'se_contain_compare_2', {}), 1523 'idNum': ('购方纳税人识别号', 'se_contain_compare_2', {}, '二手车发票买方证件号码与系统不一致'),
1524 'dateOfInvoice': ('开票日期', 'se_date_compare_2', {'three_month': True}), 1524 'dateOfInvoice': ('开票日期', 'se_date_compare_2', {'three_month': True}, '二手车发票开票日期早于首次提交申请日期'),
1525 'stamp': ('发票章', 'se_common_compare', {}), 1525 'stamp': ('发票章', 'se_common_compare', {}, '二手车发票章需人工核查'),
1526 } 1526 }
1527 1527
1528 MVC_COMPARE_LOGIC = { 1528 MVC_COMPARE_LOGIC = {
1529 'vinNo': ('9.车辆识别代号/车架号', 'se_common_compare', {}), 1529 'vinNo': ('9.车辆识别代号/车架号', 'se_common_compare', {}, '绿本车架号与系统车架号不一致'),
1530 # 'customerName': ('姓名/名称', ), 1530 # 'customerName': ('姓名/名称', ),
1531 # 'idNum': ('身份证明名称/号码', ), 1531 # 'idNum': ('身份证明名称/号码', ),
1532 # 'date': ('转移登记日期', ), 1532 # 'date': ('转移登记日期', ),
...@@ -1537,43 +1537,43 @@ TRANSFER_NUM = '身份证明名称/号码' ...@@ -1537,43 +1537,43 @@ TRANSFER_NUM = '身份证明名称/号码'
1537 TRANSFER_DATE = '转移登记日期' 1537 TRANSFER_DATE = '转移登记日期'
1538 1538
1539 MVC34_COMPARE_LOGIC = { 1539 MVC34_COMPARE_LOGIC = {
1540 'customerName': (TRANSFER_NAME, 'se_company_compare', {}), 1540 'customerName': (TRANSFER_NAME, 'se_company_compare', {}, '绿本最新转移登记人姓名与系统主借人不一致'),
1541 'idNum': (TRANSFER_NUM, 'se_contain_compare_2', {}), 1541 'idNum': (TRANSFER_NUM, 'se_contain_compare_2', {}, '绿本最新转移登记日证件号码与系统主借人证件号码不一致'),
1542 'date': (TRANSFER_DATE, 'se_date_compare_2', {}), 1542 'date': (TRANSFER_DATE, 'se_date_compare_2', {}, '转移登记日期早于第一次提交申请日期'),
1543 } 1543 }
1544 1544
1545 BC_TYPE_VALUE = '借记卡' 1545 BC_TYPE_VALUE = '借记卡'
1546 BC_COMPARE_LOGIC = { 1546 BC_COMPARE_LOGIC = {
1547 'accountNo': ('CardNum', 'se_common_compare', {'remove_space': True}), 1547 'accountNo': ('CardNum', 'se_common_compare', {'remove_space': True}, '银行卡卡号与系统不一致'),
1548 'bankName': ('BankName', 'se_both_contain_compare', {}), 1548 'bankName': ('BankName', 'se_both_contain_compare', {}, '银行卡开户行与系统不一致'),
1549 'type': ('CardType', 'se_common_compare', {}), 1549 'type': ('CardType', 'se_common_compare', {}, '银行卡非借记卡'),
1550 } 1550 }
1551 1551
1552 DDA_COMPARE_LOGIC = { 1552 DDA_COMPARE_LOGIC = {
1553 'applicationId(1)': ('check_Num', 'se_common_compare', {}), 1553 'applicationId(1)': ('check_Num', 'se_common_compare', {}, 'DDA缴费编号与系统不一致'),
1554 'applicationId(2)': ('check_Num', 'se_common_compare', {}), 1554 'applicationId(2)': ('check_Num', 'se_common_compare', {}, 'DDA签署编号系统不一致'),
1555 'bankName': ('to_bank', 'se_both_contain_compare', {}), 1555 'bankName': ('to_bank', 'se_both_contain_compare', {}, 'DDA非工商银行'),
1556 'companyName': ('to_company', 'se_company_compare', {}), 1556 'companyName': ('to_company', 'se_company_compare', {}, 'DDA渠道与系统不一致'),
1557 'customerName': (DDA_IC_NAME, 'se_contain_compare_2', {}), 1557 'customerName': (DDA_IC_NAME, 'se_contain_compare_2', {}, 'DDA客户姓名与系统不一致'),
1558 'idNum': (DDA_IC_ID, 'se_contain_compare_2', {}), 1558 'idNum': (DDA_IC_ID, 'se_contain_compare_2', {}, 'DDA身份证号码与系统不一致'),
1559 'accountHolderName': (DDA_BC_NAME, 'se_common_compare', {}), 1559 'accountHolderName': (DDA_BC_NAME, 'se_common_compare', {}, 'DDA账户名与系统不一致'),
1560 'accountNo': (DDA_BC_ID, 'se_common_compare', {'remove_space': True}), 1560 'accountNo': (DDA_BC_ID, 'se_common_compare', {'remove_space': True}, 'DDA账号与系统不一致'),
1561 } 1561 }
1562 1562
1563 JYPZ_COMPARE_LOGIC = { 1563 JYPZ_COMPARE_LOGIC = {
1564 'vinNo': ('vin', 'se_common_compare', {}), 1564 'vinNo': ('vin', 'se_common_compare', {}, '二手车凭证车辆识别代号与系统车架号不一致'),
1565 'vehicleTransactionAmount': ('price', 'se_amount_compare', {}), 1565 'vehicleTransactionAmount': ('price', 'se_amount_compare', {}, '二手车凭证购买方交易价格与系统车辆价格不一致'),
1566 'customerName': ('buyer_name', 'se_name_compare', {'is_passport': True}), 1566 'customerName': ('buyer_name', 'se_name_compare', {'is_passport': True}, '二手车凭证购买方姓名与系统主借人姓名不一致'),
1567 'idNum': ('buyer_id', 'se_contain_compare_2', {}), 1567 'idNum': ('buyer_id', 'se_contain_compare_2', {}, '二手车凭证购买方证件号与系统主借人证件号不一致'),
1568 'date': ('date', 'se_date_compare_2', {}), 1568 'date': ('date', 'se_date_compare_2', {}, '二手车凭证购买方交易价格早于submissionDate'),
1569 } 1569 }
1570 1570
1571 HMH_COMPARE_LOGIC = { 1571 HMH_COMPARE_LOGIC = {
1572 '借款人/承租人姓名': ('借款/承租人姓名', 'se_name_compare', {}), 1572 '借款人/承租人姓名': ('借款/承租人姓名', 'se_name_compare', {}, '抵押登记豁免函借款人/承租人姓名与系统不符'),
1573 '借款人/承租人证件号': ('证件号码', 'se_common_compare', {}), 1573 '借款人/承租人证件号': ('证件号码', 'se_common_compare', {}, '抵押登记豁免函借款人/承租人证件号码与系统不符'),
1574 '申请号': ('合同编号', 'se_common_compare', {}), 1574 '申请号': ('合同编号', 'se_common_compare', {}, '抵押登记豁免函申请号与系统不符'),
1575 '渠道': ('渠道', 'se_common_compare', {}), 1575 '渠道': ('渠道', 'se_common_compare', {}, '抵押登记豁免函渠道与系统不符'),
1576 '签字': ('借款人签字/盖章', 'se_common_compare', {}), 1576 '签字': ('借款人签字/盖章', 'se_common_compare', {}, '抵押登记豁免函签字需人工核查'),
1577 } 1577 }
1578 1578
1579 # MVC_OCR_FIELD = 'mvc_ocr' 1579 # MVC_OCR_FIELD = 'mvc_ocr'
......
...@@ -1084,77 +1084,77 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): ...@@ -1084,77 +1084,77 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list):
1084 other_info[consts.HMH_EN] = hmh_field_input 1084 other_info[consts.HMH_EN] = hmh_field_input
1085 compare_info['other'] = other_info 1085 compare_info['other'] = other_info
1086 1086
1087 contract_info = {} 1087 # contract_info = {}
1088 1088 #
1089 schedule_list = [] 1089 # schedule_list = []
1090 for schedule_dict in cms_info.get('paymentSchedule', []): 1090 # for schedule_dict in cms_info.get('paymentSchedule', []):
1091 tmp_str = "{1}{0}{2}".format(consts.SPLIT_STR, str(schedule_dict.get('no', '')), 1091 # tmp_str = "{1}{0}{2}".format(consts.SPLIT_STR, str(schedule_dict.get('no', '')),
1092 str(schedule_dict.get('grossRentalAmount', ''))) 1092 # str(schedule_dict.get('grossRentalAmount', '')))
1093 schedule_list.append(tmp_str) 1093 # schedule_list.append(tmp_str)
1094 schedule_list_str = consts.SCHEDULE_SPLIT_STR.join(schedule_list) 1094 # schedule_list_str = consts.SCHEDULE_SPLIT_STR.join(schedule_list)
1095 1095 #
1096 afc_contract_input = [ 1096 # afc_contract_input = [
1097 (consts.SE_AFC_CON_FIELD[0], full_no), 1097 # (consts.SE_AFC_CON_FIELD[0], full_no),
1098 (consts.SE_AFC_CON_FIELD[1], amount), 1098 # (consts.SE_AFC_CON_FIELD[1], amount),
1099 (consts.SE_AFC_CON_FIELD[2], vin_no), 1099 # (consts.SE_AFC_CON_FIELD[2], vin_no),
1100 (consts.SE_AFC_CON_FIELD[3], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), 1100 # (consts.SE_AFC_CON_FIELD[3], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))),
1101 (consts.SE_AFC_CON_FIELD[4], str(cms_info.get('terms', '0'))), 1101 # (consts.SE_AFC_CON_FIELD[4], str(cms_info.get('terms', '0'))),
1102 (consts.SE_AFC_CON_FIELD[5], str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0'))), 1102 # (consts.SE_AFC_CON_FIELD[5], str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0'))),
1103 (consts.SE_AFC_CON_FIELD[6], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), 1103 # (consts.SE_AFC_CON_FIELD[6], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))),
1104 (consts.SE_AFC_CON_FIELD[7], amount), 1104 # (consts.SE_AFC_CON_FIELD[7], amount),
1105 (consts.SE_AFC_CON_FIELD[8], vin_no), 1105 # (consts.SE_AFC_CON_FIELD[8], vin_no),
1106 (consts.SE_AFC_CON_FIELD[9], cms_info.get('dealerName', '')), 1106 # (consts.SE_AFC_CON_FIELD[9], cms_info.get('dealerName', '')),
1107 (consts.SE_AFC_CON_FIELD[10], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))), 1107 # (consts.SE_AFC_CON_FIELD[10], str(cms_info.get('financialInformation', {}).get('originationPrincipal', '0.0'))),
1108 (consts.SE_AFC_CON_FIELD[11], str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0'))), 1108 # (consts.SE_AFC_CON_FIELD[11], str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0'))),
1109 (consts.SE_AFC_CON_FIELD[12], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))), 1109 # (consts.SE_AFC_CON_FIELD[12], str(cms_info.get('financialInformation', {}).get('associatedServicePrincipal', '0.0'))),
1110 (consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))), 1110 # (consts.SE_AFC_CON_FIELD[13], str(cms_info.get('terms', '0'))),
1111 (consts.SE_AFC_CON_FIELD[14], account_no), 1111 # (consts.SE_AFC_CON_FIELD[14], account_no),
1112 (consts.SE_AFC_CON_FIELD[15], cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')), 1112 # (consts.SE_AFC_CON_FIELD[15], cms_info.get('bankAccountDetails', {}).get('accountHolderName', '')),
1113 (consts.SE_AFC_CON_FIELD[16], bank_name), 1113 # (consts.SE_AFC_CON_FIELD[16], bank_name),
1114 (consts.SE_AFC_CON_FIELD[17], schedule_list_str), 1114 # (consts.SE_AFC_CON_FIELD[17], schedule_list_str),
1115 ] 1115 # ]
1116 1116 #
1117 asp_list = [] 1117 # asp_list = []
1118 for asp_info in cms_info.get('associatedServices', []): 1118 # for asp_info in cms_info.get('associatedServices', []):
1119 asp_list.append( 1119 # asp_list.append(
1120 ( 1120 # (
1121 asp_info.get('associatedServices', ''), 1121 # asp_info.get('associatedServices', ''),
1122 asp_info.get('price', 0.0), 1122 # asp_info.get('price', 0.0),
1123 asp_info.get('financed', 0.0) 1123 # asp_info.get('financed', 0.0)
1124 ) 1124 # )
1125 ) 1125 # )
1126 1126 #
1127 if len(asp_list) > 0: 1127 # if len(asp_list) > 0:
1128 fin_total = 0 1128 # fin_total = 0
1129 gzs_status = consts.GZS_STATUS[1] 1129 # gzs_status = consts.GZS_STATUS[1]
1130 for asp_name, asp_price, asp_fin in asp_list: 1130 # for asp_name, asp_price, asp_fin in asp_list:
1131 if gzs_status == consts.GZS_STATUS[1]: 1131 # if gzs_status == consts.GZS_STATUS[1]:
1132 if consts.GZS_NAME in asp_name: 1132 # if consts.GZS_NAME in asp_name:
1133 gzs_status = consts.GZS_STATUS[0] 1133 # gzs_status = consts.GZS_STATUS[0]
1134 if gzs_status == consts.GZS_STATUS[0]: 1134 # if gzs_status == consts.GZS_STATUS[0]:
1135 if consts.GZS_NAME not in asp_name: 1135 # if consts.GZS_NAME not in asp_name:
1136 gzs_status = consts.GZS_STATUS[2] 1136 # gzs_status = consts.GZS_STATUS[2]
1137 afc_contract_input.extend( 1137 # afc_contract_input.extend(
1138 [ 1138 # [
1139 (consts.SE_AFC_CON_FIELD[18], asp_name), 1139 # (consts.SE_AFC_CON_FIELD[18], asp_name),
1140 (consts.SE_AFC_CON_FIELD[19], str(asp_price)), 1140 # (consts.SE_AFC_CON_FIELD[19], str(asp_price)),
1141 (consts.SE_AFC_CON_FIELD[20], str(asp_fin)), 1141 # (consts.SE_AFC_CON_FIELD[20], str(asp_fin)),
1142 ] 1142 # ]
1143 ) 1143 # )
1144 fin_total += asp_fin 1144 # fin_total += asp_fin
1145 afc_contract_input.append((consts.SE_AFC_CON_FIELD[21], str(fin_total))) 1145 # afc_contract_input.append((consts.SE_AFC_CON_FIELD[21], str(fin_total)))
1146 1146 #
1147 # CMS Vehicle Price / 1.13 * 10 % 1147 # # CMS Vehicle Price / 1.13 * 10 %
1148 gzs_list = [gzs_status] 1148 # gzs_list = [gzs_status]
1149 if gzs_status != consts.GZS_STATUS[1]: 1149 # if gzs_status != consts.GZS_STATUS[1]:
1150 gzs_value = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', 0.0) * 0.1 / 1.13) 1150 # gzs_value = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', 0.0) * 0.1 / 1.13)
1151 gzs_list.append(gzs_value) 1151 # gzs_list.append(gzs_value)
1152 afc_contract_input.append((consts.SE_AFC_CON_FIELD[22], consts.SPLIT_STR.join(gzs_list))) 1152 # afc_contract_input.append((consts.SE_AFC_CON_FIELD[22], consts.SPLIT_STR.join(gzs_list)))
1153 1153 #
1154 # role_name, _, role_id = main_role_info[applicant_type][0] 1154 # # role_name, _, role_id = main_role_info[applicant_type][0]
1155 1155 #
1156 contract_info[consts.AFC_CONTRACT_EN] = afc_contract_input 1156 # contract_info[consts.AFC_CONTRACT_EN] = afc_contract_input
1157 compare_info['contract'] = contract_info 1157 # compare_info['contract'] = contract_info
1158 return compare_info, cms_info.get('applicationVersion', 1) 1158 return compare_info, cms_info.get('applicationVersion', 1)
1159 1159
1160 1160
...@@ -1581,13 +1581,13 @@ def se_compare_license(license_en, ocr_res_dict, field_list): ...@@ -1581,13 +1581,13 @@ def se_compare_license(license_en, ocr_res_dict, field_list):
1581 else: 1581 else:
1582 img_path = ocr_res_list[res_idx].get(consts.IMG_PATH_KEY, '') if result == consts.RESULT_N else empty_str 1582 img_path = ocr_res_list[res_idx].get(consts.IMG_PATH_KEY, '') if result == consts.RESULT_N else empty_str
1583 error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value 1583 error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value
1584 result_field_list.append((name, value, result, ocr_str, img_path, error_type)) 1584 result_field_list.append((name, value, result, ocr_str, img_path, error_type, compare_logic[name][3]))
1585 else: 1585 else:
1586 no_ocr_result = True 1586 no_ocr_result = True
1587 1587
1588 if not is_find: 1588 if not is_find:
1589 for name, value in field_list: 1589 for name, value in field_list:
1590 result_field_list.append((name, value, consts.RESULT_N, empty_str, empty_str, ErrorType.NF.value)) 1590 result_field_list.append((name, value, consts.RESULT_N, empty_str, empty_str, ErrorType.NF.value, '{0}未找到'.format(license_en)))
1591 1591
1592 if is_find: 1592 if is_find:
1593 if special_expiry_date_slice: 1593 if special_expiry_date_slice:
...@@ -1620,7 +1620,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list): ...@@ -1620,7 +1620,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list):
1620 if os.path.exists(section_img_path): 1620 if os.path.exists(section_img_path):
1621 failed_field = [] 1621 failed_field = []
1622 base_img_path = empty_str 1622 base_img_path = empty_str
1623 for name, _, result, _, img_path, _ in result_field_list: 1623 for name, _, result, _, img_path, _, _ in result_field_list:
1624 if result == consts.RESULT_N: 1624 if result == consts.RESULT_N:
1625 if special_expiry_date_slice and name == 'idExpiryDate': 1625 if special_expiry_date_slice and name == 'idExpiryDate':
1626 continue 1626 continue
...@@ -1712,11 +1712,11 @@ def se_mvc34_compare(license_en, ocr_res_dict, field_list): ...@@ -1712,11 +1712,11 @@ def se_mvc34_compare(license_en, ocr_res_dict, field_list):
1712 result = getattr(cp, compare_logic[name][1])(value, ocr_str, **compare_logic[name][2]) 1712 result = getattr(cp, compare_logic[name][1])(value, ocr_str, **compare_logic[name][2])
1713 img_path = ocr_res.get(consts.IMG_PATH_KEY, '') if result == consts.RESULT_N else empty_str 1713 img_path = ocr_res.get(consts.IMG_PATH_KEY, '') if result == consts.RESULT_N else empty_str
1714 error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value 1714 error_type = empty_error_type if result == consts.RESULT_Y else ErrorType.OCR.value
1715 result_field_list.append((name, value, result, ocr_str, img_path, error_type)) 1715 result_field_list.append((name, value, result, ocr_str, img_path, error_type, compare_logic[name][3]))
1716 1716
1717 if not is_find: 1717 if not is_find:
1718 for name, value in field_list: 1718 for name, value in field_list:
1719 result_field_list.append((name, value, consts.RESULT_N, empty_str, empty_str, ErrorType.NF.value)) 1719 result_field_list.append((name, value, consts.RESULT_N, empty_str, empty_str, ErrorType.NF.value, '{0}未找到'.format(license_en)))
1720 1720
1721 return result_field_list, dict() 1721 return result_field_list, dict()
1722 1722
...@@ -1731,6 +1731,7 @@ def se_compare_process(compare_info, ocr_res_dict): ...@@ -1731,6 +1731,7 @@ def se_compare_process(compare_info, ocr_res_dict):
1731 failed_count = 0 1731 failed_count = 0
1732 successful_at_this_level = True 1732 successful_at_this_level = True
1733 failure_reason = {} 1733 failure_reason = {}
1734 cn_reason_list = []
1734 1735
1735 for info_key, info_value in compare_info.items(): 1736 for info_key, info_value in compare_info.items():
1736 if info_key in ['individualCusInfo', 'applicantInformation']: 1737 if info_key in ['individualCusInfo', 'applicantInformation']:
...@@ -1745,13 +1746,14 @@ def se_compare_process(compare_info, ocr_res_dict): ...@@ -1745,13 +1746,14 @@ def se_compare_process(compare_info, ocr_res_dict):
1745 strip_list.append((a, b)) 1746 strip_list.append((a, b))
1746 failure_field = [] 1747 failure_field = []
1747 result_field_list, no_ocr_result, field_img_path_dict = se_compare_license(license_en, ocr_res_dict, strip_list) 1748 result_field_list, no_ocr_result, field_img_path_dict = se_compare_license(license_en, ocr_res_dict, strip_list)
1748 for name, value, result, ocr_str, img_path, error_type in result_field_list: 1749 for name, value, result, ocr_str, img_path, error_type, cn_reason in result_field_list:
1749 if license_en not in consts.SKIP_CARD or not no_ocr_result: 1750 if license_en not in consts.SKIP_CARD or not no_ocr_result:
1750 total_fields += 1 1751 total_fields += 1
1751 if result == consts.RESULT_N: 1752 if result == consts.RESULT_N:
1752 failed_count += 1 1753 failed_count += 1
1753 successful_at_this_level = False 1754 successful_at_this_level = False
1754 failure_field.append(name) 1755 failure_field.append(name)
1756 cn_reason_list.append(cn_reason)
1755 compare_result.append( 1757 compare_result.append(
1756 { 1758 {
1757 consts.HEAD_LIST[0]: info_key, 1759 consts.HEAD_LIST[0]: info_key,
...@@ -1781,12 +1783,13 @@ def se_compare_process(compare_info, ocr_res_dict): ...@@ -1781,12 +1783,13 @@ def se_compare_process(compare_info, ocr_res_dict):
1781 result_field_list, field_img_path_dict = se_mvc34_compare(license_en, ocr_res_dict, strip_list) 1783 result_field_list, field_img_path_dict = se_mvc34_compare(license_en, ocr_res_dict, strip_list)
1782 else: 1784 else:
1783 result_field_list, _, field_img_path_dict = se_compare_license(license_en, ocr_res_dict, strip_list) 1785 result_field_list, _, field_img_path_dict = se_compare_license(license_en, ocr_res_dict, strip_list)
1784 for name, value, result, ocr_str, img_path, error_type in result_field_list: 1786 for name, value, result, ocr_str, img_path, error_type, cn_reason in result_field_list:
1785 total_fields += 1 1787 total_fields += 1
1786 if result == consts.RESULT_N: 1788 if result == consts.RESULT_N:
1787 failed_count += 1 1789 failed_count += 1
1788 successful_at_this_level = False 1790 successful_at_this_level = False
1789 failure_field.append(name) 1791 failure_field.append(name)
1792 cn_reason_list.append(cn_reason)
1790 compare_result.append( 1793 compare_result.append(
1791 { 1794 {
1792 consts.HEAD_LIST[0]: info_key, 1795 consts.HEAD_LIST[0]: info_key,
...@@ -1805,6 +1808,7 @@ def se_compare_process(compare_info, ocr_res_dict): ...@@ -1805,6 +1808,7 @@ def se_compare_process(compare_info, ocr_res_dict):
1805 failure_reason.setdefault(info_key, []).append(';'.join(failure_field)) 1808 failure_reason.setdefault(info_key, []).append(';'.join(failure_field))
1806 if failed_count == 0: 1809 if failed_count == 0:
1807 failure_reason_str = '' 1810 failure_reason_str = ''
1811 cn_failure_reason_str = ''
1808 else: 1812 else:
1809 reason_list = [] 1813 reason_list = []
1810 for key, value in failure_reason.items(): 1814 for key, value in failure_reason.items():
...@@ -1812,7 +1816,8 @@ def se_compare_process(compare_info, ocr_res_dict): ...@@ -1812,7 +1816,8 @@ def se_compare_process(compare_info, ocr_res_dict):
1812 value_str = json.dumps(value) 1816 value_str = json.dumps(value)
1813 reason_list.append('{0}: {1}'.format(key, value_str)) 1817 reason_list.append('{0}: {1}'.format(key, value_str))
1814 failure_reason_str = '、'.join(reason_list) 1818 failure_reason_str = '、'.join(reason_list)
1815 return compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str 1819 cn_failure_reason_str = '、'.join(set(cn_reason_list))
1820 return compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, cn_failure_reason_str
1816 1821
1817 1822
1818 def se_result_detect(ocr_res_dict): 1823 def se_result_detect(ocr_res_dict):
...@@ -1836,7 +1841,7 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res ...@@ -1836,7 +1841,7 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
1836 else: 1841 else:
1837 compare_info = get_se_compare_info(last_obj, application_entity, detect_list) 1842 compare_info = get_se_compare_info(last_obj, application_entity, detect_list)
1838 application_version = last_obj.application_version 1843 application_version = last_obj.application_version
1839 compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str = se_compare_process( 1844 compare_result, total_fields, failed_count, successful_at_this_level, failure_reason_str, cn_failure_reason_str = se_compare_process(
1840 compare_info, ocr_res_dict) 1845 compare_info, ocr_res_dict)
1841 compare_log.info('{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format( 1846 compare_log.info('{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'.format(
1842 log_base, application_entity, application_id, ocr_res_id, compare_result)) 1847 log_base, application_entity, application_id, ocr_res_id, compare_result))
...@@ -1901,7 +1906,7 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res ...@@ -1901,7 +1906,7 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
1901 "SubtenantId": consts.TENANT_MAP[application_entity], 1906 "SubtenantId": consts.TENANT_MAP[application_entity],
1902 "Data": { 1907 "Data": {
1903 "Result_Message": "Pass" if successful_at_this_level else "Fail", 1908 "Result_Message": "Pass" if successful_at_this_level else "Fail",
1904 "Failure_Reason": failure_reason_str, 1909 "Failure_Reason": cn_failure_reason_str,
1905 "Application_Number": application_id, 1910 "Application_Number": application_id,
1906 "Bank_Statement": "", 1911 "Bank_Statement": "",
1907 "Link_URL": application_link, 1912 "Link_URL": application_link,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!