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
6539e1d1
authored
2025-02-13 15:18:12 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix try catch
1 parent
775d6ee5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
28 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
6539e1d
...
...
@@ -3772,38 +3772,37 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id,
except
Exception
as
e
:
compare_log
.
info
(
'[sleep error] [error={0}]'
.
format
(
traceback
.
format_exc
()))
compare_log
.
info
(
'{0} [comparison unfinished file wait delay_time end] [entity={1}] [id={2}] [doc_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
.
id
))
except
Exception
as
e
:
compare_log
.
info
(
'[fsm_compare_thread error] [error={0}]'
.
format
(
traceback
.
format_exc
()))
# 调用java fsm 比对流程接口(http)
# 调用Java fsm 比对流程接口, fsm 是se流程, ca可以暂时忽略
auto_class
=
HILAutoSettlement
if
application_entity
==
consts
.
HIL_PREFIX
else
AFCAutoSettlement
auto_obj
=
auto_class
.
objects
.
filter
(
application_id
=
application_id
,
on_off
=
True
)
.
first
()
if
auto_obj
is
not
None
:
url
=
conf
.
FSM_AUTO_URL
is_auto
=
True
else
:
url
=
conf
.
FSM_URL
is_auto
=
False
# 调用java fsm 比对流程接口(http)
# 调用Java fsm 比对流程接口, fsm 是se流程, ca可以暂时忽略
auto_class
=
HILAutoSettlement
if
application_entity
==
consts
.
HIL_PREFIX
else
AFCAutoSettlement
auto_obj
=
auto_class
.
objects
.
filter
(
application_id
=
application_id
,
on_off
=
True
)
.
first
()
if
auto_obj
is
not
None
:
url
=
conf
.
FSM_AUTO_URL
is_auto
=
True
else
:
url
=
conf
.
FSM_URL
is_auto
=
False
body
=
{
'applicationId'
:
application_id
,
'businessType'
:
application_entity
,
'ocrResId'
:
ocr_res_id
,
'isCa'
:
is_ca
,
'isCms'
:
is_cms
}
try
:
compare_log
.
info
(
"request java fsm api, url:{0}, body:{1}, is_auto:{2}"
.
format
(
url
,
json
.
dumps
(
body
),
is_auto
))
headers
=
{
'Content-Type'
:
'application/json'
body
=
{
'applicationId'
:
application_id
,
'businessType'
:
application_entity
,
'ocrResId'
:
ocr_res_id
,
'isCa'
:
is_ca
,
'isCms'
:
is_cms
}
resp
=
requests
.
post
(
url
,
headers
=
headers
,
json
=
body
)
compare_log
.
info
(
"response from fsm api, resp:{0}"
.
format
(
resp
.
text
))
try
:
compare_log
.
info
(
"request java fsm api, url:{0}, body:{1}, is_auto:{2}"
.
format
(
url
,
json
.
dumps
(
body
),
is_auto
))
headers
=
{
'Content-Type'
:
'application/json'
}
resp
=
requests
.
post
(
url
,
headers
=
headers
,
json
=
body
)
compare_log
.
info
(
"response from fsm api, resp:{0}"
.
format
(
resp
.
text
))
except
Exception
as
e
:
compare_log
.
error
(
"fsm full request to java error, url:{0}, param:{1}, errorMsg:{2}"
.
format
(
url
,
json
.
dumps
(
body
),
traceback
.
format_exc
()))
except
Exception
as
e
:
compare_log
.
error
(
"fsm full request to java error, url:{0}, param:{1}, errorMsg:{2}"
.
format
(
url
,
json
.
dumps
(
body
),
traceback
.
format_exc
()))
compare_log
.
info
(
'[fsm_compare_thread error] [error={0}]'
.
format
(
traceback
.
format_exc
()))
@app.task
...
...
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