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
09296727
Commit
09296727
authored
Mar 28, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/reconsitution' into develop
parents
ec770743
e44c5a68
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
21 deletions
+84
-21
performance/Performance.Api/Startup.cs
+42
-14
performance/Performance.DtoModels/PerExcel/ComputeResult.cs
+5
-2
performance/Performance.Services/AllotCompute/CheckDataService.cs
+12
-0
performance/Performance.Services/AllotCompute/ImportDataService.cs
+3
-0
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+13
-0
performance/Performance.Services/AllotCompute/ResultComputeService.cs
+3
-0
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
+6
-5
No files found.
performance/Performance.Api/Startup.cs
View file @
09296727
...
...
@@ -48,6 +48,18 @@ public Startup(IConfiguration configuration)
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"
));
#
endregion
var
connection
=
services
.
BuildServiceProvider
().
GetService
<
IOptions
<
AppConnection
>>();
#
region
json
&
fluentvalidation
&
filter
services
//筛选器配置
.
AddMvc
(
option
=>
...
...
@@ -81,32 +93,37 @@ public void ConfigureServices(IServiceCollection services)
fv
.
RegisterValidatorsFromAssemblyContaining
(
type
.
GetType
());
}
});
#
endregion
//automapper 配置
#
region
automapper
Mapper
.
Initialize
(
cfg
=>
cfg
.
AddProfile
<
AutoMapperConfigs
>());
services
.
AddAutoMapper
();
#
endregion
//
service注入 repoitory注入
#
region
service
注入
repoitory
注入
services
.
AddPerformanceService
()
.
AddPerformanceRepoitory
();
#
endregion
//appsetting注入
services
.
Configure
<
AppConnection
>(
Configuration
.
GetSection
(
"AppConnection"
))
.
Configure
<
Application
>(
Configuration
.
GetSection
(
"Application"
))
.
Configure
<
HuyiSmsConfig
>(
Configuration
.
GetSection
(
"HuyiSmsConfig"
))
.
Configure
<
EmailOptions
>(
Configuration
.
GetSection
(
"EmailOptions"
));
#
region
swagger
//services.AddSwaggerGen(c =>
//{
// c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });
//});
//});
#
endregion
#
region
custom
util
//huyi短信发送注入
services
.
AddScoped
<
HuyiSmsNotify
>();
//用户身份信息服务
services
.
AddScoped
<
ClaimService
>();
#
endregion
#
region
email
//阿里邮箱配置
var
emailOption
=
services
.
BuildServiceProvider
().
GetService
<
IOptions
<
EmailOptions
>>();
//邮件发送
...
...
@@ -117,24 +134,27 @@ public void ConfigureServices(IServiceCollection services)
options
.
SmtpServer
=
emailOption
.
Value
.
SmtpServer
;
});
//ef配置
var
connection
=
services
.
BuildServiceProvider
().
GetService
<
IOptions
<
AppConnection
>>();
#
endregion
//
redis
#
region
redis
var
csredis
=
new
CSRedis
.
CSRedisClient
(
connection
.
Value
.
RedisConnectionString
);
RedisHelper
.
Initialization
(
csredis
);
#
endregion
//后台任务调度
#
region
hangfire
services
.
AddHangfire
(
config
=>
{
config
.
UseFilter
(
new
AutomaticRetryAttribute
{
Attempts
=
0
});
config
.
UseStorage
(
new
MySqlStorage
(
connection
.
Value
.
HangfireConnectionString
));
});
#
endregion
#
region
//ef配置
services
.
AddDbContext
<
PerformanceDbContext
>(
options
=>
{
options
.
UseMySQL
(
connection
.
Value
.
PerformanceConnectionString
);
});
#
endregion
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
...
...
@@ -160,13 +180,20 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
// c.RoutePrefix = string.Empty;
//});
#
region
hangfire
app
.
UseHangfireServer
();
app
.
UseHangfireDashboard
(
"/hangfire"
,
new
DashboardOptions
{
Authorization
=
new
[]
{
new
HangfireAuthorizationFilter
()
}
});
#
endregion
loggerFactory
.
CreateLogger
<
Startup
>().
LogDebug
(
env
.
EnvironmentName
);
app
.
UseMvc
();
}
}
#
region
hangfire
权限
public
class
HangfireAuthorizationFilter
:
Hangfire
.
Dashboard
.
IDashboardAuthorizationFilter
{
//这里需要配置权限规则
...
...
@@ -175,4 +202,5 @@ public bool Authorize(Hangfire.Dashboard.DashboardContext context)
return
true
;
}
}
#
endregion
}
performance/Performance.DtoModels/PerExcel/ComputeResult.cs
View file @
09296727
...
...
@@ -91,7 +91,7 @@ public class ComputeResult
public
Nullable
<
decimal
>
OtherPerfor
{
get
;
set
;
}
/// <summary>
///
实
发绩效(需计算)
///
应
发绩效(需计算)
/// </summary>
public
Nullable
<
decimal
>
GiveFee
{
get
;
set
;
}
...
...
@@ -109,6 +109,9 @@ public class ComputeResult
/// 年资系数(来自人员名单)
/// </summary>
public
Nullable
<
decimal
>
WorkYear
{
get
;
set
;
}
/// <summary>
/// 实发绩效
/// </summary>
public
decimal
?
RealGiveFee
{
get
;
set
;
}
}
}
performance/Performance.Services/AllotCompute/CheckDataService.cs
View file @
09296727
...
...
@@ -10,7 +10,19 @@ public class CheckDataService : IAutoInjection
{
internal
bool
Check
(
PerExcel
excel
,
per_allot
allot
)
{
//sheet页名称分类
//空行数据警告
//科室收入项 总费用相等 校验
//匹配绩效参考标准
return
true
;
}
}
}
performance/Performance.Services/AllotCompute/ImportDataService.cs
View file @
09296727
...
...
@@ -14,6 +14,9 @@
namespace
Performance.Services.AllotCompute
{
/// <summary>
/// 导入excel数据并保持
/// </summary>
public
class
ImportDataService
:
IAutoInjection
{
private
PerSheetService
perSheetService
;
...
...
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
09296727
...
...
@@ -9,6 +9,9 @@
namespace
Performance.Services.AllotCompute
{
/// <summary>
/// 对excel导入数据进行合并、计算 并保存
/// </summary>
public
class
ProcessComputService
:
IAutoInjection
{
private
PerforCofincomeRepository
perforCofincomeRepository
;
...
...
@@ -38,6 +41,12 @@ public class ProcessComputService : IAutoInjection
this
.
perforResAccountnurseRepository
=
perforResAccountnurseRepository
;
}
/// <summary>
/// 合并计算并保存
/// </summary>
/// <param name="excel"></param>
/// <param name="allot"></param>
/// <returns></returns>
public
List
<
PerSheet
>
MergeAndSave
(
PerExcel
excel
,
per_allot
allot
)
{
List
<
PerSheet
>
list
=
MergeCompute
(
excel
);
...
...
@@ -45,6 +54,7 @@ public List<PerSheet> MergeAndSave(PerExcel excel, per_allot allot)
return
list
;
}
#
region
save
/// <summary>
/// 保存计算后的医生组绩效
/// </summary>
...
...
@@ -159,7 +169,9 @@ private void Save(List<PerSheet> perSheets, int allotId)
}
}
}
#
endregion
#
region
compute
/// <summary>
/// 合并计算
/// </summary>
...
...
@@ -263,5 +275,6 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel)
}
return
cofs
;
}
#
endregion
}
}
performance/Performance.Services/AllotCompute/ResultComputeService.cs
View file @
09296727
...
...
@@ -10,6 +10,9 @@
namespace
Performance.Services.AllotCompute
{
/// <summary>
/// 最终绩效计算
/// </summary>
public
class
ResultComputeService
:
IAutoInjection
{
private
ComputeDirector
computeDirector
;
...
...
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
View file @
09296727
...
...
@@ -57,11 +57,12 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp
Efficiency
=
efficiency
?.
Value
*
resAccount
?.
Avg
,
Scale
=
scale
?.
Value
*
resAccount
?.
PerforTotal
,
Grant
=
item
.
Grant
,
ShouldGiveFee
=
(
efficiency
?.
Value
*
resAccount
?.
Avg
+
scale
?.
Value
*
resAccount
?.
PerforTotal
)
*
item
.
Grant
,
ScoreAverageRate
=
item
.
ScoreAverageRate
,
Punishment
=
item
.
Punishment
,
OtherPerfor
=
item
.
OtherPerfor
};
//应发管理绩效
compute
.
ShouldGiveFee
=
(
efficiency
?.
Value
*
resAccount
?.
Avg
+
scale
?.
Value
*
resAccount
?.
PerforTotal
)
*
item
.
Grant
;
//绩效合计
var
perforSumFee
=
(
compute
.
Avg
+
compute
.
Efficiency
+
compute
.
Scale
)
*
item
.
Grant
;
if
(
perforSumFee
>
(
compute
.
Avg
??
0
)
*
2.5
m
)
...
...
@@ -70,6 +71,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp
compute
.
PerforSumFee
=
perforSumFee
;
//应发绩效
compute
.
GiveFee
=
compute
.
Avg
*
item
.
Grant
+
(
compute
.
Efficiency
+
compute
.
Scale
)
*
item
.
Grant
*
compute
.
ScoreAverageRate
+
(
item
.
Punishment
??
0
)
+
(
item
.
OtherPerfor
??
0
);
//实发绩效
compute
.
RealGiveFee
=
compute
.
GiveFee
*
item
.
Adjust
-
compute
.
ShouldGiveFee
*
item
.
ScoreAverageRate
*
item
.
Grant
*
0.1
m
;
computeList
.
Add
(
compute
);
}
...
...
@@ -153,18 +156,16 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<res_
Punishment
=
item
.
Punishment
,
OtherPerfor
=
item
.
OtherPerfor
};
//绩效合计
compute
.
ShouldGiveFee
=
baiscnorm
*
compute
.
PostCoefficient
*
compute
.
Attendance
*
compute
.
ScoreAverageRate
+
(
compute
.
OtherPerfor
??
0
)
+
(
item
.
Workload
??
0
)
+
(
compute
.
Punishment
??
0
);
//年资系数
if
(
yearTypes
.
Contains
(
type
)
&&
item
.
WorkTime
.
HasValue
&&
item
.
WorkTime
.
Value
>
new
DateTime
(
1970
,
1
,
1
))
{
var
years
=
((
DateTime
.
Now
.
Year
-
item
.
WorkTime
.
Value
.
Year
)
*
12
+
(
DateTime
.
Now
.
Month
-
item
.
WorkTime
.
Value
.
Month
))
/
12.0
m
;
var
value
=
workyearList
.
FirstOrDefault
(
t
=>
t
.
MinRange
<
years
&&
years
<=
t
.
MaxRange
)?.
Value
;
compute
.
WorkYear
=
value
;
compute
.
ShouldGiveFee
=
compute
.
ShouldGiveFee
*
(
value
??
1
);
}
compute
.
GiveFee
=
baiscnorm
*
compute
.
PostCoefficient
*
compute
.
Attendance
*
compute
.
ScoreAverageRate
*
(
compute
.
WorkYear
??
1
)
+
(
compute
.
OtherPerfor
??
0
)
+
(
item
.
Workload
??
0
)
+
(
compute
.
Punishment
??
0
);
//应发绩效
compute
.
GiveFee
=
compute
.
Should
GiveFee
*
item
.
Adjust
*
item
.
Grant
;
compute
.
RealGiveFee
=
compute
.
GiveFee
*
item
.
Adjust
*
item
.
Grant
;
computeList
.
Add
(
compute
);
}
}
...
...
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