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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 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
):
...
...
@@ -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
...
...
@@ -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