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
5f017a8f
authored
2022-07-08 21:27:21 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
38acff43
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
3 deletions
src/apps/account/views.py
src/apps/doc/views.py
src/celery_compare/tasks.py
src/common/tools/pdf_to_img.py
src/apps/account/views.py
View file @
5f017a8
...
...
@@ -82,6 +82,7 @@ class IWALoginView(IWABaseView, GenericView):
is_valid
,
data
=
self
.
validate
(
q_number
)
if
is_valid
:
rh
.
set_token
(
data
.
get
(
'token'
)[
-
10
:],
data
.
get
(
'user_name'
))
return
response
.
ok
(
data
=
data
)
else
:
self
.
no_permission
(
data
)
...
...
src/apps/doc/views.py
View file @
5f017a8
...
...
@@ -1479,7 +1479,7 @@ class AutoSettlementExcelView(GenericView):
io_content
=
io
.
BytesIO
()
# 创建在内存中处理对象
wb
.
save
(
io_content
)
wb
.
close
()
file_name
=
'cr_auto_records_{0}'
.
format
(
timezone
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S'
))
file_name
=
'
o
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 @
5f017a8
...
...
@@ -1732,7 +1732,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
fp_campaign
=
cms_info
.
get
(
'fpCampaign'
,
''
)
fp_group
=
cms_info
.
get
(
'fpGroup'
,
''
)
insurance_type
=
cms_info
.
get
(
'insuranceDetails'
,
{})
.
get
(
'insuranceType'
,
''
)
if
i
nsurance_type
==
'Waive Insurance'
and
i
sinstance
(
insurance_price
,
str
):
if
isinstance
(
insurance_price
,
str
):
is_insurance
=
1
elif
insurance_type
==
'Comprehensive Insurance'
:
is_insurance
=
2
...
...
src/common/tools/pdf_to_img.py
View file @
5f017a8
...
...
@@ -6,6 +6,7 @@ import fitz
import
math
from
PIL
import
Image
from
io
import
BytesIO
from
unicodedata
import
normalize
# 页面保存为png图片参数
ZOOM_X_1
=
ZOOM_Y_1
=
1.0
...
...
@@ -124,7 +125,7 @@ class PDFHandler:
x1
=
x1
*
width_scale
y1
=
y1
*
height_scale
rebuild_text_list
.
append
(
((
x0
,
y0
,
x1
,
y0
,
x1
,
y1
,
x0
,
y1
),
text
)
((
x0
,
y0
,
x1
,
y0
,
x1
,
y1
,
x0
,
y1
),
normalize
(
'NFKC'
,
text
)
)
)
self
.
page_text_list
[
pno
][
'rebuild_text'
]
=
rebuild_text_list
except
Exception
as
e
:
...
...
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