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
abbffc2b
authored
2025-07-24 14:27:38 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
FIX
1 parent
01854092
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/ocr/wb.py
src/apps/doc/views.py
src/apps/doc/management/commands/ocr_process.py
View file @
abbffc2
...
...
@@ -1504,7 +1504,7 @@ class Command(BaseCommand, LoggerMixin):
self
.
log_base
,
traceback
.
format_exc
()))
# error_list.append(1)
# return
elif
classify_1_str
==
'12'
:
# weixin e-bs
elif
classify_1_str
==
'12'
or
classify_1_str
==
'29'
:
# weixin e-bs 或e-invoice 都走微信电子流水逻辑
try
:
max_img_count
=
500
for
times
in
range
(
consts
.
RETRY_TIMES
):
...
...
src/apps/doc/ocr/wb.py
View file @
abbffc2
...
...
@@ -11,6 +11,8 @@ from openpyxl import Workbook
from
openpyxl.styles
import
PatternFill
,
numbers
from
openpyxl.utils
import
get_column_letter
from
apps.doc
import
consts
import
logging
online_log
=
logging
.
getLogger
(
'online'
)
class
BSWorkbook
(
Workbook
):
...
...
@@ -561,7 +563,7 @@ class BSWorkbook(Workbook):
outlay_cell
=
None
if
outlay_cell_idx
is
None
or
outlay_cell_idx
>=
length
else
rows
[
outlay_cell_idx
]
borrow_cell
=
None
if
borrow_cell_idx
is
None
or
borrow_cell_idx
>=
length
else
rows
[
borrow_cell_idx
]
summary_cell_value
=
None
if
summary_cell
is
None
else
summary_cell
.
value
summary_cell_value
=
None
if
summary_cell
is
None
else
summary_cell
.
value
.
strip
()
date_cell_value
=
None
if
date_cell
is
None
else
date_cell
.
value
amount_cell_value
=
None
if
amount_cell
is
None
else
amount_cell
.
value
over_cell_value
=
None
if
over_cell
is
None
else
over_cell
.
value
...
...
@@ -638,6 +640,7 @@ class BSWorkbook(Workbook):
# 3.2.提取信息、高亮
# row = summary_cell.row
# online_log.info('[ti qu xin xi gao liang =========== >] [summary_cell_value={0}]'.format(summary_cell_value))
if
summary_cell
is
not
None
:
# 关键词1提取
if
summary_cell_value
in
self
.
interest_keyword
:
...
...
src/apps/doc/views.py
View file @
abbffc2
...
...
@@ -688,6 +688,10 @@ class UploadDocView(GenericView, DocHandler):
classify_1
=
12
self
.
running_log
.
info
(
'[weixin bs process] [doc_id={0}]'
.
format
(
doc
.
id
))
if
classify_1
==
0
and
(
document_name
.
startswith
(
"dzfp_"
)):
classify_1
=
29
self
.
running_log
.
info
(
'[dzfp process] [doc_id={0}]'
.
format
(
doc
.
id
))
if
document_name
.
endswith
(
'.zip'
)
or
document_name
.
endswith
(
'.rar'
)
or
document_name
.
endswith
(
'.ZIP'
)
\
or
document_name
.
endswith
(
'.RAR'
):
...
...
@@ -1247,6 +1251,10 @@ class DocView(DocGenericView, DocHandler):
classify_1
=
12
self
.
running_log
.
info
(
'[weixin bs process] [doc_id={0}]'
.
format
(
doc
.
id
))
if
classify_1
==
0
and
(
document_name
.
startswith
(
"dzfp_"
)):
classify_1
=
29
self
.
running_log
.
info
(
'[dzfp process] [doc_id={0}]'
.
format
(
doc
.
id
))
# tasks = ['{0}{1}{2}'.format(prefix, consts.SPLIT_STR, doc.id)]
task
=
consts
.
SPLIT_STR
.
join
([
prefix
,
str
(
doc
.
id
),
str
(
classify_1
)])
enqueue_res
=
rh
.
enqueue
([
task
],
is_priority
)
...
...
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