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
abf8c570
Commit
abf8c570
authored
Jan 12, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加筛选条件 - 科室
parent
56f40a0c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
24 deletions
+27
-24
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
+12
-21
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+10
-0
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+1
-1
performance/Performance.Services/GraphQLService.cs
+4
-2
No files found.
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
View file @
abf8c570
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
using
Performance.Services
;
using
Performance.Services
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Api
namespace
Performance.Api
{
{
...
@@ -34,14 +35,17 @@ public PerformanceQuery(GraphQLService service)
...
@@ -34,14 +35,17 @@ public PerformanceQuery(GraphQLService service)
);
);
Field
<
ListGraphType
<
ChartDataType
>>(
"chartdata"
,
Field
<
ListGraphType
<
ChartDataType
>>(
"chartdata"
,
arguments
:
Arguments
(),
arguments
:
Arguments
(
new
QueryArgument
<
StringGraphType
>()
{
Name
=
QueryParams
.
accountingUnit
}
),
resolve
:
context
=>
resolve
:
context
=>
{
{
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
0
;
:
0
;
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
);
StringBuilder
where
=
new
StringBuilder
();
return
service
.
GetChartData
(
reportId
,
parameters
);
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
where
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
);
return
service
.
GetChartData
(
reportId
,
parameters
,
where
.
ToString
());
}
}
);
);
...
@@ -56,23 +60,9 @@ public PerformanceQuery(GraphQLService service)
...
@@ -56,23 +60,9 @@ public PerformanceQuery(GraphQLService service)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
0
;
:
0
;
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
,
QueryParams
.
category
,
QueryParams
.
itemName
);
StringBuilder
where
=
new
StringBuilder
();
return
service
.
GetReportPerformance
(
reportId
,
parameters
);
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
where
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
,
QueryParams
.
category
,
QueryParams
.
itemName
);
}
return
service
.
GetReportPerformance
(
reportId
,
parameters
,
where
.
ToString
());
);
Field
<
ListGraphType
<
ReportPerformanceType
>>(
"dictionary"
,
arguments
:
new
QueryArguments
(
new
QueryArgument
<
IntGraphType
>()
{
Name
=
QueryParams
.
reportId
},
new
QueryArgument
<
ListGraphType
<
StringGraphType
>>()
{
Name
=
QueryParams
.
sourceType
}
),
resolve
:
context
=>
{
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
15
;
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
sourceType
);
return
service
.
GetReportPerformance
(
reportId
,
parameters
);
}
}
);
);
}
}
...
@@ -98,7 +88,7 @@ public static QueryArguments Arguments(params QueryArgument[] args)
...
@@ -98,7 +88,7 @@ public static QueryArguments Arguments(params QueryArgument[] args)
return
basic
;
return
basic
;
}
}
public
DynamicParameters
GetDynamicParameters
(
Dictionary
<
string
,
object
>
arguments
,
params
string
[]
fields
)
public
DynamicParameters
GetDynamicParameters
(
Dictionary
<
string
,
object
>
arguments
,
StringBuilder
builder
,
params
string
[]
fields
)
{
{
DynamicParameters
parameters
=
new
DynamicParameters
();
DynamicParameters
parameters
=
new
DynamicParameters
();
if
(
arguments
==
null
||
!
arguments
.
Any
())
return
parameters
;
if
(
arguments
==
null
||
!
arguments
.
Any
())
return
parameters
;
...
@@ -109,6 +99,7 @@ public DynamicParameters GetDynamicParameters(Dictionary<string, object> argumen
...
@@ -109,6 +99,7 @@ public DynamicParameters GetDynamicParameters(Dictionary<string, object> argumen
if
(
arguments
.
ContainsKey
(
item
))
if
(
arguments
.
ContainsKey
(
item
))
{
{
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]);
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]);
builder
.
Append
(
$" and
{
item
.
ToLower
()}
=@
{
item
.
ToLower
()}
"
);
}
}
}
}
}
}
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
abf8c570
...
@@ -1697,6 +1697,16 @@
...
@@ -1697,6 +1697,16 @@
Not In
Not In
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.ReportTable.PersonnelName"
>
<summary>
人员信息
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ReportTable.PersonnelNumber"
>
<summary>
人员工号
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ReportTable.AccountingUnit"
>
<member
name=
"P:Performance.DtoModels.ReportTable.AccountingUnit"
>
<summary>
<summary>
核算单元
核算单元
...
...
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
abf8c570
...
@@ -377,7 +377,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
...
@@ -377,7 +377,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
dept
.
Number
=
empolyees
.
Count
();
dept
.
Number
=
empolyees
.
Count
();
dept
.
AccountingUnit
=
account
.
AccountingUnit
;
dept
.
AccountingUnit
=
account
.
AccountingUnit
;
dept
.
UnitType
=
account
.
AccountType
;
dept
.
UnitType
=
account
.
AccountType
;
dept
.
ScoringAverage
=
resAccount
?.
ScoringAverage
==
null
?
0
:
resAccount
.
ScoringAverage
;
dept
.
ScoringAverage
=
resAccount
?.
ScoringAverage
==
null
?
1
:
resAccount
.
ScoringAverage
;
dept
.
AdjustFactor
=
(
isBudget
?
adjust
:
resAccount
?.
AdjustFactor
)
??
1
;
dept
.
AdjustFactor
=
(
isBudget
?
adjust
:
resAccount
?.
AdjustFactor
)
??
1
;
dept
.
Income
=
empolyees
.
Sum
(
w
=>
w
.
PerforTotal
??
0
);
dept
.
Income
=
empolyees
.
Sum
(
w
=>
w
.
PerforTotal
??
0
);
//dept.Extra = (extra ?? 0);
//dept.Extra = (extra ?? 0);
...
...
performance/Performance.Services/GraphQLService.cs
View file @
abf8c570
...
@@ -52,7 +52,7 @@ public ReportData GetReport(int reportId)
...
@@ -52,7 +52,7 @@ public ReportData GetReport(int reportId)
return
new
ReportData
(
report
);
return
new
ReportData
(
report
);
}
}
public
List
<
ChartData
>
GetChartData
(
int
reportId
,
DynamicParameters
parameters
)
public
List
<
ChartData
>
GetChartData
(
int
reportId
,
DynamicParameters
parameters
,
string
where
=
null
)
{
{
if
(
reportId
==
0
)
return
new
List
<
ChartData
>();
if
(
reportId
==
0
)
return
new
List
<
ChartData
>();
...
@@ -62,6 +62,7 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters)
...
@@ -62,6 +62,7 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters)
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ChartData
>();
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ChartData
>();
var
sql
=
report
.
Content
.
ToLower
();
var
sql
=
report
.
Content
.
ToLower
();
if
(!
string
.
IsNullOrEmpty
(
where
))
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ChartData
>(
sql
,
parameters
,
60
*
5
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ChartData
>(
sql
,
parameters
,
60
*
5
);
...
@@ -74,7 +75,7 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters)
...
@@ -74,7 +75,7 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters)
}
}
}
}
public
List
<
ReportTable
>
GetReportPerformance
(
int
reportId
,
DynamicParameters
parameters
)
public
List
<
ReportTable
>
GetReportPerformance
(
int
reportId
,
DynamicParameters
parameters
,
string
where
=
null
)
{
{
if
(
reportId
==
0
)
return
new
List
<
ReportTable
>();
if
(
reportId
==
0
)
return
new
List
<
ReportTable
>();
...
@@ -84,6 +85,7 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
...
@@ -84,6 +85,7 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ReportTable
>();
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ReportTable
>();
var
sql
=
report
.
Content
.
ToLower
();
var
sql
=
report
.
Content
.
ToLower
();
if
(!
string
.
IsNullOrEmpty
(
where
))
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ReportTable
>(
sql
,
parameters
,
60
*
5
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ReportTable
>(
sql
,
parameters
,
60
*
5
);
...
...
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