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
e914ba66
authored
2022-01-12 11:38:46 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
26641ca0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/models.py
src/apps/doc/views.py
src/celery_compare/tasks.py
src/apps/doc/management/commands/ocr_process.py
View file @
e914ba6
...
...
@@ -333,7 +333,7 @@ class Command(BaseCommand, LoggerMixin):
min_char_count_2
=
1000
for
product
in
license_data
.
get
(
'result'
,
{})
.
get
(
'productList'
,
[]):
name
=
product
.
get
(
'name'
,
{})
.
get
(
'words'
,
''
)
if
name
.
find
(
'机动车损失'
)
!=
-
1
or
name
.
find
(
'汽车损失'
)
!=
-
1
:
if
name
.
find
(
'机动车损失'
)
!=
-
1
or
name
.
find
(
'汽车损失'
)
!=
-
1
or
name
.
find
(
'车损险'
)
!=
-
1
:
if
len
(
name
)
<
min_char_count_1
:
min_char_count_1
=
len
(
name
)
product_result
[
0
]
=
product
.
get
(
'coverage'
,
{})
.
get
(
'words'
,
''
)
...
...
src/apps/doc/models.py
View file @
e914ba6
...
...
@@ -818,7 +818,7 @@ class HILAutoSettlement(models.Model):
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
aa_type
=
models
.
CharField
(
null
=
True
,
max_length
=
64
,
verbose_name
=
"aa_type"
)
rpa_result
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"
原因10数目
"
)
rpa_result
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"
rpa_result
"
)
rpa_1st_eye_tat
=
models
.
DecimalField
(
max_digits
=
18
,
decimal_places
=
0
,
null
=
True
,
verbose_name
=
'rpa_1st_eye_tat'
)
rpa_2nd_eye_tat
=
models
.
DecimalField
(
max_digits
=
18
,
decimal_places
=
0
,
null
=
True
,
verbose_name
=
'rpa_2nd_eye_tat'
)
rpa_3rd_eye_tat
=
models
.
DecimalField
(
max_digits
=
18
,
decimal_places
=
0
,
null
=
True
,
verbose_name
=
'rpa_3rd_eye_tat'
)
...
...
@@ -848,7 +848,7 @@ class AFCAutoSettlement(models.Model):
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 索引
aa_type
=
models
.
CharField
(
null
=
True
,
max_length
=
64
,
verbose_name
=
"aa_type"
)
rpa_result
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"
原因10数目
"
)
rpa_result
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"
rpa_result
"
)
rpa_1st_eye_tat
=
models
.
DecimalField
(
max_digits
=
18
,
decimal_places
=
0
,
null
=
True
,
verbose_name
=
'rpa_1st_eye_tat'
)
rpa_2nd_eye_tat
=
models
.
DecimalField
(
max_digits
=
18
,
decimal_places
=
0
,
null
=
True
,
verbose_name
=
'rpa_2nd_eye_tat'
)
rpa_3rd_eye_tat
=
models
.
DecimalField
(
max_digits
=
18
,
decimal_places
=
0
,
null
=
True
,
verbose_name
=
'rpa_3rd_eye_tat'
)
...
...
src/apps/doc/views.py
View file @
e914ba6
...
...
@@ -1420,5 +1420,5 @@ class AutoSettlementExcelView(GenericView):
io_content
=
io
.
BytesIO
()
# 创建在内存中处理对象
wb
.
save
(
io_content
)
wb
.
close
()
file_name
=
'
AutoSettlement'
file_name
=
'
cr_auto_records_{0}'
.
format
(
timezone
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S'
))
return
response
.
excel_response
(
file_name
,
io_content
)
...
...
src/celery_compare/tasks.py
View file @
e914ba6
...
...
@@ -2038,7 +2038,8 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list):
pre_tmp_res_part
=
{}
for
idx
,
(
name
,
value
)
in
enumerate
(
pre_field_list
):
ocr_str_or_list
=
ocr_res
.
get
(
compare_logic
[
name
][
0
])
if
isinstance
(
ocr_str_or_list
,
str
)
or
isinstance
(
ocr_str_or_list
,
list
):
if
isinstance
(
ocr_str_or_list
,
str
)
or
isinstance
(
ocr_str_or_list
,
list
)
\
or
isinstance
(
ocr_str_or_list
,
int
):
result
=
getattr
(
cp
,
compare_logic
[
name
][
1
])(
value
,
ocr_str_or_list
,
**
compare_logic
[
name
][
2
])
if
isinstance
(
ocr_str_or_list
,
list
):
ocr_str
=
json
.
dumps
(
ocr_str_or_list
,
ensure_ascii
=
False
)
...
...
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