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
b6752f9c
authored
2025-09-04 16:34:13 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
MOD:code
1 parent
e4c01a4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
src/apps/doc/views.py
src/common/response.py
src/apps/doc/views.py
View file @
b6752f9
...
...
@@ -2095,10 +2095,10 @@ class DocReOcrView(GenericView, DocHandler):
doc
=
doc_class
.
objects
.
filter
(
id
=
doc_id
)
.
first
()
if
doc
.
application_id
.
startswith
(
consts
.
FIXED_APPLICATION_ID_PREFIX
):
self
.
running_log
.
info
(
'[doc re-ocr fail not support CH-S] [application_entity={0}] [doc_id={1}]'
.
format
(
application_entity
,
doc_id
))
return
response
.
error
_msg
(
'模拟下单的文件不支持重新识别'
)
return
response
.
ok
_msg
(
'模拟下单的文件不支持重新识别'
)
if
doc
.
status
!=
DocStatus
.
PROCESS_FAILED
.
value
:
self
.
running_log
.
info
(
'[doc re-ocr fail not support status] [application_entity={0}] [doc_id={1}]'
.
format
(
application_entity
,
doc_id
))
return
response
.
error
_msg
(
'不支持的文件状态'
)
return
response
.
ok
_msg
(
'不支持的文件状态'
)
# 3. 选择队列进入
is_priority
=
PriorityApplication
.
objects
.
filter
(
application_id
=
doc
.
application_id
,
on_off
=
True
)
.
exists
()
...
...
src/common/response.py
View file @
b6752f9
...
...
@@ -34,6 +34,9 @@ class APIResponse(JsonResponse):
def
ok
(
**
kwargs
):
return
APIResponse
(
MetaStatus
.
SUCCESS
.
value
,
msg
=
MetaStatus
.
SUCCESS
.
verbose_name
,
**
kwargs
)
def
ok_msg
(
msg
=
MetaStatus
.
SUCCESS
.
verbose_name
,
**
kwargs
):
return
APIResponse
(
MetaStatus
.
SUCCESS
.
value
,
msg
=
msg
,
**
kwargs
)
def
error_msg
(
msg
=
'internal error'
,
**
kwargs
):
return
APIResponse
(
MetaStatus
.
INTERNAL_ERROR
.
value
,
msg
=
msg
,
**
kwargs
)
...
...
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