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
d9b592cf
Commit
d9b592cf
authored
Oct 15, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增报表
parent
09d0b77d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
13 deletions
+135
-13
performance/Performance.Api/Controllers/ReportController.cs
+27
-0
performance/Performance.DtoModels/Request/ReportRequest.cs
+23
-0
performance/Performance.Repository/PerforReportRepository .cs
+0
-0
performance/Performance.Services/ReportService.cs
+85
-13
No files found.
performance/Performance.Api/Controllers/ReportController.cs
View file @
d9b592cf
...
@@ -130,5 +130,31 @@ public ApiResponse AvgRatio([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
...
@@ -130,5 +130,31 @@ public ApiResponse AvgRatio([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
var
list
=
reportService
.
AvgRatio
(
request
.
HospitalId
);
var
list
=
reportService
.
AvgRatio
(
request
.
HospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
list
);
}
}
/// <summary>
/// 首页报表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"index"
)]
[
HttpPost
]
public
ApiResponse
IndexReport
([
CustomizeValidator
(
RuleSet
=
"Index"
),
FromBody
]
ReportRequest
request
)
{
var
list
=
reportService
.
IndexReport
(
request
.
HospitalId
,
request
.
Source
);
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
list
);
}
/// <summary>
/// 菜单报表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"menu"
)]
[
HttpPost
]
public
ApiResponse
MenuReport
([
CustomizeValidator
(
RuleSet
=
"Menu"
),
FromBody
]
ReportRequest
request
)
{
var
list
=
reportService
.
MenuReport
(
request
.
HospitalId
,
request
.
OnlyYear
,
request
.
Source
,
request
.
IsInHos
);
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
list
);
}
}
}
}
}
\ No newline at end of file
performance/Performance.DtoModels/Request/ReportRequest.cs
View file @
d9b592cf
...
@@ -9,7 +9,17 @@ public class ReportRequest
...
@@ -9,7 +9,17 @@ public class ReportRequest
{
{
public
int
HospitalId
{
get
;
set
;
}
public
int
HospitalId
{
get
;
set
;
}
/// <summary> 是否为首页 </summary>
public
int
IsIndex
{
get
;
set
;
}
public
int
IsIndex
{
get
;
set
;
}
/// <summary> 是否以年为单位 </summary>
public
int
OnlyYear
{
get
;
set
;
}
/// <summary> 是否住院 </summary>
public
int
IsInHos
{
get
;
set
;
}
/// <summary> 报表名称 </summary>
public
string
Source
{
get
;
set
;
}
}
}
public
class
ReportRequestValidator
:
AbstractValidator
<
ReportRequest
>
public
class
ReportRequestValidator
:
AbstractValidator
<
ReportRequest
>
{
{
...
@@ -19,6 +29,19 @@ public ReportRequestValidator()
...
@@ -19,6 +29,19 @@ public ReportRequestValidator()
{
{
RuleFor
(
x
=>
x
.
HospitalId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
HospitalId
).
NotNull
().
GreaterThan
(
0
);
});
});
RuleSet
(
"Index"
,
()
=>
{
RuleFor
(
x
=>
x
.
HospitalId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Source
).
NotNull
().
NotEmpty
();
});
RuleSet
(
"Menu"
,
()
=>
{
RuleFor
(
x
=>
x
.
HospitalId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
OnlyYear
).
NotNull
();
RuleFor
(
x
=>
x
.
Source
).
NotNull
().
NotEmpty
();
});
}
}
}
}
}
}
performance/Performance.Repository/PerforReportRepository .cs
View file @
d9b592cf
This diff is collapsed.
Click to expand it.
performance/Performance.Services/ReportService.cs
View file @
d9b592cf
...
@@ -63,7 +63,7 @@ public dynamic Survey(int hospitalId)
...
@@ -63,7 +63,7 @@ public dynamic Survey(int hospitalId)
var
allot
=
allotList
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
FirstOrDefault
();
var
allot
=
allotList
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
FirstOrDefault
();
var
keyvalue
=
new
Dictionary
<
string
,
decimal
>();
var
keyvalue
=
new
Dictionary
<
string
,
decimal
>();
var
basicList
=
perforResbaiscnormRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
var
basicList
=
perforResbaiscnormRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
t
.
PositionName
.
IndexOf
(
"保底"
)
<
0
);
if
(
basicList
!=
null
)
if
(
basicList
!=
null
)
{
{
foreach
(
var
basic
in
basicList
)
foreach
(
var
basic
in
basicList
)
...
@@ -71,17 +71,6 @@ public dynamic Survey(int hospitalId)
...
@@ -71,17 +71,6 @@ public dynamic Survey(int hospitalId)
keyvalue
.
Add
(
basic
.
PositionName
,
Math
.
Round
(
basic
.
AvgValue
.
Value
,
2
));
keyvalue
.
Add
(
basic
.
PositionName
,
Math
.
Round
(
basic
.
AvgValue
.
Value
,
2
));
}
}
}
}
var
fee
=
perforHospersonfeeRepository
.
GetEntities
(
t
=>
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
);
if
(
fee
!=
null
)
{
keyvalue
.
Add
(
"门诊患者均次"
,
Math
.
Round
(
fee
.
Where
(
t
=>
t
.
Source
==
"门诊"
).
Sum
(
t
=>
t
.
Fee
.
Value
)
/
fee
.
Where
(
t
=>
t
.
Source
==
"门诊"
).
Sum
(
t
=>
t
.
PersonTime
.
Value
),
2
));
keyvalue
.
Add
(
"住院患者均次"
,
Math
.
Round
(
fee
.
Where
(
t
=>
t
.
Source
==
"住院"
).
Sum
(
t
=>
t
.
Fee
.
Value
)
/
fee
.
Where
(
t
=>
t
.
Source
==
"住院"
).
Sum
(
t
=>
t
.
PersonTime
.
Value
),
2
));
}
else
{
keyvalue
.
Add
(
"门诊患者均次"
,
0
M
);
keyvalue
.
Add
(
"住院患者均次"
,
0
M
);
}
return
new
return
new
{
{
year
=
allot
.
Year
,
year
=
allot
.
Year
,
...
@@ -123,7 +112,7 @@ public List<PerReport> DoctorAvg(int hospitalId, int isIndex)
...
@@ -123,7 +112,7 @@ public List<PerReport> DoctorAvg(int hospitalId, int isIndex)
}
}
/// <summary>
/// <summary>
/// 科室
医生人均绩效(含科主任
)
/// 科室
护理人均绩效(含护士长
)
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
List
<
PerReport
>
NurseAvg
(
int
hospitalId
,
int
isIndex
)
public
List
<
PerReport
>
NurseAvg
(
int
hospitalId
,
int
isIndex
)
...
@@ -244,5 +233,88 @@ internal int ImportData(int allotId)
...
@@ -244,5 +233,88 @@ internal int ImportData(int allotId)
catch
{
}
catch
{
}
return
0
;
return
0
;
}
}
/// <summary>
/// 首页
/// </summary>
/// <param name="hospitalId"></param>
/// <returns></returns>
public
List
<
PerReport
>
IndexReport
(
int
hospitalId
,
string
source
)
{
var
states
=
new
List
<
int
>()
{
6
,
8
};
var
allotList
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
states
.
Contains
(
t
.
States
));
if
(
allotList
==
null
||
!
allotList
.
Any
())
throw
new
PerformanceException
(
"用户未创建绩效!"
);
var
allot
=
allotList
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
FirstOrDefault
();
var
currentDate
=
allot
.
Year
+
"-"
+
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
);
//本月
var
yoyDate
=
(
allot
.
Year
-
1
)
+
"-"
+
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
);
//同比
var
chainDate
=
allot
.
Year
+
"-"
+
(
allot
.
Month
-
1
).
ToString
().
PadLeft
(
2
,
'0'
);
//环比
var
report
=
new
List
<
PerReport
>();
switch
(
source
)
{
case
"绩效发放金额"
:
report
=
perforReportRepository
.
PerforPayment
(
hospitalId
,
currentDate
,
yoyDate
,
chainDate
);
break
;
case
"绩效发放金额占全院收入占比"
:
report
=
perforReportRepository
.
IndexPerforRatio
(
hospitalId
,
currentDate
,
yoyDate
,
chainDate
);
break
;
case
"药占比"
:
report
=
perforReportRepository
.
IndexDrugRatio
(
hospitalId
,
currentDate
,
yoyDate
,
chainDate
);
break
;
case
"材料占比"
:
report
=
perforReportRepository
.
IndexMaterialRatio
(
hospitalId
,
currentDate
,
yoyDate
,
chainDate
);
break
;
case
"结构占比"
:
report
=
perforReportRepository
.
IndexStructRatio
(
hospitalId
,
currentDate
);
break
;
}
return
report
;
}
/// <summary>
/// 菜单
/// </summary>
/// <param name="hospitalId"></param>
/// <returns></returns>
public
List
<
PerReport
>
MenuReport
(
int
hospitalId
,
int
isOnlyYear
,
string
source
,
int
?
isInHos
=
null
)
{
var
report
=
new
List
<
PerReport
>();
switch
(
source
)
{
case
"业务总收入"
:
report
=
perforReportRepository
.
GeneralIncome
(
hospitalId
,
isOnlyYear
);
break
;
case
"门诊、住院业务收入占比"
:
report
=
perforReportRepository
.
InHosIncome
(
hospitalId
,
isOnlyYear
,
isInHos
.
Value
);
break
;
case
"业务收入结构占比"
:
report
=
perforReportRepository
.
StructRatio
(
hospitalId
,
isOnlyYear
);
break
;
case
"药占比"
:
report
=
perforReportRepository
.
DrugRatio
(
hospitalId
,
isOnlyYear
);
break
;
case
"材料占比"
:
report
=
perforReportRepository
.
MaterialRatio
(
hospitalId
,
isOnlyYear
);
break
;
case
"绩效发放金额占全院收入占比"
:
report
=
perforReportRepository
.
PerforRatio
(
hospitalId
,
isOnlyYear
);
break
;
case
"绩效群体收入"
:
report
=
perforReportRepository
.
PerforGroup
(
hospitalId
,
isOnlyYear
);
break
;
case
"医生核算单元人均绩效"
:
report
=
perforReportRepository
.
DoctorAvg
(
hospitalId
,
isOnlyYear
);
break
;
case
"护理核算单元人均绩效"
:
report
=
perforReportRepository
.
NurseAvg
(
hospitalId
,
isOnlyYear
);
break
;
}
return
report
;
}
}
}
}
}
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