Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
f636c8e4
Commit
f636c8e4
authored
Dec 24, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加performances方法
parent
02316f54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
+6
-5
performance/Performance.Services/GraphQLService.cs
+23
-1
No files found.
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
View file @
f636c8e4
...
@@ -46,13 +46,14 @@ public PerformanceQuery(GraphQLService service)
...
@@ -46,13 +46,14 @@ public PerformanceQuery(GraphQLService service)
);
);
Field
<
ListGraphType
<
ReportPerformanceType
>>(
"performances"
,
Field
<
ListGraphType
<
ReportPerformanceType
>>(
"performances"
,
arguments
:
new
QueryArguments
arguments
:
Arguments
(),
(
new
QueryArgument
<
StringGraphType
>()
{
Name
=
QueryParams
.
category
}
),
resolve
:
context
=>
resolve
:
context
=>
{
{
return
new
List
<
EntityModels
.
report_performance
>();
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
0
;
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
);
return
service
.
GetReportPerformance
(
reportId
,
parameters
);
}
}
);
);
}
}
...
...
performance/Performance.Services/GraphQLService.cs
View file @
f636c8e4
...
@@ -69,9 +69,31 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters)
...
@@ -69,9 +69,31 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters)
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
logger
.
LogError
(
"获取报表数据异常: "
+
ex
.
ToString
());
logger
.
LogError
(
"
GetChartData
获取报表数据异常: "
+
ex
.
ToString
());
return
new
List
<
ChartData
>();
return
new
List
<
ChartData
>();
}
}
}
}
public
List
<
report_performance
>
GetReportPerformance
(
int
reportId
,
DynamicParameters
parameters
)
{
if
(
reportId
==
0
)
return
new
List
<
report_performance
>();
try
{
var
report
=
repreportRepository
.
GetEntity
(
t
=>
t
.
ID
==
reportId
);
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
report_performance
>();
var
sql
=
report
.
Content
.
ToLower
();
var
chartData
=
repreportRepository
.
DapperQuery
<
report_performance
>(
sql
,
parameters
);
return
chartData
!=
null
&&
chartData
.
Any
()
?
chartData
.
ToList
()
:
new
List
<
report_performance
>();
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
"GetReportPerformance获取报表数据异常: "
+
ex
.
ToString
());
return
new
List
<
report_performance
>();
}
}
}
}
}
}
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