Merge branch 'feature/CHINARPA-4846' into feature/uat-tmp
Showing
3 changed files
with
36 additions
and
13 deletions
... | @@ -1990,8 +1990,8 @@ BD_COMPARE_LOGIC = { | ... | @@ -1990,8 +1990,8 @@ BD_COMPARE_LOGIC = { |
1990 | '机动车损失保险金额': ('机动车损失保险金额', 'se_amount_lte_compare', {}, '保单车损险异常'), | 1990 | '机动车损失保险金额': ('机动车损失保险金额', 'se_amount_lte_compare', {}, '保单车损险异常'), |
1991 | '第三者责任保险金额': ('机动车第三者责任保险金额', 'se_amount_lte_compare', {}, '保单三者险异常'), | 1991 | '第三者责任保险金额': ('机动车第三者责任保险金额', 'se_amount_lte_compare', {}, '保单三者险异常'), |
1992 | '绝对免赔率': ('机动车损失保险绝对免赔率/绝对免赔额', 'se_one_compare', {}, '保单无绝对免赔项'), | 1992 | '绝对免赔率': ('机动车损失保险绝对免赔率/绝对免赔额', 'se_one_compare', {}, '保单无绝对免赔项'), |
1993 | '保险起始日期': ('保险起始日期', 'se_bd_date_compare', {'start': True}, '保单起始时间有误'), | 1993 | '保险起始日期': ('保险起始日期', 'se_bd_date_2_compare', {'start': True}, '保单起始时间有误'), |
1994 | '保险截止日期': ('保险截止日期', 'se_bd_date_compare', {}, '保单截止时间有误'), | 1994 | '保险截止日期': ('保险截止日期', 'se_bd_date_2_compare', {}, '保单截止时间有误'), |
1995 | '保单章': ('保单章', 'se_common_compare', {}, '保单无保单章'), | 1995 | '保单章': ('保单章', 'se_common_compare', {}, '保单无保单章'), |
1996 | '第一受益人': ('特别约定第一受益人', 'se_common_compare', {}, '保单第一受益人需人工核查'), | 1996 | '第一受益人': ('特别约定第一受益人', 'se_common_compare', {}, '保单第一受益人需人工核查'), |
1997 | '保险费合计': ('保险费合计', 'se_amount_lte_compare', {}, '保单保费疑似无法覆盖ASP保险融资'), | 1997 | '保险费合计': ('保险费合计', 'se_amount_lte_compare', {}, '保单保费疑似无法覆盖ASP保险融资'), | ... | ... |
... | @@ -1306,13 +1306,13 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d | ... | @@ -1306,13 +1306,13 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d |
1306 | (consts.SE_BD_FIELD[0], [co_name, bo_name] if is_cdfl else [main_name, ]), # 车贷分离 | 1306 | (consts.SE_BD_FIELD[0], [co_name, bo_name] if is_cdfl else [main_name, ]), # 车贷分离 |
1307 | (consts.SE_BD_FIELD[1], [co_id, bo_id] if is_cdfl else [main_id, ]), # 车贷分离 | 1307 | (consts.SE_BD_FIELD[1], [co_id, bo_id] if is_cdfl else [main_id, ]), # 车贷分离 |
1308 | (consts.SE_BD_FIELD[2], vin_no), | 1308 | (consts.SE_BD_FIELD[2], vin_no), |
1309 | (consts.SE_BD_FIELD[3], ssx_amount), | 1309 | # (consts.SE_BD_FIELD[3], ssx_amount), |
1310 | (consts.SE_BD_FIELD[4], dszx_amount), | 1310 | # (consts.SE_BD_FIELD[4], dszx_amount), |
1311 | (consts.SE_BD_FIELD[5], consts.JDMPV_VALUE), | 1311 | # (consts.SE_BD_FIELD[5], consts.JDMPV_VALUE), |
1312 | (consts.SE_BD_FIELD[6], cms_info.get('insuranceDetails', {}).get('startDate', '')), | 1312 | (consts.SE_BD_FIELD[6], cms_info.get('insuranceDetails', {}).get('startDate', '')), |
1313 | (consts.SE_BD_FIELD[7], cms_info.get('insuranceDetails', {}).get('endDate', '')), | 1313 | (consts.SE_BD_FIELD[7], cms_info.get('insuranceDetails', {}).get('endDate', '')), |
1314 | (consts.SE_BD_FIELD[8], consts.SE_STAMP_VALUE), | 1314 | (consts.SE_BD_FIELD[8], consts.SE_STAMP_VALUE), |
1315 | (consts.SE_BD_FIELD[9], consts.SE_DYSYR_VALUE), | 1315 | # (consts.SE_BD_FIELD[9], consts.SE_DYSYR_VALUE), |
1316 | ] | 1316 | ] |
1317 | if is_insurance == 1: | 1317 | if is_insurance == 1: |
1318 | bd_field_input.append((consts.SE_BD_FIELD[10], insurance_price)) | 1318 | bd_field_input.append((consts.SE_BD_FIELD[10], insurance_price)) |
... | @@ -1871,13 +1871,13 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect | ... | @@ -1871,13 +1871,13 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect |
1871 | (consts.SE_BD_FIELD[0], [co_name, bo_name] if is_cdfl else [main_name, ]), # 车贷分离 | 1871 | (consts.SE_BD_FIELD[0], [co_name, bo_name] if is_cdfl else [main_name, ]), # 车贷分离 |
1872 | (consts.SE_BD_FIELD[1], [co_id, bo_id] if is_cdfl else [main_id, ]), # 车贷分离 | 1872 | (consts.SE_BD_FIELD[1], [co_id, bo_id] if is_cdfl else [main_id, ]), # 车贷分离 |
1873 | (consts.SE_BD_FIELD[2], vin_no), | 1873 | (consts.SE_BD_FIELD[2], vin_no), |
1874 | (consts.SE_BD_FIELD[3], ssx_amount), | 1874 | # (consts.SE_BD_FIELD[3], ssx_amount), |
1875 | (consts.SE_BD_FIELD[4], dszx_amount), | 1875 | # (consts.SE_BD_FIELD[4], dszx_amount), |
1876 | (consts.SE_BD_FIELD[5], consts.JDMPV_VALUE), | 1876 | # (consts.SE_BD_FIELD[5], consts.JDMPV_VALUE), |
1877 | (consts.SE_BD_FIELD[6], cms_info.get('insuranceDetails', {}).get('startDate', '')), | 1877 | (consts.SE_BD_FIELD[6], cms_info.get('insuranceDetails', {}).get('startDate', '')), |
1878 | (consts.SE_BD_FIELD[7], cms_info.get('insuranceDetails', {}).get('endDate', '')), | 1878 | (consts.SE_BD_FIELD[7], cms_info.get('insuranceDetails', {}).get('endDate', '')), |
1879 | (consts.SE_BD_FIELD[8], consts.SE_STAMP_VALUE), | 1879 | (consts.SE_BD_FIELD[8], consts.SE_STAMP_VALUE), |
1880 | (consts.SE_BD_FIELD[9], consts.SE_DYSYR_VALUE), | 1880 | # (consts.SE_BD_FIELD[9], consts.SE_DYSYR_VALUE), |
1881 | ] | 1881 | ] |
1882 | if is_insurance == 1: | 1882 | if is_insurance == 1: |
1883 | bd_field_input.append((consts.SE_BD_FIELD[10], insurance_price)) | 1883 | bd_field_input.append((consts.SE_BD_FIELD[10], insurance_price)) | ... | ... |
... | @@ -12,6 +12,7 @@ import logging | ... | @@ -12,6 +12,7 @@ import logging |
12 | 12 | ||
13 | compare_log = logging.getLogger('compare') | 13 | compare_log = logging.getLogger('compare') |
14 | 14 | ||
15 | |||
15 | class Comparison: | 16 | class Comparison: |
16 | 17 | ||
17 | def __init__(self): | 18 | def __init__(self): |
... | @@ -221,7 +222,7 @@ class Comparison: | ... | @@ -221,7 +222,7 @@ class Comparison: |
221 | for idx in range(len(src_str)): | 222 | for idx in range(len(src_str)): |
222 | if src_str[idx].isdigit(): | 223 | if src_str[idx].isdigit(): |
223 | replace_char_list.append(src_str[idx]) | 224 | replace_char_list.append(src_str[idx]) |
224 | elif idx == len(src_str)-3: | 225 | elif idx == len(src_str) - 3: |
225 | replace_char_list.append('.') | 226 | replace_char_list.append('.') |
226 | return ''.join(replace_char_list) | 227 | return ''.join(replace_char_list) |
227 | 228 | ||
... | @@ -603,6 +604,30 @@ class Comparison: | ... | @@ -603,6 +604,30 @@ class Comparison: |
603 | except Exception as e: | 604 | except Exception as e: |
604 | return self.RESULT_N | 605 | return self.RESULT_N |
605 | 606 | ||
607 | def se_bd_date_2_compare(self, input_str, ocr_str, **kwargs): | ||
608 | try: | ||
609 | # Convert strings to date objects | ||
610 | ocr_date = datetime.strptime(ocr_str, "%Y-%m-%d").date() | ||
611 | |||
612 | # Get today's date | ||
613 | today_date = datetime.today().date() | ||
614 | |||
615 | if kwargs.get('start', False): | ||
616 | # Check if dates are equal and within the range of yesterday to today | ||
617 | if ocr_date < today_date: | ||
618 | return self.RESULT_Y | ||
619 | else: | ||
620 | # Check if dates are equal and ocr_date is greater than tomorrow | ||
621 | tomorrow_date = today_date + relativedelta(days=1) | ||
622 | if ocr_date > tomorrow_date: | ||
623 | return self.RESULT_Y | ||
624 | |||
625 | # Default return value if conditions are not met | ||
626 | return self.RESULT_N | ||
627 | except Exception as e: | ||
628 | # Return RESULT_N in case of any exception | ||
629 | return self.RESULT_N | ||
630 | |||
606 | def se_bs_print_date_compare(self, input_str, ocr_str, **kwargs): | 631 | def se_bs_print_date_compare(self, input_str, ocr_str, **kwargs): |
607 | try: | 632 | try: |
608 | input_date = datetime.strptime(input_str, "%Y-%m-%d") | 633 | input_date = datetime.strptime(input_str, "%Y-%m-%d") |
... | @@ -678,5 +703,3 @@ class Comparison: | ... | @@ -678,5 +703,3 @@ class Comparison: |
678 | 703 | ||
679 | 704 | ||
680 | cp = Comparison() | 705 | cp = Comparison() |
681 | |||
682 | ... | ... |
-
Please register or sign in to post a comment