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
99a36e6d
authored
2025-04-21 15:27:21 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'feature/CHINARPA-5504' into feature/uat-tmp
2 parents
fb5d0282
267fc2bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
16 deletions
src/apps/doc/management/commands/ocr_process.py
src/celery_compare/tasks.py
src/common/tools/aes_util.py
src/prese/compare.py
src/apps/doc/management/commands/ocr_process.py
View file @
99a36e6
...
...
@@ -1344,8 +1344,8 @@ class Command(BaseCommand, LoggerMixin):
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (get doc info out)] [error={1}]'
.
format
(
self
.
log_base
,
traceback
.
format_exc
()))
error_list
.
append
(
1
)
return
#
error_list.append(1)
#
return
else
:
doc_data_path
=
os
.
path
.
join
(
self
.
data_dir
,
business_type
,
consts
.
TMP_DIR_NAME
,
str
(
doc
.
id
))
os
.
makedirs
(
doc_data_path
,
exist_ok
=
True
)
...
...
@@ -1502,8 +1502,8 @@ class Command(BaseCommand, LoggerMixin):
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (db save)] [error={1}]'
.
format
(
self
.
log_base
,
traceback
.
format_exc
()))
error_list
.
append
(
1
)
return
#
error_list.append(1)
#
return
else
:
# e-contract or or e-fsm-contract or e-hmh
try
:
# pdf下载 处理 图片存储 识别
...
...
@@ -1645,8 +1645,8 @@ class Command(BaseCommand, LoggerMixin):
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (db save)] [error={1}]'
.
format
(
self
.
e_log_base
,
traceback
.
format_exc
()))
error_list
.
append
(
1
)
return
#
error_list.append(1)
#
return
def
img_2_ocr_1
(
self
,
img_queue
,
todo_count_dict
,
res_dict
,
finish_queue
,
lock
,
url
,
error_list
):
while
len
(
error_list
)
==
0
or
not
img_queue
.
empty
():
...
...
src/celery_compare/tasks.py
View file @
99a36e6
...
...
@@ -1576,9 +1576,10 @@ def get_se_cms_compare_info_auto(application_id, last_obj, application_entity, d
if
not
is_find
and
is_force
:
afc_contract_input
.
append
((
key
,
empty_str
))
if
online_sign
and
data_source
==
'ECONTRACT'
:
afc_contract_input
.
append
((
consts
.
SE_AFC_CON_FIELD
[
18
],
consts
.
SE_STAMP_VALUE
))
afc_contract_input
.
append
((
consts
.
SE_AFC_CON_FIELD
[
19
],
empty_str
))
# CHINARPA-5504 去掉见证人签字及日期
# if online_sign and data_source == 'ECONTRACT':
# afc_contract_input.append((consts.SE_AFC_CON_FIELD[18], consts.SE_STAMP_VALUE))
# afc_contract_input.append((consts.SE_AFC_CON_FIELD[19], empty_str))
contract_info
[
consts
.
AFC_CONTRACT_EN
]
=
afc_contract_input
...
...
@@ -2233,9 +2234,10 @@ def get_se_cms_compare_info(application_id, last_obj, application_entity, detect
if
not
is_find
and
is_force
:
afc_contract_input
.
append
((
key
,
empty_str
))
if
online_sign
and
data_source
==
'ECONTRACT'
:
afc_contract_input
.
append
((
consts
.
SE_AFC_CON_FIELD
[
18
],
consts
.
SE_STAMP_VALUE
))
afc_contract_input
.
append
((
consts
.
SE_AFC_CON_FIELD
[
19
],
empty_str
))
# CHINARPA-5504 去掉见证人签字及日期
# if online_sign and data_source == 'ECONTRACT':
# afc_contract_input.append((consts.SE_AFC_CON_FIELD[18], consts.SE_STAMP_VALUE))
# afc_contract_input.append((consts.SE_AFC_CON_FIELD[19], empty_str))
contract_info
[
consts
.
AFC_CONTRACT_EN
]
=
afc_contract_input
...
...
src/common/tools/aes_util.py
View file @
99a36e6
...
...
@@ -10,7 +10,7 @@ def aes_decrypt_cbc(data, key, iv):
try
:
cipher
=
AES
.
new
(
key
.
encode
(),
AES
.
MODE_CBC
,
iv
.
encode
())
res
=
cipher
.
decrypt
(
b64decode
(
data
))
res
=
res
.
decode
(
'utf-8'
)
.
replace
(
'
\x0e
'
,
''
)
res
=
res
.
decode
(
'utf-8'
)
.
replace
(
r'\x0e'
,
''
)
.
replace
(
r'\u007
'
,
''
)
except
Exception
as
e
:
res
=
''
return
res
...
...
src/prese/compare.py
View file @
99a36e6
...
...
@@ -175,9 +175,10 @@ def get_pos_compare_info(pos_info, data_source):
afc_contract_input
.
append
((
consts
.
AFC_CON_FIELDS
[
8
],
asp_list
))
afc_contract_input
.
append
((
consts
.
AFC_CON_FIELDS
[
9
],
asp_list
))
if
data_source
==
'ECONTRACT'
:
afc_contract_input
.
append
((
consts
.
AFC_CON_FIELDS
[
10
],
consts
.
HAVE_CN
))
afc_contract_input
.
append
((
consts
.
AFC_CON_FIELDS
[
11
],
empty_str
))
# CHINARPA-5504 去掉见证人签字及日期
# if data_source == 'ECONTRACT':
# afc_contract_input.append((consts.AFC_CON_FIELDS[10], consts.HAVE_CN))
# afc_contract_input.append((consts.AFC_CON_FIELDS[11], empty_str))
compare_info
.
setdefault
(
consts
.
AFC_CONTRACT_EN
,
[])
.
append
(
afc_contract_input
)
...
...
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