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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
455 additions
and
34 deletions
+455
-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
+289
-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
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.Extensions.Logging
;
using
NPOI.HSSF.UserModel
;
using
NPOI.SS.UserModel
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
Performance.Services.ExtractExcelService
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Services
{
public
class
DownloadService
:
IAutoInjection
{
private
readonly
ILogger
<
DownloadService
>
logger
;
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
PerforHospitalRepository
perforHospital
;
private
readonly
ConfigService
configService
;
private
readonly
IHostingEnvironment
evn
;
public
DownloadService
(
ILogger
<
DownloadService
>
logger
,
PerforPerallotRepository
perallotRepository
,
PerforHospitalRepository
perforHospital
,
ConfigService
configService
,
IHostingEnvironment
evn
)
{
this
.
logger
=
logger
;
this
.
perallotRepository
=
perallotRepository
;
this
.
perforHospital
=
perforHospital
;
this
.
configService
=
configService
;
this
.
evn
=
evn
;
}
#
region
财务、全院绩效发放下载
/// <summary>
/// 财务、全院绩效发放下载
/// </summary>
/// <param name="allotId"></param>
/// <param name="allData"></param>
/// <param name="isAll"></param>
/// <returns></returns>
public
string
AllComputerReport
(
int
allotId
,
List
<
ComputeResponse
>
allData
,
bool
isAll
)
{
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
hospital
=
perforHospital
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
var
headList
=
AllCompute
;
if
(!
isAll
)
headList
=
Person
;
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"PerformanceRelease"
,
$"
{
allot
.
HospitalId
}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
string
fileName
=
$"
{
hospital
.
HosName
}
-全院绩效发放-
{
DateTime
.
Now
:
yyyy
年
MM
月
dd
日
}
"
;
string
filepath
=
Path
.
Combine
(
dpath
,
fileName
);
FileStream
stream
=
new
FileStream
(
filepath
,
FileMode
.
Create
);
try
{
HSSFWorkbook
workbook
=
new
HSSFWorkbook
();
//设置单元格样式
ICellStyle
style
=
workbook
.
CreateCellStyle
();
style
.
Alignment
=
HorizontalAlignment
.
Center
;
style
.
BorderBottom
=
BorderStyle
.
Thin
;
style
.
BorderRight
=
BorderStyle
.
Thin
;
ISheet
sheet
=
workbook
.
CreateSheet
(
"全院绩效发放"
);
sheet
.
ForceFormulaRecalculation
=
true
;
ICellStyle
cellStyle
=
workbook
.
CreateCellStyle
();
cellStyle
.
DataFormat
=
HSSFDataFormat
.
GetBuiltinFormat
(
"0.00"
);
IRow
row1
=
sheet
.
CreateRow
(
0
);
row1
.
CreateCell
(
0
).
SetCellValue
(
"序号"
);
row1
.
GetCell
(
0
).
CellStyle
=
style
;
int
cellIndex
=
1
;
foreach
(
var
item
in
headList
.
Select
(
t
=>
t
.
Item2
))
{
row1
.
CreateCell
(
cellIndex
).
SetCellValue
(
item
);
row1
.
GetCell
(
cellIndex
).
CellStyle
=
style
;
sheet
.
SetColumnWidth
(
cellIndex
,
14
*
256
);
cellIndex
++;
}
int
startIndex
=
1
;
foreach
(
var
item
in
allData
)
{
var
row
=
sheet
.
CreateRow
(
startIndex
);
cellIndex
=
1
;
var
serial
=
row
.
CreateCell
(
0
);
serial
.
SetCellOValue
(
startIndex
);
serial
.
CellStyle
=
style
;
foreach
(
var
field
in
headList
.
Select
(
t
=>
t
.
Item3
))
{
var
cell
=
row
.
CreateCell
(
cellIndex
);
cell
.
SetCellOValue
(
field
?.
Invoke
(
item
));
cell
.
CellStyle
=
style
;
cellIndex
++;
}
startIndex
++;
}
//合计
cellIndex
=
1
;
var
totalRow
=
sheet
.
CreateRow
(
startIndex
);
var
totalSerial
=
totalRow
.
CreateCell
(
0
);
totalSerial
.
SetCellOValue
(
"合计"
);
totalSerial
.
CellStyle
=
style
;
foreach
(
var
value
in
headList
.
Select
(
t
=>
t
.
Item4
))
{
var
cell
=
totalRow
.
CreateCell
(
cellIndex
);
cell
.
SetCellFormula
(
string
.
Format
(
value
,
startIndex
));
cell
.
CellStyle
=
style
;
cellIndex
++;
}
workbook
.
Write
(
stream
);
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
"下载异常"
+
ex
);
}
finally
{
stream
.
Close
();
}
return
filepath
;
}
public
static
List
<(
string
,
string
,
Func
<
ComputeResponse
,
object
>,
string
)>
AllCompute
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
ComputeResponse
,
object
>,
string
)>
{
(
nameof
(
ComputeResponse
.
Source
),
"来源"
,
t
=>
t
.
Source
,
""
),
(
nameof
(
ComputeResponse
.
UnitType
),
"科室类别"
,
t
=>
t
.
UnitType
,
""
),
(
nameof
(
ComputeResponse
.
AccountingUnit
),
"核算单元"
,
t
=>
t
.
AccountingUnit
,
""
),
(
nameof
(
ComputeResponse
.
JobNumber
),
"员工号"
,
t
=>
t
.
JobNumber
,
""
),
(
nameof
(
ComputeResponse
.
EmployeeName
),
"人员姓名"
,
t
=>
t
.
EmployeeName
,
""
),
(
nameof
(
ComputeResponse
.
JobTitle
),
"职务"
,
t
=>
t
.
JobTitle
,
""
),
(
nameof
(
ComputeResponse
.
Batch
),
"批次"
,
t
=>
t
.
Batch
,
""
),
(
nameof
(
ComputeResponse
.
PerforSumFee
),
"调节后业绩绩效"
,
t
=>
t
.
PerforSumFee
,
"SUM(I2:I{0})"
),
(
nameof
(
ComputeResponse
.
PerforManagementFee
),
"调节后实发管理绩效"
,
t
=>
t
.
PerforManagementFee
,
"SUM(J2:J{0})"
),
(
nameof
(
ComputeResponse
.
AdjustLaterOtherFee
),
"调节后其他绩效"
,
t
=>
t
.
AdjustLaterOtherFee
,
"SUM(K2:K{0})"
),
(
nameof
(
ComputeResponse
.
NightWorkPerfor
),
"夜班费"
,
t
=>
t
.
NightWorkPerfor
,
"SUM(L2:L{0})"
),
(
nameof
(
ComputeResponse
.
OthePerfor
),
"医院其他绩效"
,
t
=>
t
.
OthePerfor
,
"SUM(M2:M{0})"
),
(
nameof
(
ComputeResponse
.
HideOtherPerfor
),
"不公示其他绩效"
,
t
=>
t
.
HideOtherPerfor
,
"SUM(N2:N{0})"
),
(
nameof
(
ComputeResponse
.
ShouldGiveFee
),
"应发小计"
,
t
=>
t
.
ShouldGiveFee
,
"SUM(O2:O{0})"
),
(
nameof
(
ComputeResponse
.
ReservedRatioFee
),
"预留绩效"
,
t
=>
t
.
ReservedRatioFee
,
"SUM(P2:P{0})"
),
(
nameof
(
ComputeResponse
.
RealGiveFee
),
"实发绩效"
,
t
=>
t
.
RealGiveFee
,
"SUM(Q2:Q{0})"
),
};
public
static
List
<(
string
,
string
,
Func
<
ComputeResponse
,
object
>,
string
)>
Person
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
ComputeResponse
,
object
>,
string
)>
{
(
nameof
(
ComputeResponse
.
UnitType
),
"科室类别"
,
t
=>
t
.
UnitType
,
""
),
(
nameof
(
ComputeResponse
.
AccountingUnit
),
"核算单元"
,
t
=>
t
.
AccountingUnit
,
""
),
(
nameof
(
ComputeResponse
.
JobNumber
),
"员工号"
,
t
=>
t
.
JobNumber
,
""
),
(
nameof
(
ComputeResponse
.
EmployeeName
),
"人员姓名"
,
t
=>
t
.
EmployeeName
,
""
),
(
nameof
(
ComputeResponse
.
PerforSumFee
),
"调节后业绩绩效"
,
t
=>
t
.
PerforSumFee
,
"SUM(F2:F{0})"
),
(
nameof
(
ComputeResponse
.
PerforManagementFee
),
"调节后实发管理绩效"
,
t
=>
t
.
PerforManagementFee
,
"SUM(G2:G{0})"
),
(
nameof
(
ComputeResponse
.
AdjustLaterOtherFee
),
"调节后其他绩效"
,
t
=>
t
.
AdjustLaterOtherFee
,
"SUM(H2:H{0})"
),
(
nameof
(
ComputeResponse
.
NightWorkPerfor
),
"夜班费"
,
t
=>
t
.
NightWorkPerfor
,
"SUM(I2:I{0})"
),
(
nameof
(
ComputeResponse
.
OthePerfor
),
"医院其他绩效"
,
t
=>
t
.
OthePerfor
,
"SUM(J2:J{0})"
),
(
nameof
(
ComputeResponse
.
HideOtherPerfor
),
"不公示其他绩效"
,
t
=>
t
.
HideOtherPerfor
,
"SUM(K2:K{0})"
),
(
nameof
(
ComputeResponse
.
ShouldGiveFee
),
"应发小计"
,
t
=>
t
.
ShouldGiveFee
,
"SUM(L2:L{0})"
),
(
nameof
(
ComputeResponse
.
ReservedRatioFee
),
"预留绩效"
,
t
=>
t
.
ReservedRatioFee
,
"SUM(M2:M{0})"
),
(
nameof
(
ComputeResponse
.
RealGiveFee
),
"实发绩效"
,
t
=>
t
.
RealGiveFee
,
"SUM(N2:N{0})"
),
};
#
endregion
#
region
全院绩效核算
/// <summary>
/// 全院绩效核算
/// </summary>
/// <param name="allotId"></param>
/// <param name="name"></param>
/// <param name="deptData"></param>
/// <returns></returns>
public
string
DeptReport
(
int
allotId
,
List
<
DeptResponse
>
deptData
)
{
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
hospital
=
perforHospital
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"PerformanceRelease"
,
$"
{
allot
.
HospitalId
}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
string
fileName
=
$"
{
hospital
.
HosName
}
-全院核算绩效发放-
{
DateTime
.
Now
:
yyyy
年
MM
月
dd
日
}
"
;
string
filepath
=
Path
.
Combine
(
dpath
,
fileName
);
FileStream
stream
=
new
FileStream
(
filepath
,
FileMode
.
Create
);
try
{
HSSFWorkbook
workbook
=
new
HSSFWorkbook
();
//设置单元格样式
ICellStyle
style
=
workbook
.
CreateCellStyle
();
style
.
Alignment
=
HorizontalAlignment
.
Center
;
style
.
BorderBottom
=
BorderStyle
.
Thin
;
style
.
BorderRight
=
BorderStyle
.
Thin
;
ISheet
sheet
=
workbook
.
CreateSheet
(
"全院核算绩效发放"
);
sheet
.
ForceFormulaRecalculation
=
true
;
ICellStyle
cellStyle
=
workbook
.
CreateCellStyle
();
cellStyle
.
DataFormat
=
HSSFDataFormat
.
GetBuiltinFormat
(
"0.00"
);
IRow
row1
=
sheet
.
CreateRow
(
0
);
int
cellIndex
=
0
;
foreach
(
var
item
in
HosData
.
Select
(
t
=>
t
.
Item2
))
{
row1
.
CreateCell
(
cellIndex
).
SetCellValue
(
item
);
row1
.
GetCell
(
cellIndex
).
CellStyle
=
style
;
sheet
.
SetColumnWidth
(
cellIndex
,
14
*
256
);
cellIndex
++;
}
int
startIndex
=
1
;
foreach
(
var
item
in
deptData
)
{
var
row
=
sheet
.
CreateRow
(
startIndex
);
cellIndex
=
0
;
foreach
(
var
field
in
HosData
.
Select
(
t
=>
t
.
Item3
))
{
var
cell
=
row
.
CreateCell
(
cellIndex
);
cell
.
SetCellOValue
(
field
?.
Invoke
(
item
));
cell
.
CellStyle
=
style
;
cellIndex
++;
}
startIndex
++;
}
//合计
cellIndex
=
0
;
var
totalRow
=
sheet
.
CreateRow
(
startIndex
);
foreach
(
var
value
in
HosData
.
Select
(
t
=>
t
.
Item4
))
{
var
cell
=
totalRow
.
CreateCell
(
cellIndex
);
if
(
cellIndex
==
0
)
cell
.
SetCellOValue
(
"合计"
);
else
cell
.
SetCellFormula
(
string
.
Format
(
value
,
startIndex
));
cell
.
CellStyle
=
style
;
cellIndex
++;
}
workbook
.
Write
(
stream
);
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
"下载异常"
+
ex
);
}
finally
{
stream
.
Close
();
}
return
filepath
;
}
public
static
List
<(
string
,
string
,
Func
<
DeptResponse
,
object
>,
string
)>
HosData
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
DeptResponse
,
object
>,
string
)>
{
(
nameof
(
DeptResponse
.
UnitName
),
"核算群体"
,
t
=>
t
.
UnitName
,
""
),
(
nameof
(
DeptResponse
.
AccountingUnit
),
"核算单元"
,
t
=>
t
.
AccountingUnit
,
""
),
(
nameof
(
DeptResponse
.
PerforFee
),
"业绩绩效"
,
t
=>
t
.
PerforFee
,
"SUM(C2:C{0})"
),
(
nameof
(
DeptResponse
.
WorkloadFee
),
"工作量绩效"
,
t
=>
t
.
WorkloadFee
,
"SUM(D2:D{0})"
),
(
nameof
(
DeptResponse
.
AssessBeforeOtherFee
),
"考核前其他绩效"
,
t
=>
t
.
AssessBeforeOtherFee
,
"SUM(E2:E{0})"
),
(
nameof
(
DeptResponse
.
PerforTotal
),
"考核前绩效合计"
,
t
=>
t
.
PerforTotal
,
"SUM(F2:F{0})"
),
(
nameof
(
DeptResponse
.
ScoringAverage
),
"科室考核得分"
,
t
=>
t
.
ScoringAverage
,
"SUM(G2:G{0})"
),
(
nameof
(
DeptResponse
.
MedicineExtra
),
"药占比奖罚"
,
t
=>
t
.
MedicineExtra
,
"SUM(H2:H{0})"
),
(
nameof
(
DeptResponse
.
MaterialsExtra
),
"材料占比奖罚"
,
t
=>
t
.
MaterialsExtra
,
"SUM(I2:I{0})"
),
(
nameof
(
DeptResponse
.
Extra
),
"医院奖罚"
,
t
=>
t
.
Extra
,
"SUM(J2:J{0})"
),
(
nameof
(
DeptResponse
.
ScoringPerfor
),
"考核后其他绩效"
,
t
=>
t
.
ScoringPerfor
,
"SUM(K2:K{0})"
),
(
nameof
(
DeptResponse
.
AssessLaterOtherFee
),
"考核后绩效"
,
t
=>
t
.
AssessLaterOtherFee
,
"SUM(L2:L{0})"
),
(
nameof
(
DeptResponse
.
AdjustFactor
),
"调节系数"
,
t
=>
t
.
AdjustFactor
,
"SUM(M2:M{0})"
),
(
nameof
(
DeptResponse
.
AdjustLaterOtherFee
),
"调节后其他绩效"
,
t
=>
t
.
AdjustLaterOtherFee
,
"SUM(N2:N{0})"
),
(
nameof
(
DeptResponse
.
AssessLaterManagementFee
),
"科主任实发管理绩效"
,
t
=>
t
.
AssessLaterManagementFee
,
"SUM(O2:O{0})"
),
(
nameof
(
DeptResponse
.
AprPerforAmount
),
"医院其他绩效"
,
t
=>
t
.
AprPerforAmount
,
"SUM(P2:P{0})"
),
(
nameof
(
DeptResponse
.
HideAprOtherPerforAmount
),
"不公示其他绩效"
,
t
=>
t
.
HideAprOtherPerforAmount
,
"SUM(Q2:Q{0})"
),
(
nameof
(
DeptResponse
.
RealGiveFee
),
"实发绩效"
,
t
=>
t
.
RealGiveFee
,
"SUM(R2:R{0})"
),
};
#
endregion
}
}
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