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
96ef7e43
Commit
96ef7e43
authored
Dec 28, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graphql允许字段为null,添加字典接口
parent
2ed59b4b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
32 deletions
+44
-32
performance/Performance.Api/GraphQLSchema/ChartDataType.cs
+6
-6
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
+16
-4
performance/Performance.Api/GraphQLSchema/ReportDataType.cs
+5
-5
performance/Performance.Api/GraphQLSchema/ReportPerformanceType.cs
+8
-8
performance/Performance.DtoModels/ReportData.cs
+9
-9
No files found.
performance/Performance.Api/GraphQLSchema/ChartDataType.cs
View file @
96ef7e43
...
...
@@ -7,12 +7,12 @@ public class ChartDataType : ObjectGraphType<ChartData>
{
public
ChartDataType
()
{
Field
(
x
=>
x
.
X
);
Field
(
x
=>
x
.
Y
);
Field
(
x
=>
x
.
Name
);
Field
(
x
=>
x
.
Value
);
Field
(
x
=>
x
.
Total
);
Field
(
x
=>
x
.
Type
);
Field
(
x
=>
x
.
X
,
nullable
:
true
);
Field
(
x
=>
x
.
Y
,
nullable
:
true
);
Field
(
x
=>
x
.
Name
,
nullable
:
true
);
Field
(
x
=>
x
.
Value
,
nullable
:
true
);
Field
(
x
=>
x
.
Total
,
nullable
:
true
);
Field
(
x
=>
x
.
Type
,
nullable
:
true
);
}
}
}
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
View file @
96ef7e43
...
...
@@ -59,6 +59,21 @@ public PerformanceQuery(GraphQLService service)
return
service
.
GetReportPerformance
(
reportId
,
parameters
);
}
);
Field
<
ListGraphType
<
ReportPerformanceType
>>(
"dictionary"
,
arguments
:
new
QueryArguments
(
new
QueryArgument
<
IntGraphType
>()
{
Name
=
QueryParams
.
reportId
},
new
QueryArgument
<
ListGraphType
<
StringGraphType
>>()
{
Name
=
QueryParams
.
category
}
),
resolve
:
context
=>
{
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
15
;
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
category
);
return
service
.
GetReportPerformance
(
reportId
,
parameters
);
}
);
}
public
static
QueryArguments
Arguments
(
params
QueryArgument
[]
args
)
...
...
@@ -92,10 +107,7 @@ public DynamicParameters GetDynamicParameters(Dictionary<string, object> argumen
{
if
(
arguments
.
ContainsKey
(
item
))
{
if
(
item
==
QueryParams
.
category
)
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]?.
ToString
().
Split
(
','
));
else
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]);
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]);
}
}
}
...
...
performance/Performance.Api/GraphQLSchema/ReportDataType.cs
View file @
96ef7e43
...
...
@@ -9,9 +9,9 @@ public class ReportDataType : ObjectGraphType<ReportData>
{
public
ReportDataType
()
{
Field
(
x
=>
x
.
ReportID
);
Field
(
x
=>
x
.
ChartType
);
Field
(
x
=>
x
.
Sort
);
Field
(
x
=>
x
.
ReportID
,
type
:
typeof
(
IdGraphType
)
);
Field
(
x
=>
x
.
ChartType
,
nullable
:
true
);
Field
(
x
=>
x
.
Sort
,
nullable
:
true
);
Field
(
x
=>
x
.
Title
);
Field
(
x
=>
x
.
QueryName
);
Field
(
x
=>
x
.
QueryArguments
);
...
...
@@ -24,8 +24,8 @@ public ReportDataType()
Field
(
x
=>
x
.
NTitle
);
Field
(
x
=>
x
.
NUnit
);
Field
(
x
=>
x
.
Formula
);
Field
(
x
=>
x
.
DataType
);
Field
(
x
=>
x
.
FilterValue
);
Field
(
x
=>
x
.
DataType
,
nullable
:
true
);
Field
(
x
=>
x
.
FilterValue
,
nullable
:
true
);
}
}
}
performance/Performance.Api/GraphQLSchema/ReportPerformanceType.cs
View file @
96ef7e43
...
...
@@ -8,14 +8,14 @@ public class ReportPerformanceType : ObjectGraphType<ReportTable>
{
public
ReportPerformanceType
()
{
Field
(
x
=>
x
.
AccountingUnit
);
Field
(
x
=>
x
.
Category
);
Field
(
x
=>
x
.
ItemName
);
Field
(
x
=>
x
.
CurrentValue
);
Field
(
x
=>
x
.
LastIssueValue
);
Field
(
x
=>
x
.
SamePeriodValue
);
Field
(
x
=>
x
.
BudgetValue
);
Field
(
x
=>
x
.
RatioValue
);
Field
(
x
=>
x
.
AccountingUnit
,
nullable
:
true
);
Field
(
x
=>
x
.
Category
,
nullable
:
true
);
Field
(
x
=>
x
.
ItemName
,
nullable
:
true
);
Field
(
x
=>
x
.
CurrentValue
,
nullable
:
true
);
Field
(
x
=>
x
.
LastIssueValue
,
nullable
:
true
);
Field
(
x
=>
x
.
SamePeriodValue
,
nullable
:
true
);
Field
(
x
=>
x
.
BudgetValue
,
nullable
:
true
);
Field
(
x
=>
x
.
RatioValue
,
nullable
:
true
);
}
}
}
performance/Performance.DtoModels/ReportData.cs
View file @
96ef7e43
...
...
@@ -10,8 +10,8 @@ public class ReportData
public
ReportData
(
rep_report
report
)
{
ReportID
=
report
.
ID
;
ChartType
=
report
.
ChartType
??
0
;
Sort
=
report
.
Sort
??
0
;
ChartType
=
report
.
ChartType
;
Sort
=
report
.
Sort
;
Title
=
report
.
Title
;
QueryName
=
report
.
QueryName
;
QueryArguments
=
report
.
QueryArguments
;
...
...
@@ -24,8 +24,8 @@ public ReportData(rep_report report)
NTitle
=
report
.
NTitle
;
NUnit
=
report
.
NUnit
;
Formula
=
report
.
Formula
;
DataType
=
report
.
DataType
??
0
;
FilterValue
=
report
.
FilterValue
??
0
;
DataType
=
report
.
DataType
;
FilterValue
=
report
.
FilterValue
;
ChartData
=
new
List
<
ChartData
>();
}
...
...
@@ -34,12 +34,12 @@ public ReportData(rep_report report)
/// <summary>
///
/// </summary>
public
int
ChartType
{
get
;
set
;
}
public
Nullable
<
int
>
ChartType
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
Sort
{
get
;
set
;
}
public
Nullable
<
int
>
Sort
{
get
;
set
;
}
/// <summary>
/// 报表标题
...
...
@@ -104,12 +104,12 @@ public ReportData(rep_report report)
/// <summary>
/// 1表示需要进行小于百分2的类型进行合并
/// </summary>
public
int
DataType
{
get
;
set
;
}
public
Nullable
<
int
>
DataType
{
get
;
set
;
}
/// <summary>
/// 图标value过滤执值
/// </summary>
public
decimal
FilterValue
{
get
;
set
;
}
public
Nullable
<
decimal
>
FilterValue
{
get
;
set
;
}
/// <summary>
/// 图表数据
...
...
@@ -146,7 +146,7 @@ public class ChartData
/// <summary>
/// 总量
/// </summary>
public
decimal
Total
{
get
;
set
;
}
public
Nullable
<
decimal
>
Total
{
get
;
set
;
}
/// <summary>
/// ChartData 类型标签
...
...
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