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
8eb3eae2
authored
2025-02-14 14:45:29 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/CHINARPA-5075'
2 parents
e9f31776
df025c2d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
0 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/common/tools/mssql_script29.py
src/apps/doc/consts.py
View file @
8eb3eae
...
...
@@ -1250,6 +1250,7 @@ FSM_CONTRACT_SC_FIELD = 'fsm_sc_ocr'
FSM_CONTRACT_SC2_FIELD
=
'fsm_sc2_ocr'
FS_FIELD
=
'fs_ocr'
FSS_FIELD
=
'fss_ocr'
DP_FIELD
=
'dp_ocr'
BS_CLASSIFY
=
10089
...
...
@@ -1308,6 +1309,7 @@ COMPARE_FIELDS = (
HIL_CONTRACT_3_FIELD
,
FS_FIELD
,
FSS_FIELD
,
DP_FIELD
,
)
PRE_COMPARE_FIELDS
=
(
...
...
@@ -1511,6 +1513,7 @@ JYPZ_TYPE_1 = ['二手车交易凭证']
JYPZ_TYPE_2
=
[
'BMW官方认证二手车交易凭证'
,
'二手车交易凭证'
]
SE_FS_FIELD
=
[
'Hash值'
,
'公章'
,
'财年'
,
'资产负债表内容'
,
'利润表内容'
]
SE_FSS_FIELD
=
[
'公司名称'
,
'公章'
]
SE_DP_FIELD
=
[
'渠道'
,
'姓名'
,
'证件号码'
,
'合同编号(含版本号)'
,
'承诺人签字-电子'
,
'承诺人签字日期-电子'
]
SE_BANK_FIELD
=
[
'accountNo'
,
'bankName'
]
SE_DDA_FIELD
=
[
'applicationId(1)'
,
'applicationId(2)'
,
'bankName'
,
'companyName'
,
'customerName'
,
'idNum'
,
'accountHolderName'
,
'accountNo'
]
...
...
@@ -1826,6 +1829,7 @@ HIL_CONTRACT_2_EN = '车辆租赁抵押合同'
HIL_CONTRACT_3_EN
=
'车辆处置协议'
FS_EN
=
'Financial Statement'
FSS_EN
=
'Financial Statement Supplementary'
DP_EN
=
'Down Payment'
DDA_NO_FIND
=
'需人工查看DDA或截图'
FS_NO_FIND
=
'未提供财报或财报不完整'
...
...
@@ -2185,6 +2189,15 @@ FSS_COMPARE_LOGIC = {
'公章'
:
(
'stamp'
,
'stamp_str_compare'
,
{},
'财报情况说明无公章'
),
}
DP_COMPARE_LOGIC
=
{
'渠道'
:
(
'financial_org_name'
,
'se_common_compare'
,
{
'remove_space'
:
True
},
'首付款支付承诺书渠道错误'
),
'姓名'
:
(
'main_borrower_name'
,
'se_common_compare'
,
{
'remove_space'
:
True
},
'首付款支付承诺书姓名与系统不一致'
),
'证件号码'
:
(
'main_borrower_id_no'
,
'se_common_compare'
,
{
'remove_space'
:
True
},
'首付款支付承诺书证件号码与系统不一致'
),
'合同编号(含版本号)'
:
(
'apply_no'
,
'se_common_compare'
,
{
'remove_space'
:
True
},
'首付款支付承诺书合同编号与系统不一致'
),
'承诺人签字-电子'
:
(
'promisor_signature'
,
'se_common_compare'
,
{
'remove_all_space'
:
True
},
'首付款支付承诺书承诺人签字与系统不一致'
),
'承诺人签字日期-电子'
:
(
'promisor_signature_date'
,
'se_have_compare'
,
{},
'N-首付款支付承诺书缺少签字日期'
),
}
AFC_HT_DATE_FIELDS
=
[
'主借人日期'
,
'共借人日期'
,
'保证人日期1'
,
'保证人日期2'
]
# MVC_OCR_FIELD = 'mvc_ocr'
...
...
@@ -2215,6 +2228,7 @@ SE_COMPARE_FIELD = {
HIL_CONTRACT_3_EN
:
(
HIL_CONTRACT_3_FIELD
,
HIL_CONTRACT_3_COMPARE_LOGIC
,
False
),
FS_EN
:
(
FS_FIELD
,
FS_COMPARE_LOGIC
,
False
),
FSS_EN
:
(
FSS_FIELD
,
FSS_COMPARE_LOGIC
,
False
),
DP_EN
:
(
DP_FIELD
,
DP_COMPARE_LOGIC
,
False
),
}
SE_COMPARE_FIELD_AUTO
=
{
...
...
src/celery_compare/tasks.py
View file @
8eb3eae
...
...
@@ -944,6 +944,7 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d
is_bo_corporate
=
False
role_count
=
0
borrower_name
=
''
borrower_idnum
=
''
legal_name
=
''
# province = cms_info.get('province', '')
for
individual_info
in
cms_info
.
get
(
'applicantInformation'
,
[]):
...
...
@@ -971,8 +972,14 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d
is_bo_corporate
=
True
# CHINARPA-4660 财报主借人姓名赋值
# CHINARPA-5075 首付款承诺书主借人证件号赋值
if
individual_info
[
'applicantType'
]
==
consts
.
APPLICANT_TYPE_ORDER
[
0
]:
borrower_name
=
customer_name
for
id_info
in
individual_info
.
get
(
'IDInformation'
,
[]):
if
id_info
.
get
(
'idType'
)
in
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
:
borrower_idnum
=
decode_des
(
id_info
.
get
(
'idNum'
,
''
),
des_key
)
elif
is_corporate
and
id_info
.
get
(
'idType'
)
in
[
'Unified Social Credit Code'
,
'Tax Number'
,
'Business License Number'
]:
borrower_idnum
=
decode_des
(
id_info
.
get
(
'idNum'
,
''
),
des_key
)
for
id_info
in
individual_info
.
get
(
'IDInformation'
,
[]):
if
id_info
.
get
(
'idType'
)
in
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
:
...
...
@@ -1577,6 +1584,20 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d
contract_info
[
consts
.
AFC_CONTRACT_QRS_EN
]
=
afc_contract_qrs_input
compare_info
[
'contract'
]
=
contract_info
# 首付款承诺书
down_payment_info
=
{}
down_payment_input
=
[]
totalDownPayment
=
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'totalDownPayment'
))
if
totalDownPayment
and
totalDownPayment
!=
'0.00'
:
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
0
],
cms_info
.
get
(
'financeCompany'
,
''
)))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
1
],
borrower_name
))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
2
],
borrower_idnum
))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
3
],
cms_info
.
get
(
'settlemnetVerification'
,
{})
.
get
(
'applicationNo'
,
''
)))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
4
],
legal_name
if
is_bo_corporate
else
borrower_name
))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
5
],
'有/无'
))
down_payment_info
[
consts
.
DP_EN
]
=
down_payment_input
compare_info
[
'downPayment'
]
=
down_payment_info
return
compare_info
,
cms_info
.
get
(
'autoApprovedDetails'
,
{})
.
get
(
'aaType'
,
''
),
is_gsyh
,
allow_bs_type
...
...
@@ -1614,6 +1635,7 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect
is_bo_corporate
=
False
role_count
=
0
borrower_name
=
''
borrower_idnum
=
''
legal_name
=
''
# province = cms_info.get('province', '')
for
individual_info
in
cms_info
.
get
(
'applicantInformation'
,
[]):
...
...
@@ -1641,8 +1663,14 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect
is_bo_corporate
=
True
# CHINARPA-4660 财报主借人姓名赋值
# CHINARPA-5075 首付款承诺书主借人证件号赋值
if
individual_info
[
'applicantType'
]
==
consts
.
APPLICANT_TYPE_ORDER
[
0
]:
borrower_name
=
customer_name
for
id_info
in
individual_info
.
get
(
'IDInformation'
,
[]):
if
id_info
.
get
(
'idType'
)
in
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
:
borrower_idnum
=
decode_des
(
id_info
.
get
(
'idNum'
,
''
),
des_key
)
elif
is_corporate
and
id_info
.
get
(
'idType'
)
in
[
'Unified Social Credit Code'
,
'Tax Number'
,
'Business License Number'
]:
borrower_idnum
=
decode_des
(
id_info
.
get
(
'idNum'
,
''
),
des_key
)
for
id_info
in
individual_info
.
get
(
'IDInformation'
,
[]):
if
id_info
.
get
(
'idType'
)
in
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
:
...
...
@@ -2212,6 +2240,20 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect
afc_contract_qrs_input
=
[(
consts
.
SE_AFC_CON_QRS_FIELD
[
0
],
'{0}{1}{2}'
.
format
(
role_count
,
consts
.
SPLIT_STR
,
full_no
))]
contract_info
[
consts
.
AFC_CONTRACT_QRS_EN
]
=
afc_contract_qrs_input
compare_info
[
'contract'
]
=
contract_info
# 首付款承诺书
down_payment_info
=
{}
down_payment_input
=
[]
totalDownPayment
=
str
(
cms_info
.
get
(
'financialInformation'
,
{})
.
get
(
'totalDownPayment'
))
if
totalDownPayment
and
totalDownPayment
!=
'0.00'
:
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
0
],
cms_info
.
get
(
'financeCompany'
,
''
)))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
1
],
borrower_name
))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
2
],
borrower_idnum
))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
3
],
cms_info
.
get
(
'settlemnetVerification'
,
{})
.
get
(
'applicationNo'
,
''
)))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
4
],
legal_name
if
is_bo_corporate
else
borrower_name
))
down_payment_input
.
append
((
consts
.
SE_DP_FIELD
[
5
],
'有/无'
))
down_payment_info
[
consts
.
DP_EN
]
=
down_payment_input
compare_info
[
'downPayment'
]
=
down_payment_info
return
compare_info
,
cms_info
.
get
(
'applicationVersion'
,
1
),
cms_info
.
get
(
'autoApprovedDetails'
,
{})
.
get
(
'aaType'
,
''
),
is_gsyh
,
allow_bs_type
...
...
src/common/tools/comparison.py
View file @
8eb3eae
...
...
@@ -324,6 +324,9 @@ class Comparison:
return
self
.
RESULT_Y
if
kwargs
.
get
(
'remove_space'
,
False
):
input_str
=
input_str
.
replace
(
' '
,
''
)
if
kwargs
.
get
(
'remove_all_space'
,
False
):
input_str
=
input_str
.
replace
(
' '
,
''
)
ocr_str
=
ocr_str
.
replace
(
' '
,
''
)
if
kwargs
.
get
(
'brackets_replace'
,
False
):
input_str
=
input_str
.
translate
(
self
.
KH_TRANS
)
ocr_str
=
ocr_str
.
translate
(
self
.
KH_TRANS
)
...
...
src/common/tools/mssql_script29.py
0 → 100644
View file @
8eb3eae
import
pyodbc
hil_sql
=
"""
ALTER TABLE hil_ocr_result ADD dp_ocr nvarchar(max);
ALTER TABLE hil_se_ocr_result ADD dp_ocr nvarchar(max);
"""
afc_sql
=
"""
ALTER TABLE afc_ocr_result ADD dp_ocr nvarchar(max);
ALTER TABLE afc_se_ocr_result ADD dp_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