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
b0c9794f
authored
2022-12-05 18:39:51 +0800
by
王聪
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
兼容不同文档类型
1 parent
be68ba59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
src/apps/doc/mixins.py
src/pos/consts.py
src/apps/doc/mixins.py
View file @
b0c9794
...
...
@@ -7,6 +7,7 @@ from . import consts
from
prese.compare
import
pre_compare
,
get_empty_result
from
common.mixins
import
LoggerMixin
from
settings
import
conf
from
pos.consts
import
DocumentType
class
MPOSHandler
:
...
...
@@ -255,6 +256,6 @@ class PosHandler:
doc_type
=
file_obj
.
get
(
'documentType'
,
''
)
img_base64
=
file_obj
.
get
(
'fileBase64'
)
if
doc_type
==
'Greenbook'
:
if
doc_type
==
DocumentType
.
GREEN_BOOK
.
value
.
en_name
:
PosHandler
.
greenbook_process
(
result_obj
,
img_base64
)
return
result_obj
...
...
src/pos/consts.py
0 → 100644
View file @
b0c9794
from
enum
import
Enum
class
DocumentTypeModel
:
def
__init__
(
self
,
code
,
en_name
,
cn_name
):
self
.
code
=
code
;
self
.
en_name
=
en_name
self
.
cn_name
=
cn_name
class
DocumentType
(
Enum
):
GREEN_BOOK
=
DocumentTypeModel
(
"DTGBK"
,
"Green Book"
,
"机动车登记证"
)
CONFIRMATION_LETTER
=
DocumentTypeModel
(
"DTCLE"
,
"Confirmation Letter"
,
"解抵押确认函"
)
WEBSITE_SCREENSHOT
=
DocumentTypeModel
(
"DTWES"
,
"Website Screenshot"
,
"网页截图"
)
if
__name__
==
'__main__'
:
print
(
DocumentType
.
GREEN_BOOK
.
value
.
en_name
)
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