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
eccdff28
authored
2021-07-11 16:17:33 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
se compare part 5
1 parent
d47405de
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
9 deletions
src/apps/doc/consts.py
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/models.py
src/apps/doc/views.py
src/apps/doc/consts.py
View file @
eccdff2
...
...
@@ -1054,18 +1054,23 @@ EEP_OCR_FIELD = 'eep_ocr'
DL_OCR_FIELD
=
'dl_ocr'
PP_OCR_FIELD
=
'pp_ocr'
MVC_OCR_FIELD
=
'mvc_ocr'
MVI_OCR_FIELD
=
'mvi_ocr'
BC_OCR_FIELD
=
'bc_ocr'
UCI_OCR_FIELD
=
'uci_ocr'
DDA_OCR_FIELD
=
'bs_ocr'
RESULT_MAPPING
=
{
# MVI_CLASSIFY: 'mvi_ocr'
,
MVI_CLASSIFY
:
MVI_OCR_FIELD
,
IC_CLASSIFY
:
IC_OCR_FIELD
,
RP_CLASSIFY
:
RP_OCR_FIELD
,
# BC_CLASSIFY: 'bc_ocr'
,
BC_CLASSIFY
:
BC_OCR_FIELD
,
BL_CLASSIFY
:
BL_OCR_FIELD
,
# UCI_CLASSIFY: 'uci_ocr'
,
UCI_CLASSIFY
:
UCI_OCR_FIELD
,
EEP_CLASSIFY
:
EEP_OCR_FIELD
,
DL_CLASSIFY
:
DL_OCR_FIELD
,
PP_CLASSIFY
:
PP_OCR_FIELD
,
MVC_CLASSIFY
:
MVC_OCR_FIELD
,
DDA_CLASSIFY
:
DDA_OCR_FIELD
,
# VAT_CLASSIFY: 'vat_ocr',
}
...
...
src/apps/doc/management/commands/ocr_process.py
View file @
eccdff2
...
...
@@ -979,7 +979,7 @@ class Command(BaseCommand, LoggerMixin):
finally
:
# TODO 识别结果存一张表,方便跑报表
#
CA
比对
# 比对
if
len
(
license_summary
)
>
0
and
doc
.
document_scheme
!=
consts
.
DOC_SCHEME_LIST
[
2
]:
try
:
is_ca
=
True
if
doc
.
document_scheme
==
consts
.
DOC_SCHEME_LIST
[
0
]
else
False
...
...
src/apps/doc/models.py
View file @
eccdff2
...
...
@@ -190,6 +190,58 @@ class AFCComparisonInfo(models.Model):
db_table
=
'afc_comparison_info'
situ_db_label
=
'afc'
# 比对信息表
class
AFCSEComparisonInfo
(
models
.
Model
):
id
=
models
.
BigAutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
uniq_seq
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
"唯一序列号"
)
# 索引
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
application_version
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"应用版本"
)
# CUSTOMER_TYPE = ['TCCOR', 'TCDAS', 'TCFRE', 'TCIAS', 'TCIND', 'TCSEP', 'TCURE']
customer_type
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"顾客类型"
)
first_submmison_date
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"首次提交时间"
)
property_doc_policy
=
models
.
CharField
(
null
=
True
,
max_length
=
16
,
verbose_name
=
"申请及文件政策"
)
individual_cus_info
=
models
.
TextField
(
verbose_name
=
"个人信息"
)
corporate_cus_info
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"公司信息"
)
vehicle_info
=
models
.
TextField
(
verbose_name
=
"车辆信息"
)
insurance_info
=
models
.
TextField
(
verbose_name
=
"保险信息"
)
bank_info
=
models
.
TextField
(
verbose_name
=
"银行信息"
)
quotationt_info
=
models
.
TextField
(
verbose_name
=
"报价信息"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
# 索引
class
Meta
:
managed
=
False
db_table
=
'afc_se_comparison_info'
situ_db_label
=
'afc'
# 比对信息表
class
HILSEComparisonInfo
(
models
.
Model
):
id
=
models
.
BigAutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
uniq_seq
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
"唯一序列号"
)
# 索引
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
application_version
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"应用版本"
)
# CUSTOMER_TYPE = ['TCCOR', 'TCDAS', 'TCFRE', 'TCIAS', 'TCIND', 'TCSEP', 'TCURE']
customer_type
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"顾客类型"
)
first_submmison_date
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"首次提交时间"
)
property_doc_policy
=
models
.
CharField
(
null
=
True
,
max_length
=
16
,
verbose_name
=
"申请及文件政策"
)
individual_cus_info
=
models
.
TextField
(
verbose_name
=
"个人信息"
)
corporate_cus_info
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"公司信息"
)
vehicle_info
=
models
.
TextField
(
verbose_name
=
"车辆信息"
)
insurance_info
=
models
.
TextField
(
verbose_name
=
"保险信息"
)
bank_info
=
models
.
TextField
(
verbose_name
=
"银行信息"
)
quotationt_info
=
models
.
TextField
(
verbose_name
=
"报价信息"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
# 索引
class
Meta
:
managed
=
False
db_table
=
'hil_se_comparison_info'
# 比对信息表
class
HILComparisonInfo
(
models
.
Model
):
...
...
@@ -220,7 +272,7 @@ class AFCOCRResult(models.Model):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
银行流水
"
)
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
DDA
"
)
mvi_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"机动车销售统一发票"
)
ic_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"身份证"
)
rp_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"居住证"
)
...
...
@@ -247,7 +299,7 @@ class HILOCRResult(models.Model):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
银行流水
"
)
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
DDA
"
)
mvi_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"机动车销售统一发票"
)
ic_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"身份证"
)
rp_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"居住证"
)
...
...
@@ -273,7 +325,7 @@ class AFCSEOCRResult(models.Model):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
银行流水
"
)
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
DDA
"
)
mvi_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"机动车销售统一发票"
)
ic_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"身份证"
)
rp_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"居住证"
)
...
...
@@ -300,7 +352,7 @@ class HILSEOCRResult(models.Model):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
银行流水
"
)
bs_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"
DDA
"
)
mvi_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"机动车销售统一发票"
)
ic_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"身份证"
)
rp_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"居住证"
)
...
...
src/apps/doc/views.py
View file @
eccdff2
...
...
@@ -21,7 +21,9 @@ from .models import (
PriorityApplication
,
GCAPRecords
,
AFCComparisonInfo
,
AFCSEComparisonInfo
,
HILComparisonInfo
,
HILSEComparisonInfo
,
AFCCompareOfflineReport
,
HILCompareOfflineReport
,
AFCCACompareResult
,
...
...
@@ -524,7 +526,38 @@ class SECompareView(GenericView):
# pos上传比对信息接口 SE
@use_args
(
se_compare_args
,
location
=
'data'
)
def
post
(
self
,
request
,
args
):
self
.
running_log
.
info
(
'se compare in'
)
# 存库
content
=
args
.
get
(
'content'
,
{})
uniq_seq
=
content
.
get
(
'uniqSeq'
)
business_type
=
content
.
get
(
'applicationEntity'
)
application_id
=
content
.
get
(
'applicationId'
)
individual_cus_info
=
json
.
dumps
(
content
.
get
(
'individualCusInfo'
))
vehicle_info
=
json
.
dumps
(
content
.
get
(
'vehicleInfo'
))
insurance_info
=
json
.
dumps
(
content
.
get
(
'insuranceInfo'
))
bank_info
=
json
.
dumps
(
content
.
get
(
'bankInfo'
))
quotationt_info
=
json
.
dumps
(
content
.
get
(
'quotationtInfo'
))
corporate_cus_info
=
json
.
dumps
(
content
.
get
(
'corporateCusInfo'
))
if
isinstance
(
content
.
get
(
'corporateCusInfo'
),
dict
)
else
None
comparison_class
=
HILSEComparisonInfo
if
business_type
in
consts
.
HIL_SET
else
AFCSEComparisonInfo
comparison_class
.
objects
.
create
(
uniq_seq
=
uniq_seq
,
application_id
=
application_id
,
application_version
=
content
.
get
(
'applicationVersion'
),
customer_type
=
content
.
get
(
'customerType'
),
first_submmison_date
=
content
.
get
(
'firstSubmmisonDate'
),
property_doc_policy
=
content
.
get
(
'propertyDocumentPolicy'
,
None
),
individual_cus_info
=
individual_cus_info
,
corporate_cus_info
=
corporate_cus_info
,
vehicle_info
=
vehicle_info
,
insurance_info
=
insurance_info
,
bank_info
=
bank_info
,
quotationt_info
=
quotationt_info
)
# 触发比对
compare
.
apply_async
((
application_id
,
business_type
,
uniq_seq
,
None
,
False
),
queue
=
'queue_compare'
)
return
response
.
ok
()
post
.
openapi_doc
=
'''
...
...
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