c3532ca6 by wangling

保单比对规则修改,去掉机动车损失保险金额,第三种责任限额金额,绝对免赔率,第一受益人的校验,修改保险开始日期,保险截止日期的校验,保险开始日期<今天,保险截止日期>明天

1 parent 8bc45eee
...@@ -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):
...@@ -192,7 +193,7 @@ class Comparison: ...@@ -192,7 +193,7 @@ class Comparison:
192 def se_input_list_compare(self, input_list, ocr_str, **kwargs): 193 def se_input_list_compare(self, input_list, ocr_str, **kwargs):
193 if isinstance(input_list, list) and len(input_list) > 0 and isinstance(ocr_str, str): 194 if isinstance(input_list, list) and len(input_list) > 0 and isinstance(ocr_str, str):
194 ocr_str = ocr_str.translate(self.KH_TRANS) 195 ocr_str = ocr_str.translate(self.KH_TRANS)
195 196
196 for input_str in input_list: 197 for input_str in input_list:
197 input_str = input_str.translate(self.KH_TRANS) 198 input_str = input_str.translate(self.KH_TRANS)
198 compare_log.info('[se_input_list_compare] [input_str {0}] [ocr_str {1}]'.format(input_str, ocr_str)) 199 compare_log.info('[se_input_list_compare] [input_str {0}] [ocr_str {1}]'.format(input_str, ocr_str))
...@@ -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,7 +604,6 @@ class Comparison: ...@@ -603,7 +604,6 @@ class Comparison:
603 except Exception as e: 604 except Exception as e:
604 return self.RESULT_N 605 return self.RESULT_N
605 606
606
607 def se_bd_date_2_compare(self, input_str, ocr_str, **kwargs): 607 def se_bd_date_2_compare(self, input_str, ocr_str, **kwargs):
608 try: 608 try:
609 # Convert strings to date objects 609 # Convert strings to date objects
...@@ -615,12 +615,12 @@ class Comparison: ...@@ -615,12 +615,12 @@ class Comparison:
615 615
616 if kwargs.get('start', False): 616 if kwargs.get('start', False):
617 # Check if dates are equal and within the range of yesterday to today 617 # Check if dates are equal and within the range of yesterday to today
618 if input_date == ocr_date and ocr_date < today_date: 618 if ocr_date < today_date:
619 return self.RESULT_Y 619 return self.RESULT_Y
620 else: 620 else:
621 # Check if dates are equal and ocr_date is greater than tomorrow 621 # Check if dates are equal and ocr_date is greater than tomorrow
622 tomorrow_date = today_date + relativedelta(days=1) 622 tomorrow_date = today_date + relativedelta(days=1)
623 if input_date == ocr_date and ocr_date > tomorrow_date: 623 if ocr_date > tomorrow_date:
624 return self.RESULT_Y 624 return self.RESULT_Y
625 625
626 # Default return value if conditions are not met 626 # Default return value if conditions are not met
...@@ -687,7 +687,7 @@ class Comparison: ...@@ -687,7 +687,7 @@ class Comparison:
687 # input_str = input_str.replace('-', '') 687 # input_str = input_str.replace('-', '')
688 688
689 return self.is_after_today_pre(ocr_str) 689 return self.is_after_today_pre(ocr_str)
690 690
691 def se_qrs_compare(self, input_str, ocr_str_or_list, **kwargs): 691 def se_qrs_compare(self, input_str, ocr_str_or_list, **kwargs):
692 try: 692 try:
693 target_count_str, application_id = input_str.split('_') 693 target_count_str, application_id = input_str.split('_')
...@@ -704,5 +704,3 @@ class Comparison: ...@@ -704,5 +704,3 @@ class Comparison:
704 704
705 705
706 cp = Comparison() 706 cp = Comparison()
707
708
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!