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
7cd3c3b3
Commit
7cd3c3b3
authored
Nov 20, 2020
by
lcx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2020_1119' into v2020morge
parents
5b751ceb
8dd3403e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
218 additions
and
82 deletions
+218
-82
performance/Performance.Api/Controllers/SecondAllotController.cs
+20
-10
performance/Performance.Api/Startup.cs
+43
-26
performance/Performance.DtoModels/Response/SecondPerforResponse.cs
+27
-26
performance/Performance.Services/ComputeService.cs
+8
-13
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+3
-1
performance/Performance.Services/SecondAllotService.cs
+117
-6
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
7cd3c3b3
...
...
@@ -33,6 +33,7 @@ public class SecondAllotController : ControllerBase
}
#
region
二次绩效列表、录入数据展示,保存数据
/// <summary>
/// 二次绩效列表(没有需要初始化)
/// </summary>
...
...
@@ -134,7 +135,8 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo
// var result = secondAllotService.GetSecondDetail(secondid);
// return new ApiResponse(ResponseType.OK, result);
//}
#
endregion
#
endregion
二次绩效列表、录入数据展示,保存数据
/// <summary>
/// 二次绩效录入页面自动补全
...
...
@@ -161,10 +163,11 @@ public ApiResponse OtherAutoComplete([FromBody] SecondEmpRequest request)
}
#
region
模板使用
/// <summary>
/// 选择二次绩效模板
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"api/temp/list"
)]
public
ApiResponse
<
List
<
SecondTempResponse
>>
Temp
([
FromBody
]
AllotDeptRequest
request
)
...
...
@@ -197,9 +200,11 @@ public ApiResponse RefreshTemp([CustomizeValidator(RuleSet = "Refresh"), FromBod
secondAllotService
.
RefreshTemp
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
#
endregion
#
endregion
模板使用
#
region
二次绩效工作量配置
/// <summary>
/// 二次绩效工作量列表
/// </summary>
...
...
@@ -300,9 +305,11 @@ public ApiResponse SingleDelete([CustomizeValidator(RuleSet = "Delete"), FromBod
var
result
=
secondAllotService
.
DeleteWorkType
(
request
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"删除成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"删除失败"
);
}
#
endregion
#
endregion
二次绩效工作量配置
#
region
二次绩效审核
/// <summary>
/// 提交审核
/// </summary>
...
...
@@ -352,7 +359,6 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
/// <summary>
/// 护理部二次绩效审核列表
/// </summary>
...
...
@@ -377,9 +383,11 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request)
var
result
=
secondAllotService
.
NursingDeptAudit
(
userid
,
request
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
#
endregion
#
endregion
二次绩效审核
#
region
二次绩效其他绩效
/// <summary>
/// 二次绩效其他绩效详情
/// </summary>
...
...
@@ -408,7 +416,8 @@ public ApiResponse OtherSave([FromBody] AgOtherRequest request)
var
result
=
secondAllotService
.
OtherSave
(
request
.
SecondId
,
request
.
Othersources
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
#
endregion
#
endregion
二次绩效其他绩效
/// <summary>
/// 二次绩效结果打印
...
...
@@ -428,11 +437,11 @@ public ApiResponse SecondPrint(int secondid)
/// <returns></returns>
[
Route
(
"api/second/deptcompute/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
SecondPerforResponse
>>
DeptComputeDetail
(
int
allotId
)
public
ApiResponse
DeptComputeDetail
(
int
allotId
)
{
var
userId
=
claimService
.
GetUserId
();
var
data
=
secondAllotService
.
DeptComputeDetail
(
userId
,
allotId
);
return
new
ApiResponse
<
List
<
SecondPerforResponse
>>(
ResponseType
.
OK
,
data
);
var
data
=
secondAllotService
.
DeptComputeDetail
(
userId
,
allotId
,
out
int
isShowManage
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
isShowManage
,
data
}
);
}
}
}
\ No newline at end of file
performance/Performance.Api/Startup.cs
View file @
7cd3c3b3
...
...
@@ -52,17 +52,20 @@ public void ConfigureServices(IServiceCollection services)
Encoding
.
RegisterProvider
(
CodePagesEncodingProvider
.
Instance
);
#
region
appsetting
注入
services
.
Configure
<
AppConnection
>(
Configuration
.
GetSection
(
"AppConnection"
))
.
Configure
<
Application
>(
Configuration
.
GetSection
(
"Application"
))
.
Configure
<
HuyiSmsConfig
>(
Configuration
.
GetSection
(
"HuyiSmsConfig"
))
.
Configure
<
EmailOptions
>(
Configuration
.
GetSection
(
"EmailOptions"
))
.
Configure
<
WebapiUrl
>(
Configuration
.
GetSection
(
"WebapiUrl"
));
#
endregion
#
endregion
appsetting
注入
var
connection
=
services
.
BuildServiceProvider
().
GetService
<
IOptions
<
AppConnection
>>();
#
region
json
&
fluentvalidation
&
filter
services
//筛选器配置
.
AddMvc
(
option
=>
...
...
@@ -97,19 +100,23 @@ public void ConfigureServices(IServiceCollection services)
fv
.
RegisterValidatorsFromAssemblyContaining
(
type
.
GetType
());
}
});
#
endregion
#
endregion
json
&
fluentvalidation
&
filter
#
region
automapper
Mapper
.
Initialize
(
cfg
=>
cfg
.
AddProfile
<
AutoMapperConfigs
>());
services
.
AddAutoMapper
();
#
endregion
#
region
service
注入
repoitory
注入
#
endregion
automapper
#
region
service
注入
repoitory
注入
services
.
AddPerformanceService
()
.
AddPerformanceRepoitory
();
#
endregion
#
endregion
service
注入
repoitory
注入
#
region
custom
util
...
...
@@ -118,7 +125,7 @@ public void ConfigureServices(IServiceCollection services)
//用户身份信息服务
services
.
AddScoped
<
ClaimService
>();
#
endregion
#
endregion
custom
util
#
region
email
...
...
@@ -132,22 +139,26 @@ public void ConfigureServices(IServiceCollection services)
options
.
SmtpServer
=
emailOption
.
Value
.
SmtpServer
;
});
#
endregion
#
endregion
email
#
region
redis
//var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString);
//RedisHelper.Initialization(csredis);
#
endregion
#
endregion
redis
services
.
AddMemoryCache
();
#
region
hangfire
services
.
AddHangfire
(
config
=>
{
config
.
UseFilter
(
new
AutomaticRetryAttribute
{
Attempts
=
0
});
config
.
UseStorage
(
new
MySqlStorage
(
connection
.
Value
.
HangfireConnectionString
));
});
#
endregion
#
region
hangfire
//services.AddHangfire(config =>
//{
// config.UseFilter(new AutomaticRetryAttribute { Attempts = 0 });
// config.UseStorage(new MySqlStorage(connection.Value.HangfireConnectionString));
//});
#
endregion
hangfire
services
.
AddSignalR
();
services
.
AddCors
(
options
=>
...
...
@@ -158,15 +169,17 @@ public void ConfigureServices(IServiceCollection services)
});
});
#
region
//ef配置
services
.
AddDbContext
<
PerformanceDbContext
>(
options
=>
{
options
.
UseMySQL
(
connection
.
Value
.
PerformanceConnectionString
);
});
#
endregion
#
region
swagger
#
endregion
//ef配置
#
region
swagger
services
.
AddSwaggerGen
(
c
=>
{
c
.
SwaggerDoc
(
"v1"
,
new
Info
{
Version
=
"v1.0"
,
Title
=
"绩效API接口"
});
...
...
@@ -196,10 +209,10 @@ public void ConfigureServices(IServiceCollection services)
In
=
"HEADER"
});
#
endregion
#
endregion
Token
绑定到
ConfigureServices
});
#
endregion
#
endregion
swagger
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
...
...
@@ -216,6 +229,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
}
#
region
Swagger
app
.
UseSwagger
();
app
.
UseSwaggerUI
(
c
=>
{
...
...
@@ -223,14 +237,15 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
//c.SwaggerEndpoint("/swagger/v1/swagger.json", "v1.0");
c
.
RoutePrefix
=
""
;
});
#
endregion
#
endregion
Swagger
#
region
hangfire
app
.
UseHangfireServer
();
app
.
UseHangfireDashboard
(
"/hangfire"
,
new
DashboardOptions
{
Authorization
=
new
[]
{
new
HangfireAuthorizationFilter
()
}
});
//
app.UseHangfireServer();
//
app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[] { new HangfireAuthorizationFilter() } });
#
endregion
#
endregion
hangfire
app
.
UseCors
(
"SignalrCore"
);
app
.
UseSignalR
(
routes
=>
routes
.
MapHub
<
AllotLogHub
>(
"/performance/allotLogHub"
));
...
...
@@ -250,5 +265,6 @@ public bool Authorize(Hangfire.Dashboard.DashboardContext context)
return
true
;
}
}
#
endregion
}
#
endregion
hangfire
权限
}
\ No newline at end of file
performance/Performance.DtoModels/Response/SecondPerforResponse.cs
View file @
7cd3c3b3
...
...
@@ -4,22 +4,22 @@
namespace
Performance.DtoModels
{
public
class
SecondPerforResponse
public
class
SecondPerforResponse
:
ComputeResponse
{
/// <summary>
/// 人员姓名
/// </summary>
public
string
EmployeeName
{
get
;
set
;
}
///
//
<summary>
///
//
人员姓名
///
//
</summary>
//
public string EmployeeName { get; set; }
/// <summary>
/// 职务
/// </summary>
public
string
JobTitle
{
get
;
set
;
}
///
//
<summary>
///
//
职务
///
//
</summary>
//
public string JobTitle { get; set; }
/// <summary>
/// 人员工号
/// </summary>
public
string
JobNumber
{
get
;
set
;
}
///
//
<summary>
///
//
人员工号
///
//
</summary>
//
public string JobNumber { get; set; }
/// <summary>
/// 效率绩效
...
...
@@ -41,19 +41,19 @@ public class SecondPerforResponse
/// </summary>
public
Nullable
<
decimal
>
Grant
{
get
;
set
;
}
/// <summary>
/// 应发管理绩效
/// </summary>
public
Nullable
<
decimal
>
ShouldGiveFee
{
get
;
set
;
}
///
//
<summary>
///
//
应发管理绩效
///
//
</summary>
//
public Nullable<decimal> ShouldGiveFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public
Nullable
<
decimal
>
PerforSumFee
{
get
;
set
;
}
///
//
<summary>
///
//
绩效合计
///
//
</summary>
//
public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public
Nullable
<
decimal
>
ScoreAverageRate
{
get
;
set
;
}
///
//
<summary>
///
//
考核对分率
///
//
</summary>
//
public Nullable<decimal> ScoreAverageRate { get; set; }
}
}
}
\ No newline at end of file
performance/Performance.Services/ComputeService.cs
View file @
7cd3c3b3
...
...
@@ -110,7 +110,6 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
var
apramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
);
if
(
pairs
.
Keys
.
Any
(
t
=>
t
==
type
))
{
#
region
MyRegion
//var employees = _perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allotId && pairs[type].Contains(t.UnitType));
...
...
@@ -160,7 +159,7 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
//data = Mapper.Map<List<ResComputeResponse>>(joinData);
#
endregion
#
endregion
MyRegion
var
employees
=
_perforImemployeeclinicRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
pairs
[
type
].
Contains
(
t
.
UnitType
));
if
(
employees
==
null
||
!
employees
.
Any
())
return
new
List
<
ResComputeResponse
>();
...
...
@@ -168,7 +167,6 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
var
computes
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
pairs
[
type
].
Contains
(
t
.
UnitType
));
if
(
computes
==
null
||
!
computes
.
Any
())
return
new
List
<
ResComputeResponse
>();
data
=
Mapper
.
Map
<
List
<
ResComputeResponse
>>(
computes
);
data
.
ForEach
(
t
=>
...
...
@@ -378,7 +376,6 @@ public DeptDetailResponse GetDepartmentDetail(int allotId, string department, in
return
null
;
}
/// <summary>
/// 返回科室详情
/// </summary>
...
...
@@ -573,7 +570,7 @@ private List<ComputeResponse> GetSecondPerformance(int allotId)
/// </summary>
/// <param name="allotId"></param>
/// <param name="computes"></param>
p
rivate
List
<
ComputeResponse
>
AddAprAmount
(
int
allotId
,
List
<
ComputeResponse
>
computes
)
p
ublic
List
<
ComputeResponse
>
AddAprAmount
(
int
allotId
,
List
<
ComputeResponse
>
computes
)
{
if
(
computes
==
null
||
!
computes
.
Any
())
return
computes
;
...
...
@@ -584,7 +581,7 @@ private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> co
foreach
(
var
item
in
computes
.
GroupBy
(
w
=>
new
{
w
.
AccountingUnit
,
w
.
JobNumber
}))
{
// 补充过一次就不在补充了
// 补充过一次就不在补充了
var
emp
=
computes
.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Key
.
AccountingUnit
&&
w
.
JobNumber
==
item
.
Key
.
JobNumber
)
.
OrderByDescending
(
w
=>
w
.
Source
).
FirstOrDefault
();
var
apramount
=
list
.
Where
(
t
=>
t
.
AccountingUnit
==
emp
.
AccountingUnit
...
...
@@ -602,7 +599,6 @@ private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> co
//}
}
return
computes
;
}
...
...
@@ -666,8 +662,9 @@ private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> co
// }
// }
// return result;
//}
#
endregion
//}
#
endregion
绩效发放列表
public
res_compute
GetComputeSingle
(
int
computeid
)
{
...
...
@@ -728,7 +725,6 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
var
headers
=
_perforImheaderRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
account
.
AllotID
);
var
basicData
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
account
.
AllotID
&&
t
.
AccountingUnit
==
account
.
AccountingUnit
);
DeptDataDetails
deptDetails
=
new
DeptDataDetails
{
ShowFormula
=
allot
.
ShowFormula
,
...
...
@@ -896,7 +892,6 @@ private List<DetailModule> CommonDetailItems(List<im_data> basicData, List<im_he
return
dto
;
}).
ToList
();
}
var
headerData
=
headers
?.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
if
(
headerData
!=
null
&&
headerData
.
Any
())
...
...
@@ -1003,6 +998,7 @@ private UnitType TypeConversion(int? unitType)
type
=
UnitType
.
护理组
;
return
type
;
}
public
DeptDataDetails
DeptOfficeDetail
(
int
accountId
)
{
var
account
=
perforResaccountRepository
.
GetEntity
(
t
=>
t
.
ID
==
accountId
);
...
...
@@ -1076,7 +1072,6 @@ public DeptDataDetails DeptOfficeDetail(int accountId)
return
deptDetails
;
}
public
DeptDataDetails
SpecialDeptDetail
(
ag_secondallot
second
)
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
second
.
AllotId
);
...
...
@@ -1243,7 +1238,7 @@ public DeptDataDetails GetDoctorDetail(int computeId)
Scale
=
employee
.
Scale
??
0
,
//规模绩效系数
ScalePerfor
=
resCompute
.
Scale
??
0
,
//规模绩效
Management
=
employee
.
Management
,
//管理绩效发放系数
ShouldGiveFee
=
resCompute
.
ShouldGiveFee
??
0
,
//考核前管理绩效
ShouldGiveFee
=
resCompute
.
ShouldGiveFee
??
0
,
//考核前管理绩效
ScoringAverage
=
resCompute
.
ScoreAverageRate
??
1
,
//考核得分率
AssessLaterManagementFee
=
Math
.
Round
(
resCompute
.
ShouldGiveFee
*
resCompute
.
ScoreAverageRate
*
resCompute
.
Attendance
+
resCompute
.
Punishment
??
0
),
//考核后管理绩效
AdjustFactor
=
employee
?.
Adjust
??
1
,
//调节系数
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
7cd3c3b3
...
...
@@ -86,6 +86,7 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
var
row
=
sheet
.
GetRow
(
i
);
if
(
row
!=
null
)
{
row
.
ZeroHeight
=
false
;
//取消隐藏行
int
dataFirstCellRowNum
=
point
.
DataFirstCellNum
.
Value
;
//跳过核算单元和科室
for
(
int
j
=
dataFirstCellRowNum
;
j
<
row
.
LastCellNum
;
j
++)
...
...
@@ -101,4 +102,4 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
}
}
}
}
}
\ No newline at end of file
performance/Performance.Services/SecondAllotService.cs
View file @
7cd3c3b3
...
...
@@ -37,7 +37,10 @@ public class SecondAllotService : IAutoInjection
private
readonly
PerforPerapramountRepository
perapramountRepository
;
private
readonly
PerforResspecialunitRepository
resspecialunitRepository
;
private
readonly
PersonService
personService
;
private
readonly
ComputeService
computeService
;
private
readonly
PerforRescomputeRepository
rescomputeRepository
;
private
readonly
PerforPeremployeeRepository
peremployeeRepository
;
private
readonly
PerforImemployeeclinicRepository
imemployeeclinicRepository
;
private
readonly
List
<
ag_tempitem
>
tempitems
=
new
List
<
ag_tempitem
>();
public
SecondAllotService
(
IOptions
<
Application
>
application
,
...
...
@@ -61,7 +64,10 @@ public class SecondAllotService : IAutoInjection
PerforPerapramountRepository
perapramountRepository
,
PerforResspecialunitRepository
resspecialunitRepository
,
PersonService
personService
,
PerforRescomputeRepository
rescomputeRepository
)
ComputeService
computeService
,
PerforRescomputeRepository
rescomputeRepository
,
PerforPeremployeeRepository
peremployeeRepository
,
PerforImemployeeclinicRepository
imemployeeclinicRepository
)
{
this
.
application
=
application
.
Value
;
this
.
hospitalRepository
=
hospitalRepository
;
...
...
@@ -84,7 +90,10 @@ public class SecondAllotService : IAutoInjection
this
.
perapramountRepository
=
perapramountRepository
;
this
.
resspecialunitRepository
=
resspecialunitRepository
;
this
.
personService
=
personService
;
this
.
computeService
=
computeService
;
this
.
rescomputeRepository
=
rescomputeRepository
;
this
.
peremployeeRepository
=
peremployeeRepository
;
this
.
imemployeeclinicRepository
=
imemployeeclinicRepository
;
this
.
tempitems
=
perforAgtempitemRepository
.
GetEntities
();
}
...
...
@@ -1715,15 +1724,17 @@ public List<SecPrintResponse> Print(int secondId)
#
endregion
打印
public
List
<
SecondPerforResponse
>
DeptComputeDetail
(
int
userId
,
int
allotId
)
public
List
<
SecondPerforResponse
>
DeptComputeDetail
(
int
userId
,
int
allotId
,
out
int
isShowManage
)
{
var
user
=
perforUserRepository
.
GetEntity
(
t
=>
t
.
ID
==
userId
);
if
(
user
==
null
)
throw
new
NotImplementedException
(
"人员ID无效"
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
isShowManage
=
computeService
.
IsShowManage
(
allotId
);
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userId
);
var
role
=
roleRepository
.
GetEntity
(
t
=>
t
.
ID
==
userrole
.
RoleID
);
Dictionary
<
int
,
string
>
dict
=
new
Dictionary
<
int
,
string
>
{
{
application
.
DirectorRole
,
AccountUnitType
.
科主任
.
ToString
()
},
...
...
@@ -1733,10 +1744,109 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId)
if
(!
dict
.
Keys
.
Contains
(
role
.
Type
.
Value
))
return
new
List
<
SecondPerforResponse
>();
var
data
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
AccountingUnit
==
user
.
Department
&&
t
.
AccountType
==
dict
[
role
.
Type
.
Value
]);
if
(
data
==
null
||
!
data
.
Any
())
return
new
List
<
SecondPerforResponse
>();
var
computes
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
AccountingUnit
==
user
.
Department
&&
t
.
AccountType
==
dict
[
role
.
Type
.
Value
]);
if
(
computes
==
null
||
!
computes
.
Any
())
return
new
List
<
SecondPerforResponse
>();
var
data
=
GetAllotPerformance
(
allotId
,
computes
,
isShowManage
);
// 补充医院其他绩效
var
result
=
AddAprAmount
(
allotId
,
data
);
// 预留比例
if
(
result
!=
null
)
{
var
empDic
=
peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
foreach
(
var
item
in
result
)
{
var
perfor
=
((
item
.
GiveFee
??
0
)
!=
0
?
item
.
GiveFee
:
item
.
PerforSumFee
)
??
0
;
item
.
PerforSumFee
=
Math
.
Round
(
item
.
PerforSumFee
??
0
,
0
,
MidpointRounding
.
AwayFromZero
);
item
.
PerforManagementFee
=
Math
.
Round
(
item
.
PerforManagementFee
??
0
,
0
,
MidpointRounding
.
AwayFromZero
);
item
.
GiveFee
=
Math
.
Round
(
perfor
,
0
,
MidpointRounding
.
AwayFromZero
);
item
.
AdjustLaterOtherFee
=
Math
.
Round
(
item
.
AdjustLaterOtherFee
??
0
,
0
,
MidpointRounding
.
AwayFromZero
);
item
.
OthePerfor
=
Math
.
Round
(
item
.
OthePerfor
??
0
,
0
,
MidpointRounding
.
AwayFromZero
);
item
.
NightWorkPerfor
=
Math
.
Round
(
item
.
NightWorkPerfor
??
0
,
0
,
MidpointRounding
.
AwayFromZero
);
item
.
ShouldGiveFee
=
Math
.
Round
((
perfor
+
item
.
AdjustLaterOtherFee
+
item
.
NightWorkPerfor
)
??
0
,
0
,
MidpointRounding
.
AwayFromZero
);
item
.
RealGiveFee
=
Math
.
Round
((
perfor
+
item
.
AdjustLaterOtherFee
+
item
.
NightWorkPerfor
)
??
0
,
0
,
MidpointRounding
.
AwayFromZero
);
}
}
return
result
;
}
/// <summary>
/// 获取一次次绩效结果
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
private
List
<
SecondPerforResponse
>
GetAllotPerformance
(
int
allotId
,
List
<
res_compute
>
computes
,
int
isShowManage
)
{
if
(
computes
==
null
||
!
computes
.
Any
())
return
new
List
<
SecondPerforResponse
>();
var
types1
=
new
List
<
string
>
{
AccountUnitType
.
护士长
.
ToString
(),
AccountUnitType
.
科主任
.
ToString
()
};
var
types2
=
new
List
<
string
>
{
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政高层
.
ToString
()
};
// 业务中层人员信息
var
empolyeeList
=
imemployeeclinicRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
computes
.
Select
(
t
=>
{
var
comp
=
new
SecondPerforResponse
()
{
AccountingUnit
=
t
.
AccountingUnit
,
EmployeeName
=
t
.
EmployeeName
,
JobNumber
=
t
.
JobNumber
,
JobTitle
=
t
.
JobTitle
,
UnitType
=
t
.
AccountType
,
Scale
=
t
.
Scale
,
Efficiency
=
t
.
Efficiency
,
Grant
=
t
.
Grant
,
Punishment
=
t
.
Punishment
,
ShouldGiveFee
=
t
.
ShouldGiveFee
,
PerforSumFee
=
t
.
PerforSumFee
,
GiveFee
=
t
.
GiveFee
*
t
.
Adjust
,
AdjustLaterOtherFee
=
t
.
AdjustLaterOtherFee
??
0
,
OthePerfor
=
t
.
OtherPerfor
,
RealGiveFee
=
t
.
RealGiveFee
};
if
(
types1
.
Contains
(
t
.
AccountType
))
comp
.
PerforManagementFee
=
((
t
.
Efficiency
+
t
.
Scale
)
*
t
.
Grant
+
t
.
OtherManagePerfor
)
*
t
.
Attendance
*
t
.
ScoreAverageRate
;
else
comp
.
PerforManagementFee
=
t
.
RealGiveFee
;
// 行政中层 行政高层 补充 夜班费
if
(
types2
.
Contains
(
t
.
AccountType
))
comp
.
NightWorkPerfor
=
t
.
NightWorkPerfor
;
// 获取科主任系数,解决共用科主任重复计算人均问题
var
basics
=
empolyeeList
?.
FirstOrDefault
(
w
=>
w
.
AccountingUnit
==
t
.
AccountingUnit
&&
w
.
DoctorName
==
t
.
EmployeeName
&&
w
.
PersonnelNumber
==
t
.
JobNumber
)?.
Basics
;
// 仅显示管理绩效
if
(
isShowManage
==
2
)
comp
.
PerforSumFee
=
0
;
else
comp
.
PerforSumFee
=
Math
.
Round
((
t
.
Avg
*
(
basics
??
1
))
+
t
.
ShouldGiveFee
+
t
.
AssessBeforeOtherFee
??
0
);
return
comp
;
}).
ToList
();
}
public
List
<
SecondPerforResponse
>
AddAprAmount
(
int
allotId
,
List
<
SecondPerforResponse
>
computes
)
{
if
(
computes
==
null
||
!
computes
.
Any
())
return
computes
;
var
list
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
);
if
(
list
==
null
||
!
list
.
Any
())
return
computes
;
foreach
(
var
item
in
computes
.
GroupBy
(
w
=>
new
{
w
.
AccountingUnit
,
w
.
JobNumber
}))
{
// 补充过一次就不在补充了
var
emp
=
computes
.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Key
.
AccountingUnit
&&
w
.
JobNumber
==
item
.
Key
.
JobNumber
)
.
OrderByDescending
(
w
=>
w
.
Source
).
FirstOrDefault
();
var
apramount
=
list
.
Where
(
t
=>
t
.
AccountingUnit
==
emp
.
AccountingUnit
&&
!
string
.
IsNullOrEmpty
(
t
.
PersonnelNumber
)
&&
emp
.
JobNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
());
emp
.
OthePerfor
=
apramount
?.
Sum
(
w
=>
w
.
Amount
)
??
0
;
}
return
Mapper
.
Map
<
List
<
SecondPerforResponse
>>(
data
)
;
return
computes
;
}
}
}
\ No newline at end of file
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