add hil contract compare
Showing
4 changed files
with
287 additions
and
42 deletions
... | @@ -1466,12 +1466,79 @@ SE_AFC_CON_MAP = { | ... | @@ -1466,12 +1466,79 @@ SE_AFC_CON_MAP = { |
1466 | 'ASP项目详情': (None, 4, '附加产品融资贷款本金总金额明细', None), | 1466 | 'ASP项目详情': (None, 4, '附加产品融资贷款本金总金额明细', None), |
1467 | } | 1467 | } |
1468 | 1468 | ||
1469 | # key, (pno1, pno2, max_pno+1, key1, key2) | ||
1470 | SE_HIL_CON_1_MAP = { | ||
1471 | '合同编号-每页': (None, None, 7, '合同编号', None), | ||
1472 | '合同编号-正文': (5, 4, 7, '合同编号(正文)', None), | ||
1473 | '车辆识别代码': (5, 4, 7, '车辆识别代码', None), | ||
1474 | '车辆卖方': (5, 4, 7, '车辆卖方(经销商)', None), | ||
1475 | '车辆原始销售价格': (5, 4, 7, '车辆原始销售价格(《机动车销售统一发票》所列金额)', None), | ||
1476 | '融资成本总额': (5, 4, 7, '融资成本总额', None), | ||
1477 | '租期': (5, 4, 7, '租期', None), | ||
1478 | '还款计划表': (5, 5, 7, '付款计划表', None), | ||
1479 | 'ASP项目详情': (5, 4, 7, '车辆附加产品明细表', None), | ||
1480 | '承租人法定代表人或授权代表': (1, 1, 7, '承租人-法定代表人或授权代表', None), | ||
1481 | |||
1482 | '承租人姓名': (1, 1, 7, '承租人-姓名', None), | ||
1483 | '承租人证件号': (1, 1, 7, '承租人-证件号码', None), | ||
1484 | '承租人签字': (6, 6, 7, '签字页-承租人姓名', None), | ||
1485 | |||
1486 | '共同承租人姓名': (1, 1, 7, '共同承租人-姓名', None), | ||
1487 | '共同承租人证件号': (1, 1, 7, '共同承租人-证件号码', None), | ||
1488 | '共同承租人签字': (6, 6, 7, '签字页-共同承租人姓名', None), | ||
1489 | |||
1490 | '保证人姓名1': (1, 1, 7, '保证人1-姓名', None), | ||
1491 | '保证人证件号1': (1, 1, 7, '保证人1-证件号码', None), | ||
1492 | '保证人签字1': (6, 6, 7, '签字页-保证人1姓名', None), | ||
1493 | |||
1494 | '保证人姓名2': (1, 1, 7, '保证人2-姓名', None), | ||
1495 | '保证人证件号2': (1, 1, 7, '保证人2-证件号码', None), | ||
1496 | '保证人签字2': (6, 6, 7, '签字页-保证人2姓名', None), | ||
1497 | } | ||
1498 | |||
1499 | SE_HIL_CON_2_MAP = { | ||
1500 | '合同编号': (1, None, 3, '合同编号', None), | ||
1501 | '合同编号-正文': (1, None, 3, '合同编号(正文)', None), | ||
1502 | '车辆识别代码': (1, None, 3, '车辆识别代码', None), | ||
1503 | '租金总额': (1, None, 3, '租金总额', None), | ||
1504 | '融资租赁期限': (1, None, 3, '融资租赁期限', None), | ||
1505 | '抵押人': (1, None, 3, '抵押人姓名/名称', None), | ||
1506 | '抵押人证件号码': (1, None, 3, '抵押人证件号码', None), | ||
1507 | '抵押人签字': (2, None, 3, '签字页-抵押人姓名', None), | ||
1508 | '抵押人配偶': (1, None, 3, '抵押人配偶姓名/名称', None), | ||
1509 | '抵押人配偶证件号码': (1, None, 3, '抵押人配偶证件号码', None), | ||
1510 | '抵押人配偶签字': (2, None, 3, '签字页-抵押人配偶姓名', None), | ||
1511 | } | ||
1512 | |||
1513 | SE_HIL_CON_3_MAP = { | ||
1514 | '合同编号-每页': (None, None, 5, '合同编号', None), | ||
1515 | '承租人姓名': (1, None, 5, '承租人-姓名', None), | ||
1516 | '承租人证件号码': (1, None, 5, '承租人-证件号码', None), | ||
1517 | '销售经销商': (1, None, 5, '销售经销商', None), | ||
1518 | '合同编号-正文': (1, None, 5, '合同编号(正文)', None), | ||
1519 | '姓名/名称': (4, None, 5, '签字页-承租人姓名', None), | ||
1520 | '自然人身份证件号码/法人执照号码': (4, None, 5, '签字页-自然人身份证件号码/法人执照号码', None), | ||
1521 | '承租人签字': (4, None, 5, '签字页-承租人签章', None), | ||
1522 | } | ||
1523 | |||
1524 | SE_HIL_CON_MAP = { | ||
1525 | HIL_CONTRACT_1_CLASSIFY: SE_HIL_CON_1_MAP, | ||
1526 | HIL_CONTRACT_2_CLASSIFY: SE_HIL_CON_2_MAP, | ||
1527 | HIL_CONTRACT_3_CLASSIFY: SE_HIL_CON_3_MAP, | ||
1528 | } | ||
1529 | |||
1469 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', | 1530 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', |
1470 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', | 1531 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', |
1471 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', | 1532 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', |
1472 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情'] | 1533 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情'] |
1473 | 1534 | ||
1474 | # '项目1', '用途总金额', '贷款本金', '附加产品融资贷款本金总金额', '购置税校验' | 1535 | # '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表' |
1536 | SE_HIL_CON_1_FIELD = ['合同编号-每页', '合同编号-正文', '车辆识别代码', '车辆卖方', '车辆原始销售价格', '融资成本总额', '租期', | ||
1537 | '还款计划表', 'ASP项目详情', '购置税校验', '承租人法定代表人或授权代表'] | ||
1538 | SE_HIL_CON_2_FIELD = ['合同编号', '合同编号-正文', '车辆识别代码', '租金总额', '融资租赁期限'] | ||
1539 | SE_HIL_CON_3_FIELD = ['合同编号-每页', '承租人姓名', '承租人证件号码', '销售经销商', '合同编号-正文', '姓名/名称', | ||
1540 | '自然人身份证件号码/法人执照号码', '承租人签字'] | ||
1541 | |||
1475 | 1542 | ||
1476 | ROLE_LIST = [ | 1543 | ROLE_LIST = [ |
1477 | ('借款人签字及时间', 'Borrower', 0, 0, True, False), | 1544 | ('借款人签字及时间', 'Borrower', 0, 0, True, False), |
... | @@ -1496,6 +1563,35 @@ ROLE_LIST = [ | ... | @@ -1496,6 +1563,35 @@ ROLE_LIST = [ |
1496 | ('保证人日期2', 'Guarantor', 1, '有', False, False), | 1563 | ('保证人日期2', 'Guarantor', 1, '有', False, False), |
1497 | ] | 1564 | ] |
1498 | 1565 | ||
1566 | # key, app_type, id_idx, field_idx, is_force, e_write | ||
1567 | ROLE_LIST_2 = [ | ||
1568 | ('抵押人', 'Borrower', 0, 0, True, True), | ||
1569 | ('抵押人证件号码', 'Borrower', 0, 2, True, True), | ||
1570 | ('抵押人签字', 'Borrower', 0, 0, True, False), | ||
1571 | |||
1572 | ('抵押人配偶', 'Co-Borrower', 0, 0, False, True), | ||
1573 | ('抵押人配偶证件号码', 'Co-Borrower', 0, 2, False, True), | ||
1574 | ('抵押人配偶签字', 'Co-Borrower', 0, 0, False, False), | ||
1575 | ] | ||
1576 | |||
1577 | ROLE_LIST_1 = [ | ||
1578 | ('承租人姓名', 'Borrower', 0, 0, True, True), | ||
1579 | ('承租人证件号', 'Borrower', 0, 2, True, True), | ||
1580 | ('承租人签字', 'Borrower', 0, 0, True, False), | ||
1581 | |||
1582 | ('共同承租人姓名', 'Co-Borrower', 0, 0, False, True), | ||
1583 | ('共同承租人证件号', 'Co-Borrower', 0, 2, False, True), | ||
1584 | ('共同承租人签字', 'Co-Borrower', 0, 0, False, False), | ||
1585 | |||
1586 | ('保证人姓名1', 'Guarantor', 0, 0, False, True), | ||
1587 | ('保证人证件号1', 'Guarantor', 0, 2, False, True), | ||
1588 | ('保证人签字1', 'Guarantor', 0, 0, False, False), | ||
1589 | |||
1590 | ('保证人姓名2', 'Guarantor', 1, 0, False, True), | ||
1591 | ('保证人证件号2', 'Guarantor', 1, 2, False, True), | ||
1592 | ('保证人签字2', 'Guarantor', 1, 0, False, False), | ||
1593 | ] | ||
1594 | |||
1499 | GZS_REASON_1 = '此申请有ASP产品,需人工核查' | 1595 | GZS_REASON_1 = '此申请有ASP产品,需人工核查' |
1500 | GZS_REASON_2 = 'ASP购置税金额小于系统金额' | 1596 | GZS_REASON_2 = 'ASP购置税金额小于系统金额' |
1501 | GZS_NAME = '车辆购置税' | 1597 | GZS_NAME = '车辆购置税' |
... | @@ -1678,7 +1774,7 @@ BD_COMPARE_LOGIC = { | ... | @@ -1678,7 +1774,7 @@ BD_COMPARE_LOGIC = { |
1678 | '保险截止日期': ('保险截止日期', 'se_bd_date_compare', {}, '保单截止时间有误'), | 1774 | '保险截止日期': ('保险截止日期', 'se_bd_date_compare', {}, '保单截止时间有误'), |
1679 | '保单章': ('保单章', 'se_common_compare', {}, '保单无保单章'), | 1775 | '保单章': ('保单章', 'se_common_compare', {}, '保单无保单章'), |
1680 | '第一受益人': ('特别约定第一受益人', 'se_common_compare', {}, '保单第一受益人需人工核查'), | 1776 | '第一受益人': ('特别约定第一受益人', 'se_common_compare', {}, '保单第一受益人需人工核查'), |
1681 | '保险费合计': ('保险费合计', 'se_amount_compare', {}, '保单保费疑似无法覆盖ASP保险融资'), | 1777 | '保险费合计': ('保险费合计', 'se_amount_lte_compare', {}, '保单保费疑似无法覆盖ASP保险融资'), |
1682 | } | 1778 | } |
1683 | 1779 | ||
1684 | BS_COMPARE_LOGIC = { | 1780 | BS_COMPARE_LOGIC = { |
... | @@ -1693,13 +1789,72 @@ BS_COMPARE_LOGIC = { | ... | @@ -1693,13 +1789,72 @@ BS_COMPARE_LOGIC = { |
1693 | SPECIAL_REASON = '主共借人未提供银行流水,含担保人需人工查看直系亲属关系' | 1789 | SPECIAL_REASON = '主共借人未提供银行流水,含担保人需人工查看直系亲属关系' |
1694 | SPECIAL_REASON_2 = '担保人未提供银行流水,需人工查看直系亲属关系' | 1790 | SPECIAL_REASON_2 = '担保人未提供银行流水,需人工查看直系亲属关系' |
1695 | 1791 | ||
1792 | # ['合同编号-每页', '合同编号-正文', '车辆识别代码', '车辆卖方', '车辆原始销售价格', '融资成本总额', '租期', '还款计划表', 'ASP项目详情', '购置税校验', '承租人法定代表人或授权代表'] | ||
1793 | # ['承租人姓名', '承租人证件号', '承租人签字', '共同承租人姓名', '共同承租人证件号', '共同承租人签字', '保证人姓名1', '保证人证件号1', '保证人签字1', '保证人姓名2', '保证人证件号2', '保证人签字2'] | ||
1794 | HIL_CONTRACT_1_COMPARE_LOGIC = { | ||
1795 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '售后回租合同中合同编号系统不一致'), | ||
1796 | '合同编号-正文': ('合同编号-正文', 'se_common_compare', {}, '售后回租合同第一页正文中合同编号系统不一致'), | ||
1797 | '车辆识别代码': ('车辆识别代码', 'se_common_compare', {}, '售后回租合同车辆识别代码与系统车架号不一致'), | ||
1798 | '车辆卖方': ('车辆卖方', 'se_common_compare', {}, '售后回租合同车辆卖方与系统经销商不一致'), | ||
1799 | '车辆原始销售价格': ('车辆原始销售价格', 'se_amount_str_compare', {}, '售后回租合同车辆原始销售价格与系统车辆价格不一致'), | ||
1800 | '融资成本总额': ('融资成本总额', 'se_amount_str_compare', {}, '售后回租合同ASP融资成本总额与系统不一致'), | ||
1801 | '租期': ('租期', 'se_contain_compare_2', {}, '售后回租合同首页中贷款期限系统不一致'), | ||
1802 | '还款计划表': ('还款计划表', 'se_schedule_compare', {"value_idx": 3}, '售后回租合同还款计划表与系统不一致'), | ||
1803 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, '售后回租合同ASP名称或者金额与系统不一致'), | ||
1804 | '承租人法定代表人或授权代表': ('承租人法定代表人或授权代表', 'se_name_compare', {}, '售后回租合同承租人法定代表人或授权代表与系统不一致'), | ||
1805 | |||
1806 | '承租人姓名': ('承租人姓名', 'se_name_compare', {}, '售后回租合同承租人姓名与系统不一致'), | ||
1807 | '承租人证件号': ('承租人证件号', 'se_common_compare', {}, '售后回租合同承租人证件号与系统不一致'), | ||
1808 | '承租人签字': ('承租人签字', 'se_contain_compare', {}, '售后回租合同承租人签字与系统不一致'), | ||
1809 | |||
1810 | '共同承租人姓名': ('共同承租人姓名', 'se_name_compare', {}, '售后回租合同共同承租人姓名与系统不一致'), | ||
1811 | '共同承租人证件号': ('共同承租人证件号', 'se_common_compare', {}, '售后回租合同共同承租人证件号与系统不一致'), | ||
1812 | '共同承租人签字': ('共同承租人签字', 'se_contain_compare', {}, '售后回租合同共同承租人签字与系统不一致'), | ||
1813 | |||
1814 | '保证人姓名1': ('保证人姓名1', 'se_name_compare', {}, '售后回租合同保证人姓名1与系统不一致'), | ||
1815 | '保证人证件号1': ('保证人证件号1', 'se_common_compare', {}, '售后回租合同保证人证件号1与系统不一致'), | ||
1816 | '保证人签字1': ('保证人签字1', 'se_contain_compare', {}, '售后回租合同保证人签字1与系统不一致'), | ||
1817 | |||
1818 | '保证人姓名2': ('保证人姓名2', 'se_name_compare', {}, '售后回租合同保证人姓名2与系统不一致'), | ||
1819 | '保证人证件号2': ('保证人证件号2', 'se_common_compare', {}, '售后回租合同保证人证件号2与系统不一致'), | ||
1820 | '保证人签字2': ('保证人签字2', 'se_contain_compare', {}, '售后回租合同保证人签字2与系统不一致'), | ||
1821 | } | ||
1822 | |||
1823 | # ['合同编号', '合同编号-正文', '车辆识别代码', '租金总额', '融资租赁期限'] | ||
1824 | # ['抵押人', '抵押人证件号码', '抵押人签字', '抵押人配偶', '抵押人配偶证件号码', '抵押人配偶签字'] | ||
1825 | HIL_CONTRACT_2_COMPARE_LOGIC = { | ||
1826 | '合同编号': ('合同编号', 'se_common_compare', {}, '车辆租赁抵押合同合同编号与系统合同编号不一致'), | ||
1827 | '合同编号-正文': ('合同编号-正文', 'se_common_compare', {}, '车辆租赁抵押合同正文合同编号与系统合同编号不一致'), | ||
1828 | '车辆识别代码': ('车辆识别代码', 'se_common_compare', {}, '车辆租赁抵押合同车辆识别代码与系统车架号不一致'), | ||
1829 | '租金总额': ('租金总额', 'se_amount_str_compare', {}, '车辆租赁抵押合同租金总额与系统租金总额不一致'), | ||
1830 | '融资租赁期限': ('融资租赁期限', 'se_common_compare', {}, '车辆租赁抵押合同融资租赁期限与系统不一致'), | ||
1831 | '抵押人': ('抵押人', 'se_name_compare', {}, '车辆租赁抵押合同抵押人姓名与系统不一致'), | ||
1832 | '抵押人证件号码': ('抵押人证件号码', 'se_common_compare', {}, '车辆租赁抵押合同抵押人证件号码与系统不一致'), | ||
1833 | '抵押人签字': ('抵押人签字', 'se_contain_compare', {}, '车辆租赁抵押合同抵押人签字与系统承租人姓名不一致'), | ||
1834 | '抵押人配偶': ('抵押人配偶', 'se_name_compare', {}, '车辆租赁抵押合同抵押人配偶姓名与系统不一致'), | ||
1835 | '抵押人配偶证件号码': ('抵押人配偶证件号码', 'se_common_compare', {}, '车辆租赁抵押合同抵押人配偶证件号码与系统不一致'), | ||
1836 | '抵押人配偶签字': ('抵押人配偶签字', 'se_contain_compare', {}, '车辆租赁抵押合同抵押人签字与系统承租人配偶姓名不一致'), | ||
1837 | } | ||
1838 | |||
1839 | # ['合同编号-每页', '承租人姓名', '承租人证件号码', '销售经销商', '合同编号-正文', '姓名/名称', '自然人身份证件号码/法人执照号码', '承租人签字'] | ||
1840 | HIL_CONTRACT_3_COMPARE_LOGIC = { | ||
1841 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '车辆处置协议合同编号与系统不一致'), | ||
1842 | '承租人姓名': ('承租人姓名', 'se_name_compare', {}, '车辆处置协议承租人姓名与系统不一致'), | ||
1843 | '承租人证件号码': ('承租人证件号码', 'se_common_compare', {}, '车辆处置协议承租人证件号码与系统不一致'), | ||
1844 | '销售经销商': ('销售经销商', 'se_common_compare', {}, '车辆处置协议经销商与系统不一致'), | ||
1845 | '合同编号-正文': ('合同编号-正文', 'se_common_compare', {}, '车辆处置协议正文合同编号与系统不一致'), | ||
1846 | '姓名/名称': ('姓名/名称', 'se_name_compare', {}, '车辆处置协议签字页客户姓名与系统不一致'), | ||
1847 | '自然人身份证件号码/法人执照号码': ('自然人身份证件号码/法人执照号码', 'se_common_compare', {}, '车辆处置协议签字页客户证件号码与系统不一致'), | ||
1848 | '承租人签字': ('承租人签字', 'se_contain_compare', {}, '车辆处置协议承租人签字与系统承租人姓名不一致'), | ||
1849 | } | ||
1850 | |||
1696 | HT_COMPARE_LOGIC = { | 1851 | HT_COMPARE_LOGIC = { |
1697 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '合同编号与系统不一致'), | 1852 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '合同编号与系统不一致'), |
1698 | '所购车辆价格-小写-重要条款': ('所购车辆价格-小写-重要条款', 'se_amount_str_compare', {}, '合同首页中车辆价格与系统不一致'), | 1853 | '所购车辆价格-小写-重要条款': ('所购车辆价格-小写-重要条款', 'se_amount_str_compare', {}, '合同首页中车辆价格与系统不一致'), |
1699 | '车架号-重要条款': ('车架号-重要条款', 'se_common_compare', {}, '合同首页中车架号与系统不一致'), | 1854 | '车架号-重要条款': ('车架号-重要条款', 'se_common_compare', {}, '合同首页中车架号与系统不一致'), |
1700 | '贷款本金金额-重要条款': ('贷款本金金额-重要条款', 'se_amount_str_compare', {}, '合同首页中贷款本金与系统不一致'), | 1855 | '贷款本金金额-重要条款': ('贷款本金金额-重要条款', 'se_amount_str_compare', {}, '合同首页中贷款本金与系统不一致'), |
1701 | '贷款期限-重要条款': ('贷款期限-重要条款', 'se_common_compare', {}, '合同首页中贷款期限与系统不一致'), | 1856 | '贷款期限-重要条款': ('贷款期限-重要条款', 'se_common_compare', {}, '合同首页中贷款期限与系统不一致'), |
1702 | '车辆贷款本金金额-重要条款': ('车辆贷款本金金额-重要条款', 'se_amount_str_compare', {}, '车辆贷款本金金额-重要条款'), | 1857 | '车辆贷款本金金额-重要条款': ('车辆贷款本金金额-重要条款', 'se_amount_str_compare', {}, '合同车辆贷款本金金额-重要条款'), |
1703 | '附加产品融资贷款本金总额-重要条款': ('附加产品融资贷款本金总额-重要条款', 'se_amount_str_compare', {}, '合同首页中附加产品融资金额与系统不一致'), | 1858 | '附加产品融资贷款本金总额-重要条款': ('附加产品融资贷款本金总额-重要条款', 'se_amount_str_compare', {}, '合同首页中附加产品融资金额与系统不一致'), |
1704 | '所购车辆价格': ('所购车辆价格', 'se_amount_str_compare', {}, '主合同页中车辆价格与系统不一致'), | 1859 | '所购车辆价格': ('所购车辆价格', 'se_amount_str_compare', {}, '主合同页中车辆价格与系统不一致'), |
1705 | '车架号': ('车架号', 'se_common_compare', {}, '主合同页中车架号与系统不一致'), | 1860 | '车架号': ('车架号', 'se_common_compare', {}, '主合同页中车架号与系统不一致'), |
... | @@ -1734,10 +1889,10 @@ HT_COMPARE_LOGIC = { | ... | @@ -1734,10 +1889,10 @@ HT_COMPARE_LOGIC = { |
1734 | '见证人签字': ('见证人签字', 'se_have_compare', {}, '合同见证人无'), | 1889 | '见证人签字': ('见证人签字', 'se_have_compare', {}, '合同见证人无'), |
1735 | '见证人日期': ('见证人日期', 'se_date_contain_compare', {}, '合同见证人签字日期不符合逻辑'), | 1890 | '见证人日期': ('见证人日期', 'se_date_contain_compare', {}, '合同见证人签字日期不符合逻辑'), |
1736 | 1891 | ||
1737 | '还款计划表': ('还款计划表', 'se_schedule_compare', {}, '还款计划表与系统不一致'), | 1892 | '还款计划表': ('还款计划表', 'se_schedule_compare', {"value_idx": 1}, '合同还款计划表与系统不一致'), |
1738 | 1893 | ||
1739 | 'ASP项目详情-重要条款': ('ASP项目详情-重要条款', 'se_asp_compare', {}, '(重要条款)ASP名称或者金额与系统不一致'), | 1894 | 'ASP项目详情-重要条款': ('ASP项目详情-重要条款', 'se_asp_compare', {}, '合同(重要条款)ASP名称或者金额与系统不一致'), |
1740 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, 'ASP名称或者金额与系统不一致'), | 1895 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, '合同ASP名称或者金额与系统不一致'), |
1741 | } | 1896 | } |
1742 | 1897 | ||
1743 | 1898 | ||
... | @@ -1764,8 +1919,8 @@ SE_COMPARE_FIELD = { | ... | @@ -1764,8 +1919,8 @@ SE_COMPARE_FIELD = { |
1764 | BD_EN: (BD_FIELD, BD_COMPARE_LOGIC, False), | 1919 | BD_EN: (BD_FIELD, BD_COMPARE_LOGIC, False), |
1765 | BS_EN: (BS_FIELD, BS_COMPARE_LOGIC, False), | 1920 | BS_EN: (BS_FIELD, BS_COMPARE_LOGIC, False), |
1766 | HIL_CONTRACT_1_EN: (HIL_CONTRACT_1_FIELD, HIL_CONTRACT_1_COMPARE_LOGIC, False), | 1921 | HIL_CONTRACT_1_EN: (HIL_CONTRACT_1_FIELD, HIL_CONTRACT_1_COMPARE_LOGIC, False), |
1767 | HIL_CONTRACT_2_EN: (HIL_CONTRACT_1_FIELD, HIL_CONTRACT_2_COMPARE_LOGIC, False), | 1922 | HIL_CONTRACT_2_EN: (HIL_CONTRACT_2_FIELD, HIL_CONTRACT_2_COMPARE_LOGIC, False), |
1768 | HIL_CONTRACT_3_EN: (HIL_CONTRACT_1_FIELD, HIL_CONTRACT_3_COMPARE_LOGIC, False), | 1923 | HIL_CONTRACT_3_EN: (HIL_CONTRACT_3_FIELD, HIL_CONTRACT_3_COMPARE_LOGIC, False), |
1769 | } | 1924 | } |
1770 | 1925 | ||
1771 | 1926 | ... | ... |
... | @@ -909,11 +909,10 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -909,11 +909,10 @@ class Command(BaseCommand, LoggerMixin): |
909 | ) | 909 | ) |
910 | return res | 910 | return res |
911 | 911 | ||
912 | def rebuild_contract(self, contract_result_compare): | 912 | def rebuild_contract(self, license_summary, contract_result_compare): |
913 | res_list = [] | ||
914 | for classify, page_info_dict in contract_result_compare.items(): | 913 | for classify, page_info_dict in contract_result_compare.items(): |
915 | res = {} | ||
916 | if classify == consts.CONTRACT_CLASSIFY: | 914 | if classify == consts.CONTRACT_CLASSIFY: |
915 | res = {} | ||
917 | is_asp = page_info_dict.get(consts.ASP_KEY, False) | 916 | is_asp = page_info_dict.get(consts.ASP_KEY, False) |
918 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): | 917 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): |
919 | pno = pno_asp if is_asp else pno_not_asp | 918 | pno = pno_asp if is_asp else pno_not_asp |
... | @@ -927,8 +926,26 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -927,8 +926,26 @@ class Command(BaseCommand, LoggerMixin): |
927 | res[key] = page_info_dict.get(str(pno), {}).get(key1, '') | 926 | res[key] = page_info_dict.get(str(pno), {}).get(key1, '') |
928 | else: | 927 | else: |
929 | res[key] = page_info_dict.get(str(pno), {}).get(key1, {}).get(key2, '') | 928 | res[key] = page_info_dict.get(str(pno), {}).get(key1, {}).get(key2, '') |
930 | res_list.append(res) | 929 | |
931 | return res_list | 930 | license_summary[classify] = [res] |
931 | else: | ||
932 | res = {} | ||
933 | for key, (pno1, pno2, end_idx, key1, key2) in consts.SE_HIL_CON_MAP[classify].items(): | ||
934 | if pno1 is None: | ||
935 | for i in range(1, end_idx): | ||
936 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) | ||
937 | elif key2 is None: | ||
938 | tmp_res = page_info_dict.get(str(pno1), {}).get(key1) | ||
939 | if tmp_res is None and isinstance(pno2, int): | ||
940 | tmp_res = page_info_dict.get(str(pno2), {}).get(key1, '') | ||
941 | res[key] = tmp_res | ||
942 | else: | ||
943 | tmp_res = page_info_dict.get(str(pno1), {}).get(key1, {}).get(key2) | ||
944 | if tmp_res is None and isinstance(pno2, int): | ||
945 | tmp_res = page_info_dict.get(str(pno2), {}).get(key1, {}).get(key2, '') | ||
946 | res[key] = tmp_res | ||
947 | |||
948 | license_summary[classify] = [res] | ||
932 | 949 | ||
933 | def rebuild_bs_summary(self, bs_summary, unknown_summary): | 950 | def rebuild_bs_summary(self, bs_summary, unknown_summary): |
934 | # bs_summary = { | 951 | # bs_summary = { |
... | @@ -1659,9 +1676,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -1659,9 +1676,7 @@ class Command(BaseCommand, LoggerMixin): |
1659 | finally: | 1676 | finally: |
1660 | # TODO 识别结果存一张表,方便跑报表 | 1677 | # TODO 识别结果存一张表,方便跑报表 |
1661 | 1678 | ||
1662 | contract_result_compare_rebuild = self.rebuild_contract(contract_result_compare) | 1679 | self.rebuild_contract(license_summary, contract_result_compare) |
1663 | if len(contract_result_compare_rebuild) > 0: | ||
1664 | license_summary[consts.CONTRACT_CLASSIFY] = contract_result_compare_rebuild | ||
1665 | 1680 | ||
1666 | bs_rebuild = self.rebuild_bs(merged_bs_summary) | 1681 | bs_rebuild = self.rebuild_bs(merged_bs_summary) |
1667 | if len(bs_rebuild) > 0: | 1682 | if len(bs_rebuild) > 0: | ... | ... |
... | @@ -925,7 +925,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -925,7 +925,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
925 | license_dict[consts.BL_EN] = bl_field_input | 925 | license_dict[consts.BL_EN] = bl_field_input |
926 | all_id_num.append(id_num) | 926 | all_id_num.append(id_num) |
927 | if individual_info.get('customersubType', '') == 'Corporate': | 927 | if individual_info.get('customersubType', '') == 'Corporate': |
928 | company_info_list.append((customer_name, id_num)) | 928 | company_info_list.append((customer_name, id_num, legal_name)) |
929 | 929 | ||
930 | # SME营业执照--------------------------------------------------------------------------------------------------- | 930 | # SME营业执照--------------------------------------------------------------------------------------------------- |
931 | if individual_info.get('customersubType', '').startswith('Self Employed'): | 931 | if individual_info.get('customersubType', '').startswith('Self Employed'): |
... | @@ -1091,7 +1091,6 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1091,7 +1091,6 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
1091 | bs_info[consts.BS_EN] = bs_field_input | 1091 | bs_info[consts.BS_EN] = bs_field_input |
1092 | compare_info['Bank Statement'] = bs_info | 1092 | compare_info['Bank Statement'] = bs_info |
1093 | 1093 | ||
1094 | |||
1095 | # 抵押登记豁免函---------------------------------------------------------------------------------------------------- | 1094 | # 抵押登记豁免函---------------------------------------------------------------------------------------------------- |
1096 | other_info = {} | 1095 | other_info = {} |
1097 | full_no = cms_info.get('settlemnetVerification', {}).get('applicationNo', '') | 1096 | full_no = cms_info.get('settlemnetVerification', {}).get('applicationNo', '') |
... | @@ -1156,13 +1155,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1156,13 +1155,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
1156 | 1155 | ||
1157 | # 保单 ----------------------------------------------------------------------------------------------------------- | 1156 | # 保单 ----------------------------------------------------------------------------------------------------------- |
1158 | is_insurance = 0 | 1157 | is_insurance = 0 |
1158 | fp_campaign = cms_info.get('fpCampaign', '') | ||
1159 | insurance_type = cms_info.get('insuranceDetails', {}).get('insuranceType', '') | 1159 | insurance_type = cms_info.get('insuranceDetails', {}).get('insuranceType', '') |
1160 | if insurance_type == 'Waive Insurance' and isinstance(insurance_price, str): | 1160 | if insurance_type == 'Waive Insurance' and isinstance(insurance_price, str): |
1161 | is_insurance = 1 | 1161 | is_insurance = 1 |
1162 | elif insurance_type == 'Comprehensive Insurance': | 1162 | elif insurance_type == 'Comprehensive Insurance': |
1163 | is_insurance = 2 | 1163 | is_insurance = 2 |
1164 | if is_insurance != 0: | 1164 | if is_insurance != 0: |
1165 | fp_campaign = cms_info.get('fpCampaign', '') | ||
1166 | if fp_campaign.find('OCU') == -1: | 1165 | if fp_campaign.find('OCU') == -1: |
1167 | ssx_amount = amount | 1166 | ssx_amount = amount |
1168 | else: | 1167 | else: |
... | @@ -1190,21 +1189,93 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1190,21 +1189,93 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
1190 | if len(other_info) > 0: | 1189 | if len(other_info) > 0: |
1191 | compare_info['other'] = other_info | 1190 | compare_info['other'] = other_info |
1192 | 1191 | ||
1192 | schedule_list = [] | ||
1193 | total_amount = 0 | ||
1194 | for schedule_dict in cms_info.get('paymentSchedule', []): | ||
1195 | tmp_str = "{1}{0}{2}".format(consts.SPLIT_STR, str(schedule_dict.get('no', '')), | ||
1196 | str(schedule_dict.get('grossRentalAmount', ''))) | ||
1197 | schedule_list.append(tmp_str) | ||
1198 | total_amount += float(schedule_dict.get('grossRentalAmount', '0.0')) | ||
1199 | schedule_list_str = consts.SCHEDULE_SPLIT_STR.join(schedule_list) | ||
1200 | |||
1201 | online_sign = cms_info.get('contractSource', 'Online Sign') == 'Online Sign' | ||
1202 | |||
1203 | contract_info = {} | ||
1193 | if application_entity in consts.HIL_SET: | 1204 | if application_entity in consts.HIL_SET: |
1194 | # HIL合同----------------------------------------------------------------------------------------- | 1205 | # HIL合同 售后回租合同 -------------------------------------------------------------------------------------- |
1206 | hil_contract_1_input = [ | ||
1207 | (consts.SE_HIL_CON_1_FIELD[0], [full_no] if online_sign else full_no), | ||
1208 | (consts.SE_HIL_CON_1_FIELD[1], full_no), | ||
1209 | (consts.SE_HIL_CON_1_FIELD[2], vin_no), | ||
1210 | (consts.SE_HIL_CON_1_FIELD[3], cms_info.get('dealerName', '')), | ||
1211 | (consts.SE_HIL_CON_1_FIELD[4], amount), | ||
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'))), | ||
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 | ] | ||
1218 | |||
1219 | if isinstance(company_info, tuple): | ||
1220 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[10], company_info[2])) | ||
1221 | |||
1222 | for key, app_type, id_idx, field_idx, is_force, e_write in consts.ROLE_LIST_1: | ||
1223 | if not e_write and not online_sign: | ||
1224 | continue | ||
1225 | is_find = False | ||
1226 | if app_type in main_role_info: | ||
1227 | if len(main_role_info[app_type]) >= id_idx+1: | ||
1228 | is_find = True | ||
1229 | if isinstance(field_idx, int): | ||
1230 | hil_contract_1_input.append((key, main_role_info[app_type][id_idx][field_idx])) | ||
1231 | else: | ||
1232 | hil_contract_1_input.append((key, field_idx)) | ||
1233 | if not is_find and is_force: | ||
1234 | hil_contract_1_input.append((key, empty_str)) | ||
1235 | contract_info[consts.HIL_CONTRACT_1_EN] = hil_contract_1_input | ||
1236 | |||
1237 | # HIL合同 车辆处置协议 -------------------------------------------------------------------------------------- | ||
1238 | if fp_campaign.find('Joy_Select') != -1: | ||
1239 | hil_contract_3_input = [ | ||
1240 | (consts.SE_HIL_CON_3_FIELD[0], [full_no] if online_sign else full_no), | ||
1241 | (consts.SE_HIL_CON_3_FIELD[1], hmh_name), | ||
1242 | (consts.SE_HIL_CON_3_FIELD[2], hmh_id), | ||
1243 | (consts.SE_HIL_CON_3_FIELD[3], cms_info.get('dealerName', '')), | ||
1244 | (consts.SE_HIL_CON_3_FIELD[4], full_no), | ||
1245 | (consts.SE_HIL_CON_3_FIELD[5], hmh_name), | ||
1246 | (consts.SE_HIL_CON_3_FIELD[6], hmh_id), | ||
1247 | ] | ||
1248 | if online_sign: | ||
1249 | hil_contract_3_input.append((consts.SE_HIL_CON_3_FIELD[7], hmh_name)) | ||
1250 | contract_info[consts.HIL_CONTRACT_3_EN] = hil_contract_3_input | ||
1251 | |||
1252 | # HIL合同 车辆租赁抵押合同 -------------------------------------------------------------------------------------- | ||
1253 | hil_contract_2_input = [ | ||
1254 | (consts.SE_HIL_CON_2_FIELD[0], full_no), | ||
1255 | (consts.SE_HIL_CON_2_FIELD[1], full_no), | ||
1256 | (consts.SE_HIL_CON_2_FIELD[2], vin_no), | ||
1257 | (consts.SE_HIL_CON_2_FIELD[3], format(total_amount, '.2f')), | ||
1258 | (consts.SE_HIL_CON_2_FIELD[4], str(cms_info.get('terms', '0'))), | ||
1259 | ] | ||
1195 | 1260 | ||
1261 | for key, app_type, id_idx, field_idx, is_force, e_write in consts.ROLE_LIST_2: | ||
1262 | if not e_write and not online_sign: | ||
1263 | continue | ||
1264 | is_find = False | ||
1265 | if app_type in main_role_info: | ||
1266 | if len(main_role_info[app_type]) >= id_idx+1: | ||
1267 | is_find = True | ||
1268 | if isinstance(field_idx, int): | ||
1269 | hil_contract_2_input.append((key, main_role_info[app_type][id_idx][field_idx])) | ||
1270 | else: | ||
1271 | hil_contract_2_input.append((key, field_idx)) | ||
1272 | if not is_find and is_force: | ||
1273 | hil_contract_2_input.append((key, empty_str)) | ||
1274 | contract_info[consts.HIL_CONTRACT_2_EN] = hil_contract_2_input | ||
1275 | compare_info['contract'] = contract_info | ||
1196 | return compare_info, cms_info.get('applicationVersion', 1) | 1276 | return compare_info, cms_info.get('applicationVersion', 1) |
1197 | else: | 1277 | else: |
1198 | # AFC合同----------------------------------------------------------------------------------------------------------- | 1278 | # AFC合同----------------------------------------------------------------------------------------------------------- |
1199 | contract_info = {} | ||
1200 | |||
1201 | schedule_list = [] | ||
1202 | for schedule_dict in cms_info.get('paymentSchedule', []): | ||
1203 | tmp_str = "{1}{0}{2}".format(consts.SPLIT_STR, str(schedule_dict.get('no', '')), | ||
1204 | str(schedule_dict.get('grossRentalAmount', ''))) | ||
1205 | schedule_list.append(tmp_str) | ||
1206 | schedule_list_str = consts.SCHEDULE_SPLIT_STR.join(schedule_list) | ||
1207 | |||
1208 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) | 1279 | vehicle_principal_str = str(cms_info.get('financialInformation', {}).get('vehiclePrincipal', '0.0')) |
1209 | afc_contract_input = [ | 1280 | afc_contract_input = [ |
1210 | (consts.SE_AFC_CON_FIELD[0], full_no), | 1281 | (consts.SE_AFC_CON_FIELD[0], full_no), |
... | @@ -1238,7 +1309,6 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): | ... | @@ -1238,7 +1309,6 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list): |
1238 | afc_contract_input.pop(9) | 1309 | afc_contract_input.pop(9) |
1239 | 1310 | ||
1240 | # '借款人签字及时间', 'Borrower', 0, 0, True | 1311 | # '借款人签字及时间', 'Borrower', 0, 0, True |
1241 | online_sign = cms_info.get('contractSource', 'Online Sign') == 'Online Sign' | ||
1242 | for key, app_type, id_idx, field_idx, is_force, e_write in consts.ROLE_LIST: | 1312 | for key, app_type, id_idx, field_idx, is_force, e_write in consts.ROLE_LIST: |
1243 | if not e_write and not online_sign: | 1313 | if not e_write and not online_sign: |
1244 | continue | 1314 | continue |
... | @@ -1729,7 +1799,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list): | ... | @@ -1729,7 +1799,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list): |
1729 | return result_field_list, no_ocr_result, field_img_path_dict | 1799 | return result_field_list, no_ocr_result, field_img_path_dict |
1730 | 1800 | ||
1731 | 1801 | ||
1732 | def se_afc_contract_compare(license_en, ocr_res_dict, strip_list): | 1802 | def se_contract_compare(license_en, ocr_res_dict, strip_list): |
1733 | ocr_field, compare_logic, _ = consts.SE_COMPARE_FIELD[license_en] | 1803 | ocr_field, compare_logic, _ = consts.SE_COMPARE_FIELD[license_en] |
1734 | ocr_res_str = ocr_res_dict.get(ocr_field) | 1804 | ocr_res_str = ocr_res_dict.get(ocr_field) |
1735 | 1805 | ||
... | @@ -1983,8 +2053,8 @@ def se_compare_process(compare_info, ocr_res_dict): | ... | @@ -1983,8 +2053,8 @@ def se_compare_process(compare_info, ocr_res_dict): |
1983 | failure_field = [] | 2053 | failure_field = [] |
1984 | if license_en == consts.MVC34_EN: | 2054 | if license_en == consts.MVC34_EN: |
1985 | result_field_list, field_img_path_dict = se_mvc34_compare(license_en, ocr_res_dict, strip_list) | 2055 | result_field_list, field_img_path_dict = se_mvc34_compare(license_en, ocr_res_dict, strip_list) |
1986 | elif license_en == consts.AFC_CONTRACT_EN: | 2056 | elif license_en in [consts.HIL_CONTRACT_1_EN, consts.HIL_CONTRACT_2_EN, consts.HIL_CONTRACT_3_EN, consts.AFC_CONTRACT_EN]: |
1987 | result_field_list, field_img_path_dict = se_afc_contract_compare(license_en, ocr_res_dict, strip_list) | 2057 | result_field_list, field_img_path_dict = se_contract_compare(license_en, ocr_res_dict, strip_list) |
1988 | elif license_en == consts.BS_EN: | 2058 | elif license_en == consts.BS_EN: |
1989 | result_field_list, field_img_path_dict = se_bs_compare(license_en, ocr_res_dict, strip_list) | 2059 | result_field_list, field_img_path_dict = se_bs_compare(license_en, ocr_res_dict, strip_list) |
1990 | else: | 2060 | else: | ... | ... |
... | @@ -159,12 +159,17 @@ class Comparison: | ... | @@ -159,12 +159,17 @@ class Comparison: |
159 | 159 | ||
160 | return self.build_res(input_str == compare_str), compare_str | 160 | return self.build_res(input_str == compare_str), compare_str |
161 | 161 | ||
162 | def se_list_compare(self, input_str, ocr_str_or_list, **kwargs): | 162 | def se_list_compare(self, input_str_or_list, ocr_str_or_list, **kwargs): |
163 | if isinstance(ocr_str_or_list, list): | 163 | if isinstance(ocr_str_or_list, list) and len(ocr_str_or_list) > 0: |
164 | for item in ocr_str_or_list: | 164 | if isinstance(input_str_or_list, list) and len(input_str_or_list) > 0: |
165 | if item != input_str: | 165 | if input_str_or_list[0] == ocr_str_or_list[0]: |
166 | return self.RESULT_N | 166 | return self.RESULT_Y |
167 | return self.RESULT_Y | 167 | return self.RESULT_N |
168 | else: | ||
169 | for item in ocr_str_or_list: | ||
170 | if item != input_str_or_list: | ||
171 | return self.RESULT_N | ||
172 | return self.RESULT_Y | ||
168 | else: | 173 | else: |
169 | return self.RESULT_N | 174 | return self.RESULT_N |
170 | 175 | ||
... | @@ -177,7 +182,8 @@ class Comparison: | ... | @@ -177,7 +182,8 @@ class Comparison: |
177 | ocr_str_or_list.pop(0) | 182 | ocr_str_or_list.pop(0) |
178 | schedule_list = [] | 183 | schedule_list = [] |
179 | for row_list in ocr_str_or_list: | 184 | for row_list in ocr_str_or_list: |
180 | tmp_str = "{1}{0}{2}".format(self.SPLIT_STR, row_list[0], row_list[1].replace(',', '')) | 185 | tmp_str = "{1}{0}{2}".format( |
186 | self.SPLIT_STR, row_list[0], row_list[kwargs.get('value_idx', 1)].replace(',', '')) | ||
181 | schedule_list.append(tmp_str) | 187 | schedule_list.append(tmp_str) |
182 | return self.build_res(self.SCHEDULE_SPLIT_STR.join(schedule_list) == input_str) | 188 | return self.build_res(self.SCHEDULE_SPLIT_STR.join(schedule_list) == input_str) |
183 | else: | 189 | else: |
... | @@ -304,7 +310,6 @@ class Comparison: | ... | @@ -304,7 +310,6 @@ class Comparison: |
304 | except Exception as e: | 310 | except Exception as e: |
305 | return self.RESULT_N | 311 | return self.RESULT_N |
306 | 312 | ||
307 | |||
308 | def ca_date_compare(self, input_str, ocr_str, **kwargs): | 313 | def ca_date_compare(self, input_str, ocr_str, **kwargs): |
309 | if kwargs.get('long', False): | 314 | if kwargs.get('long', False): |
310 | if '长期' in ocr_str or '永久' in ocr_str: | 315 | if '长期' in ocr_str or '永久' in ocr_str: |
... | @@ -366,7 +371,7 @@ class Comparison: | ... | @@ -366,7 +371,7 @@ class Comparison: |
366 | def se_amount_lte_compare(self, input_str, ocr_str, **kwargs): | 371 | def se_amount_lte_compare(self, input_str, ocr_str, **kwargs): |
367 | try: | 372 | try: |
368 | float_input = float(input_str) | 373 | float_input = float(input_str) |
369 | float_ocr = float(ocr_str) | 374 | float_ocr = float(ocr_str.replace('元', '').replace(',', '')) |
370 | except Exception as e: | 375 | except Exception as e: |
371 | return self.RESULT_N | 376 | return self.RESULT_N |
372 | else: | 377 | else: | ... | ... |
-
Please register or sign in to post a comment