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
db73da94
authored
2022-05-30 16:22:58 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
June SE part 2
1 parent
5b24219b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/apps/doc/consts.py
View file @
db73da9
...
...
@@ -1409,7 +1409,7 @@ SE_CORPORATE_ALL_FIELD = ['companyName', 'legalRepName', 'firstIdNo', 'businessL
'taxRegistrationCertificateNo'
,
'establishmentDate'
,
'businessLicenseDueDate'
]
SE_NEW_FIELD
=
[
'vinNo'
,
'dealer'
,
'vehicleTransactionAmount'
]
SE_USED_FIELD
=
[
'vinNo'
,
'vehicleTransactionAmount'
]
SE_NEW_ADD_FIELD
=
[
'customerName'
,
'idNum'
,
'dateOfInvoice'
,
'stamp'
,
'发票联'
,
'发票真伪校验'
,
'新旧版式'
]
SE_NEW_ADD_FIELD
=
[
'customerName'
,
'idNum'
,
'dateOfInvoice'
,
'stamp'
,
'发票联'
,
'发票真伪校验'
,
'新旧版式'
,
'不含税价校验'
,
'增值税额校验'
,
'价税合计大小写检验'
]
SE_FPL_VALUE
=
'发票联'
SE_STAMP_VALUE
=
'有'
SE_DYSYR_VALUE
=
'无'
...
...
@@ -1717,6 +1717,12 @@ SME_BL_COMPARE_LOGIC = {
'businessLicenseDueDate'
:
(
'营业期限'
,
'se_date_compare'
,
{
'ocr_split'
:
True
,
'long'
:
True
,
'ocr_replace'
:
True
,
'today'
:
True
},
'公司营业期限疑似过期'
),
}
ZW_METHOD
=
'mvi_special'
LOWER_AMOUNT_FIELD
=
'价税合计小写'
UPPER_AMOUNT_FIELD
=
'价税合计大写'
BHSJ_FIELD
=
'不含税价'
ZZSSE_FIELD
=
'增值税税额'
MVI_COMPARE_LOGIC
=
{
'vinNo'
:
(
'车辆识别代码'
,
'se_common_compare'
,
{},
'发票车架号与系统不一致'
),
'dealer'
:
(
'销方名称'
,
'se_contain_compare_2'
,
{
'brackets_replace'
:
True
},
'发票销货单位名称与系统不一致'
),
...
...
@@ -1726,14 +1732,13 @@ MVI_COMPARE_LOGIC = {
'dateOfInvoice'
:
(
'开票日期'
,
'se_date_compare_2'
,
{
'three_month'
:
True
},
'发票开票日期早于首次提交申请日期'
),
'stamp'
:
(
'销售单位章'
,
'se_common_compare'
,
{},
'发票无章'
),
'发票联'
:
(
'发票类型'
,
'se_common_compare'
,
{},
'发票疑似非发票联'
),
'发票真伪校验'
:
(
'发票真伪校验'
,
'se_common_compare'
,
{},
'发票疑似造假,需人工核算'
),
# '发票真伪校验': ('发票真伪校验', 'se_common_compare', {}, '发票疑似造假,需人工核算'),
'不含税价校验'
:
(
BHSJ_FIELD
,
'se_common_compare'
,
{},
'发票不含税价疑似错误,需人工核算'
),
'增值税额校验'
:
(
ZZSSE_FIELD
,
'se_common_compare'
,
{},
'发票增值税额疑似错误,需人工核算'
),
'价税合计大小写检验'
:
(
'价税合计大小写检验'
,
'se_common_compare'
,
{},
'发票价税合计大小写校验疑似错误,需人工核算'
),
'新旧版式'
:
(
'新旧版式'
,
'se_contain_compare_2'
,
{},
'发票版本与打印版式不符'
),
}
ZW_METHOD
=
'mvi_special'
LOWER_AMOUNT_FIELD
=
'价税合计小写'
UPPER_AMOUNT_FIELD
=
'价税合计大写'
BHSJ_FIELD
=
'不含税价'
ZZSSE_FIELD
=
'增值税税额'
UCI_COMPARE_LOGIC
=
{
'vinNo'
:
(
'车架号'
,
'se_common_compare'
,
{},
'二手车发票车架号与系统不一致'
),
...
...
src/celery_compare/tasks.py
View file @
db73da9
This diff is collapsed.
Click to expand it.
src/common/tools/comparison.py
View file @
db73da9
...
...
@@ -123,7 +123,7 @@ 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
):
def
mvi_special
(
self
,
amount_lower_str
,
amount_upper_str
):
# 不含税价, 增值税税额
try
:
if
float
(
amount_lower_str
)
!=
rmb_handler
.
to_rmb_lower
(
amount_upper_str
):
...
...
@@ -131,7 +131,7 @@ class Comparison:
except
Exception
:
return
self
.
RESULT_N
else
:
return
self
.
SPLIT_STR
.
join
([
bhsj_str
,
zzsse_str
,
self
.
RESULT_Y
])
return
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
):
...
...
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