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
6d1539c3
Commit
6d1539c3
authored
Apr 08, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增绩效医院是增加是否开放年资系数,修改copy方法。人员名单不上传是,根据年月倒序取最后一次的人员名单。对于绩效人员的增删改。
parent
6e63e344
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
314 additions
and
11 deletions
+314
-11
performance/Performance.Api/Controllers/EmployeeController.cs
+64
-0
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
+2
-0
performance/Performance.DtoModels/Request/EmployeeRequest.cs
+135
-0
performance/Performance.DtoModels/Request/HospitalRequest.cs
+6
-1
performance/Performance.EntityModels/Entity/per_againallot.cs
+9
-9
performance/Performance.EntityModels/Entity/sys_hospital.cs
+5
-0
performance/Performance.Services/AllotCompute/ImportDataService.cs
+19
-0
performance/Performance.Services/ConfigService.cs
+6
-0
performance/Performance.Services/EmployeeService.cs
+66
-0
performance/Performance.Services/HospitalService.cs
+1
-0
performance/Performance.Services/SheetSevice.cs
+1
-1
No files found.
performance/Performance.Api/Controllers/EmployeeController.cs
0 → 100644
View file @
6d1539c3
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
AutoMapper
;
using
FluentValidation.AspNetCore
;
using
Microsoft.AspNetCore.Mvc
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Services
;
namespace
Performance.Api.Controllers
{
[
Route
(
"api/[controller]"
)]
public
class
EmployeeController
:
Controller
{
private
EmployeeService
employeeService
;
public
EmployeeController
(
EmployeeService
employeeService
)
{
this
.
employeeService
=
employeeService
;
}
/// <summary>
/// 新增人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"insert"
)]
[
HttpPost
]
public
ApiResponse
Insert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
EmployeeRequest
request
)
{
var
employee
=
employeeService
.
Insert
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
}
/// <summary>
/// 修改人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"update"
)]
[
HttpPost
]
public
ApiResponse
Update
([
CustomizeValidator
(
RuleSet
=
"Update"
),
FromBody
]
EmployeeRequest
request
)
{
var
employee
=
employeeService
.
Update
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
}
/// <summary>
/// 删除人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"delete"
)]
[
HttpPost
]
public
ApiResponse
Delete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
EmployeeRequest
request
)
{
if
(!
employeeService
.
Delete
(
request
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
}
\ No newline at end of file
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
View file @
6d1539c3
...
...
@@ -70,6 +70,7 @@ public AutoMapperConfigs()
.
ForMember
(
dest
=>
dest
.
UnitType
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
UnitType
==
"医生组"
?
1
:
(
src
.
UnitType
==
"护理组"
?
2
:
0
)));
CreateMap
<
PerDataEmployee
,
im_employee
>();
CreateMap
<
im_employee
,
PerDataEmployee
>();
CreateMap
<
PerDataAccountBaisc
,
PerDataAccountDoctor
>()
.
ForMember
(
dest
=>
dest
.
AccountingUnit
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
AccountingUnit
))
...
...
@@ -126,6 +127,7 @@ public AutoMapperConfigs()
CreateMap
<
per_againallot
,
AgainAllotResponse
>();
CreateMap
<
res_compute
,
ComputeResponse
>();
CreateMap
<
EmployeeRequest
,
im_employee
>();
}
}
}
performance/Performance.DtoModels/Request/EmployeeRequest.cs
0 → 100644
View file @
6d1539c3
using
FluentValidation
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
EmployeeRequest
{
/// <summary>
///
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
AllotID
{
get
;
set
;
}
/// <summary>
/// sheet页id
/// </summary>
public
Nullable
<
int
>
SheetID
{
get
;
set
;
}
/// <summary>
/// 科室类别(例如 医技科室 临床科室 其他科室)
/// </summary>
public
string
AccountType
{
get
;
set
;
}
/// <summary>
/// 核算单元
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
/// <summary>
/// 科室名称
/// </summary>
public
string
Department
{
get
;
set
;
}
/// <summary>
/// 绩效基数核算参考对象
/// </summary>
public
string
FitPeople
{
get
;
set
;
}
/// <summary>
/// 医生姓名
/// </summary>
public
string
DoctorName
{
get
;
set
;
}
/// <summary>
/// 职称
/// </summary>
public
string
JobTitle
{
get
;
set
;
}
/// <summary>
/// 岗位系数
/// </summary>
public
Nullable
<
decimal
>
PostCoefficient
{
get
;
set
;
}
/// <summary>
/// 参加工作时间
/// </summary>
public
Nullable
<
DateTime
>
WorkTime
{
get
;
set
;
}
/// <summary>
/// 考核得分率
/// </summary>
public
Nullable
<
decimal
>
ScoreAverageRate
{
get
;
set
;
}
/// <summary>
/// 出勤率
/// </summary>
public
Nullable
<
decimal
>
Attendance
{
get
;
set
;
}
/// <summary>
/// 核算单元医生数
/// </summary>
public
Nullable
<
int
>
PeopleNumber
{
get
;
set
;
}
/// <summary>
/// 工作量绩效
/// </summary>
public
Nullable
<
decimal
>
Workload
{
get
;
set
;
}
/// <summary>
/// 其他绩效
/// </summary>
public
Nullable
<
decimal
>
OtherPerfor
{
get
;
set
;
}
/// <summary>
/// 医院奖罚
/// </summary>
public
Nullable
<
decimal
>
Punishment
{
get
;
set
;
}
/// <summary>
/// 调节系数
/// </summary>
public
Nullable
<
decimal
>
Adjust
{
get
;
set
;
}
/// <summary>
/// 发放系数
/// </summary>
public
Nullable
<
decimal
>
Grant
{
get
;
set
;
}
public
class
EmployeeRequestValidator
:
AbstractValidator
<
EmployeeRequest
>
{
public
EmployeeRequestValidator
()
{
Action
action
=
()
=>
{
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
SheetID
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
AccountingUnit
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
DoctorName
).
NotNull
().
NotEmpty
();
};
RuleSet
(
"Insert"
,
()
=>
{
action
();
});
RuleSet
(
"Update"
,
()
=>
{
action
();
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Delete"
,
()
=>
{
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
GreaterThan
(
0
);
});
}
}
}
}
performance/Performance.DtoModels/Request/HospitalRequest.cs
View file @
6d1539c3
...
...
@@ -32,9 +32,13 @@ public class HospitalRequest : ApiRequest
/// </summary>
public
string
HosType
{
get
;
set
;
}
/// <summary>
///
///
医院状态 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
States
{
get
;
set
;
}
/// <summary>
/// 是否开启年资系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenWorkYear
{
get
;
set
;
}
}
public
class
HospitalRequestValidator
:
AbstractValidator
<
HospitalRequest
>
...
...
@@ -47,6 +51,7 @@ public HospitalRequestValidator()
RuleFor
(
x
=>
x
.
AreaCode
).
NotNull
().
NotEmpty
().
Length
(
1
,
50
);
RuleFor
(
x
=>
x
.
HosLevel
).
NotNull
().
NotEmpty
().
Length
(
1
,
50
);
RuleFor
(
x
=>
x
.
HosType
).
NotNull
().
NotEmpty
().
Length
(
1
,
50
);
RuleFor
(
x
=>
x
.
IsOpenWorkYear
).
NotNull
().
InclusiveBetween
(
1
,
2
);
};
RuleSet
(
"Insert"
,
()
=>
...
...
performance/Performance.EntityModels/Entity/per_againallot.cs
View file @
6d1539c3
...
...
@@ -7,35 +7,35 @@
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
namespace
Performance.EntityModels
{
/// <summary>
///
/// </summary>
[
Table
(
"per_againallot"
)]
public
class
per_againallot
public
class
per_againallot
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
ID
{
get
;
set
;
}
public
int
ID
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
AllotID
{
get
;
set
;
}
/// <summary>
/// 用户ID
/// </summary>
public
Nullable
<
int
>
CreateUser
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
Nullable
<
DateTime
>
CreateDateTime
{
get
;
set
;
}
/// <summary>
/// 上传时间
/// </summary>
...
...
@@ -45,12 +45,12 @@ public class per_againallot
/// 科室名称
/// </summary>
public
string
Department
{
get
;
set
;
}
/// <summary>
/// 文件路径
/// </summary>
public
string
Path
{
get
;
set
;
}
/// <summary>
/// 二次分配状态 0 数据未上传 1 数据已上传 2 正在生成绩效 3 绩效生成成功 4 绩效生成失败 5 归档
/// </summary>
...
...
performance/Performance.EntityModels/Entity/sys_hospital.cs
View file @
6d1539c3
...
...
@@ -60,5 +60,10 @@ public class sys_hospital
/// 医院状态 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
States
{
get
;
set
;
}
/// <summary>
/// 是否开启年资系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenWorkYear
{
get
;
set
;
}
}
}
performance/Performance.Services/AllotCompute/ImportDataService.cs
View file @
6d1539c3
...
...
@@ -21,6 +21,7 @@ public class ImportDataService : IAutoInjection
{
private
PerSheetService
perSheetService
;
private
PerforPersheetRepository
perforPerSheetRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
private
PerforImdataRepository
perforImDataRepository
;
private
PerforImheaderRepository
perforImHeaderRepository
;
private
PerforImemployeeRepository
perforImEmployeeRepository
;
...
...
@@ -29,6 +30,7 @@ public class ImportDataService : IAutoInjection
private
PerforLogdbugRepository
logdbug
;
public
ImportDataService
(
PerSheetService
perSheetService
,
PerforPersheetRepository
perforPerSheetRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforImdataRepository
perforImDataRepository
,
PerforImheaderRepository
perforImHeaderRepository
,
PerforImemployeeRepository
perforImEmployeeRepository
,
...
...
@@ -38,6 +40,7 @@ public class ImportDataService : IAutoInjection
{
this
.
perSheetService
=
perSheetService
;
this
.
perforPerSheetRepository
=
perforPerSheetRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforImDataRepository
=
perforImDataRepository
;
this
.
perforImHeaderRepository
=
perforImHeaderRepository
;
this
.
perforImEmployeeRepository
=
perforImEmployeeRepository
;
...
...
@@ -105,6 +108,22 @@ private void SaveEmployee(PerSheet sheet, int allotId)
var
imsheet
=
new
per_sheet
{
AllotID
=
allotId
,
SheetName
=
sheet
.
SheetName
,
Source
=
1
,
SheetType
=
(
int
)
sheet
.
SheetType
};
perforPerSheetRepository
.
Add
(
imsheet
);
var
dataList
=
sheet
.
PerData
.
Select
(
t
=>
(
PerDataEmployee
)
t
);
//新上传名单中无人员名单,取到最后日期的数据
if
(
dataList
==
null
||
dataList
.
Count
()
<=
0
)
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
allotList
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
)
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
);
foreach
(
var
item
in
allotList
)
{
var
employeeList
=
perforImEmployeeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
item
.
ID
);
if
(
employeeList
!=
null
&&
employeeList
.
Count
>
0
)
{
dataList
=
Mapper
.
Map
<
List
<
PerDataEmployee
>>(
employeeList
);
break
;
}
}
}
List
<
im_employee
>
addList
=
new
List
<
im_employee
>();
foreach
(
var
data
in
dataList
)
{
...
...
performance/Performance.Services/ConfigService.cs
View file @
6d1539c3
...
...
@@ -19,6 +19,7 @@ public class ConfigService : IAutoInjection
private
PerforCofagainRepository
_againRepository
;
private
PerforPerallotRepository
perforPerAllotRepository
;
private
PerforPeragainallotRepository
perforPeragainallotRepository
;
private
PerforHospitalRepository
perforHospitalRepository
;
private
PerforLogdbugRepository
logdbug
;
public
ConfigService
(
PerforCofdirectorRepository
cofdirectorRepository
,
PerforCofdrugpropRepository
cofdrugpropRepository
,
...
...
@@ -27,6 +28,7 @@ public class ConfigService : IAutoInjection
PerforCofagainRepository
againRepository
,
PerforPerallotRepository
perforPerAllotRepository
,
PerforPeragainallotRepository
perforPeragainallotRepository
,
PerforHospitalRepository
perforHospitalRepository
,
PerforLogdbugRepository
logdbug
)
{
this
.
_directorRepository
=
cofdirectorRepository
;
...
...
@@ -36,6 +38,7 @@ public class ConfigService : IAutoInjection
this
.
_againRepository
=
againRepository
;
this
.
perforPerAllotRepository
=
perforPerAllotRepository
;
this
.
perforPeragainallotRepository
=
perforPeragainallotRepository
;
this
.
perforHospitalRepository
=
perforHospitalRepository
;
this
.
logdbug
=
logdbug
;
}
...
...
@@ -329,6 +332,9 @@ public void Copy(per_allot allot)
{
var
workyear
=
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
if
(
hospital
!=
null
&&
hospital
?.
IsOpenWorkYear
==
2
)
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
1
});
_workyearRepository
.
AddRange
(
newWorkyears
.
ToArray
());
}
}
...
...
performance/Performance.Services/EmployeeService.cs
0 → 100644
View file @
6d1539c3
using
AutoMapper
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Logging
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
Performance.Services.AllotCompute
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
namespace
Performance.Services
{
public
class
EmployeeService
:
IAutoInjection
{
private
PerforImemployeeRepository
perforImemployeeRepository
;
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
)
{
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
}
/// <summary>
/// 新增人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
im_employee
Insert
(
EmployeeRequest
request
)
{
var
employee
=
Mapper
.
Map
<
im_employee
>(
request
);
perforImemployeeRepository
.
Add
(
employee
);
return
employee
;
}
/// <summary>
/// 修改人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
im_employee
Update
(
EmployeeRequest
request
)
{
var
employee
=
perforImemployeeRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ID
);
if
(
employee
==
null
)
throw
new
PerformanceException
(
"该人员不存在"
);
employee
.
AccountingUnit
=
request
.
AccountingUnit
;
employee
.
Department
=
request
.
Department
??
employee
.
Department
;
employee
.
FitPeople
=
request
.
FitPeople
??
employee
.
FitPeople
;
employee
.
DoctorName
=
request
.
DoctorName
;
employee
.
JobTitle
=
request
.
JobTitle
??
employee
.
JobTitle
;
perforImemployeeRepository
.
Update
(
employee
);
return
employee
;
}
/// <summary>
/// 删除人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
bool
Delete
(
EmployeeRequest
request
)
{
var
employee
=
Mapper
.
Map
<
im_employee
>(
request
);
return
perforImemployeeRepository
.
Remove
(
employee
);
}
}
}
performance/Performance.Services/HospitalService.cs
View file @
6d1539c3
...
...
@@ -98,6 +98,7 @@ public HospitalResponse Update(HospitalRequest request)
hospital
.
HosType
=
request
.
HosType
;
hospital
.
AreaCode
=
request
.
AreaCode
;
hospital
.
States
=
request
.
States
;
hospital
.
IsOpenWorkYear
=
request
.
IsOpenWorkYear
;
if
(!
_hospitalRepository
.
Update
(
hospital
))
throw
new
PerformanceException
(
"保存失败"
);
...
...
performance/Performance.Services/SheetSevice.cs
View file @
6d1539c3
...
...
@@ -188,7 +188,7 @@ private void CommonExport(int sheetID, SheetExportResponse response)
factorhead
.
Data
.
Add
(
new
Cell
(
0
,
"护理组分割比例:"
,
1
,
3
,
false
,
false
));
response
=
AddFactor
(
response
,
factorhead
,
headList
.
ToList
(),
dataList
,
"护理组"
);
var
factorhead1
=
new
Row
(
response
.
Header
.
Count
());
factorhead1
.
Data
.
Add
(
new
Cell
(
0
,
"医生组分割比例:
:
"
,
1
,
3
,
false
,
false
));
factorhead1
.
Data
.
Add
(
new
Cell
(
0
,
"医生组分割比例:"
,
1
,
3
,
false
,
false
));
response
=
AddFactor
(
response
,
factorhead1
,
headList
.
ToList
(),
dataList
,
"医生组"
);
}
...
...
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