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
0af5cb40
authored
2023-03-22 18:33:24 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ADD
1 parent
66e1870b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
6 deletions
src/apps/doc/consts.py
src/apps/doc/models.py
src/apps/doc/views.py
src/common/tools/mssql_script25.py
src/apps/doc/consts.py
View file @
0af5cb4
...
...
@@ -2455,10 +2455,12 @@ RE_RPA_RESULT_MAP = {v: k for k, v in RPA_RESULT_MAP.items()}
AUTO_WB_FIELD
=
(
(
'application_id'
,
'aa_type'
,
'ocr_latest_comparison_time'
,
'ocr_auto_result_pass'
,
'ocr_whole_result_pass'
,
'rpa_result'
,
'rpa_1st_eye_tat'
,
'rpa_2nd_eye_tat'
,
'rpa_3rd_eye_tat'
,
'rpa_total_tat'
,
'rpa_activated_time'
,
'rpa_get_case_from_ocr_time'
,
'rpa_get_case_from_oc_time'
,
'rpa_payment_authorize_time'
,
'rpa_second_eye_time'
),
'rpa_get_case_from_ocr_time'
,
'rpa_get_case_from_oc_time'
,
'rpa_payment_authorize_time'
,
'rpa_second_eye_time'
,
'is_fsm'
),
(
'application_id'
,
'aa_type'
,
'latest_comparison_time'
,
'auto_result'
,
'whole_result'
,
'rpa_result'
,
'rpa_1st_eye_tat'
,
'rpa_2nd_eye_tat'
,
'rpa_3rd_eye_tat'
,
'rpa_total_tat'
,
'rpa_activated_time'
,
'rpa_get_case_from_ocr_time'
,
'rpa_get_case_from_oc_time'
,
'rpa_payment_authorize_time'
,
'rpa_second_eye_time'
)
'rpa_get_case_from_ocr_time'
,
'rpa_get_case_from_oc_time'
,
'rpa_payment_authorize_time'
,
'rpa_second_eye_time'
,
'is_fsm'
)
)
MPOS_MAP
=
{
...
...
src/apps/doc/models.py
View file @
0af5cb4
...
...
@@ -880,6 +880,8 @@ class HILAutoSettlement(models.Model):
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
is_fsm
=
models
.
SmallIntegerField
(
null
=
False
,
default
=
0
,
verbose_name
=
"是否fsm流程 1:是"
)
class
Meta
:
managed
=
False
db_table
=
'hil_auto_settlement'
...
...
@@ -910,6 +912,8 @@ class AFCAutoSettlement(models.Model):
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
is_fsm
=
models
.
SmallIntegerField
(
null
=
False
,
default
=
0
,
verbose_name
=
"是否fsm流程 1:是"
)
class
Meta
:
managed
=
False
db_table
=
'afc_auto_settlement'
...
...
src/apps/doc/views.py
View file @
0af5cb4
...
...
@@ -348,6 +348,7 @@ auto_list_args = {
'activated_time_end'
:
fields
.
Date
(
required
=
False
),
'comparison_time_start'
:
fields
.
Date
(
required
=
False
),
'comparison_time_end'
:
fields
.
Date
(
required
=
False
),
'is_fsm'
:
fields
.
Int
(
required
=
False
),
}
compare_result_args
=
{
...
...
@@ -1437,6 +1438,9 @@ class SECMSView(GenericView):
# auto flag
is_auto
=
cms_info
.
get
(
'AutoSettlement'
,
False
)
# fsm flag
fsm_contract
=
cms_info
.
get
(
'FSMContract'
,
False
)
is_fsm
=
1
if
fsm_contract
else
0
,
auto_class
=
HILAutoSettlement
if
business_type
in
consts
.
HIL_SET
else
AFCAutoSettlement
auto_obj
=
auto_class
.
objects
.
filter
(
application_id
=
application_id
)
.
first
()
...
...
@@ -1448,6 +1452,7 @@ class SECMSView(GenericView):
if
auto_obj
is
None
:
auto_class
.
objects
.
create
(
application_id
=
application_id
,
is_fsm
=
is_fsm
,
)
elif
auto_obj
.
on_off
is
False
:
auto_obj
.
on_off
=
True
...
...
@@ -1467,7 +1472,6 @@ class SECMSView(GenericView):
)
# 检查是否fsm流程(SE)
fsm_contract
=
cms_info
.
get
(
'FSMContract'
,
False
)
fsm_best_price
=
cms_info
.
get
(
'FSMBestPrice'
,
False
)
if
fsm_contract
:
# 记录fsm 流程的cms 提交
...
...
@@ -1575,6 +1579,8 @@ class AutoSettlementView(GenericView):
whole_result
=
args
.
get
(
'whole_result'
,
''
)
rpa_result
=
args
.
get
(
'rpa_result'
,
''
)
is_fsm
=
args
.
get
(
'is_fsm'
)
if
isinstance
(
auto_result
,
int
):
auto_result
=
consts
.
RESULT_MAP
.
get
(
auto_result
)
if
isinstance
(
whole_result
,
int
):
...
...
@@ -1595,9 +1601,10 @@ class AutoSettlementView(GenericView):
time3_query
=
Q
(
ocr_latest_comparison_time__gte
=
comparison_time_start
,
ocr_latest_comparison_time__lt
=
comparison_time_end
+
datetime
.
timedelta
(
days
=
1
))
\
if
comparison_time_start
is
not
None
and
comparison_time_end
is
not
None
else
Q
()
is_fsm_query
=
Q
(
is_fsm
=
is_fsm
)
if
is_fsm
is
not
None
else
Q
()
query
=
application_id_query
&
auto_result_query
&
whole_result_query
&
rpa_result_query
\
&
time1_query
&
time2_query
&
time3_query
&
time1_query
&
time2_query
&
time3_query
&
is_fsm_query
auto_class
=
HILAutoSettlement
if
business_type
in
consts
.
HIL_SET
else
AFCAutoSettlement
...
...
@@ -1608,7 +1615,7 @@ class AutoSettlementView(GenericView):
raise
self
.
invalid_params
(
'页数不存在'
)
val_tuple
=
(
'application_id'
,
'ocr_latest_comparison_time'
,
'ocr_auto_result_pass'
,
'ocr_whole_result_pass'
,
'rpa_result'
,
'rpa_activated_time'
,
'rpa_get_case_from_ocr_time'
)
'rpa_result'
,
'rpa_activated_time'
,
'rpa_get_case_from_ocr_time'
,
'is_fsm'
)
auto_queryset
=
auto_class
.
objects
.
filter
(
query
)
.
values
(
*
val_tuple
)
.
order_by
(
'-ocr_latest_comparison_time'
)[
start_index
:
end_index
]
...
...
@@ -1656,6 +1663,8 @@ class AutoSettlementExcelView(GenericView):
whole_result
=
args
.
get
(
'whole_result'
,
''
)
rpa_result
=
args
.
get
(
'rpa_result'
,
''
)
is_fsm
=
args
.
get
(
'is_fsm'
)
if
isinstance
(
auto_result
,
int
):
auto_result
=
consts
.
RESULT_MAP
.
get
(
auto_result
)
if
isinstance
(
whole_result
,
int
):
...
...
@@ -1676,9 +1685,10 @@ class AutoSettlementExcelView(GenericView):
time3_query
=
Q
(
ocr_latest_comparison_time__gte
=
comparison_time_start
,
ocr_latest_comparison_time__lt
=
comparison_time_end
+
datetime
.
timedelta
(
days
=
1
))
\
if
comparison_time_start
is
not
None
and
comparison_time_end
is
not
None
else
Q
()
is_fsm_query
=
Q
(
is_fsm
=
is_fsm
)
if
is_fsm
is
not
None
else
Q
()
query
=
application_id_query
&
auto_result_query
&
whole_result_query
&
rpa_result_query
\
&
time1_query
&
time2_query
&
time3_query
&
time1_query
&
time2_query
&
time3_query
&
is_fsm_query
auto_class
=
HILAutoSettlement
if
business_type
in
consts
.
HIL_SET
else
AFCAutoSettlement
...
...
src/common/tools/mssql_script25.py
0 → 100644
View file @
0af5cb4
import
pyodbc
hil_sql
=
"""
ALTER TABLE hil_auto_settlement ADD is_fsm tinyint not null default 0;
"""
afc_sql
=
"""
ALTER TABLE afc_auto_settlement ADD is_fsm tinyint not null default 0;
"""
hil_cnxn
=
pyodbc
.
connect
(
'DRIVER={ODBC Driver 17 for SQL Server};'
,
autocommit
=
True
)
hil_cursor
=
hil_cnxn
.
cursor
()
hil_cursor
.
execute
(
hil_sql
)
hil_cursor
.
close
()
hil_cnxn
.
close
()
afc_cnxn
=
pyodbc
.
connect
(
'DRIVER={ODBC Driver 17 for SQL Server};'
,
autocommit
=
True
)
afc_cursor
=
afc_cnxn
.
cursor
()
afc_cursor
.
execute
(
afc_sql
)
afc_cursor
.
close
()
afc_cnxn
.
close
()
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