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
2be87904
authored
2024-10-12 14:13:37 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init 4962
1 parent
578a5e19
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
src/celery_compare/tasks.py
src/settings/conf/prd.ini
src/settings/conf/sit.ini
src/settings/conf/uat.ini
src/celery_compare/tasks.py
View file @
2be8790
...
...
@@ -2458,7 +2458,7 @@ def se_bs_compare(license_en, ocr_res_dict, strip_list, is_auto, aa_type):
return
result_field_list
,
field_img_path_dict
def
se_compare_license
(
license_en
,
ocr_res_dict
,
field_list
):
def
se_compare_license
(
license_en
,
ocr_res_dict
,
field_list
,
is_auto
):
ocr_field
,
compare_logic
,
special_expiry_date
=
consts
.
SE_COMPARE_FIELD
[
license_en
]
is_find
=
False
...
...
@@ -2513,6 +2513,14 @@ def se_compare_license(license_en, ocr_res_dict, field_list):
ocr_res_list
[
res_idx
]
.
get
(
consts
.
LOWER_AMOUNT_FIELD
,
''
),
ocr_res_list
[
res_idx
]
.
get
(
consts
.
UPPER_AMOUNT_FIELD
,
''
),
)
# auto 保单 保险费合计 ocr结果需要加上一个基数,再与cms结果做比对
elif
is_auto
and
ocr_field
==
consts
.
BD_FIELD
and
name
==
consts
.
SE_BD_FIELD
[
10
]:
ocr_str
=
ocr_res_list
[
res_idx
]
.
get
(
compare_logic
[
name
][
0
])
compare_log
.
info
(
'{0} [bd_4962_price] [ori ocr_str:{1}] '
.
format
(
log_base
,
ocr_str
))
add_price
=
conf
.
BD_PRICE
compare_log
.
info
(
'{0} [bd_4962_price] [add_price:{1}] '
.
format
(
log_base
,
add_price
))
ocr_str
=
float
(
ocr_str
)
+
float
(
add_price
)
compare_log
.
info
(
'{0} [bd_4962_price] [final ocr_str:{1}] '
.
format
(
log_base
,
ocr_str
))
else
:
ocr_str
=
ocr_res_list
[
res_idx
]
.
get
(
compare_logic
[
name
][
0
])
...
...
@@ -3287,7 +3295,7 @@ def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto, id_res_list
license_en
,
id_res_list
,
strip_list
,
is_auto
)
else
:
result_field_list
,
no_ocr_result
,
field_img_path_dict
=
se_compare_license
(
license_en
,
ocr_res_dict
,
strip_list
)
license_en
,
ocr_res_dict
,
strip_list
,
is_auto
)
each_license_failed_count
=
0
for
name
,
value
,
result
,
ocr_str
,
img_path
,
error_type
,
cn_reason
in
result_field_list
:
if
license_en
not
in
consts
.
SKIP_CARD
or
not
no_ocr_result
:
...
...
@@ -3346,7 +3354,7 @@ def se_compare_process(compare_info, ocr_res_dict, is_gsyh, is_auto, id_res_list
elif
license_en
==
consts
.
FS_EN
:
result_field_list
,
field_img_path_dict
=
se_fs_compare
(
license_en
,
ocr_res_dict
,
strip_list
)
else
:
result_field_list
,
_
,
field_img_path_dict
=
se_compare_license
(
license_en
,
ocr_res_dict
,
strip_list
)
result_field_list
,
_
,
field_img_path_dict
=
se_compare_license
(
license_en
,
ocr_res_dict
,
strip_list
,
is_auto
)
each_license_failed_count
=
0
for
name
,
value
,
result
,
ocr_str
,
img_path
,
error_type
,
cn_reason
in
result_field_list
:
...
...
src/settings/conf/prd.ini
View file @
2be8790
...
...
@@ -16,3 +16,4 @@ BASE_URL = https://sfocr-prod.bmwgroup.net
DELAY_SECONDS
=
60
BD_PRICE
=
950
\ No newline at end of file
...
...
src/settings/conf/sit.ini
View file @
2be8790
...
...
@@ -15,3 +15,5 @@ DEALER_CODE = ocr_situ_group
BASE_URL
=
https://staging-bmw-ocr.situdata.com
DELAY_SECONDS
=
60
BD_PRICE
=
950
\ No newline at end of file
...
...
src/settings/conf/uat.ini
View file @
2be8790
...
...
@@ -15,3 +15,5 @@ DEALER_CODE = ocr_situ_group
BASE_URL
=
https://sfocr-uat.bmwgroup.net
DELAY_SECONDS
=
60
BD_PRICE
=
950
\ No newline at end of file
...
...
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