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
4c41cfe9
Commit
4c41cfe9
authored
Nov 19, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次绩效管理绩效
parent
86776b8d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
45 deletions
+139
-45
performance/Performance.Api/Startup.cs
+43
-26
performance/Performance.Services/ComputeService.cs
+8
-13
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+3
-1
performance/Performance.Services/SecondAllotService.cs
+85
-5
No files found.
performance/Performance.Api/Startup.cs
View file @
4c41cfe9
...
...
@@ -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.Services/ComputeService.cs
View file @
4c41cfe9
...
...
@@ -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 @
4c41cfe9
...
...
@@ -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 @
4c41cfe9
...
...
@@ -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
();
}
...
...
@@ -1721,9 +1730,11 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId)
if
(
user
==
null
)
throw
new
NotImplementedException
(
"人员ID无效"
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
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,78 @@ 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
=
computeService
.
AddAprAmount
(
allotId
,
data
);
return
Mapper
.
Map
<
List
<
SecondPerforResponse
>>(
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
Mapper
.
Map
<
List
<
SecondPerforResponse
>>(
computes
);
}
/// <summary>
/// 获取一次次绩效结果
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
private
List
<
ComputeResponse
>
GetAllotPerformance
(
int
allotId
,
List
<
res_compute
>
computes
,
int
isShowManage
)
{
if
(
computes
==
null
||
!
computes
.
Any
())
return
new
List
<
ComputeResponse
>();
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
ComputeResponse
(
"一次绩效"
,
t
.
AccountingUnit
,
t
.
EmployeeName
,
t
.
JobNumber
,
t
.
JobTitle
);
comp
.
UnitType
=
t
.
AccountType
;
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
);
comp
.
Punishment
=
t
.
Punishment
;
comp
.
ShouldGiveFee
=
t
.
ShouldGiveFee
;
comp
.
PerforSumFee
=
t
.
PerforSumFee
;
comp
.
GiveFee
=
t
.
GiveFee
*
t
.
Adjust
;
comp
.
AdjustLaterOtherFee
=
t
.
AdjustLaterOtherFee
??
0
;
comp
.
OthePerfor
=
t
.
OtherPerfor
;
comp
.
RealGiveFee
=
t
.
RealGiveFee
;
return
comp
;
}).
ToList
();
}
}
}
\ 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