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
82558bf0
authored
2024-07-24 16:42:02 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ADD:log
1 parent
93aaae0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
82558bf
...
...
@@ -2574,6 +2574,7 @@ def se_compare_license(license_en, ocr_res_dict, field_list):
return
result_field_list
,
no_ocr_result
,
field_img_path_dict
def
se_fs_compare
(
license_en
,
ocr_res_dict
,
field_list
):
compare_log
.
info
(
'{0} [se_fs_compare] start'
.
format
(
log_base
))
ocr_field
,
compare_logic
,
special_expiry_date
=
consts
.
SE_COMPARE_FIELD
[
license_en
]
is_find
=
False
...
...
@@ -2583,15 +2584,18 @@ def se_fs_compare(license_en, ocr_res_dict, field_list):
section_img_info
=
dict
()
field_img_path_dict
=
dict
()
ocr_res_str
=
ocr_res_dict
.
get
(
ocr_field
)
compare_log
.
info
(
'{0} [se_fs_compare] ocr_res:{1}'
.
format
(
log_base
,
ocr_res_str
))
if
ocr_res_str
is
not
None
:
ocr_res_list
=
json
.
loads
(
ocr_res_str
)
length
=
len
(
ocr_res_list
)
# 先判断最后一次上传的文件是不是包括3个,如果不是直接返回"未提供财报或财报不完整"
last_ocr_str
=
ocr_res_list
[
length
-
1
]
compare_log
.
info
(
'{0} [se_fs_compare] [code len {1}] [stamp len {2}] ]'
.
format
(
log_base
,
len
(
last_ocr_str
.
get
(
'code'
,{})),
len
(
last_ocr_str
.
get
(
'stamp'
,{}))))
if
len
(
last_ocr_str
.
get
(
'code'
,{}))
!=
3
or
len
(
last_ocr_str
.
get
(
'stamp'
,{}))
!=
3
:
compare_log
.
info
(
'{0} [se_fs_compare] last ocr result len < 3'
.
format
(
log_base
))
# 先判断最后一次上传的文件是不是包括3个,如果不是直接返回"未提供财报或财报不完整"
compare_log
.
info
(
'{0} [se_fs_compare error] last ocr result len < 3'
.
format
(
log_base
))
else
:
for
res_idx
in
range
(
length
-
1
,
-
1
,
-
1
):
if
is_find
:
...
...
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