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
b661123a
authored
2021-08-30 15:51:52 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/slice1' into feature/0611
2 parents
ed435b3f
9736b86a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
src/apps/doc/models.py
src/apps/doc/views.py
src/celery_compare/tasks.py
src/apps/doc/models.py
View file @
b661123
...
...
@@ -561,7 +561,7 @@ class AFCSECompareResult(models.Model):
reason10_count
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"原因10数目"
)
result
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"比对结果"
)
comments
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"备注"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
Tru
e
,
verbose_name
=
'修改时间'
)
# 索引
update_time
=
models
.
DateTimeField
(
auto_now
=
Fals
e
,
verbose_name
=
'修改时间'
)
# 索引
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
class
Meta
:
...
...
@@ -589,7 +589,7 @@ class AFCCACompareResult(models.Model):
reason10_count
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"原因10数目"
)
result
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"比对结果"
)
comments
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"备注"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
Tru
e
,
verbose_name
=
'修改时间'
)
# 索引
update_time
=
models
.
DateTimeField
(
auto_now
=
Fals
e
,
verbose_name
=
'修改时间'
)
# 索引
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
class
Meta
:
...
...
@@ -617,7 +617,7 @@ class HILSECompareResult(models.Model):
reason10_count
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"原因10数目"
)
result
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"比对结果"
)
comments
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"备注"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
Tru
e
,
verbose_name
=
'修改时间'
)
# 索引
update_time
=
models
.
DateTimeField
(
auto_now
=
Fals
e
,
verbose_name
=
'修改时间'
)
# 索引
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
class
Meta
:
...
...
@@ -644,7 +644,7 @@ class HILCACompareResult(models.Model):
reason10_count
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"原因10数目"
)
result
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"比对结果"
)
comments
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"备注"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
Tru
e
,
verbose_name
=
'修改时间'
)
# 索引
update_time
=
models
.
DateTimeField
(
auto_now
=
Fals
e
,
verbose_name
=
'修改时间'
)
# 索引
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
class
Meta
:
...
...
@@ -675,6 +675,7 @@ class AFCSECompareResultRecord(models.Model):
class
Meta
:
managed
=
False
db_table
=
'afc_se_compare_result_record'
situ_db_label
=
'afc'
class
AFCCACompareResultRecord
(
models
.
Model
):
...
...
@@ -700,6 +701,7 @@ class AFCCACompareResultRecord(models.Model):
class
Meta
:
managed
=
False
db_table
=
'afc_ca_compare_result_record'
situ_db_label
=
'afc'
class
HILSECompareResultRecord
(
models
.
Model
):
...
...
src/apps/doc/views.py
View file @
b661123
...
...
@@ -447,7 +447,7 @@ result_item_args = {
consts
.
HEAD_LIST
[
5
]:
fields
.
Str
(
required
=
True
),
consts
.
HEAD_LIST
[
6
]:
fields
.
Str
(
required
=
True
),
consts
.
HEAD_LIST
[
7
]:
fields
.
Str
(
required
=
True
),
consts
.
HEAD_LIST
[
8
]:
fields
.
List
(
fields
.
Str
(),
required
=
True
),
consts
.
HEAD_LIST
[
8
]:
fields
.
Str
(
required
=
True
),
consts
.
HEAD_LIST
[
9
]:
fields
.
Int
(
required
=
True
),
}
...
...
@@ -903,8 +903,10 @@ class DocView(GenericView, DocHandler):
class
CompareResultView
(
GenericView
):
permission_classes
=
[]
authentication_classes
=
[]
# permission_classes = []
# authentication_classes = []
permission_classes
=
[
IsAuthenticated
]
authentication_classes
=
[
OAuth2AuthenticationWithUser
]
# 获取比对结果
@use_args
(
compare_result_args
,
location
=
'querystring'
)
...
...
@@ -1044,13 +1046,13 @@ class CompareResultView(GenericView):
if
update_time
==
result_obj
.
update_time
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M'
):
result_obj
.
result
=
result_str
result_obj
.
comments
=
args
.
get
(
'comments'
,
''
)
result_obj
.
update_time
=
result_obj
.
update_time
#
result_obj.update_time = result_obj.update_time
result_obj
.
save
()
return
response
.
ok
()
else
:
whole_result
=
consts
.
RESULT_Y
if
result_obj
.
is_finish
else
consts
.
RESULT_N
comments
=
''
if
result_obj
.
comments
is
None
else
comments
=
result_obj
.
comments
comments
=
''
if
result_obj
.
comments
is
None
else
result_obj
.
comments
compare_result
=
{
'id'
:
0
if
result_obj
is
None
else
result_obj
.
id
,
...
...
src/celery_compare/tasks.py
View file @
b661123
...
...
@@ -415,6 +415,7 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
res_obj
.
version
=
'{0}{1}{2}'
.
format
(
consts
.
INFO_SOURCE
[
0
],
consts
.
SPLIT_STR
,
last_obj
.
application_version
)
# res_obj.reason1_count = reason1_count
res_obj
.
result
=
json
.
dumps
(
compare_result
)
res_obj
.
update_time
=
start_time
res_obj
.
save
()
compare_log
.
info
(
'{0} [CA] [result save success] [entity={1}] [id={2}] [ocr_res_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
))
...
...
@@ -1078,6 +1079,7 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
res_obj
.
version
=
'{0}{1}{2}'
.
format
(
consts
.
INFO_SOURCE
[
0
],
consts
.
SPLIT_STR
,
last_obj
.
application_version
)
# res_obj.reason1_count = reason1_count
res_obj
.
result
=
json
.
dumps
(
compare_result
)
res_obj
.
update_time
=
datetime
.
now
()
res_obj
.
save
()
compare_log
.
info
(
'{0} [SE] [result save success] [entity={1}] [id={2}] [ocr_res_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
))
...
...
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