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
d6fc968c
authored
2025-02-14 14:45:51 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'hotfix/2025-02'
2 parents
8eb3eae2
a0de225f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
src/apps/doc/management/commands/ocr_process.py
src/celery_compare/tasks.py
src/settings/__init__.py
src/apps/doc/management/commands/ocr_process.py
View file @
d6fc968
...
...
@@ -2130,10 +2130,20 @@ class Command(BaseCommand, LoggerMixin):
# 更新OCR累计识别结果表
if
business_type
==
consts
.
HIL_PREFIX
:
result_class
=
HILOCRResult
if
is_ca
else
HILSEOCRResult
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
try
:
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_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
)
else
:
result_class
=
AFCOCRResult
if
is_ca
else
AFCSEOCRResult
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
try
:
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_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
)
except
Exception
as
e
:
self
.
online_log
.
error
(
...
...
@@ -2172,10 +2182,20 @@ class Command(BaseCommand, LoggerMixin):
# 更新OCR累计识别结果表
if
business_type
==
consts
.
HIL_PREFIX
:
result_class
=
HILOCRResult
if
is_ca
else
HILSEOCRResult
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
try
:
res_obj
=
atomicSaveDBHIL
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_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
)
else
:
result_class
=
AFCOCRResult
if
is_ca
else
AFCSEOCRResult
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_dict
)
try
:
res_obj
=
atomicSaveDBAFC
(
self
,
result_class
,
doc
,
license_summary
,
ic_merge
,
rp_merge
,
task_str
,
financial_statement_dict
,
financial_explanation_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
)
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 @
d6fc968
This diff is collapsed.
Click to expand it.
src/settings/__init__.py
View file @
d6fc968
...
...
@@ -102,7 +102,7 @@ for db_setting in DATABASES.values():
'driver'
:
'ODBC Driver 17 for SQL Server'
,
'extra_params'
:
"odbc_cursortype=2"
}
db_setting
[
'CONN_MAX_AGE'
]
=
60
# 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