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
b98face7
authored
2021-10-08 00:26:25 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix cms
1 parent
bb783cf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
305 additions
and
102 deletions
src/apps/doc/consts.py
src/celery_compare/tasks.py
src/apps/doc/consts.py
View file @
b98face
...
...
@@ -1517,6 +1517,14 @@ SE_FIRST_ID_FIELD_MAPPING = {
'ITRES'
:
(
RP_EN
,
SE_FIRST_ID_FIELD
),
}
SE_CMS_FIRST_ID_FIELD_MAPPING
=
{
'PRC ID'
:
(
ID_EN
,
True
),
'Passport No'
:
(
PP_EN
,
False
),
'HongKong and Macao Resident Permit to Mainland'
:
(
EEP_EN
,
False
),
'TaiWan Resident Permit to Mainland'
:
(
EEP_EN
,
False
),
'Hongkong/Macau/Taiwan Resident ID'
:
(
RP_EN
,
False
),
}
SE_SECOND_ID_FIELD_MAPPING
=
{
'ITPRC'
:
(
ID_EN
,
SE_SECOND_ID_FIELD
),
'ITPSP'
:
(
PP_EN
,
SE_SECOND_ID_FIELD
),
...
...
@@ -1717,3 +1725,4 @@ APPLICANT_TYPE_MAP = {
'Mortgager'
:
'GAUTR2'
}
APPLICANT_TYPE_ORDER
=
[
'Borrower'
,
'Co Borrower'
,
'Guarantor'
,
'Mortgager'
]
...
...
src/celery_compare/tasks.py
View file @
b98face
...
...
@@ -40,17 +40,17 @@ empty_error_type = 1000
des_key
=
conf
.
CMS_DES_KEY
class
FakePOS
:
def
__init__
(
self
,
application_id
,
first_submmison_date
,
application_version
,
customer_type
):
self
.
application_id
=
application_id
self
.
first_submmison_date
=
first_submmison_date
self
.
application_version
=
application_version
self
.
customer_type
=
customer_type
#
class FakePOS:
#
#
def __init__(self,
#
application_id,
#
first_submmison_date,
#
application_version,
#
customer_type):
#
self.application_id = application_id
#
self.first_submmison_date = first_submmison_date
#
self.application_version = application_version
#
self.customer_type = customer_type
def
name_check
(
ocr_res_dict
,
second_ocr_field
,
second_compare_list
,
second_id_num
,
name
):
...
...
@@ -724,6 +724,196 @@ def ca_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
traceback
.
format_exc
()))
def
get_se_cms_compare_info
(
last_obj
,
application_entity
,
detect_list
):
cms_info
=
json
.
loads
(
last_obj
.
content
)
compare_info
=
{}
individual_info_dict
=
{}
main_role_info
=
{}
company_info_list
=
[]
province
=
cms_info
.
get
(
'province'
,
''
)
for
individual_info
in
cms_info
.
get
(
'applicantInformation'
,
[]):
all_id_num
=
[]
license_dict
=
{}
customer_name
=
individual_info
.
get
(
'name'
,
''
)
legal_name
=
individual_info
.
get
(
'legalRepName'
,
''
)
establishment_date
=
individual_info
.
get
(
'establishmentDate'
,
''
)
date_of_birth
=
individual_info
.
get
(
'dateOfBirth'
,
''
)
for
id_info
in
individual_info
.
get
(
'IDInformation'
,
[]):
if
id_info
.
get
(
'idType'
)
in
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
:
license_en
,
is_prc
=
consts
.
SE_CMS_FIRST_ID_FIELD_MAPPING
[
id_info
[
'idType'
]]
# ['customerName', 'idNum', 'dateOfBirth', 'idExpiryDate', 'hukouProvince']
id_num
=
decode_des
(
id_info
.
get
(
'idNum'
,
''
),
des_key
)
field_input
=
[
(
'customerName'
,
customer_name
),
(
'idNum'
,
id_num
),
(
'dateOfBirth'
,
date_of_birth
),
(
'idExpiryDate'
,
id_info
.
get
(
'idExpiryDate'
,
''
)),
]
if
is_prc
:
field_input
.
append
((
'hukouProvince'
,
province
))
license_dict
[
license_en
]
=
field_input
all_id_num
.
append
(
id_num
)
elif
id_info
.
get
(
'idType'
)
==
'Unified Social Credit Code'
:
# ['companyName', 'legalRepName', 'businessLicenseNo', 'organizationCreditCode',
# 'taxRegistrationCertificateNo', 'establishmentDate', 'businessLicenseDueDate']
id_num
=
decode_des
(
id_info
.
get
(
'idNum'
,
''
),
des_key
)
bl_field_input
=
[
(
'companyName'
,
customer_name
),
(
'legalRepName'
,
legal_name
),
(
'businessLicenseNo'
,
id_num
),
(
'organizationCreditCode'
,
id_num
),
(
'taxRegistrationCertificateNo'
,
id_num
),
(
'establishmentDate'
,
establishment_date
),
(
'businessLicenseDueDate'
,
id_info
.
get
(
'idExpiryDate'
,
''
)),
]
license_dict
[
consts
.
BL_EN
]
=
bl_field_input
# all_id_num.append(id_num)
if
individual_info
.
get
(
'customersubType'
,
''
)
==
'Corporate'
:
company_info_list
.
append
((
customer_name
,
id_num
))
if
individual_info
.
get
(
'customersubType'
,
''
)
.
startswith
(
'Self Employed'
):
sep_field_input
=
[
(
'companyName'
,
customer_name
),
(
'organizationType'
,
individual_info
.
get
(
'selfEmployedSubType'
,
''
)),
]
license_dict
[
consts
.
BL_EN
]
=
sep_field_input
if
len
(
all_id_num
)
>
0
:
main_role_info
.
setdefault
(
individual_info
[
'applicantType'
],
[])
.
append
(
(
customer_name
,
'、'
.
join
(
all_id_num
),
all_id_num
[
0
])
)
if
len
(
license_dict
)
>
0
:
individual_info_dict
.
setdefault
(
individual_info
[
'applicantType'
],
[])
.
append
(
license_dict
)
compare_info
[
'applicantInformation'
]
=
individual_info_dict
main_name
=
main_num
=
hmh_name
=
hmh_id
=
''
for
applicant_type
in
consts
.
APPLICANT_TYPE_ORDER
:
if
applicant_type
in
main_role_info
:
main_name
,
main_num
,
_
=
main_role_info
[
applicant_type
][
0
]
hmh_name
,
_
,
hmh_id
=
main_role_info
[
applicant_type
][
0
]
break
dda_name_list
=
[]
dda_num_list
=
[]
for
applicant_type
in
consts
.
APPLICANT_TYPE_ORDER
[:
2
]:
if
applicant_type
in
main_role_info
:
for
dda_name_part
,
_
,
dda_num_part
in
main_role_info
[
applicant_type
]:
dda_name_list
.
append
(
dda_name_part
)
dda_num_list
.
append
(
dda_num_part
)
dda_name
=
'、'
.
join
(
dda_name_list
)
dda_num
=
'、'
.
join
(
dda_num_list
)
del
main_role_info
if
len
(
company_info_list
)
>
0
:
company_info
=
company_info_list
[
0
]
else
:
company_info
=
None
vehicle_info
=
{}
vehicle_field_input
=
[]
vehicle_status
=
cms_info
.
get
(
'vehicleStatus'
,
''
)
first_submmison_date
=
cms_info
.
get
(
'submissionDate'
,
''
)
vin_no
=
cms_info
.
get
(
'vehicleInformation'
,
{})
.
get
(
'vinNo'
,
''
)
amount
=
str
(
cms_info
.
get
(
'totalFinanceAmount'
,
''
))
if
vehicle_status
==
'New'
:
vehicle_field_input
.
append
((
'vinNo'
,
vin_no
))
vehicle_field_input
.
append
((
'dealer'
,
cms_info
.
get
(
'dealerName'
,
''
)))
vehicle_field_input
.
append
((
'vehicleTransactionAmount'
,
amount
))
if
isinstance
(
company_info
,
tuple
):
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
company_info
[
0
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
company_info
[
1
]))
else
:
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
main_name
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
main_num
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
2
],
first_submmison_date
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
3
],
consts
.
SE_STAMP_VALUE
))
vehicle_info
[
consts
.
MVI_EN
]
=
vehicle_field_input
else
:
gb_field_input
=
[
(
'vinNo'
,
vin_no
),
]
gb34_field_input
=
[]
jypz_field_input
=
[]
vehicle_field_input
.
append
((
'vinNo'
,
vin_no
))
vehicle_field_input
.
append
((
'vehicleTransactionAmount'
,
amount
))
if
isinstance
(
company_info
,
tuple
):
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
company_info
[
0
]))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
company_info
[
1
]))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
company_info
[
0
]))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
company_info
[
1
]))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
0
],
company_info
[
0
]))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
1
],
company_info
[
1
]))
else
:
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
main_name
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
main_num
))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
0
],
main_name
))
jypz_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
1
],
main_num
))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
0
],
main_name
))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
1
],
main_num
))
gb34_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
2
],
first_submmison_date
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
2
],
first_submmison_date
))
vehicle_field_input
.
append
((
consts
.
SE_NEW_ADD_FIELD
[
3
],
consts
.
SE_STAMP_VALUE
))
jypz_field_input
.
append
((
'vinNo'
,
vin_no
))
jypz_field_input
.
append
((
'vehicleTransactionAmount'
,
amount
))
jypz_field_input
.
append
((
consts
.
SE_GB_USED_FIELD
[
-
1
],
first_submmison_date
))
vehicle_info
[
consts
.
MVC_EN
]
=
gb_field_input
vehicle_info
[
consts
.
MVC34_EN
]
=
gb34_field_input
if
not
detect_list
[
0
]:
vehicle_info
[
consts
.
UCI_EN
]
=
vehicle_field_input
if
not
detect_list
[
1
]:
vehicle_info
[
consts
.
JYPZ_EN
]
=
jypz_field_input
if
detect_list
[
0
]
and
detect_list
[
1
]:
vehicle_info
[
consts
.
UCI_EN
]
=
vehicle_field_input
compare_info
[
'vehicleInfo'
]
=
vehicle_info
bank_info
=
{}
bank_name
=
cms_info
.
get
(
'bankAccountDetails'
,
{})
.
get
(
'bankName'
,
''
)
account_no
=
decode_des
(
cms_info
.
get
(
'bankAccountDetails'
,
{})
.
get
(
'accountNo'
,
''
),
des_key
)
is_gsyh
=
True
if
'工商'
in
bank_name
else
False
bank_field_input
=
[
(
'accountNo'
,
account_no
),
(
'bankName'
,
bank_name
),
]
bank_info
[
consts
.
BC_EN
]
=
bank_field_input
if
is_gsyh
or
not
detect_list
[
-
1
]:
dda_field_input
=
[
(
'applicationId(1)'
,
last_obj
.
application_id
),
(
'applicationId(2)'
,
last_obj
.
application_id
),
(
'bankName'
,
bank_name
),
(
'companyName'
,
consts
.
HIL_COMPANY_NAME
if
application_entity
in
consts
.
HIL_SET
else
consts
.
AFC_COMPANY_NAME
),
(
'customerName'
,
dda_name
),
(
'idNum'
,
dda_num
),
(
'accountHolderName'
,
cms_info
.
get
(
'bankAccountDetails'
,
{})
.
get
(
'accountHolderName'
,
''
)),
(
'accountNo'
,
account_no
),
]
bank_info
[
consts
.
DDA_EN
]
=
dda_field_input
compare_info
[
'bankInfo'
]
=
bank_info
if
not
detect_list
[
2
]:
other_info
=
{}
hmh_field_input
=
[
(
consts
.
SE_HMH_FIELD
[
0
],
hmh_name
),
(
consts
.
SE_HMH_FIELD
[
1
],
hmh_id
),
(
consts
.
SE_HMH_FIELD
[
2
],
last_obj
.
application_id
)
]
other_info
[
consts
.
HMH_EN
]
=
hmh_field_input
compare_info
[
'other'
]
=
other_info
return
compare_info
,
cms_info
.
get
(
'applicationVersion'
,
1
)
def
get_se_compare_info
(
last_obj
,
application_entity
,
detect_list
):
compare_info
=
{}
individual_info_dict
=
{}
...
...
@@ -900,7 +1090,7 @@ def get_se_compare_info(last_obj, application_entity, detect_list):
return
compare_info
def
rebuild_compare_info
(
last_obj
,
application_id
):
#
def rebuild_compare_info(last_obj, application_id):
# {
# "content": {
# "financeCompany": "宝马汽车金融有限公司",
...
...
@@ -1002,69 +1192,69 @@ def rebuild_compare_info(last_obj, application_id):
# }
# }
cms_info
=
json
.
loads
(
last_obj
.
content
)
fake_pos
=
FakePOS
(
application_id
,
cms_info
.
get
(
'submissionDate'
,
''
),
cms_info
.
get
(
'applicationVersion'
,
1
),
cms_info
.
get
(
'applicantInformation'
,
[])[
0
]
.
get
(
'customersubType'
,
''
))
fake_pos
.
bank_info
=
json
.
dumps
(
{
'accountNo'
:
decode_des
(
cms_info
.
get
(
'bankAccountDetails'
,
{})
.
get
(
'accountNo'
,
''
),
des_key
),
'bankName'
:
cms_info
.
get
(
'bankAccountDetails'
,
{})
.
get
(
'bankName'
,
''
),
'accountHolderName'
:
cms_info
.
get
(
'bankAccountDetails'
,
{})
.
get
(
'accountHolderName'
,
''
),
}
)
fake_pos
.
vehicle_info
=
json
.
dumps
(
{
'vehicleStatus'
:
cms_info
.
get
(
'vehicleStatus'
,
''
),
'vinNo'
:
cms_info
.
get
(
'vehicleInformation'
,
{})
.
get
(
'vinNo'
,
''
),
'dealer'
:
cms_info
.
get
(
'dealerName'
,
''
),
'vehicleTransactionAmount'
:
str
(
cms_info
.
get
(
'totalFinanceAmount'
,
''
)),
}
)
individual_cus_info
=
[]
for
individual_cus
in
cms_info
.
get
(
'applicantInformation'
,
[]):
id_type
=
id_num
=
id_date
=
second_id_type
=
second_id_num
=
None
for
idx
,
id_info
in
enumerate
(
individual_cus
.
get
(
''
,
[])):
if
idx
>
1
:
break
elif
idx
==
0
:
id_type
=
id_info
.
get
(
'idType'
)
id_num
=
decode_des
(
id_info
.
get
(
'idNum'
))
id_date
=
id_info
.
get
(
'idExpiryDate'
)
else
:
second_id_type
=
id_info
.
get
(
'idType'
)
second_id_num
=
decode_des
(
id_info
.
get
(
'idNum'
))
individual_cus_info
.
append
(
{
'applicantType'
:
consts
.
APPLICANT_TYPE_MAP
.
get
(
individual_cus
.
get
(
'applicantType'
)),
'customerType'
:
individual_cus
.
get
(
'customersubType'
),
'idType'
:
id_type
,
'idNum'
:
id_num
,
'idExpiryDate'
:
id_date
,
'customerName'
:
individual_cus
.
get
(
'name'
),
'dateOfBirth'
:
individual_cus
.
get
(
'dateOfBirth'
,
''
),
'hukouProvince'
:
cms_info
.
get
(
'province'
,
''
),
'secondIdType'
:
second_id_type
,
'secondIdNum'
:
second_id_num
,
'companyName'
:
individual_cus
.
get
(
'name'
),
'selfEmployedSubType'
:
individual_cus
.
get
(
'selfEmployedSubType'
,
''
),
}
)
fake_pos
.
individual_cus_info
=
json
.
dumps
(
individual_cus_info
)
fake_pos
.
corporate_cus_info
=
None
return
fake_pos
#
cms_info = json.loads(last_obj.content)
#
#
fake_pos = FakePOS(application_id,
#
cms_info.get('submissionDate', ''),
#
cms_info.get('applicationVersion', 1),
#
cms_info.get('applicantInformation', [])[0].get('customersubType', ''))
#
#
fake_pos.bank_info = json.dumps(
#
{
#
'accountNo': decode_des(cms_info.get('bankAccountDetails', {}).get('accountNo', ''), des_key),
#
'bankName': cms_info.get('bankAccountDetails', {}).get('bankName', ''),
#
'accountHolderName': cms_info.get('bankAccountDetails', {}).get('accountHolderName', ''),
#
}
#
)
#
#
fake_pos.vehicle_info = json.dumps(
#
{
#
'vehicleStatus': cms_info.get('vehicleStatus', ''),
#
'vinNo': cms_info.get('vehicleInformation', {}).get('vinNo', ''),
#
'dealer': cms_info.get('dealerName', ''),
#
'vehicleTransactionAmount': str(cms_info.get('totalFinanceAmount', '')),
#
}
#
)
#
#
individual_cus_info = []
#
for individual_cus in cms_info.get('applicantInformation', []):
#
id_type = id_num = id_date = second_id_type = second_id_num = None
#
for idx, id_info in enumerate(individual_cus.get('', [])):
#
if idx > 1:
#
break
#
elif idx == 0:
#
id_type = id_info.get('idType')
#
id_num = decode_des(id_info.get('idNum'))
#
id_date = id_info.get('idExpiryDate')
#
else:
#
second_id_type = id_info.get('idType')
#
second_id_num = decode_des(id_info.get('idNum'))
#
individual_cus_info.append(
#
{
#
'applicantType': consts.APPLICANT_TYPE_MAP.get(individual_cus.get('applicantType')),
#
'customerType': individual_cus.get('customersubType'),
#
#
'idType': id_type,
#
'idNum': id_num,
#
'idExpiryDate': id_date,
#
#
'customerName': individual_cus.get('name'),
#
'dateOfBirth': individual_cus.get('dateOfBirth', ''),
#
'hukouProvince': cms_info.get('province', ''),
#
#
'secondIdType': second_id_type,
#
'secondIdNum': second_id_num,
#
#
'companyName': individual_cus.get('name'),
#
'selfEmployedSubType': individual_cus.get('selfEmployedSubType', ''),
#
}
#
)
#
#
fake_pos.individual_cus_info = json.dumps(individual_cus_info)
#
#
fake_pos.corporate_cus_info = None
#
#
return fake_pos
def
se_compare_license
(
license_en
,
ocr_res_dict
,
field_list
):
...
...
@@ -1289,9 +1479,13 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
# 比对逻辑
start_time
=
datetime
.
now
()
detect_list
=
se_result_detect
(
ocr_res_dict
)
# if is_cms:
# last_obj = rebuild_compare_info(last_obj, application_id)
if
is_cms
:
last_obj
=
rebuild_compare_info
(
last_obj
,
application_id
)
compare_info
=
get_se_compare_info
(
last_obj
,
application_entity
,
detect_list
)
compare_info
,
application_version
=
get_se_cms_compare_info
(
last_obj
,
application_entity
,
detect_list
)
else
:
compare_info
=
get_se_compare_info
(
last_obj
,
application_entity
,
detect_list
)
application_version
=
last_obj
.
application_version
compare_result
,
total_fields
,
failed_count
,
successful_at_this_level
,
failure_reason_str
=
se_compare_process
(
compare_info
,
ocr_res_dict
)
compare_log
.
info
(
'{0} [SE] [compare success] [entity={1}] [id={2}] [ocr_res_id={3}] [result={4}]'
.
format
(
...
...
@@ -1311,7 +1505,7 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
res_obj
.
compare_count
=
total_fields
res_obj
.
failed_count
=
failed_count
res_obj
.
is_finish
=
successful_at_this_level
res_obj
.
version
=
'{0}{1}{2}'
.
format
(
consts
.
INFO_SOURCE
[
0
],
consts
.
SPLIT_STR
,
last_obj
.
application_version
)
res_obj
.
version
=
'{0}{1}{2}'
.
format
(
consts
.
INFO_SOURCE
[
0
],
consts
.
SPLIT_STR
,
application_version
)
# res_obj.reason1_count = reason1_count
res_obj
.
result
=
json
.
dumps
(
compare_result
)
res_obj
.
update_time
=
datetime
.
now
()
...
...
@@ -1338,7 +1532,7 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
failure_reason
=
failure_reason_str
,
process_name
=
ProcessName
.
SE_CACOMPARE
.
value
,
total_fields
=
total_fields
,
workflow_name
=
last_obj
.
customer_type
,
workflow_name
=
''
if
is_cms
else
last_obj
.
customer_type
,
)
compare_log
.
info
(
'{0} [SE] [report save success] [entity={1}] [id={2}] [ocr_res_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
))
...
...
@@ -1348,30 +1542,30 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
traceback
.
format_exc
()))
# cms结果发送
if
is_cms
:
try
:
application_link
=
'{0}/showList/showList?entity={1}&scheme={2}&case_id={3}'
.
format
(
conf
.
BASE_URL
,
application_entity
,
consts
.
COMPARE_DOC_SCHEME_LIST
[
1
],
application_id
)
data
=
{
"SubtenantId"
:
consts
.
TENANT_MAP
[
application_entity
],
"Data"
:
{
"Result_Message"
:
"Pass"
if
successful_at_this_level
else
"Fail"
,
"Failure_Reason"
:
failure_reason_str
,
"Application_Number"
:
application_id
,
"Bank_Statement"
:
""
,
"Link_URL"
:
application_link
,
"OCR_Version"
:
1
,
"Origin"
:
consts
.
INFO_SOURCE
[
1
]
}
# if is_cms:
try
:
application_link
=
'{0}/showList/showList?entity={1}&scheme={2}&case_id={3}'
.
format
(
conf
.
BASE_URL
,
application_entity
,
consts
.
COMPARE_DOC_SCHEME_LIST
[
1
],
application_id
)
data
=
{
"SubtenantId"
:
consts
.
TENANT_MAP
[
application_entity
],
"Data"
:
{
"Result_Message"
:
"Pass"
if
successful_at_this_level
else
"Fail"
,
"Failure_Reason"
:
failure_reason_str
,
"Application_Number"
:
application_id
,
"Bank_Statement"
:
""
,
"Link_URL"
:
application_link
,
"OCR_Version"
:
1
,
"Origin"
:
consts
.
INFO_SOURCE
[
1
]
}
response
=
cms
.
send
(
data
)
except
Exception
as
e
:
compare_log
.
error
(
'{0} [SE] [cms error] [entity={1}] [id={2}] [ocr_res_id={3}] '
'[error={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
,
traceback
.
format_exc
()))
else
:
compare_log
.
info
(
'{0} [SE] [cms success] [entity={1}] [id={2}] [ocr_res_id={3}] [response={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
,
response
))
}
response
=
cms
.
send
(
data
)
except
Exception
as
e
:
compare_log
.
error
(
'{0} [SE] [cms error] [entity={1}] [id={2}] [ocr_res_id={3}] '
'[error={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
,
traceback
.
format_exc
()))
else
:
compare_log
.
info
(
'{0} [SE] [cms success] [entity={1}] [id={2}] [ocr_res_id={3}] [response={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
,
response
))
@app.task
def
compare
(
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
=
True
,
is_cms
=
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