Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c3532ca6
authored
2024-07-30 17:07:26 +0800
by
wangling
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
保单比对规则修改,去掉机动车损失保险金额,第三种责任限额金额,绝对免赔率,第一受益人的校验,修改保险开始日期,保险截止日期的校验,保险开始日期<今天,保险截止日期>明天
1 parent
8bc45eee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
src/common/tools/comparison.py
src/common/tools/comparison.py
View file @
c3532ca
...
...
@@ -12,6 +12,7 @@ import logging
compare_log
=
logging
.
getLogger
(
'compare'
)
class
Comparison
:
def
__init__
(
self
):
...
...
@@ -192,7 +193,7 @@ class Comparison:
def
se_input_list_compare
(
self
,
input_list
,
ocr_str
,
**
kwargs
):
if
isinstance
(
input_list
,
list
)
and
len
(
input_list
)
>
0
and
isinstance
(
ocr_str
,
str
):
ocr_str
=
ocr_str
.
translate
(
self
.
KH_TRANS
)
for
input_str
in
input_list
:
input_str
=
input_str
.
translate
(
self
.
KH_TRANS
)
compare_log
.
info
(
'[se_input_list_compare] [input_str {0}] [ocr_str {1}]'
.
format
(
input_str
,
ocr_str
))
...
...
@@ -221,7 +222,7 @@ class Comparison:
for
idx
in
range
(
len
(
src_str
)):
if
src_str
[
idx
]
.
isdigit
():
replace_char_list
.
append
(
src_str
[
idx
])
elif
idx
==
len
(
src_str
)
-
3
:
elif
idx
==
len
(
src_str
)
-
3
:
replace_char_list
.
append
(
'.'
)
return
''
.
join
(
replace_char_list
)
...
...
@@ -603,7 +604,6 @@ class Comparison:
except
Exception
as
e
:
return
self
.
RESULT_N
def
se_bd_date_2_compare
(
self
,
input_str
,
ocr_str
,
**
kwargs
):
try
:
# Convert strings to date objects
...
...
@@ -615,12 +615,12 @@ class Comparison:
if
kwargs
.
get
(
'start'
,
False
):
# Check if dates are equal and within the range of yesterday to today
if
input_date
==
ocr_date
and
ocr_date
<
today_date
:
if
ocr_date
<
today_date
:
return
self
.
RESULT_Y
else
:
# Check if dates are equal and ocr_date is greater than tomorrow
tomorrow_date
=
today_date
+
relativedelta
(
days
=
1
)
if
input_date
==
ocr_date
and
ocr_date
>
tomorrow_date
:
if
ocr_date
>
tomorrow_date
:
return
self
.
RESULT_Y
# Default return value if conditions are not met
...
...
@@ -687,7 +687,7 @@ class Comparison:
# input_str = input_str.replace('-', '')
return
self
.
is_after_today_pre
(
ocr_str
)
def
se_qrs_compare
(
self
,
input_str
,
ocr_str_or_list
,
**
kwargs
):
try
:
target_count_str
,
application_id
=
input_str
.
split
(
'_'
)
...
...
@@ -704,5 +704,3 @@ class Comparison:
cp
=
Comparison
()
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment