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
8d597c61
Commit
8d597c61
authored
Oct 11, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发放表下载
parent
dbed92f6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
34 deletions
+166
-34
performance/Performance.Api/Controllers/ComputeController.cs
+105
-34
performance/Performance.Api/wwwroot/Performance.Api.xml
+21
-0
performance/Performance.Services/ComputeService.cs
+40
-0
performance/Performance.Services/DownloadService.cs
+0
-0
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
8d597c61
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Performance.DtoModels.Request
;
using
Performance.DtoModels.Request
;
using
System.IO
;
using
Microsoft.AspNetCore.StaticFiles
;
namespace
Performance.Api.Controllers
namespace
Performance.Api.Controllers
{
{
...
@@ -24,14 +26,18 @@ public class ComputeController : Controller
...
@@ -24,14 +26,18 @@ public class ComputeController : Controller
private
AllotService
_allotService
;
private
AllotService
_allotService
;
private
ClaimService
_claim
;
private
ClaimService
_claim
;
private
EmployeeService
_employeeService
;
private
EmployeeService
_employeeService
;
private
readonly
DownloadService
downloadService
;
public
ComputeController
(
AllotService
allotService
,
public
ComputeController
(
AllotService
allotService
,
ComputeService
computeService
,
ComputeService
computeService
,
EmployeeService
employeeService
,
EmployeeService
employeeService
,
DownloadService
downloadService
,
ClaimService
claim
)
ClaimService
claim
)
{
{
_allotService
=
allotService
;
_allotService
=
allotService
;
_computeService
=
computeService
;
_computeService
=
computeService
;
_employeeService
=
employeeService
;
_employeeService
=
employeeService
;
this
.
downloadService
=
downloadService
;
_claim
=
claim
;
_claim
=
claim
;
}
}
...
@@ -147,6 +153,7 @@ public ApiResponse<List<DeptResponse>> GetAdminPerformance([FromBody] ComputerRe
...
@@ -147,6 +153,7 @@ public ApiResponse<List<DeptResponse>> GetAdminPerformance([FromBody] ComputerRe
return
new
ApiResponse
<
List
<
DeptResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
return
new
ApiResponse
<
List
<
DeptResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
}
/// <summary>
/// <summary>
/// 科室绩效详情
/// 科室绩效详情
/// </summary>
/// </summary>
...
@@ -215,6 +222,7 @@ public ApiResponse AllCompute([FromBody] ComputerRequest request)
...
@@ -215,6 +222,7 @@ public ApiResponse AllCompute([FromBody] ComputerRequest request)
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
}
}
/// <summary>
/// <summary>
/// 获取全院绩效平均
/// 获取全院绩效平均
/// </summary>
/// </summary>
...
@@ -294,43 +302,12 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
...
@@ -294,43 +302,12 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
if
(
list
==
null
||
!
list
.
Any
())
if
(
list
==
null
||
!
list
.
Any
())
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
var
result
=
list
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
,
t
.
EmployeeName
,
t
.
JobNumber
}).
Select
(
t
=>
new
ComputeResponse
var
result
=
_computeService
.
ComputerGroupBy
(
list
);
{
JobNumber
=
t
.
Key
.
JobNumber
,
EmployeeName
=
t
.
Key
.
EmployeeName
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
UnitType
=
t
.
Key
.
UnitType
,
PerforSumFee
=
t
.
Sum
(
s
=>
s
.
PerforSumFee
),
PerforManagementFee
=
t
.
Sum
(
s
=>
s
.
PerforManagementFee
),
AdjustLaterOtherFee
=
t
.
Sum
(
s
=>
s
.
AdjustLaterOtherFee
),
ShouldGiveFee
=
t
.
Sum
(
s
=>
s
.
ShouldGiveFee
),
OthePerfor
=
t
.
Sum
(
s
=>
s
.
OthePerfor
),
HideOtherPerfor
=
t
.
Sum
(
s
=>
s
.
HideOtherPerfor
),
NightWorkPerfor
=
t
.
Sum
(
s
=>
s
.
NightWorkPerfor
),
RealGiveFee
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
ReservedRatio
=
t
.
Sum
(
s
=>
s
.
ReservedRatio
),
ReservedRatioFee
=
t
.
Sum
(
s
=>
s
.
ReservedRatioFee
),
BankCard
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
BankCard
,
JobCategory
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
JobCategory
,
Duty
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
Duty
,
TitlePosition
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
TitlePosition
}).
OrderBy
(
t
=>
{
string
value
=
t
.
JobNumber
;
switch
(
value
)
{
case
string
val
when
string
.
IsNullOrEmpty
(
val
):
break
;
case
string
val
when
Regex
.
IsMatch
(
val
,
@"^[+-]?\d*$"
):
value
=
value
.
PadLeft
(
20
,
'0'
);
break
;
}
return
value
;
});
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
result
);
}
}
/// <summary>
/// <summary>
/// 修改实发绩效
/// 修改实发绩效
/// </summary>
/// </summary>
...
@@ -425,5 +402,98 @@ public ApiResponse Batch([FromBody] BatchRequest request)
...
@@ -425,5 +402,98 @@ public ApiResponse Batch([FromBody] BatchRequest request)
var
result
=
_computeService
.
Batch
(
request
);
var
result
=
_computeService
.
Batch
(
request
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
}
#
region
发放表下载
/// <summary>
/// 下载院领导、中层、工勤组绩效
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"gethosdata/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
GetAdminPerDownload
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetAdminPerformance
(
allotId
);
var
filepath
=
downloadService
.
DeptReport
(
allotId
,
list
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
filepath
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
/// <summary>
/// 下载全院绩效列表
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"allcompute/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
AllComputeDownload
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
isShowManage
=
_computeService
.
IsShowManage
(
allotId
);
var
list
=
_computeService
.
AllCompute
(
allotId
,
allot
.
HospitalId
,
isShowManage
);
var
filepath
=
downloadService
.
AllComputerReport
(
allotId
,
list
,
true
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
filepath
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
/// <summary>
/// 下载全院绩效列表(人事科)
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"allcompute/personnel/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
AllComputeByPMDownLoad
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
isShowManage
=
_computeService
.
IsShowManage
(
allotId
);
var
list
=
_computeService
.
AllCompute
(
allotId
,
allot
.
HospitalId
,
isShowManage
,
true
);
var
result
=
_computeService
.
ComputerGroupBy
(
list
);
var
filepath
=
downloadService
.
AllComputerReport
(
allotId
,
result
,
false
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
filepath
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
#
endregion
}
}
}
}
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
8d597c61
...
@@ -554,6 +554,27 @@
...
@@ -554,6 +554,27 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetAdminPerDownload(System.Int32)"
>
<summary>
下载院领导、中层、工勤组绩效
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeDownload(System.Int32)"
>
<summary>
下载全院绩效列表
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeByPMDownLoad(System.Int32)"
>
<summary>
下载全院绩效列表(人事科)
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)"
>
<summary>
<summary>
获取 药占比类型信息列表
获取 药占比类型信息列表
...
...
performance/Performance.Services/ComputeService.cs
View file @
8d597c61
...
@@ -941,6 +941,46 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
...
@@ -941,6 +941,46 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
return
response
?.
OrderBy
(
t
=>
AccountTypes
.
FirstOrDefault
(
a
=>
a
.
Name
==
t
.
UnitType
)?.
Value
).
ThenByDescending
(
t
=>
t
.
AccountingUnit
).
ToList
();
return
response
?.
OrderBy
(
t
=>
AccountTypes
.
FirstOrDefault
(
a
=>
a
.
Name
==
t
.
UnitType
)?.
Value
).
ThenByDescending
(
t
=>
t
.
AccountingUnit
).
ToList
();
}
}
public
List
<
ComputeResponse
>
ComputerGroupBy
(
List
<
ComputeResponse
>
list
)
{
var
result
=
list
?.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
,
t
.
EmployeeName
,
t
.
JobNumber
}).
Select
(
t
=>
new
ComputeResponse
{
JobNumber
=
t
.
Key
.
JobNumber
,
EmployeeName
=
t
.
Key
.
EmployeeName
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
UnitType
=
t
.
Key
.
UnitType
,
PerforSumFee
=
t
.
Sum
(
s
=>
s
.
PerforSumFee
),
PerforManagementFee
=
t
.
Sum
(
s
=>
s
.
PerforManagementFee
),
AdjustLaterOtherFee
=
t
.
Sum
(
s
=>
s
.
AdjustLaterOtherFee
),
ShouldGiveFee
=
t
.
Sum
(
s
=>
s
.
ShouldGiveFee
),
OthePerfor
=
t
.
Sum
(
s
=>
s
.
OthePerfor
),
HideOtherPerfor
=
t
.
Sum
(
s
=>
s
.
HideOtherPerfor
),
NightWorkPerfor
=
t
.
Sum
(
s
=>
s
.
NightWorkPerfor
),
RealGiveFee
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
ReservedRatio
=
t
.
Sum
(
s
=>
s
.
ReservedRatio
),
ReservedRatioFee
=
t
.
Sum
(
s
=>
s
.
ReservedRatioFee
),
BankCard
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
BankCard
,
JobCategory
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
JobCategory
,
Duty
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
Duty
,
TitlePosition
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
TitlePosition
}).
OrderBy
(
t
=>
{
string
value
=
t
.
JobNumber
;
switch
(
value
)
{
case
string
val
when
string
.
IsNullOrEmpty
(
val
):
break
;
case
string
val
when
Regex
.
IsMatch
(
val
,
@"^[+-]?\d*$"
):
value
=
value
.
PadLeft
(
20
,
'0'
);
break
;
}
return
value
;
});
return
result
.
ToList
();
}
///// <summary>
///// <summary>
///// 合并医院其他绩效、不公示其他绩效
///// 合并医院其他绩效、不公示其他绩效
///// </summary>
///// </summary>
...
...
performance/Performance.Services/DownloadService.cs
0 → 100644
View file @
8d597c61
This diff is collapsed.
Click to expand it.
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