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
aea7d36f
Commit
aea7d36f
authored
Dec 29, 2021
by
纪旭 韦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
2dbc74f7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
7 deletions
+38
-7
performance/Performance.Api/Controllers/ReportController.cs
+7
-5
performance/Performance.DtoModels/Request/ComputerRequest.cs
+5
-1
performance/Performance.Repository/PerforReportRepository .cs
+21
-0
performance/Performance.Services/ComputeService.cs
+5
-1
No files found.
performance/Performance.Api/Controllers/ReportController.cs
View file @
aea7d36f
...
@@ -395,14 +395,16 @@ public ApiResponse GetWholeHospitalGrantSummary([FromBody] HospitalGrantSummary
...
@@ -395,14 +395,16 @@ public ApiResponse GetWholeHospitalGrantSummary([FromBody] HospitalGrantSummary
string
.
IsNullOrEmpty
(
request
.
EndTime
)
||
!
DateTime
.
TryParse
(
request
.
EndTime
,
out
edate
))
string
.
IsNullOrEmpty
(
request
.
EndTime
)
||
!
DateTime
.
TryParse
(
request
.
EndTime
,
out
edate
))
throw
new
PerformanceException
(
"请输入正确的时间"
);
throw
new
PerformanceException
(
"请输入正确的时间"
);
var
datas
=
_computeService
.
GetAllComputeViewByDate
(
"view_allot_sign_dept"
,
bdate
,
edate
.
AddMonths
(
1
)
);
var
datas
=
_computeService
.
GetAllComputeViewByDate
AndTotal
(
"view_allot_sign_dept"
,
bdate
,
edate
.
AddMonths
(
1
),
request
.
GroupBy
,
request
.
SumBy
);
if
(
null
==
datas
)
if
(
null
==
datas
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
selectdata
=
request
.
GroupBy
.
Union
(
request
.
SumBy
);
var
list
=
new
QueryComputeByDateGetTotal
var
data
=
datas
.
GroupBy
(
t
=>
new
{
t
.
UnitName
});
{
Data
=
datas
.
ToList
(),
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
data
);
TotalData
=
_computeService
.
SumDatas
(
datas
),
};
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
}
}
...
...
performance/Performance.DtoModels/Request/ComputerRequest.cs
View file @
aea7d36f
...
@@ -82,4 +82,8 @@ public class QueryComputeByDateGetPage
...
@@ -82,4 +82,8 @@ public class QueryComputeByDateGetPage
public
int
PageSize
{
get
;
set
;
}
public
int
PageSize
{
get
;
set
;
}
public
int
TotalCount
{
get
;
set
;
}
public
int
TotalCount
{
get
;
set
;
}
}
}
}
public
class
QueryComputeByDateGetTotal
{
public
List
<
dynamic
>
Data
{
get
;
set
;
}
public
Dictionary
<
string
,
decimal
>
TotalData
{
get
;
set
;
}}
}
performance/Performance.Repository/PerforReportRepository .cs
View file @
aea7d36f
...
@@ -397,6 +397,7 @@ public List<dynamic> QueryCompute(int allotId, string viewName)
...
@@ -397,6 +397,7 @@ public List<dynamic> QueryCompute(int allotId, string viewName)
return
DapperQuery
<
dynamic
>(
sql
,
new
{
allotId
})?.
ToList
();
return
DapperQuery
<
dynamic
>(
sql
,
new
{
allotId
})?.
ToList
();
}
}
public
List
<
dynamic
>
QueryComputeByDate
(
string
viewName
,
DateTime
beginTime
,
DateTime
endTime
)
public
List
<
dynamic
>
QueryComputeByDate
(
string
viewName
,
DateTime
beginTime
,
DateTime
endTime
)
{
{
var
sql
=
$@"SELECT * FROM
{
viewName
}
var
sql
=
$@"SELECT * FROM
{
viewName
}
...
@@ -405,6 +406,26 @@ public List<dynamic> QueryComputeByDate(string viewName, DateTime beginTime, Dat
...
@@ -405,6 +406,26 @@ public List<dynamic> QueryComputeByDate(string viewName, DateTime beginTime, Dat
return
DapperQuery
<
dynamic
>(
sql
,
new
{
beginTime
=
beginTime
.
ToString
(
"yyyy-MM-dd"
),
endTime
=
endTime
.
ToString
(
"yyyy-MM-dd"
)
}).
ToList
();
return
DapperQuery
<
dynamic
>(
sql
,
new
{
beginTime
=
beginTime
.
ToString
(
"yyyy-MM-dd"
),
endTime
=
endTime
.
ToString
(
"yyyy-MM-dd"
)
}).
ToList
();
}
}
public
List
<
dynamic
>
QueryComputeByDateAndTotal
(
string
viewName
,
DateTime
beginTime
,
DateTime
endTime
,
List
<
string
>
groupBy
,
List
<
string
>
sumBy
)
{
string
Groupby
=
""
;
string
Sumby
=
""
;
foreach
(
var
item
in
groupBy
)
{
Groupby
+=
$@"
{
item
}
,"
;
}
foreach
(
var
item
in
sumBy
)
{
Sumby
+=
$@"Sum(
{
item
}
)
{
item
}
,"
;
}
Groupby
=
Groupby
.
Substring
(
0
,
Groupby
.
Length
-
1
);
Sumby
=
Sumby
.
Substring
(
0
,
Sumby
.
Length
-
1
);
var
sql
=
$@"SELECT
{
Groupby
}
,
{
Sumby
}
FROM
{
viewName
}
where STR_TO_DATE(concat(Year,'-',Month,'-01'),'%Y-%m-%d') >= @beginTime
and STR_TO_DATE(concat(Year,'-',Month,'-01'),'%Y-%m-%d') < @endTime Group By
{
Groupby
}
"
;
return
DapperQuery
<
dynamic
>(
sql
,
new
{
beginTime
=
beginTime
.
ToString
(
"yyyy-MM-dd"
),
endTime
=
endTime
.
ToString
(
"yyyy-MM-dd"
)
}).
ToList
();
}
public
CustonPagingData
QueryCustom
(
CustomPagingRequest
request
,
bool
IsHead
)
public
CustonPagingData
QueryCustom
(
CustomPagingRequest
request
,
bool
IsHead
)
{
{
...
...
performance/Performance.Services/ComputeService.cs
View file @
aea7d36f
...
@@ -2069,10 +2069,14 @@ public List<dynamic> GetAllComputeView(int hospitalId, int AllotId, string viewN
...
@@ -2069,10 +2069,14 @@ public List<dynamic> GetAllComputeView(int hospitalId, int AllotId, string viewN
{
{
return
reportRepository
.
QueryCompute
(
AllotId
,
viewName
);
return
reportRepository
.
QueryCompute
(
AllotId
,
viewName
);
}
}
public
List
<
dynamic
>
GetAllComputeViewByDate
(
string
viewName
,
DateTime
beginTime
,
DateTime
endTime
)
public
List
<
dynamic
>
GetAllComputeViewByDate
(
string
viewName
,
DateTime
beginTime
,
DateTime
endTime
)
{
{
return
reportRepository
.
QueryComputeByDate
(
viewName
,
beginTime
,
endTime
);
return
reportRepository
.
QueryComputeByDate
(
viewName
,
beginTime
,
endTime
);
}
public
List
<
dynamic
>
GetAllComputeViewByDateAndTotal
(
string
viewName
,
DateTime
beginTime
,
DateTime
endTime
,
List
<
string
>
groupBy
,
List
<
string
>
sumBy
)
{
return
reportRepository
.
QueryComputeByDateAndTotal
(
viewName
,
beginTime
,
endTime
,
groupBy
,
sumBy
);
}
}
/// <summary>
/// <summary>
///
///
...
...
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