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
0c5207a0
authored
2021-12-13 16:24:55 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
hil contract part 1
1 parent
8b3fd09a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
1 deletions
src/apps/doc/consts.py
src/apps/doc/models.py
src/celery_compare/tasks.py
src/common/tools/mssql_script12.py
src/apps/doc/consts.py
View file @
0c5207a
...
...
@@ -1180,6 +1180,9 @@ JYPZ_OCR_FIELD = 'jypz_ocr'
HT_FIELD
=
'ht_ocr'
BD_FIELD
=
'bd_ocr'
BS_FIELD
=
'bss_ocr'
HIL_CONTRACT_1_FIELD
=
'hil_contract_1_ocr'
HIL_CONTRACT_2_FIELD
=
'hil_contract_2_ocr'
HIL_CONTRACT_3_FIELD
=
'hil_contract_3_ocr'
BS_CLASSIFY
=
10087
RESULT_MAPPING
=
{
...
...
@@ -1200,6 +1203,9 @@ RESULT_MAPPING = {
CONTRACT_CLASSIFY
:
HT_FIELD
,
INSURANCE_CLASSIFY
:
BD_FIELD
,
BS_CLASSIFY
:
BS_FIELD
,
HIL_CONTRACT_1_CLASSIFY
:
HIL_CONTRACT_1_FIELD
,
HIL_CONTRACT_2_CLASSIFY
:
HIL_CONTRACT_2_FIELD
,
HIL_CONTRACT_3_CLASSIFY
:
HIL_CONTRACT_3_FIELD
,
}
CA_ADD_COMPARE_FIELDS
=
(
IC_OCR_FIELD
,
BL_OCR_FIELD
,
BS_FIELD
)
...
...
@@ -1220,6 +1226,9 @@ COMPARE_FIELDS = (MVI_OCR_FIELD,
HT_FIELD
,
BD_FIELD
,
BS_FIELD
,
HIL_CONTRACT_1_FIELD
,
HIL_CONTRACT_2_FIELD
,
HIL_CONTRACT_3_FIELD
,
)
# 身份证
...
...
@@ -1514,6 +1523,9 @@ JYPZ_EN = 'Used Car Document'
AFC_CONTRACT_EN
=
'AFC Contract'
BD_EN
=
'Insurance'
BS_EN
=
'Bank Statement'
HIL_CONTRACT_1_EN
=
'售后回租合同'
HIL_CONTRACT_2_EN
=
'车辆租赁抵押合同'
HIL_CONTRACT_3_EN
=
'车辆处置协议'
SKIP_CARD
=
{
SME_BL_EN
}
...
...
@@ -1750,6 +1762,9 @@ SE_COMPARE_FIELD = {
AFC_CONTRACT_EN
:
(
HT_FIELD
,
HT_COMPARE_LOGIC
,
False
),
BD_EN
:
(
BD_FIELD
,
BD_COMPARE_LOGIC
,
False
),
BS_EN
:
(
BS_FIELD
,
BS_COMPARE_LOGIC
,
False
),
HIL_CONTRACT_1_EN
:
(
HIL_CONTRACT_1_FIELD
,
HIL_CONTRACT_1_COMPARE_LOGIC
,
False
),
HIL_CONTRACT_2_EN
:
(
HIL_CONTRACT_1_FIELD
,
HIL_CONTRACT_2_COMPARE_LOGIC
,
False
),
HIL_CONTRACT_3_EN
:
(
HIL_CONTRACT_1_FIELD
,
HIL_CONTRACT_3_COMPARE_LOGIC
,
False
),
}
...
...
src/apps/doc/models.py
View file @
0c5207a
...
...
@@ -316,6 +316,9 @@ class AFCOCRResult(models.Model):
ht_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"AFC合同"
)
bd_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"保单"
)
bss_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"银行流水"
)
hil_contract_1_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同1"
)
hil_contract_2_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同2"
)
hil_contract_3_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同3"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
...
...
@@ -348,6 +351,9 @@ class HILOCRResult(models.Model):
ht_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"AFC合同"
)
bd_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"保单"
)
bss_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"银行流水"
)
hil_contract_1_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同1"
)
hil_contract_2_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同2"
)
hil_contract_3_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同3"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
...
...
@@ -379,6 +385,9 @@ class AFCSEOCRResult(models.Model):
ht_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"AFC合同"
)
bd_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"保单"
)
bss_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"银行流水"
)
hil_contract_1_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同1"
)
hil_contract_2_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同2"
)
hil_contract_3_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同3"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
...
...
@@ -411,6 +420,9 @@ class HILSEOCRResult(models.Model):
ht_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"AFC合同"
)
bd_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"保单"
)
bss_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"银行流水"
)
hil_contract_1_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同1"
)
hil_contract_2_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同2"
)
hil_contract_3_ocr
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"HIL合同3"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
...
...
src/celery_compare/tasks.py
View file @
0c5207a
...
...
@@ -1191,8 +1191,10 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list):
compare_info
[
'other'
]
=
other_info
if
application_entity
in
consts
.
HIL_SET
:
return
compare_info
,
cms_info
.
get
(
'applicationVersion'
,
1
)
# HIL合同-----------------------------------------------------------------------------------------
return
compare_info
,
cms_info
.
get
(
'applicationVersion'
,
1
)
else
:
# AFC合同-----------------------------------------------------------------------------------------------------------
contract_info
=
{}
...
...
src/common/tools/mssql_script12.py
0 → 100644
View file @
0c5207a
import
pyodbc
hil_sql
=
"""
ALTER TABLE hil_ocr_result ADD hil_contract_1_ocr nvarchar(max);
ALTER TABLE hil_ocr_result ADD hil_contract_2_ocr nvarchar(max);
ALTER TABLE hil_ocr_result ADD hil_contract_3_ocr nvarchar(max);
ALTER TABLE hil_se_ocr_result ADD hil_contract_1_ocr nvarchar(max);
ALTER TABLE hil_se_ocr_result ADD hil_contract_2_ocr nvarchar(max);
ALTER TABLE hil_se_ocr_result ADD hil_contract_3_ocr nvarchar(max);
"""
afc_sql
=
"""
ALTER TABLE afc_ocr_result ADD hil_contract_1_ocr nvarchar(max);
ALTER TABLE afc_ocr_result ADD hil_contract_2_ocr nvarchar(max);
ALTER TABLE afc_ocr_result ADD hil_contract_3_ocr nvarchar(max);
ALTER TABLE afc_se_ocr_result ADD hil_contract_1_ocr nvarchar(max);
ALTER TABLE afc_se_ocr_result ADD hil_contract_2_ocr nvarchar(max);
ALTER TABLE afc_se_ocr_result ADD hil_contract_3_ocr nvarchar(max);
"""
hil_cnxn
=
pyodbc
.
connect
(
'DRIVER={ODBC Driver 17 for SQL Server};'
,
autocommit
=
True
)
hil_cursor
=
hil_cnxn
.
cursor
()
hil_cursor
.
execute
(
hil_sql
)
hil_cursor
.
close
()
hil_cnxn
.
close
()
afc_cnxn
=
pyodbc
.
connect
(
'DRIVER={ODBC Driver 17 for SQL Server};'
,
autocommit
=
True
)
afc_cursor
=
afc_cnxn
.
cursor
()
afc_cursor
.
execute
(
afc_sql
)
afc_cursor
.
close
()
afc_cnxn
.
close
()
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