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
b9c80f62
authored
2025-02-25 14:54:57 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
MOD:merge
2 parents
c10429b1
d45e104a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
src/apps/doc/consts.py
src/apps/doc/management/commands/ocr_process.py
src/celery_compare/tasks.py
src/settings/__init__.py
src/apps/doc/consts.py
View file @
b9c80f6
...
...
@@ -2016,12 +2016,12 @@ BS_COMPARE_LOGIC = {
'户名'
:
(
'role'
,
'se_bs_one_compare'
,
{},
'主共借人未提供银行流水'
),
'(担保人1)户名'
:
(
'role'
,
'se_bs_name_compare'
,
{},
'担保人1未提供银行流水'
),
'(担保人2)户名'
:
(
'role'
,
'se_bs_name_compare'
,
{},
'担保人2未提供银行流水'
),
'打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
15
},
'主共借人银行流水打印日期超过15
天'
),
'(担保人1)打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
15
},
'担保人1银行流水打印日期超过15
天'
),
'(担保人2)打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
15
},
'担保人2银行流水打印日期超过15
天'
),
'流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'主共借人银行流水
日期不满足3个月
'
),
'(担保人1)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人1银行流水
日期不满足3个月
'
),
'(担保人2)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人2银行流水
日期不满足3个月
'
),
'打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
30
},
'主共借人银行流水打印日期超过30
天'
),
'(担保人1)打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
30
},
'担保人1银行流水打印日期超过30
天'
),
'(担保人2)打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
30
},
'担保人2银行流水打印日期超过30
天'
),
'流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'主共借人银行流水
区间异常,请核查
'
),
'(担保人1)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人1银行流水
区间异常,请核查
'
),
'(担保人2)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人2银行流水
区间异常,请核查
'
),
'类型'
:
(
'bankStatement_type'
,
'se_bs_type_compare'
,
{},
'高风险经销商流水类型异常'
),
}
...
...
@@ -2032,9 +2032,9 @@ BS_COMPARE_LOGIC_AUTO = {
'打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
30
},
'主共借人银行流水打印日期超过30天'
),
'(担保人1)打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
30
},
'担保人1银行流水打印日期超过30天'
),
'(担保人2)打印日期'
:
(
'print_time'
,
'se_bs_print_date_compare'
,
{
'days'
:
30
},
'担保人2银行流水打印日期超过30天'
),
'流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'主共借人银行流水
日期不满足2个月
'
),
'(担保人1)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人1银行流水
日期不满足2个月
'
),
'(担保人2)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人2银行流水
日期不满足2个月
'
),
'流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'主共借人银行流水
区间异常,请核查
'
),
'(担保人1)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人1银行流水
区间异常,请核查
'
),
'(担保人2)流水日期'
:
(
'timedelta'
,
'se_bs_date_compare'
,
{},
'担保人2银行流水
区间异常,请核查
'
),
'类型'
:
(
'bankStatement_type'
,
'se_bs_type_compare'
,
{},
'高风险经销商流水类型异常'
),
}
...
...
@@ -2192,7 +2192,7 @@ FSS_COMPARE_LOGIC = {
DP_COMPARE_LOGIC
=
{
'渠道'
:
(
'financial_org_name'
,
'se_common_compare'
,
{
'remove_space'
:
True
},
'首付款支付承诺书渠道错误'
),
'姓名'
:
(
'main_borrower_name'
,
'se_common_compare'
,
{
'remove_space'
:
True
},
'首付款支付承诺书姓名与系统不一致'
),
'姓名'
:
(
'main_borrower_name'
,
'se_common_compare'
,
{
'remove_
all_
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
},
'首付款支付承诺书承诺人签字与系统不一致'
),
...
...
@@ -2592,6 +2592,8 @@ DOWN_PAYMENT_CLASSIFY_LIST = [96]
# 首付款支付承诺书sheet名称
DOWN_PAYMENT_SHEET_NAME
=
"首付款支付承诺书"
NEW_FILE_COMPARE_SET
=
[
96
]
# Jira-4562 - 银行流水首页提取关键词
INCOME_KEYWORDS_LIST
=
[
"养老金"
,
"社保"
,
"代发工资"
,
"工资入账"
,
"奖金"
,
"养老保险"
,
"代发"
,
"工资"
]
INCOME_KEYWORDS_DICT
=
{
...
...
@@ -2603,6 +2605,4 @@ INCOME_KEYWORDS_DICT = {
"养老保险"
:
"yanglaobaoxian"
,
"代发"
:
"daifa"
,
"工资"
:
"gongzi"
}
NEW_FILE_COMPARE_SET
=
[
96
]
\ No newline at end of file
}
\ No newline at end of file
...
...
src/apps/doc/management/commands/ocr_process.py
View file @
b9c80f6
...
...
@@ -1646,7 +1646,7 @@ class Command(BaseCommand, LoggerMixin):
try
:
channel
,
img_path
,
text_list
=
img_queue
.
get
(
block
=
False
)
except
Exception
as
e
:
# self.online_log.info('{0} [img_2_ocr_1] [queue empty]'.format(self.log_base))
#
#
self.online_log.info('{0} [img_2_ocr_1] [queue empty]'.format(self.log_base))
time
.
sleep
(
self
.
sleep_time_img_get
)
continue
else
:
...
...
@@ -2159,19 +2159,19 @@ class Command(BaseCommand, LoggerMixin):
if
business_type
==
consts
.
HIL_PREFIX
:
result_class
=
HILOCRResult
if
is_ca
else
HILSEOCRResult
try
:
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
except
Exception
as
e
:
# 遇到报错重试一次,希望解决两个文件首次入库都插入的问题
self
.
online_log
.
error
(
'{0} [process error (ocr result save) retry] [task={1}] [error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
else
:
result_class
=
AFCOCRResult
if
is_ca
else
AFCSEOCRResult
try
:
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
except
Exception
as
e
:
# 遇到报错重试一次,希望解决两个文件首次入库都插入的问题
self
.
online_log
.
error
(
'{0} [process error (ocr result save) retry] [task={1}] [error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
except
Exception
as
e
:
self
.
online_log
.
error
(
...
...
@@ -2211,19 +2211,19 @@ class Command(BaseCommand, LoggerMixin):
if
business_type
==
consts
.
HIL_PREFIX
:
result_class
=
HILOCRResult
if
is_ca
else
HILSEOCRResult
try
:
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
except
Exception
as
e
:
# 遇到报错重试一次,希望解决两个文件首次入库都插入的问题
self
.
online_log
.
error
(
'{0} [process error (ocr result save) retry] [task={1}] [error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
else
:
result_class
=
AFCOCRResult
if
is_ca
else
AFCSEOCRResult
try
:
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
except
Exception
as
e
:
# 遇到报错重试一次,希望解决两个文件首次入库都插入的问题
self
.
online_log
.
error
(
'{0} [process error (ocr result save) retry] [task={1}] [error={2}]'
.
format
(
self
.
log_base
,
task_str
,
traceback
.
format_exc
()))
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
,
down_payment_dict
)
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (ocr result save)] [task={1}] [error={2}]'
.
format
(
...
...
src/celery_compare/tasks.py
View file @
b9c80f6
...
...
@@ -1225,7 +1225,7 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d
allow_bs_type
=
'全部'
if
cms_info
.
get
(
'autoApprovedDetails'
,
{})
.
get
(
'aaType'
,
''
)
in
[
'CAA1'
,
'CAA2'
]
and
\
'无需提供银行流水'
not
in
cms_info
.
get
(
'autoApprovedDetails'
,
{})
.
get
(
'PolicyComments'
,
''
):
date_timedelta
=
60
if
auto
else
90
date_timedelta
=
83
if
auto
else
83
bs_role_list
=
[]
for
applicant_type
in
consts
.
APPLICANT_TYPE_ORDER
[:
2
]:
if
applicant_type
in
main_role_info
:
...
...
@@ -1916,7 +1916,7 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect
allow_bs_type
=
'全部'
if
cms_info
.
get
(
'autoApprovedDetails'
,
{})
.
get
(
'aaType'
,
''
)
in
[
'CAA1'
,
'CAA2'
]
and
\
'无需提供银行流水'
not
in
cms_info
.
get
(
'autoApprovedDetails'
,
{})
.
get
(
'PolicyComments'
,
''
):
date_timedelta
=
60
if
auto
else
90
date_timedelta
=
83
if
auto
else
83
bs_role_list
=
[]
for
applicant_type
in
consts
.
APPLICANT_TYPE_ORDER
[:
2
]:
if
applicant_type
in
main_role_info
:
...
...
src/settings/__init__.py
View file @
b9c80f6
...
...
@@ -102,7 +102,7 @@ for db_setting in DATABASES.values():
'driver'
:
'ODBC Driver 17 for SQL Server'
,
'extra_params'
:
"odbc_cursortype=2;TrustServerCertificate=yes;Encrypt=yes"
}
db_setting
[
'CONN_MAX_AGE'
]
=
6
0
db_setting
[
'CONN_MAX_AGE'
]
=
0
# set this to False if you want to turn off pyodbc's connection pooling
DATABASE_CONNECTION_POOLING
=
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