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
30dab433
authored
2024-03-07 17:07:44 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
MOD:接收文件接口增加fsm标志
1 parent
70735d1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
src/apps/doc/views.py
src/apps/doc/views.py
View file @
30dab43
...
...
@@ -279,6 +279,7 @@ se_compare_args = {
application_data_args
=
{
'applicationId'
:
fields
.
Str
(
required
=
True
,
validate
=
validate
.
Length
(
max
=
64
)),
'applicationStatus'
:
fields
.
Str
(
required
=
False
,
validate
=
validate
.
Length
(
max
=
64
)),
'fsm'
:
fields
.
Boolean
(
required
=
False
),
}
applicant_data_args
=
{
...
...
@@ -581,6 +582,7 @@ class UploadDocView(GenericView, DocHandler):
application_id
=
application_data
.
get
(
'applicationId'
)
# 包含FSM 激活状态
application_status
=
application_data
.
get
(
'applicationStatus'
,
''
)
fsm
=
application_data
.
get
(
'fsm'
,
False
)
document_scheme
=
document
.
get
(
'documentScheme'
)
data_source
=
document
.
get
(
'dataSource'
)
document_name
=
document
.
get
(
'documentName'
,
''
)
...
...
@@ -650,7 +652,10 @@ class UploadDocView(GenericView, DocHandler):
classify_1
=
0
# 电子合同 Econtract or OVP(FSM)
if
data_source
==
consts
.
DATA_SOURCE_LIST
[
2
]
or
data_source
==
consts
.
DATA_SOURCE_LIST
[
3
]:
if
document_scheme
==
consts
.
DOC_SCHEME_LIST
[
1
]:
# 如果是OVP来源的非FSM classify_1还是等于0,走纸质模型
if
data_source
==
consts
.
DATA_SOURCE_LIST
[
3
]
and
not
fsm
:
classify_1
=
0
elif
document_scheme
==
consts
.
DOC_SCHEME_LIST
[
1
]:
for
keyword
,
classify_1_tmp
in
consts
.
ECONTRACT_KEYWORDS_MAP
.
get
(
prefix
):
if
keyword
in
document_name
:
classify_1
=
classify_1_tmp
...
...
@@ -670,8 +675,8 @@ class UploadDocView(GenericView, DocHandler):
task
=
consts
.
SPLIT_STR
.
join
([
prefix
,
str
(
doc
.
id
),
str
(
classify_1
)])
enqueue_res
=
rh
.
enqueue
([
task
],
is_priority
,
is_zip
)
self
.
running_log
.
info
(
'[doc upload success] [args={0}] [business_type={1}] [doc_id={2}] '
'[is_priority={3}] [enqueue_res={4}]'
.
format
(
args
,
prefix
,
doc
.
id
,
is_priority
,
enqueue_res
))
'[is_priority={3}] [enqueue_res={4}]
[is_fsm={5} [classify_1={6}]]
'
.
format
(
args
,
prefix
,
doc
.
id
,
is_priority
,
enqueue_res
,
fsm
,
classify_1
))
try
:
end_time
=
time
.
time
()
...
...
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