Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
8da45e8b
Commit
8da45e8b
authored
Jan 19, 2021
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "报告列表"
This reverts commit
4237791b
parent
4237791b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
tamp_diagnose_app.py
app/model/tamp_diagnose_app.py
+3
-12
report_service.py
app/service/report_service.py
+11
-3
No files found.
app/model/tamp_diagnose_app.py
View file @
8da45e8b
...
...
@@ -132,16 +132,12 @@ class HoldDiagnoseReport(Base, BaseModel):
report_data
=
Column
(
Text
)
name
=
Column
(
String
(
100
))
def
__init__
(
self
):
self
.
type
=
2
def
to_dict
(
self
,
allow_field
=
None
):
all_field
=
[
r
.
name
for
r
in
self
.
__table__
.
columns
]
if
allow_field
:
allow_field
=
set
(
allow_field
)
&
set
(
allow_field
)
else
:
allow_field
=
all_field
allow_field
.
append
(
'type'
)
if
self
.
file
:
self
.
file
=
pdf_folder
+
self
.
file
data
=
{
c
:
int
(
getattr
(
self
,
c
)
.
timestamp
())
if
isinstance
(
getattr
(
self
,
c
),
datetime
.
datetime
)
else
getattr
(
self
,
c
)
for
c
in
allow_field
}
...
...
@@ -163,6 +159,7 @@ class HoldDiagnoseReport(Base, BaseModel):
data
[
'customer_name'
]
=
res2
[
0
]
else
:
data
[
'customer_name'
]
=
''
data
[
'type'
]
=
2
return
data
...
...
@@ -179,16 +176,12 @@ class HoldReport(Base, BaseModel):
report_data
=
Column
(
Text
)
name
=
Column
(
String
(
100
))
def
__init__
(
self
):
self
.
type
=
1
def
to_dict
(
self
,
allow_field
=
None
):
all_field
=
[
r
.
name
for
r
in
self
.
__table__
.
columns
]
if
allow_field
:
allow_field
=
set
(
allow_field
)
&
set
(
allow_field
)
else
:
allow_field
=
all_field
allow_field
.
append
(
'type'
)
if
self
.
file
:
self
.
file
=
pdf_folder
+
self
.
file
data
=
{
c
:
int
(
getattr
(
self
,
c
)
.
timestamp
())
if
isinstance
(
getattr
(
self
,
c
),
datetime
.
datetime
)
else
getattr
(
self
,
c
)
for
c
in
allow_field
}
...
...
@@ -210,6 +203,7 @@ class HoldReport(Base, BaseModel):
data
[
'customer_name'
]
=
res2
[
0
]
else
:
data
[
'customer_name'
]
=
''
data
[
'type'
]
=
1
return
data
...
...
@@ -226,16 +220,12 @@ class PeriodicReport(Base, BaseModel):
report_data
=
Column
(
Text
)
name
=
Column
(
String
(
100
))
def
__init__
(
self
):
self
.
type
=
3
def
to_dict
(
self
,
allow_field
=
None
):
all_field
=
[
r
.
name
for
r
in
self
.
__table__
.
columns
]
if
allow_field
:
allow_field
=
set
(
allow_field
)
&
set
(
allow_field
)
else
:
allow_field
=
all_field
allow_field
.
append
(
'type'
)
if
self
.
file
:
self
.
file
=
pdf_folder
+
self
.
file
data
=
{
c
:
int
(
getattr
(
self
,
c
)
.
timestamp
())
if
isinstance
(
getattr
(
self
,
c
),
datetime
.
datetime
)
else
getattr
(
self
,
c
)
for
c
in
allow_field
}
...
...
@@ -257,6 +247,7 @@ class PeriodicReport(Base, BaseModel):
data
[
'customer_name'
]
=
res2
[
0
]
else
:
data
[
'customer_name'
]
=
''
data
[
'type'
]
=
3
return
data
...
...
app/service/report_service.py
View file @
8da45e8b
...
...
@@ -47,15 +47,23 @@ def get_report_list(args):
PeriodicReport
.
update_time
<=
end_time
))
if
type
==
0
:
res
=
hold_report
.
union_all
(
hold_diagnose_report
)
.
union_all
(
periodic_report
)
if
hold_report
.
all
():
res
.
extend
(
hold_report
)
if
hold_diagnose_report
.
all
():
res
.
append
(
hold_diagnose_report
)
if
periodic_report
.
all
():
res
.
append
(
periodic_report
)
# res = hold_report.union_all(hold_diagnose_report).union_all(periodic_report)
elif
type
==
1
:
res
=
hold_report
elif
type
==
2
:
res
=
hold_diagnose_report
elif
type
==
3
:
res
=
periodic_report
totalSize
=
res
.
count
()
data
=
res
.
offset
(
offset
)
.
limit
(
pageSize
)
# totalSize = res.count()
# data = res.offset(offset).limit(pageSize)
totalSize
=
len
(
res
)
data
=
res
[
offset
:
pageSize
]
if
data
:
allow_field
=
[
'id'
,
'customer_id'
,
'ifa_id'
,
'update_time'
,
'update_status'
,
'file'
,
'be_viewed'
,
'name'
]
data
=
[
r
.
to_dict
(
allow_field
=
allow_field
)
for
r
in
data
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment