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
7c486b64
authored
2022-06-09 19:57:29 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/auto-flag'
2 parents
0e55233e
a11a2e69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
23 deletions
src/apps/doc/views.py
src/apps/doc/views.py
View file @
7c486b6
...
...
@@ -743,29 +743,29 @@ class SECompareView(GenericView):
@use_args
(
se_compare_args
,
location
=
'data'
)
def
post
(
self
,
request
,
args
):
# 存库
content
=
args
.
get
(
'content'
,
{})
business_type
=
content
.
get
(
'applicationEntity'
)
application_id
=
content
.
get
(
'applicationId'
)
is_auto
=
content
.
get
(
'isAutoSettlement'
,
False
)
auto_class
=
HILAutoSettlement
if
business_type
in
consts
.
HIL_SET
else
AFCAutoSettlement
auto_obj
=
auto_class
.
objects
.
filter
(
application_id
=
application_id
)
.
first
()
if
is_auto
:
# 加入优先级队列
PriorityApplication
.
objects
.
update_or_create
(
application_id
=
application_id
,
defaults
=
{
'on_off'
:
True
})
# 加入auto表
if
auto_obj
is
None
:
auto_class
.
objects
.
create
(
application_id
=
application_id
,
)
elif
auto_obj
.
on_off
is
False
:
auto_obj
.
on_off
=
True
auto_obj
.
save
()
else
:
if
auto_obj
is
not
None
and
auto_obj
.
on_off
is
True
:
auto_obj
.
on_off
=
False
auto_obj
.
save
()
#
content = args.get('content', {})
#
business_type = content.get('applicationEntity')
#
application_id = content.get('applicationId')
#
is_auto = content.get('isAutoSettlement', False)
#
#
auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement
#
auto_obj = auto_class.objects.filter(application_id=application_id).first()
#
if is_auto:
#
# 加入优先级队列
#
PriorityApplication.objects.update_or_create(
#
application_id=application_id, defaults={'on_off': True})
#
# 加入auto表
#
if auto_obj is None:
#
auto_class.objects.create(
#
application_id=application_id,
#
)
#
elif auto_obj.on_off is False:
#
auto_obj.on_off = True
#
auto_obj.save()
#
else:
#
if auto_obj is not None and auto_obj.on_off is True:
#
auto_obj.on_off = False
#
auto_obj.save()
return
response
.
ok
()
# uniq_seq = content.get('uniqSeq')
...
...
@@ -1256,6 +1256,30 @@ class SECMSView(GenericView):
business_type
=
consts
.
AFC_PREFIX
if
cms_info
.
get
(
'financeCompany'
,
''
)
.
startswith
(
'宝马'
)
else
consts
.
HIL_PREFIX
src_application_id
=
cms_info
.
get
(
'settlemnetVerification'
,
{})
.
get
(
'applicationNo'
,
''
)
application_id
=
src_application_id
[:
src_application_id
.
rfind
(
'-'
)]
# auto flag
is_auto
=
cms_info
.
get
(
'AutoSettlement'
,
False
)
auto_class
=
HILAutoSettlement
if
business_type
in
consts
.
HIL_SET
else
AFCAutoSettlement
auto_obj
=
auto_class
.
objects
.
filter
(
application_id
=
application_id
)
.
first
()
if
is_auto
:
# 加入优先级队列
PriorityApplication
.
objects
.
update_or_create
(
application_id
=
application_id
,
defaults
=
{
'on_off'
:
True
})
# 加入auto表
if
auto_obj
is
None
:
auto_class
.
objects
.
create
(
application_id
=
application_id
,
)
elif
auto_obj
.
on_off
is
False
:
auto_obj
.
on_off
=
True
auto_obj
.
save
()
else
:
if
auto_obj
is
not
None
and
auto_obj
.
on_off
is
True
:
auto_obj
.
on_off
=
False
auto_obj
.
save
()
# 比对信息存储
content_str
=
json
.
dumps
(
cms_info
)
comparison_class
=
HILSECMSInfo
if
business_type
in
consts
.
HIL_SET
else
AFCSECMSInfo
...
...
@@ -1267,6 +1291,7 @@ class SECMSView(GenericView):
# 触发比对
compare
.
apply_async
((
application_id
,
business_type
,
None
,
None
,
False
,
True
),
queue
=
'queue_compare'
)
return
response
.
ok
()
post
.
openapi_doc
=
'''
...
...
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