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
434b9a9a
Commit
434b9a9a
authored
Aug 23, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加接口
parent
8e927fdb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
0 deletions
+112
-0
performance/Performance.Api/Controllers/ReportController.cs
+14
-0
performance/Performance.DtoModels/Request/ConditionRequest.cs
+56
-0
performance/Performance.Services/ReportService.cs
+42
-0
No files found.
performance/Performance.Api/Controllers/ReportController.cs
View file @
434b9a9a
...
@@ -218,5 +218,18 @@ public ApiResponse MenuReport([CustomizeValidator(RuleSet = "Menu"), FromBody] R
...
@@ -218,5 +218,18 @@ public ApiResponse MenuReport([CustomizeValidator(RuleSet = "Menu"), FromBody] R
var
list
=
reportService
.
MenuReport
(
request
);
var
list
=
reportService
.
MenuReport
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
list
);
}
}
/// <summary>
/// 绩效汇报表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"table"
)]
[
HttpPost
]
public
ApiResponse
Table
([
FromBody
]
ConditionRequest
request
)
{
var
list
=
reportService
.
Table
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
list
);
}
}
}
}
}
\ No newline at end of file
performance/Performance.DtoModels/Request/ConditionRequest.cs
0 → 100644
View file @
434b9a9a
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
ConditionRequest
{
public
int
[]
Year
{
get
;
set
;
}
public
int
[]
Month
{
get
;
set
;
}
public
string
[]
AccountingUnit
{
get
;
set
;
}
public
string
[]
UnitType
{
get
;
set
;
}
}
public
class
TableData
{
public
List
<
Header
>
Headers
{
get
;
set
;
}
public
string
Data
{
get
;
set
;
}
}
public
class
Header
{
public
string
Date
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
public
string
Field
{
get
;
set
;
}
}
public
class
QueryData
{
public
int
HospitalId
{
get
;
set
;
}
public
int
Year
{
get
;
set
;
}
public
int
Month
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
public
string
SourceType
{
get
;
set
;
}
public
string
Category
{
get
;
set
;
}
public
string
ItemName
{
get
;
set
;
}
public
Nullable
<
decimal
>
Value
{
get
;
set
;
}
}
}
performance/Performance.Services/ReportService.cs
View file @
434b9a9a
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.DtoModels.Request
;
using
Performance.EntityModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
Performance.Repository
;
using
Performance.Services.ExtractExcelService
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -402,5 +404,45 @@ public void ExecProc(string execsql, object param)
...
@@ -402,5 +404,45 @@ public void ExecProc(string execsql, object param)
logger
.
LogError
(
$"执行存储过程时发生异常,sql:
{
execsql
}
;参数:
{
JsonHelper
.
Serialize
(
param
)}
;异常:
{
ex
.
Message
}
;"
);
logger
.
LogError
(
$"执行存储过程时发生异常,sql:
{
execsql
}
;参数:
{
JsonHelper
.
Serialize
(
param
)}
;异常:
{
ex
.
Message
}
;"
);
}
}
}
}
public
TableData
Table
(
ConditionRequest
request
)
{
TableData
tableData
=
new
TableData
();
try
{
var
condition
=
request
.
Year
.
Join
(
request
.
Month
,
t
=>
true
,
t
=>
true
,
(
t1
,
t2
)
=>
new
{
t1
,
t2
});
var
data
=
perforReportRepository
.
DapperQuery
<
QueryData
>(
""
,
new
{
});
if
(
data
==
null
||
!
data
.
Any
())
return
tableData
;
var
groupData
=
data
.
GroupBy
(
t
=>
new
{
t
.
SourceType
,
t
.
Category
,
t
.
ItemName
});
var
type
=
data
.
Select
(
t
=>
new
{
SourceType
=
t
.
SourceType
.
NoBlank
(),
Category
=
t
.
Category
.
NoBlank
(),
ItemName
=
t
.
ItemName
.
NoBlank
()
}).
Distinct
();
var
groupType
=
type
.
GroupBy
(
t
=>
t
.
SourceType
).
Select
(
t
=>
new
{
Type
=
t
.
Key
,
Count
=
t
.
Count
()
}).
OrderBy
(
t
=>
t
.
Type
).
ThenBy
(
t
=>
t
.
Count
);
// 含有子集
foreach
(
var
item
in
groupType
.
Where
(
t
=>
t
.
Count
>
1
))
{
}
// 不包含子集含有子集
foreach
(
var
item
in
groupType
.
Where
(
t
=>
t
.
Count
==
1
))
{
}
}
catch
(
Exception
)
{
}
return
tableData
;
}
}
}
}
}
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