da4982cf by 周伟奇

SE logic modify part2

1 parent 1a89d0da
...@@ -183,6 +183,16 @@ class Comparison: ...@@ -183,6 +183,16 @@ class Comparison:
183 def se_date_contain_compare(self, input_str, ocr_str_or_list, **kwargs): 183 def se_date_contain_compare(self, input_str, ocr_str_or_list, **kwargs):
184 return self.RESULT_Y 184 return self.RESULT_Y
185 185
186 @staticmethod
187 def amount_fix(src_str):
188 replace_char_list = []
189 for idx in range(len(src_str)):
190 if src_str[idx].isdigit():
191 replace_char_list.append(src_str[idx])
192 elif idx == len(src_str)-3 and src_str[idx] == '.':
193 replace_char_list.append(src_str[idx])
194 return ''.join(replace_char_list)
195
186 def se_schedule_compare(self, input_str, ocr_str_or_list, **kwargs): 196 def se_schedule_compare(self, input_str, ocr_str_or_list, **kwargs):
187 if isinstance(ocr_str_or_list, list): 197 if isinstance(ocr_str_or_list, list):
188 if len(ocr_str_or_list) > 0: 198 if len(ocr_str_or_list) > 0:
...@@ -192,7 +202,8 @@ class Comparison: ...@@ -192,7 +202,8 @@ class Comparison:
192 tmp_str = "{1}{0}{2}".format( 202 tmp_str = "{1}{0}{2}".format(
193 self.SPLIT_STR, 203 self.SPLIT_STR,
194 row_list[0].replace('.', ''), 204 row_list[0].replace('.', ''),
195 row_list[kwargs.get('value_idx', 1)].replace(',', '')) 205 # 优化还款计划表页,小数点只存在与还款金额的倒数第三位。
206 self.amount_fix(row_list[kwargs.get('value_idx', 1)]))
196 schedule_list.append(tmp_str) 207 schedule_list.append(tmp_str)
197 return self.build_res(self.SCHEDULE_SPLIT_STR.join(schedule_list) == input_str) 208 return self.build_res(self.SCHEDULE_SPLIT_STR.join(schedule_list) == input_str)
198 else: 209 else:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!