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
d24fcf2c
authored
2021-11-15 14:52:39 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
fix merge
2 parents
fdb7ca98
806c91b2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/apps/doc/consts.py
View file @
d24fcf2
This diff is collapsed.
Click to expand it.
src/celery_compare/tasks.py
View file @
d24fcf2
This diff is collapsed.
Click to expand it.
src/common/tools/comparison.py
View file @
d24fcf2
...
...
@@ -16,6 +16,7 @@ class Comparison:
self
.
CSIBM
=
'CSIBM'
self
.
CSSME
=
'CSSME'
self
.
CSOTH
=
'CSOTH'
self
.
SPLIT_STR
=
'_'
self
.
TYPE_MAPPING
=
(
(
r'个体工商户'
,
self
.
CSIBM
),
...
...
@@ -109,6 +110,16 @@ class Comparison:
ocr_output
=
None
return
self
.
build_res
(
input_str
==
ocr_str
),
ocr_output
def
mvi_special
(
self
,
amount_lower_str
,
amount_upper_str
,
bhsj_str
,
zzsse_str
):
# 不含税价, 增值税税额
try
:
if
float
(
amount_lower_str
)
!=
rmb_handler
.
to_rmb_lower
(
amount_upper_str
):
return
self
.
RESULT_N
except
Exception
:
return
self
.
RESULT_N
else
:
return
self
.
SPLIT_STR
.
join
([
bhsj_str
,
zzsse_str
,
self
.
RESULT_Y
])
def
rmb_compare
(
self
,
input_str
,
ocr_str
,
idx
,
**
kwargs
):
if
not
isinstance
(
ocr_str
,
str
)
or
not
isinstance
(
input_str
,
str
):
return
self
.
RESULT_NA
,
None
...
...
@@ -198,7 +209,7 @@ class Comparison:
)
dti
=
DatetimeIndex
(
dt_array
,
tz
=
None
,
name
=
None
)
ts
=
dti
[
0
]
if
isinstance
(
ts
,
NaTType
)
or
ts
.
date
()
<
datetime
.
today
(
)
.
date
():
if
isinstance
(
ts
,
NaTType
)
or
ts
.
date
()
<
(
datetime
.
today
()
+
relativedelta
(
days
=
8
)
)
.
date
():
return
False
else
:
return
True
...
...
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