Merge branch 'feature/SE3'
Showing
9 changed files
with
181 additions
and
80 deletions
... | @@ -1031,9 +1031,9 @@ JYPZ_FIELD_ORDER = (("type", "标题"), | ... | @@ -1031,9 +1031,9 @@ JYPZ_FIELD_ORDER = (("type", "标题"), |
1031 | ("buyer_id", "购买方身份证号码/营业执照号码"), | 1031 | ("buyer_id", "购买方身份证号码/营业执照号码"), |
1032 | ("vin", "车辆识别代号/车架号码"), | 1032 | ("vin", "车辆识别代号/车架号码"), |
1033 | ("price", "车辆价格"), | 1033 | ("price", "车辆价格"), |
1034 | ("date", "购买方交易日期"), | 1034 | ("buyer_date", "购买方交易日期"), |
1035 | ("date", "出卖方交易日期"), | 1035 | ("seller_date", "出卖方交易日期"), |
1036 | ("date", "经销商交易日期"), | 1036 | ("agent_date", "经销商交易日期"), |
1037 | ("stamp_signature_buyer", "购买方签字/盖章"), | 1037 | ("stamp_signature_buyer", "购买方签字/盖章"), |
1038 | ("stamp_signature_seller", "出卖方签字/盖章"), | 1038 | ("stamp_signature_seller", "出卖方签字/盖章"), |
1039 | ("stamp_signature_agent", "经销商签字/盖章"),) | 1039 | ("stamp_signature_agent", "经销商签字/盖章"),) |
... | @@ -1439,6 +1439,8 @@ SE_BS_FIELD = ['户名', '打印日期', '流水日期', '(担保人1)户名', ' | ... | @@ -1439,6 +1439,8 @@ SE_BS_FIELD = ['户名', '打印日期', '流水日期', '(担保人1)户名', ' |
1439 | SE_HMH_FIELD = ['借款人/承租人姓名', '借款人/承租人证件号', '申请号', '渠道', '签字'] | 1439 | SE_HMH_FIELD = ['借款人/承租人姓名', '借款人/承租人证件号', '申请号', '渠道', '签字'] |
1440 | SE_BD_FIELD = ['被保险人姓名', '被保险人证件号码', '车架号', '机动车损失保险金额', '第三者责任保险金额', '绝对免赔率', '保险起始日期', '保险截止日期', '保单章', '第一受益人', '保险费合计'] | 1440 | SE_BD_FIELD = ['被保险人姓名', '被保险人证件号码', '车架号', '机动车损失保险金额', '第三者责任保险金额', '绝对免赔率', '保险起始日期', '保险截止日期', '保单章', '第一受益人', '保险费合计'] |
1441 | JDMPV_VALUE = ['-', '--', '0%', '0.00', '/', '0', ''] | 1441 | JDMPV_VALUE = ['-', '--', '0%', '0.00', '/', '0', ''] |
1442 | JYPZ_TYPE_1 = ['二手车交易凭证'] | ||
1443 | JYPZ_TYPE_2 = ['BMW官方认证二手车交易凭证', '二手车交易凭证'] | ||
1442 | 1444 | ||
1443 | SE_BANK_FIELD = ['accountNo', 'bankName'] | 1445 | SE_BANK_FIELD = ['accountNo', 'bankName'] |
1444 | SE_DDA_FIELD = ['applicationId(1)', 'applicationId(2)', 'bankName', 'companyName', 'customerName', 'idNum', 'accountHolderName', 'accountNo'] | 1446 | SE_DDA_FIELD = ['applicationId(1)', 'applicationId(2)', 'bankName', 'companyName', 'customerName', 'idNum', 'accountHolderName', 'accountNo'] |
... | @@ -1582,19 +1584,21 @@ SE_HIL_CON_MAP = { | ... | @@ -1582,19 +1584,21 @@ SE_HIL_CON_MAP = { |
1582 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', | 1584 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', |
1583 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', | 1585 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', |
1584 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', | 1586 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', |
1585 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情'] | 1587 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情', |
1588 | '合同编号-每页(no-asp)', '无ASP产品'] | ||
1586 | CON_BANK_FIELD = ['还款账号', '户名', '开户行'] | 1589 | CON_BANK_FIELD = ['还款账号', '户名', '开户行'] |
1587 | 1590 | ||
1588 | # '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表' | 1591 | # '承租人姓名', '承租人证件号码', '承租人法定代表人或授权代表' |
1589 | SE_HIL_CON_1_FIELD = ['合同编号-每页', '合同编号-正文', '车辆识别代码', '车辆卖方', '车辆原始销售价格', '融资成本总额', '租期', | 1592 | SE_HIL_CON_1_FIELD = ['合同编号-每页', '合同编号-正文', '车辆识别代码', '车辆卖方', '车辆原始销售价格', '融资成本总额', '租期', |
1590 | '还款计划表', 'ASP项目详情', '购置税校验', '承租人法定代表人或授权代表', '还款账号', '户名', '开户行', | 1593 | '还款计划表', 'ASP项目详情', '购置税校验', '承租人法定代表人或授权代表', '还款账号', '户名', '开户行', |
1591 | '共同承租人法定代表人或授权代表'] | 1594 | '共同承租人法定代表人或授权代表', '无ASP产品'] |
1592 | SE_HIL_CON_2_FIELD = ['合同编号', '合同编号-正文', '车辆识别代码', '租金总额', '融资租赁期限'] | 1595 | SE_HIL_CON_2_FIELD = ['合同编号', '合同编号-正文', '车辆识别代码', '租金总额', '融资租赁期限'] |
1593 | SE_HIL_CON_3_FIELD = ['合同编号-每页', '承租人姓名', '承租人证件号码', '销售经销商', '合同编号-正文', '姓名/名称', | 1596 | SE_HIL_CON_3_FIELD = ['合同编号-每页', '承租人姓名', '承租人证件号码', '销售经销商', '合同编号-正文', '姓名/名称', |
1594 | '自然人身份证件号码/法人执照号码', '承租人签字'] | 1597 | '自然人身份证件号码/法人执照号码', '承租人签字'] |
1595 | 1598 | ||
1596 | 1599 | ||
1597 | ROLE_LIST = [ | 1600 | ROLE_LIST = [ |
1601 | # key_afc1, cdfl_key, app_type, id_idx, field_idx, is_force, e_write | ||
1598 | ('借款人签字及时间', '借款人签字及时间', 'Borrower', 0, 0, True, False), | 1602 | ('借款人签字及时间', '借款人签字及时间', 'Borrower', 0, 0, True, False), |
1599 | ('借款人姓名', '借款人姓名', 'Borrower', 0, 0, True, True), | 1603 | ('借款人姓名', '借款人姓名', 'Borrower', 0, 0, True, True), |
1600 | ('借款人证件号', '借款人证件号', 'Borrower', 0, 2, True, True), | 1604 | ('借款人证件号', '借款人证件号', 'Borrower', 0, 2, True, True), |
... | @@ -1810,14 +1814,21 @@ DDA_COMPARE_LOGIC = { | ... | @@ -1810,14 +1814,21 @@ DDA_COMPARE_LOGIC = { |
1810 | } | 1814 | } |
1811 | 1815 | ||
1812 | JYPZ_COMPARE_LOGIC = { | 1816 | JYPZ_COMPARE_LOGIC = { |
1817 | 'type': ('type', 'super_list_compare', {}, '二手车凭证类型与产品不符'), | ||
1813 | 'vinNo': ('vin', 'se_common_compare', {}, '二手车凭证车辆识别代号与系统车架号不一致'), | 1818 | 'vinNo': ('vin', 'se_common_compare', {}, '二手车凭证车辆识别代号与系统车架号不一致'), |
1814 | 'dealerName': ('authorized_dealer', 'se_common_compare', {}, '二手车凭证经销商与系统经销商不一致'), | 1819 | 'dealerName': ('authorized_dealer', 'se_common_compare', {}, '二手车凭证经销商与系统经销商不一致'), |
1815 | 'vehicleTransactionAmount': ('price', 'se_amount_compare', {}, '二手车凭证购买方交易价格与系统车辆价格不一致'), | 1820 | 'vehicleTransactionAmount': ('price', 'se_amount_compare', {}, '二手车凭证购买方交易价格与系统车辆价格不一致'), |
1816 | 'customerName': ('buyer_name', 'se_name_compare', {'is_passport': True}, '二手车凭证购买方姓名与系统主借人姓名不一致'), | 1821 | 'customerName': ('buyer_name', 'se_name_compare', {'is_passport': True}, '二手车凭证购买方姓名与系统主借人姓名不一致'), |
1817 | 'idNum': ('buyer_id', 'se_contain_compare_2', {}, '二手车凭证购买方证件号与系统主借人证件号不一致'), | 1822 | 'idNum': ('buyer_id', 'se_contain_compare_2', {}, '二手车凭证购买方证件号与系统主借人证件号不一致'), |
1818 | 'date': ('date', 'se_date_compare_2', {'three_month': True}, '二手车凭证交易日期早于submissionDate'), | 1823 | # 'date': ('date', 'se_date_compare_2', {'three_month': True}, '二手车凭证交易日期早于submissionDate'), |
1824 | 'date': ('buyer_date', 'se_jypz_date_compare', {}, '二手车交易凭证交易日期不一致或二手车凭证交易日期早于submissionDate'), | ||
1819 | } | 1825 | } |
1820 | 1826 | ||
1827 | JYPZ_DATE_FIELD_1 = 'date' | ||
1828 | JYPZ_DATE_FIELD_2 = 'buyer_date' | ||
1829 | JYPZ_DATE_FIELD_3 = 'seller_date' | ||
1830 | JYPZ_DATE_FIELD_4 = 'agent_date' | ||
1831 | |||
1821 | HMH_COMPARE_LOGIC = { | 1832 | HMH_COMPARE_LOGIC = { |
1822 | '借款人/承租人姓名': ('借款/承租人姓名', 'se_name_compare', {}, '抵押登记豁免函借款人/承租人姓名与系统不符'), | 1833 | '借款人/承租人姓名': ('借款/承租人姓名', 'se_name_compare', {}, '抵押登记豁免函借款人/承租人姓名与系统不符'), |
1823 | '借款人/承租人证件号': ('证件号码', 'se_common_compare', {}, '抵押登记豁免函借款人/承租人证件号码与系统不符'), | 1834 | '借款人/承租人证件号': ('证件号码', 'se_common_compare', {}, '抵押登记豁免函借款人/承租人证件号码与系统不符'), |
... | @@ -1911,6 +1922,9 @@ HIL_CONTRACT_1_COMPARE_LOGIC = { | ... | @@ -1911,6 +1922,9 @@ HIL_CONTRACT_1_COMPARE_LOGIC = { |
1911 | '保证人姓名2': ('保证人姓名2', 'se_name_compare', {}, '售后回租合同保证人姓名2与系统不一致'), | 1922 | '保证人姓名2': ('保证人姓名2', 'se_name_compare', {}, '售后回租合同保证人姓名2与系统不一致'), |
1912 | '保证人证件号2': ('保证人证件号2', 'se_common_compare', {}, '售后回租合同保证人证件号2与系统不一致'), | 1923 | '保证人证件号2': ('保证人证件号2', 'se_common_compare', {}, '售后回租合同保证人证件号2与系统不一致'), |
1913 | '保证人签字2': ('保证人签字2', 'se_contain_compare', {}, '售后回租合同保证人签字2与系统不一致'), | 1924 | '保证人签字2': ('保证人签字2', 'se_contain_compare', {}, '售后回租合同保证人签字2与系统不一致'), |
1925 | |||
1926 | '购置税校验': ('购置税校验', 'se_self_compare_gzs', {}, GZS_REASON_2), | ||
1927 | '无ASP产品': ('无ASP产品', 'se_self_compare_other_asp', {}, GZS_REASON_1), | ||
1914 | } | 1928 | } |
1915 | 1929 | ||
1916 | # ['合同编号', '合同编号-正文', '车辆识别代码', '租金总额', '融资租赁期限'] | 1930 | # ['合同编号', '合同编号-正文', '车辆识别代码', '租金总额', '融资租赁期限'] |
... | @@ -1943,6 +1957,8 @@ HIL_CONTRACT_3_COMPARE_LOGIC = { | ... | @@ -1943,6 +1957,8 @@ HIL_CONTRACT_3_COMPARE_LOGIC = { |
1943 | 1957 | ||
1944 | HT_COMPARE_LOGIC = { | 1958 | HT_COMPARE_LOGIC = { |
1945 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '合同编号与系统不一致'), | 1959 | '合同编号-每页': ('合同编号-每页', 'se_list_compare', {}, '合同编号与系统不一致'), |
1960 | # '合同编号-每页(no-asp)': ('合同编号-每页', 'se_list_compare', {'pop_last': True}, '合同编号与系统不一致'), | ||
1961 | '合同编号-每页(no-asp)': ('合同编号-每页', 'se_list_compare', {}, '合同编号与系统不一致'), | ||
1946 | '所购车辆价格-小写-重要条款': ('所购车辆价格-小写-重要条款', 'se_amount_str_compare', {}, '合同首页中车辆价格与系统不一致'), | 1962 | '所购车辆价格-小写-重要条款': ('所购车辆价格-小写-重要条款', 'se_amount_str_compare', {}, '合同首页中车辆价格与系统不一致'), |
1947 | '车架号-重要条款': ('车架号-重要条款', 'se_common_compare', {}, '合同首页中车架号与系统不一致'), | 1963 | '车架号-重要条款': ('车架号-重要条款', 'se_common_compare', {}, '合同首页中车架号与系统不一致'), |
1948 | '贷款本金金额-重要条款': ('贷款本金金额-重要条款', 'se_amount_str_compare', {}, '合同首页中贷款本金与系统不一致'), | 1964 | '贷款本金金额-重要条款': ('贷款本金金额-重要条款', 'se_amount_str_compare', {}, '合同首页中贷款本金与系统不一致'), |
... | @@ -1988,8 +2004,12 @@ HT_COMPARE_LOGIC = { | ... | @@ -1988,8 +2004,12 @@ HT_COMPARE_LOGIC = { |
1988 | 2004 | ||
1989 | 'ASP项目详情-重要条款': ('ASP项目详情-重要条款', 'se_asp_compare', {}, '合同(重要条款)ASP名称或者金额与系统不一致'), | 2005 | 'ASP项目详情-重要条款': ('ASP项目详情-重要条款', 'se_asp_compare', {}, '合同(重要条款)ASP名称或者金额与系统不一致'), |
1990 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, '合同ASP名称或者金额与系统不一致'), | 2006 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, '合同ASP名称或者金额与系统不一致'), |
2007 | |||
2008 | '购置税校验': ('购置税校验', 'se_self_compare_gzs', {}, GZS_REASON_2), | ||
2009 | '无ASP产品': ('无ASP产品', 'se_self_compare_other_asp', {}, GZS_REASON_1), | ||
1991 | } | 2010 | } |
1992 | 2011 | ||
2012 | AFC_HT_DATE_FIELDS = ['主借人日期', '共借人日期', '保证人日期1', '保证人日期2'] | ||
1993 | 2013 | ||
1994 | # MVC_OCR_FIELD = 'mvc_ocr' | 2014 | # MVC_OCR_FIELD = 'mvc_ocr' |
1995 | 2015 | ... | ... |
... | @@ -919,6 +919,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -919,6 +919,7 @@ class Command(BaseCommand, LoggerMixin): |
919 | 'role': bs_info.get('role', ''), | 919 | 'role': bs_info.get('role', ''), |
920 | 'print_time': print_date, | 920 | 'print_time': print_date, |
921 | 'timedelta': bs_info.get('timedelta', ''), | 921 | 'timedelta': bs_info.get('timedelta', ''), |
922 | 'verify': bs_info.get('verify', True) | ||
922 | } | 923 | } |
923 | ) | 924 | ) |
924 | return res | 925 | return res |
... | @@ -928,12 +929,14 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -928,12 +929,14 @@ class Command(BaseCommand, LoggerMixin): |
928 | if classify == consts.CONTRACT_CLASSIFY: | 929 | if classify == consts.CONTRACT_CLASSIFY: |
929 | res = {} | 930 | res = {} |
930 | is_asp = page_info_dict.get(consts.ASP_KEY, False) | 931 | is_asp = page_info_dict.get(consts.ASP_KEY, False) |
932 | # is_asp = True | ||
931 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): | 933 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): |
932 | pno = pno_asp if is_asp else pno_not_asp | 934 | pno = pno_asp if is_asp else pno_not_asp |
933 | if pno is None: | 935 | if pno is None: |
934 | if isinstance(pno_asp, int): | 936 | if isinstance(pno_asp, int): |
935 | continue | 937 | continue |
936 | end_idx = 9 if is_asp else 8 | 938 | end_idx = 9 |
939 | # end_idx = 9 if is_asp else 8 | ||
937 | for i in range(1, end_idx): | 940 | for i in range(1, end_idx): |
938 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) | 941 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) |
939 | elif key2 is None: | 942 | elif key2 is None: | ... | ... |
... | @@ -882,3 +882,26 @@ class AFCAutoSettlement(models.Model): | ... | @@ -882,3 +882,26 @@ class AFCAutoSettlement(models.Model): |
882 | situ_db_label = 'afc' | 882 | situ_db_label = 'afc' |
883 | 883 | ||
884 | 884 | ||
885 | class HILbankVerification(models.Model): | ||
886 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 | ||
887 | application_id = models.CharField(max_length=64, verbose_name="申请id") # 索引 | ||
888 | on_off = models.BooleanField(default=True, verbose_name="是否有效") | ||
889 | update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') | ||
890 | create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') | ||
891 | |||
892 | class Meta: | ||
893 | managed = False | ||
894 | db_table = 'hil_bank_verification' | ||
895 | |||
896 | |||
897 | class AFCbankVerification(models.Model): | ||
898 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 | ||
899 | application_id = models.CharField(max_length=64, verbose_name="申请id") # 索引 | ||
900 | on_off = models.BooleanField(default=True, verbose_name="是否有效") | ||
901 | update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') | ||
902 | create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') | ||
903 | |||
904 | class Meta: | ||
905 | managed = False | ||
906 | db_table = 'afc_bank_verification' | ||
907 | situ_db_label = 'afc' | ... | ... |
... | @@ -392,7 +392,9 @@ class BSWorkbook(Workbook): | ... | @@ -392,7 +392,9 @@ class BSWorkbook(Workbook): |
392 | cell.fill = self.amount_fill | 392 | cell.fill = self.amount_fill |
393 | for cell in ms[4]: | 393 | for cell in ms[4]: |
394 | cell.fill = self.amount_fill | 394 | cell.fill = self.amount_fill |
395 | return ms, timedelta | 395 | |
396 | verify_res = False if len(metadata_highlight_row) > 0 or len(verify_highlight_row) > 0 else True | ||
397 | return ms, timedelta, verify_res | ||
396 | 398 | ||
397 | @staticmethod | 399 | @staticmethod |
398 | def amount_format(amount_str): | 400 | def amount_format(amount_str): |
... | @@ -723,20 +725,21 @@ class BSWorkbook(Workbook): | ... | @@ -723,20 +725,21 @@ class BSWorkbook(Workbook): |
723 | # 2.元信息提取表 | 725 | # 2.元信息提取表 |
724 | confidence = self.get_confidence(max_find_count, classify) | 726 | confidence = self.get_confidence(max_find_count, classify) |
725 | is_verify_classify = classify in consts.BS_VERIFY_CLASSIFY | 727 | is_verify_classify = classify in consts.BS_VERIFY_CLASSIFY |
726 | ms, timedelta = self.build_meta_sheet(role_name, | 728 | ms, timedelta, verify_res = self.build_meta_sheet(role_name, |
727 | new_card, | 729 | new_card, |
728 | confidence, | 730 | confidence, |
729 | summary.get('code'), | 731 | summary.get('code'), |
730 | summary.get('verify'), | 732 | summary.get('verify'), |
731 | summary.get('print_time'), | 733 | summary.get('print_time'), |
732 | start_date, | 734 | start_date, |
733 | end_date, | 735 | end_date, |
734 | res_count_tuple, | 736 | res_count_tuple, |
735 | is_verify_classify, | 737 | is_verify_classify, |
736 | metadata) | 738 | metadata) |
737 | 739 | ||
738 | summary['timedelta'] = timedelta | 740 | summary['timedelta'] = timedelta |
739 | summary['end_date'] = end_date | 741 | summary['end_date'] = end_date |
742 | summary['verify'] = verify_res | ||
740 | 743 | ||
741 | # 3.创建月份表、提取/高亮关键行 | 744 | # 3.创建月份表、提取/高亮关键行 |
742 | # 倒序处理 | 745 | # 倒序处理 | ... | ... |
... | @@ -42,6 +42,8 @@ from .models import ( | ... | @@ -42,6 +42,8 @@ from .models import ( |
42 | HILSECompareResultRecord, | 42 | HILSECompareResultRecord, |
43 | HILAutoSettlement, | 43 | HILAutoSettlement, |
44 | AFCAutoSettlement, | 44 | AFCAutoSettlement, |
45 | HILbankVerification, | ||
46 | AFCbankVerification, | ||
45 | ) | 47 | ) |
46 | from .named_enum import ErrorType, AutoResult, WholeResult, RPAResult | 48 | from .named_enum import ErrorType, AutoResult, WholeResult, RPAResult |
47 | from .mixins import DocHandler, MPOSHandler | 49 | from .mixins import DocHandler, MPOSHandler |
... | @@ -112,7 +114,7 @@ se_bank_args = { | ... | @@ -112,7 +114,7 @@ se_bank_args = { |
112 | 'applicantType': fields.Str(required=True, validate=validate.Length(max=16)), | 114 | 'applicantType': fields.Str(required=True, validate=validate.Length(max=16)), |
113 | 'accountHolderName': fields.Str(required=True, validate=validate.Length(max=256)), | 115 | 'accountHolderName': fields.Str(required=True, validate=validate.Length(max=256)), |
114 | 'accountNo': fields.Str(required=True, validate=validate.Length(max=256)), | 116 | 'accountNo': fields.Str(required=True, validate=validate.Length(max=256)), |
115 | 'bankVerificationStatus': fields.Str(required=False, validate=validate.Length(max=16)), | 117 | 'bankVerificationStatus': fields.Str(required=False, validate=validate.Length(max=128)), |
116 | 'isAllDocUploaded': fields.Boolean(required=False) | 118 | 'isAllDocUploaded': fields.Boolean(required=False) |
117 | } | 119 | } |
118 | 120 | ||
... | @@ -249,10 +251,10 @@ applicant_data_args = { | ... | @@ -249,10 +251,10 @@ applicant_data_args = { |
249 | # 'coApplicantName': fields.Str(required=True, validate=validate.Length(max=16)), | 251 | # 'coApplicantName': fields.Str(required=True, validate=validate.Length(max=16)), |
250 | # 'guarantor1Name': fields.Str(required=True, validate=validate.Length(max=16)), | 252 | # 'guarantor1Name': fields.Str(required=True, validate=validate.Length(max=16)), |
251 | # 'guarantor2Name': fields.Str(required=True, validate=validate.Length(max=16)), | 253 | # 'guarantor2Name': fields.Str(required=True, validate=validate.Length(max=16)), |
252 | 'mainApplicantName': fields.Str(required=True), | 254 | 'mainApplicantName': fields.Str(required=False), |
253 | 'coApplicantName': fields.Str(required=True), | 255 | 'coApplicantName': fields.Str(required=False), |
254 | 'guarantor1Name': fields.Str(required=True), | 256 | 'guarantor1Name': fields.Str(required=False), |
255 | 'guarantor2Name': fields.Str(required=True), | 257 | 'guarantor2Name': fields.Str(required=False), |
256 | } | 258 | } |
257 | 259 | ||
258 | document_args = { | 260 | document_args = { |
... | @@ -267,7 +269,7 @@ document_args = { | ... | @@ -267,7 +269,7 @@ document_args = { |
267 | 269 | ||
268 | doc_upload_args = { | 270 | doc_upload_args = { |
269 | 'applicationData': fields.Nested(application_data_args, required=True), | 271 | 'applicationData': fields.Nested(application_data_args, required=True), |
270 | 'applicantData': fields.Nested(applicant_data_args, required=True), | 272 | 'applicantData': fields.Nested(applicant_data_args, required=False), |
271 | 'document': fields.Nested(document_args, required=True), | 273 | 'document': fields.Nested(document_args, required=True), |
272 | } | 274 | } |
273 | 275 | ||
... | @@ -748,61 +750,26 @@ class SECompareView(GenericView): | ... | @@ -748,61 +750,26 @@ class SECompareView(GenericView): |
748 | @use_args(se_compare_args, location='data') | 750 | @use_args(se_compare_args, location='data') |
749 | def post(self, request, args): | 751 | def post(self, request, args): |
750 | # 存库 | 752 | # 存库 |
751 | # content = args.get('content', {}) | 753 | content = args.get('content', {}) |
752 | # business_type = content.get('applicationEntity') | 754 | business_type = content.get('applicationEntity') |
753 | # application_id = content.get('applicationId') | 755 | application_id = content.get('applicationId') |
754 | # is_auto = content.get('isAutoSettlement', False) | 756 | bank_verify = content.get('bankInfo', {}).get('bankVerificationStatus', '') |
755 | # | 757 | |
756 | # auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement | 758 | bank_class = HILbankVerification if business_type in consts.HIL_SET else AFCbankVerification |
757 | # auto_obj = auto_class.objects.filter(application_id=application_id).first() | 759 | bank_obj = bank_class.objects.filter(application_id=application_id).first() |
758 | # if is_auto: | 760 | |
759 | # # 加入优先级队列 | 761 | if bank_obj is None and bank_verify == 'PASS': |
760 | # PriorityApplication.objects.update_or_create( | 762 | bank_class.objects.create( |
761 | # application_id=application_id, defaults={'on_off': True}) | 763 | application_id=application_id, |
762 | # # 加入auto表 | 764 | ) |
763 | # if auto_obj is None: | 765 | elif bank_obj is not None and bank_verify == 'PASS' and bank_obj.on_off is False: |
764 | # auto_class.objects.create( | 766 | bank_obj.on_off = True |
765 | # application_id=application_id, | 767 | bank_obj.save() |
766 | # ) | 768 | elif bank_obj is not None and bank_verify != 'PASS' and bank_obj.on_off is True: |
767 | # elif auto_obj.on_off is False: | 769 | bank_obj.on_off = False |
768 | # auto_obj.on_off = True | 770 | bank_obj.save() |
769 | # auto_obj.save() | ||
770 | # else: | ||
771 | # if auto_obj is not None and auto_obj.on_off is True: | ||
772 | # auto_obj.on_off = False | ||
773 | # auto_obj.save() | ||
774 | return response.ok() | ||
775 | 771 | ||
776 | # uniq_seq = content.get('uniqSeq') | 772 | return response.ok() |
777 | # business_type = content.get('applicationEntity') | ||
778 | # application_id = content.get('applicationId') | ||
779 | # | ||
780 | # individual_cus_info = json.dumps(content.get('individualCusInfo')) | ||
781 | # vehicle_info = json.dumps(content.get('vehicleInfo')) | ||
782 | # insurance_info = json.dumps(content.get('insuranceInfo')) | ||
783 | # bank_info = json.dumps(content.get('bankInfo')) | ||
784 | # quotationt_info = json.dumps(content.get('quotationtInfo')) | ||
785 | # corporate_cus_info = json.dumps(content.get('corporateCusInfo')) if isinstance( | ||
786 | # content.get('corporateCusInfo'), dict) else None | ||
787 | |||
788 | # comparison_class = HILSEComparisonInfo if business_type in consts.HIL_SET else AFCSEComparisonInfo | ||
789 | # comparison_class.objects.create( | ||
790 | # uniq_seq=uniq_seq, | ||
791 | # application_id=application_id, | ||
792 | # application_version=content.get('applicationVersion'), | ||
793 | # customer_type=content.get('customerType'), | ||
794 | # first_submmison_date=content.get('firstSubmmisonDate'), | ||
795 | # property_doc_policy=content.get('propertyDocumentPolicy', None), | ||
796 | # individual_cus_info=individual_cus_info, | ||
797 | # corporate_cus_info=corporate_cus_info, | ||
798 | # vehicle_info=vehicle_info, | ||
799 | # insurance_info=insurance_info, | ||
800 | # bank_info=bank_info, | ||
801 | # quotationt_info=quotationt_info | ||
802 | # ) | ||
803 | # 触发比对 | ||
804 | # compare.apply_async((application_id, business_type, uniq_seq, None, False, False), | ||
805 | # queue='queue_compare') | ||
806 | 773 | ||
807 | post.openapi_doc = ''' | 774 | post.openapi_doc = ''' |
808 | tags: [info] | 775 | tags: [info] | ... | ... |
This diff is collapsed.
Click to expand it.
... | @@ -173,6 +173,11 @@ class Comparison: | ... | @@ -173,6 +173,11 @@ class Comparison: |
173 | return self.RESULT_Y | 173 | return self.RESULT_Y |
174 | return self.RESULT_N | 174 | return self.RESULT_N |
175 | else: | 175 | else: |
176 | # if kwargs.get('pop_last', False): | ||
177 | # for item in ocr_str_or_list[:-1]: | ||
178 | # if item != input_str_or_list: | ||
179 | # return self.RESULT_N | ||
180 | # else: | ||
176 | for item in ocr_str_or_list: | 181 | for item in ocr_str_or_list: |
177 | if item != input_str_or_list: | 182 | if item != input_str_or_list: |
178 | return self.RESULT_N | 183 | return self.RESULT_N |
... | @@ -582,6 +587,27 @@ class Comparison: | ... | @@ -582,6 +587,27 @@ class Comparison: |
582 | else: | 587 | else: |
583 | return self.RESULT_N | 588 | return self.RESULT_N |
584 | 589 | ||
590 | def se_self_compare_gzs(self, input_list, ocr_str, **kwargs): | ||
591 | if isinstance(input_list, list) and len(input_list) == 2: | ||
592 | try: | ||
593 | if isinstance(input_list[0], float) and isinstance(input_list[1], float) \ | ||
594 | and input_list[0] >= input_list[1]: | ||
595 | return self.RESULT_Y | ||
596 | except Exception as e: | ||
597 | return self.RESULT_N | ||
598 | return self.RESULT_N | ||
599 | |||
600 | def se_self_compare_other_asp(self, input_str, ocr_str, **kwargs): | ||
601 | return self.RESULT_N | ||
602 | |||
603 | def se_jypz_date_compare(self, input_str, ocr_date_list, **kwargs): | ||
604 | ocr_date_set = set(ocr_date_list) | ||
605 | if len(ocr_date_set) > 1: | ||
606 | return self.RESULT_N | ||
607 | if not any(ocr_date_set): | ||
608 | return self.RESULT_N | ||
609 | return self.se_date_compare_2(input_str, ocr_date_set.pop(), three_month=True) | ||
610 | |||
585 | 611 | ||
586 | cp = Comparison() | 612 | cp = Comparison() |
587 | 613 | ... | ... |
src/common/tools/mssql_script18.py
0 → 100644
1 | import pyodbc | ||
2 | |||
3 | hil_sql = """ | ||
4 | create table hil_bank_verification | ||
5 | ( | ||
6 | id bigint identity primary key, | ||
7 | application_id nvarchar(64) not null, | ||
8 | on_off bit default 1 not null, | ||
9 | update_time datetime not null, | ||
10 | create_time datetime not null | ||
11 | ); | ||
12 | |||
13 | create index hil_bank_verification_application_id_index | ||
14 | on hil_bank_verification (application_id); | ||
15 | """ | ||
16 | |||
17 | afc_sql = """ | ||
18 | create table afc_bank_verification | ||
19 | ( | ||
20 | id bigint identity primary key, | ||
21 | application_id nvarchar(64) not null, | ||
22 | on_off bit default 1 not null, | ||
23 | update_time datetime not null, | ||
24 | create_time datetime not null | ||
25 | ); | ||
26 | |||
27 | create index afc_bank_verification_application_id_index | ||
28 | on afc_bank_verification (application_id); | ||
29 | """ | ||
30 | |||
31 | hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True) | ||
32 | |||
33 | hil_cursor = hil_cnxn.cursor() | ||
34 | hil_cursor.execute(hil_sql) | ||
35 | |||
36 | hil_cursor.close() | ||
37 | hil_cnxn.close() | ||
38 | |||
39 | afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True) | ||
40 | |||
41 | afc_cursor = afc_cnxn.cursor() | ||
42 | afc_cursor.execute(afc_sql) | ||
43 | |||
44 | afc_cursor.close() | ||
45 | afc_cnxn.close() |
1 | import os | 1 | import os |
2 | import re | ||
2 | import json | 3 | import json |
3 | import cv2 | 4 | import cv2 |
4 | import shutil | 5 | import shutil |
... | @@ -48,8 +49,9 @@ class PDFBuild: | ... | @@ -48,8 +49,9 @@ class PDFBuild: |
48 | 49 | ||
49 | class PDFHandler: | 50 | class PDFHandler: |
50 | 51 | ||
51 | def __init__(self, path, img_dir_path, document_name=None): | 52 | def __init__(self, path, img_dir_path, document_name=None, pwd_list=[]): |
52 | self.path = path | 53 | self.path = path |
54 | self.pwd_list = self.get_pwd_list(document_name, pwd_list) | ||
53 | self.img_dir_path = img_dir_path | 55 | self.img_dir_path = img_dir_path |
54 | self.img_path_list = [] | 56 | self.img_path_list = [] |
55 | self.img_count = 0 | 57 | self.img_count = 0 |
... | @@ -75,6 +77,12 @@ class PDFHandler: | ... | @@ -75,6 +77,12 @@ class PDFHandler: |
75 | self.page_count = None | 77 | self.page_count = None |
76 | self.metadata = None | 78 | self.metadata = None |
77 | 79 | ||
80 | @staticmethod | ||
81 | def get_pwd_list(doc_name, pwd_list): | ||
82 | pwd_list_from_doc_name = re.findall(r'\d{6}', doc_name) | ||
83 | pwd_list_from_doc_name.extend(pwd_list) | ||
84 | return pwd_list_from_doc_name | ||
85 | |||
78 | def get_suffix(self, file_name): | 86 | def get_suffix(self, file_name): |
79 | if file_name is None: | 87 | if file_name is None: |
80 | return None | 88 | return None |
... | @@ -370,6 +378,12 @@ class PDFHandler: | ... | @@ -370,6 +378,12 @@ class PDFHandler: |
370 | self.img_path_list.append(img_save_path) | 378 | self.img_path_list.append(img_save_path) |
371 | else: | 379 | else: |
372 | with fitz.Document(self.path) as pdf: | 380 | with fitz.Document(self.path) as pdf: |
381 | # 解密 | ||
382 | for pwd in self.pwd_list: | ||
383 | if not pdf.isEncrypted: | ||
384 | break | ||
385 | pdf.authenticate(pwd) | ||
386 | |||
373 | self.metadata = pdf.metadata | 387 | self.metadata = pdf.metadata |
374 | self.page_count = pdf.pageCount | 388 | self.page_count = pdf.pageCount |
375 | if isinstance(max_img_count, int) and pdf.pageCount >= max_img_count: | 389 | if isinstance(max_img_count, int) and pdf.pageCount >= max_img_count: | ... | ... |
-
Please register or sign in to post a comment