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
8b9aafc9
Commit
8b9aafc9
authored
Aug 19, 2021
by
钟博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/个人账号登陆查询绩效' into develop
parents
86dd9971
c9b2aff2
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
393 additions
and
14 deletions
+393
-14
performance/Performance.Api/Controllers/AccountController.cs
+2
-2
performance/Performance.Api/Controllers/AllotController.cs
+13
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+7
-1
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+25
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+40
-0
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
+3
-0
performance/Performance.DtoModels/Enum.cs
+16
-0
performance/Performance.DtoModels/Response/HospitalRequest.cs
+5
-0
performance/Performance.DtoModels/Response/OwnerPerformanceDto.cs
+27
-0
performance/Performance.DtoModels/Response/PerEmployeeResponse.cs
+5
-0
performance/Performance.DtoModels/SaveCollectData.cs
+2
-1
performance/Performance.EntityModels/Entity/sys_hospital.cs
+5
-0
performance/Performance.EntityModels/Other/view_allot_result.cs
+46
-0
performance/Performance.Repository/PerforReportRepository .cs
+7
-0
performance/Performance.Services/AllotService.cs
+78
-0
performance/Performance.Services/PersonService.cs
+86
-9
performance/Performance.Services/UserService.cs
+26
-1
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
8b9aafc9
...
...
@@ -147,9 +147,9 @@ public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self"
/// <returns></returns>
[
Route
(
"list"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
UserResponse
>>
List
()
public
ApiResponse
<
List
<
UserResponse
>>
List
(
[
FromBody
]
UserRequest
request
)
{
var
userList
=
_userService
.
GetUserList
(
_claim
.
GetUserId
());
var
userList
=
_userService
.
GetUserList
(
_claim
.
GetUserId
()
,
request
.
Role
);
return
new
ApiResponse
<
List
<
UserResponse
>>(
ResponseType
.
OK
,
"ok"
,
userList
);
}
...
...
performance/Performance.Api/Controllers/AllotController.cs
View file @
8b9aafc9
...
...
@@ -493,5 +493,18 @@ public IActionResult DownloadCurrentCalculationTable(int allotid)
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
/// <summary>
/// 查询个人绩效
/// </summary>
/// <returns></returns>
[
Route
(
"owner/query"
)]
[
HttpGet
]
public
ApiResponse
GetOwnerPerformance
()
{
var
userid
=
_claim
.
GetUserId
();
var
res
=
_allotService
.
GetOwnerPerformance
(
userid
);
return
new
ApiResponse
(
ResponseType
.
OK
,
res
);
}
}
}
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
8b9aafc9
...
...
@@ -43,7 +43,7 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AccountController.List"
>
<member
name=
"M:Performance.Api.Controllers.AccountController.List
(Performance.DtoModels.UserRequest)
"
>
<summary>
用户列表
</summary>
...
...
@@ -308,6 +308,12 @@
<param
name=
"allotid"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.GetOwnerPerformance"
>
<summary>
查询个人绩效
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)"
>
<summary>
预算管理查询(包含金额、占比)
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
8b9aafc9
...
...
@@ -3434,6 +3434,11 @@
行政后勤是否显示管理绩效按钮 1 是 2 否
</summary>
</member>
<member
name=
"P:Performance.DtoModels.HospitalResponse.IsOwnerQuery"
>
<summary>
是否开启个人绩效查询账号创建 1 是 2 否
</summary>
</member>
<member
name=
"P:Performance.DtoModels.IncomeResponse.SheetNameKeyword"
>
<summary>
关键字匹配
...
...
@@ -3474,6 +3479,26 @@
菜单状态 1 启用 2禁用
</summary>
</member>
<member
name=
"P:Performance.DtoModels.OwnerPerformanceDto.ShouldGiveFee"
>
<summary>
应发绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.OwnerPerformanceDto.ReservedRatio"
>
<summary>
预留比例
</summary>
</member>
<member
name=
"P:Performance.DtoModels.OwnerPerformanceDto.ReservedRatioFee"
>
<summary>
预留金额
</summary>
</member>
<member
name=
"P:Performance.DtoModels.OwnerPerformanceDto.RealGiveFee"
>
<summary>
实发绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerEmployeeResponse.WorkTime"
>
<summary>
参加工作时间
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
8b9aafc9
...
...
@@ -6897,6 +6897,11 @@
行政后勤是否显示管理绩效按钮 1 是 2 否
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_hospital.IsOwnerQuery"
>
<summary>
是否开启个人绩效查询账号创建 1 是 2 否
</summary>
</member>
<member
name=
"T:Performance.EntityModels.sys_hospitalconfig"
>
<summary>
...
...
@@ -7407,5 +7412,40 @@
统计的HIS的原始科室名称
</summary>
</member>
<member
name=
"P:Performance.DtoModels.view_allot_result.Source"
>
<summary>
来源
</summary>
</member>
<member
name=
"P:Performance.DtoModels.view_allot_result.PerforSumFee"
>
<summary>
业绩绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.view_allot_result.PerforManagementFee"
>
<summary>
管理绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.view_allot_result.NightWorkPerfor"
>
<summary>
夜班绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.view_allot_result.AdjustLaterOtherFee"
>
<summary>
调节后其他绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.view_allot_result.OtherPerfor"
>
<summary>
医院其他绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.view_allot_result.HideOtherPerfor"
>
<summary>
不公示其他绩效
</summary>
</member>
</members>
</doc>
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
View file @
8b9aafc9
...
...
@@ -244,6 +244,9 @@ public AutoMapperConfigs()
CreateMap
<
ag_headsource
,
SecPrintHeaderResponse
>()
.
ForMember
(
dest
=>
dest
.
TheTotalAllocationOfPerformanceResults
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
TotalDeptReward
))
.
ReverseMap
();
CreateMap
<
view_allot_result
,
OwnerPerformanceDto
>()
.
ReverseMap
();
}
}
}
performance/Performance.DtoModels/Enum.cs
View file @
8b9aafc9
...
...
@@ -114,4 +114,20 @@ public enum DataFormat
/// <summary> 日期 </summary>
日期
}
public
enum
Role
{
绩效管理员
=
1
,
医院管理员
=
2
,
护士长
=
3
,
科主任
=
4
,
绩效核算办
=
5
,
院领导
=
6
,
财务科
=
7
,
人事科
=
8
,
特殊科室
=
9
,
行政科室
=
10
,
数据收集
=
11
,
绩效查询
=
12
,
}
}
performance/Performance.DtoModels/Response/HospitalRequest.cs
View file @
8b9aafc9
...
...
@@ -37,5 +37,10 @@ public class HospitalResponse
/// 行政后勤是否显示管理绩效按钮 1 是 2 否
/// </summary>
public
Nullable
<
int
>
IsShowManageButton
{
get
;
set
;
}
/// <summary>
/// 是否开启个人绩效查询账号创建 1 是 2 否
/// </summary>
public
Nullable
<
int
>
IsOwnerQuery
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/Response/OwnerPerformanceDto.cs
0 → 100644
View file @
8b9aafc9
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
OwnerPerformanceDto
:
view_allot_result
{
public
IEnumerable
<
OwnerPerformanceDto
>
Detail
{
get
;
set
;
}
/// <summary>
/// 应发绩效
/// </summary>
public
decimal
?
ShouldGiveFee
{
get
;
set
;
}
/// <summary>
/// 预留比例
/// </summary>
public
decimal
?
ReservedRatio
{
get
;
set
;
}
/// <summary>
/// 预留金额
/// </summary>
public
decimal
?
ReservedRatioFee
{
get
;
set
;
}
/// <summary>
/// 实发绩效
/// </summary>
public
decimal
RealGiveFee
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/Response/PerEmployeeResponse.cs
View file @
8b9aafc9
...
...
@@ -18,4 +18,9 @@ public class PerEmployeeResponse : per_employee
/// </summary>
public
new
string
BirthDate
{
get
;
set
;
}
}
public
class
PersonePassword
:
per_employee
{
public
string
Password
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/SaveCollectData.cs
View file @
8b9aafc9
...
...
@@ -9,6 +9,7 @@ public class SaveCollectData
{
public
int
SheetType
{
get
;
set
;
}
public
string
SheetName
{
get
;
set
;
}
public
int
?
CreateUser
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
}
...
...
@@ -18,7 +19,7 @@ public class UserCollectData
public
int
HospitalId
{
get
;
set
;
}
public
int
?
CreateUser
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
public
new
string
[][]
Data
{
get
;
set
;
}
}
...
...
performance/Performance.EntityModels/Entity/sys_hospital.cs
View file @
8b9aafc9
...
...
@@ -120,5 +120,10 @@ public class sys_hospital
/// 行政后勤是否显示管理绩效按钮 1 是 2 否
/// </summary>
public
Nullable
<
int
>
IsShowManageButton
{
get
;
set
;
}
/// <summary>
/// 是否开启个人绩效查询账号创建 1 是 2 否
/// </summary>
public
Nullable
<
int
>
IsOwnerQuery
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Other/view_allot_result.cs
0 → 100644
View file @
8b9aafc9
namespace
Performance.DtoModels
{
public
class
view_allot_result
{
public
int
HospitalID
{
get
;
set
;
}
public
int
Year
{
get
;
set
;
}
public
int
Month
{
get
;
set
;
}
/// <summary>
/// 来源
/// </summary>
public
string
Source
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
public
int
?
SecondId
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
int
?
IsShowManage
{
get
;
set
;
}
public
string
EmployeeName
{
get
;
set
;
}
public
string
JobNumber
{
get
;
set
;
}
public
string
JobTitle
{
get
;
set
;
}
/// <summary>
/// 业绩绩效
/// </summary>
public
decimal
?
PerforSumFee
{
get
;
set
;
}
/// <summary>
/// 管理绩效
/// </summary>
public
decimal
?
PerforManagementFee
{
get
;
set
;
}
/// <summary>
/// 夜班绩效
/// </summary>
public
decimal
?
NightWorkPerfor
{
get
;
set
;
}
/// <summary>
/// 调节后其他绩效
/// </summary>
public
decimal
?
AdjustLaterOtherFee
{
get
;
set
;
}
/// <summary>
/// 医院其他绩效
/// </summary>
public
decimal
?
OtherPerfor
{
get
;
set
;
}
/// <summary>
/// 不公示其他绩效
/// </summary>
public
decimal
?
HideOtherPerfor
{
get
;
set
;
}
public
decimal
?
RealPerformance
{
get
;
set
;
}
}
}
performance/Performance.Repository/PerforReportRepository .cs
View file @
8b9aafc9
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -382,5 +383,11 @@ public List<EmployeeReservedDto> GetEmployeeReserved(int hospitalId, int year)
string
sql
=
"SELECT * FROM view_allot_result_report WHERE HospitalID=@HospitalID AND Year=@Year"
;
return
DapperQuery
<
EmployeeReservedDto
>(
sql
,
new
{
HospitalID
=
hospitalId
,
Year
=
year
})?.
ToList
();
}
public
List
<
view_allot_result
>
GetOwnerPerformance
(
List
<
int
>
hospitalId
,
string
jobNumber
)
{
string
sql
=
"SELECT * FROM view_allot_result WHERE HospitalID IN @HospitalID AND JobNumber=@JobNumber"
;
return
DapperQuery
<
view_allot_result
>(
sql
,
new
{
HospitalID
=
hospitalId
,
JobNumber
=
jobNumber
})?.
ToList
();
}
}
}
performance/Performance.Services/AllotService.cs
View file @
8b9aafc9
...
...
@@ -44,6 +44,7 @@ public class AllotService : IAutoInjection
private
readonly
UserService
userService
;
private
PerforCofdirectorRepository
perforCofdirectorRepository
;
private
readonly
PerforReportRepository
_reportRepository
;
private
readonly
PerforPeremployeeRepository
_perforPeremployeeRepository
;
//private readonly IHubContext<AllotLogHub> hubContext;
private
readonly
LogManageService
logManageService
;
...
...
@@ -78,6 +79,7 @@ public class AllotService : IAutoInjection
ReportService
reportService
,
PerforCofdirectorRepository
perforCofdirectorRepository
,
PerforReportRepository
reportRepository
,
PerforPeremployeeRepository
perforPeremployeeRepository
,
QueryDataService
queryDataService
)
{
_allotRepository
=
allotRepository
;
...
...
@@ -107,6 +109,7 @@ public class AllotService : IAutoInjection
this
.
reportService
=
reportService
;
this
.
perforCofdirectorRepository
=
perforCofdirectorRepository
;
_reportRepository
=
reportRepository
;
_perforPeremployeeRepository
=
perforPeremployeeRepository
;
this
.
queryDataService
=
queryDataService
;
}
...
...
@@ -659,5 +662,80 @@ public List<EmployeeReservedDto> GetReserved(int hospitalId, int year, int useri
return
reserveds
;
}
/// <summary>
/// 查询个人绩效
/// </summary>
/// <param name="userid"></param>
/// <returns></returns>
public
List
<
OwnerPerformanceDto
>
GetOwnerPerformance
(
int
userid
)
{
var
user
=
userService
.
GetUser
(
userid
);
if
(
user
==
null
)
throw
new
PerformanceException
(
"用户信息错误"
);
var
roleType
=
roleService
.
GetUserRole
(
userid
)?.
FirstOrDefault
()?.
Type
;
if
(!
roleType
.
HasValue
)
throw
new
PerformanceException
(
"用户信息错误"
);
if
(
roleType
!=
(
int
)
Role
.
绩效查询
)
throw
new
PerformanceException
(
"当前用户暂不支持绩效查询"
);
var
hospitals
=
userService
.
GetUserHospital
(
userid
);
string
jobNumber
=
user
.
Login
;
var
owner
=
_reportRepository
.
GetOwnerPerformance
(
hospitals
,
jobNumber
);
if
(
owner
==
null
||
!
owner
.
Any
())
return
new
List
<
OwnerPerformanceDto
>();
var
employees
=
_perforPeremployeeRepository
.
GetEntities
(
w
=>
w
.
PersonnelNumber
==
jobNumber
);
var
res
=
owner
.
GroupBy
(
w
=>
new
{
w
.
AllotId
,
w
.
Year
,
w
.
Month
,
w
.
JobNumber
})
.
Select
(
w
=>
new
OwnerPerformanceDto
{
AllotId
=
w
.
Key
.
AllotId
,
Year
=
w
.
Key
.
Year
,
Month
=
w
.
Key
.
Month
,
JobNumber
=
w
.
Key
.
JobNumber
,
PerforSumFee
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
PerforSumFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 业绩绩效
PerforManagementFee
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
PerforManagementFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 管理绩效
NightWorkPerfor
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
NightWorkPerfor
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 夜班绩效
AdjustLaterOtherFee
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
AdjustLaterOtherFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 调节后其他绩效
OtherPerfor
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
OtherPerfor
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 医院其他绩效
HideOtherPerfor
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
HideOtherPerfor
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 不公示其他绩效
RealPerformance
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
RealPerformance
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 中转使用: 业绩绩效+管理绩效+调节后其他绩效
Detail
=
w
.
Where
(
p
=>
p
.
Year
==
w
.
Key
.
Year
&&
p
.
Month
==
w
.
Key
.
Month
&&
p
.
JobNumber
==
w
.
Key
.
JobNumber
)
.
Select
(
detial
=>
{
var
dto
=
Mapper
.
Map
<
OwnerPerformanceDto
>(
detial
);
// 应发绩效
dto
.
ShouldGiveFee
=
Math
.
Round
((
dto
.
RealPerformance
??
0
)
+
(
dto
.
OtherPerfor
??
0
)
+
(
dto
.
HideOtherPerfor
??
0
)
+
(
dto
.
NightWorkPerfor
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
dto
.
ReservedRatio
=
employees
?.
FirstOrDefault
(
emp
=>
emp
.
AllotId
==
dto
.
AllotId
&&
emp
.
PersonnelNumber
==
jobNumber
)?.
ReservedRatio
??
0
;
// 预留比例
dto
.
ReservedRatioFee
=
Math
.
Round
((
dto
.
RealPerformance
??
0
)
*
(
dto
.
ReservedRatio
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
// 预留绩效
dto
.
RealGiveFee
=
Math
.
Round
(
dto
.
ShouldGiveFee
-
(
dto
.
ReservedRatioFee
??
0
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 实发绩效
return
dto
;
}),
})
.
ToList
();
foreach
(
var
item
in
res
)
{
item
.
UnitType
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
UnitType
??
""
;
item
.
AccountingUnit
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
AccountingUnit
??
""
;
item
.
EmployeeName
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
DoctorName
??
""
;
// 全部是0的记录不显示
item
.
Detail
=
item
.
Detail
.
Where
(
w
=>
!(
w
.
PerforSumFee
==
0
&&
w
.
PerforManagementFee
==
0
&&
w
.
ShouldGiveFee
==
0
&&
w
.
OtherPerfor
==
0
&&
w
.
HideOtherPerfor
==
0
&&
w
.
RealGiveFee
==
0
));
// 为了保证总额一致
item
.
ShouldGiveFee
=
Math
.
Round
(
item
.
Detail
?.
Sum
(
w
=>
w
.
ShouldGiveFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 应发绩效
item
.
ReservedRatio
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
ReservedRatio
??
0
;
// 预留比例
item
.
ReservedRatioFee
=
Math
.
Round
(
item
.
Detail
?.
Sum
(
w
=>
w
.
ReservedRatioFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 预留绩效
item
.
RealGiveFee
=
Math
.
Round
(
item
.
Detail
?.
Sum
(
w
=>
w
.
RealGiveFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 实发绩效
}
return
res
?.
OrderByDescending
(
w
=>
w
.
Year
).
ThenByDescending
(
w
=>
w
.
Month
).
ToList
();
}
}
}
performance/Performance.Services/PersonService.cs
View file @
8b9aafc9
...
...
@@ -32,6 +32,8 @@ public class PersonService : IAutoInjection
private
readonly
PerforUserroleRepository
perforUserroleRepository
;
private
readonly
PerforRoleRepository
perforRoleRepository
;
private
readonly
PerforAgsecondallotRepository
agsecondallotRepository
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
private
readonly
UserService
userService
;
private
readonly
Application
application
;
private
readonly
IHostingEnvironment
evn
;
...
...
@@ -55,6 +57,8 @@ public class PersonService : IAutoInjection
PerforUserroleRepository
perforUserroleRepository
,
PerforRoleRepository
perforRoleRepository
,
PerforAgsecondallotRepository
agsecondallotRepository
,
PerforHospitalRepository
perforHospitalRepository
,
UserService
userService
,
IOptions
<
Application
>
application
,
IHostingEnvironment
evn
)
...
...
@@ -67,6 +71,8 @@ IHostingEnvironment evn
this
.
perforUserroleRepository
=
perforUserroleRepository
;
this
.
perforRoleRepository
=
perforRoleRepository
;
this
.
agsecondallotRepository
=
agsecondallotRepository
;
this
.
perforHospitalRepository
=
perforHospitalRepository
;
this
.
userService
=
userService
;
this
.
application
=
application
.
Value
;
this
.
evn
=
evn
;
}
...
...
@@ -635,12 +641,19 @@ private string[] GetUnitType(int userId)
public
HandsonTable
GetBatchPersonStructrue
(
int
hospitalId
)
{
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
Person
.
Select
(
t
=>
t
.
Item2
).
ToArray
(),
Person
.
Select
(
t
=>
new
collect_permission
var
hos
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
hospitalId
);
var
cols
=
hos
.
IsOwnerQuery
==
1
?
PersonPassword
.
Select
(
t
=>
t
.
Item2
).
ToArray
()
:
Person
.
Select
(
t
=>
t
.
Item2
).
ToArray
();
var
permissions
=
hos
.
IsOwnerQuery
==
1
?
PersonPassword
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Item2
,
Visible
=
1
}).
ToList
());
}).
ToList
()
:
Person
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Item2
,
Visible
=
1
}).
ToList
();
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
cols
,
permissions
);
var
deptdics
=
perdeptdicRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
ss
=
deptdics
?.
Where
(
t
=>
!
new
string
[]
{
UnitType
.
专家组
.
ToString
()
}.
Contains
(
t
.
UnitType
));
if
(
result
.
Columns
!=
null
&&
result
.
Columns
.
Any
())
...
...
@@ -716,13 +729,54 @@ public HandsonTable GetDepartmentHands(int hospitalId)
public
bool
BathSavePerson
(
int
AllotId
,
int
HospitalId
,
SaveCollectData
request
)
{
var
dict
=
new
Dictionary
<
string
,
string
>();
Person
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
//根据IsOwnerQuery是否等于1来过滤密码列
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
HospitalId
);
if
(
hospital
.
IsOwnerQuery
==
1
)
{
PersonPassword
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
}
else
{
Person
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
}
var
dicData
=
CreateDataRow
(
request
,
dict
);
List
<
per_employee
>
employees
=
new
List
<
per_employee
>();
var
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
HospitalId
&&
t
.
AllotId
==
AllotId
);
//begin 绩效查询角色配置、查询信息
var
usercollor
=
new
UserCollectData
{
HospitalId
=
HospitalId
,
CreateUser
=
request
.
CreateUser
,
ColHeaders
=
UserService
.
Users
.
Values
.
ToArray
(),
};
var
role
=
perforRoleRepository
.
GetEntity
(
t
=>
t
.
RoleName
==
"绩效查询"
);
var
userRole
=
perforUserroleRepository
.
GetEntities
(
t
=>
t
.
RoleID
==
role
.
ID
).
Select
(
t
=>
t
.
UserID
);
var
users
=
perforUserRepository
.
GetEntities
(
t
=>
userRole
.
Contains
(
t
.
ID
));
var
newUsers
=
new
List
<
string
[
]>
();
//end
var
delPersonsNum
=
new
List
<
string
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
per_employee
>(
json
);
//begin 绩效查询角色
if
(
hospital
.
IsOwnerQuery
==
1
)
{
var
isNewRole
=
!
string
.
IsNullOrEmpty
(
data
.
PersonnelNumber
?.
Trim
())
&&
!
string
.
IsNullOrEmpty
(
item
[
"Password"
]);
var
isRepeat
=
users
.
Any
(
t
=>
t
.
RealName
==
data
.
DoctorName
?.
Trim
()
&&
t
.
Login
==
data
.
PersonnelNumber
?.
Trim
());
if
(
isNewRole
&&
!
isRepeat
)
{
newUsers
.
Add
(
new
[]
{
$"
{
data
.
DoctorName
?.
Trim
()}
"
,
$"
{
data
.
PersonnelNumber
?.
Trim
()}
"
,
$"
{
item
[
"Password"
]}
"
,
""
,
""
,
"绩效查询"
,
$"
{
hospital
.
HosName
}
"
,
$"
{
data
.
AccountingUnit
?.
Trim
()}
"
});
}
}
//end
if
(!
string
.
IsNullOrEmpty
(
item
[
"AttendanceDay"
])
&&
!
string
.
IsNullOrEmpty
(
item
[
"ReservedRatio"
]))
{
decimal
attendanceDay
=
ConvertHelper
.
To
<
decimal
>(
item
[
"AttendanceDay"
]),
reservedRatio
=
ConvertHelper
.
To
<
decimal
>(
item
[
"ReservedRatio"
]);
...
...
@@ -730,8 +784,7 @@ public bool BathSavePerson(int AllotId, int HospitalId, SaveCollectData request)
return
false
;
}
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
per_employee
>(
json
);
if
(
persons
!=
null
)
if
(
persons
.
Any
(
t
=>
t
.
PersonnelNumber
?.
Trim
()
==
data
.
PersonnelNumber
?.
Trim
()))
delPersonsNum
.
Add
(
data
.
PersonnelNumber
);
...
...
@@ -748,6 +801,13 @@ public bool BathSavePerson(int AllotId, int HospitalId, SaveCollectData request)
employees
.
Add
(
data
);
}
}
if
(
newUsers
.
Count
>
0
)
{
usercollor
.
Data
=
newUsers
.
ToArray
();
userService
.
SaveUserHandsFlat
(
usercollor
);
}
var
delPerson
=
persons
?.
Where
(
t
=>
delPersonsNum
.
Contains
(
t
.
PersonnelNumber
));
if
(
delPerson
!=
null
&&
delPerson
.
Any
())
peremployeeRepository
.
RemoveRange
(
delPerson
.
ToArray
());
...
...
@@ -911,6 +971,23 @@ private void DeptDicList(int HospitalId, List<per_dept_dic> deptDics, DeptdicHan
return
result
;
}
public
static
List
<(
string
,
string
,
Func
<
PersonePassword
,
object
>)>
PersonPassword
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
PersonePassword
,
object
>)>
{
(
nameof
(
PersonePassword
.
AccountingUnit
),
"核算单元"
,
t
=>
t
.
AccountingUnit
),
(
nameof
(
PersonePassword
.
Department
),
"科室名称"
,
t
=>
t
.
Department
),
(
nameof
(
PersonePassword
.
DoctorName
),
"姓名"
,
t
=>
t
.
DoctorName
),
(
nameof
(
PersonePassword
.
PersonnelNumber
),
"员工工号"
,
t
=>
t
.
PersonnelNumber
),
(
nameof
(
PersonePassword
.
JobCategory
),
"正式/临聘"
,
t
=>
t
.
JobCategory
),
(
nameof
(
PersonePassword
.
Duty
),
"职务"
,
t
=>
t
.
Duty
),
(
nameof
(
PersonePassword
.
JobTitle
),
"职称"
,
t
=>
t
.
JobTitle
),
(
nameof
(
PersonePassword
.
UnitType
),
"人员类别"
,
t
=>
t
.
UnitType
),
(
nameof
(
PersonePassword
.
AttendanceDay
),
"出勤天数"
,
t
=>
t
.
AttendanceDay
),
(
nameof
(
PersonePassword
.
ReservedRatio
),
"预留比例"
,
t
=>
t
.
ReservedRatio
),
(
nameof
(
PersonePassword
.
BankCard
),
"银行卡号"
,
t
=>
t
.
BankCard
),
(
nameof
(
PersonePassword
.
Password
),
"密码"
,
t
=>
t
.
Password
),
(
nameof
(
PersonePassword
.
Remark
),
"备注"
,
t
=>
t
.
Remark
),
};
public
static
List
<(
string
,
string
,
Func
<
per_employee
,
object
>)>
Person
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
per_employee
,
object
>)>
{
(
nameof
(
per_employee
.
AccountingUnit
),
"核算单元"
,
t
=>
t
.
AccountingUnit
),
...
...
@@ -1004,11 +1081,11 @@ public string GetPersonDictFile(int allotId, int userId)
public
bool
ReloadPersonnel
(
int
hospitalId
,
int
allotId
)
{
var
allotList
=
perallotRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
)?.
OrderBy
(
s
=>
s
.
Year
).
ThenBy
(
s
=>
s
.
Month
).
ToList
();
if
(
allotList
==
null
||
!
allotList
.
Any
())
if
(
allotList
==
null
||
!
allotList
.
Any
())
throw
new
PerformanceException
(
"加载失败,绩效记录不存在!"
);
var
allot
=
allotList
.
FirstOrDefault
(
w
=>
w
.
ID
==
allotId
);
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"加载失败,绩效记录不存在!"
);
var
index
=
allotList
.
IndexOf
(
allot
);
...
...
@@ -1019,11 +1096,11 @@ public bool ReloadPersonnel(int hospitalId, int allotId)
if
(
prevAllot
==
null
)
prevAllot
.
ID
=
-
1
;
var
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
AllotId
==
prevAllot
.
ID
);
if
(
persons
==
null
||
!
persons
.
Any
())
if
(
persons
==
null
||
!
persons
.
Any
())
throw
new
PerformanceException
(
"加载失败,未查询到上月人员信息!"
);
var
i
=
peremployeeRepository
.
Execute
(
$@"DELETE FROM per_employee WHERE HospitalId=@HospitalId and AllotId=@AllotId;"
,
new
{
hospitalId
,
allotId
});
if
(
i
<=
0
)
if
(
i
<=
0
)
throw
new
PerformanceException
(
"加载失败,人员信息重置失败!"
);
int
day
=
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
...
...
performance/Performance.Services/UserService.cs
View file @
8b9aafc9
...
...
@@ -129,12 +129,20 @@ public sys_role GetUserFirstRole(int userId)
return
role
;
}
public
List
<
int
>
GetUserHospital
(
int
userId
)
{
var
userHospital
=
_userhospitalRepository
.
GetEntities
(
t
=>
t
.
UserID
==
userId
);
if
(
userHospital
!=
null
&&
userHospital
.
Any
(
w
=>
w
.
HospitalID
.
HasValue
))
return
userHospital
.
Where
(
w
=>
w
.
HospitalID
.
HasValue
).
Select
(
w
=>
w
.
HospitalID
.
Value
).
ToList
();
return
new
List
<
int
>();
}
/// <summary>
/// 查询用户列表
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public
List
<
UserResponse
>
GetUserList
(
int
userID
)
public
List
<
UserResponse
>
GetUserList
(
int
userID
,
int
roleType
=
1
)
{
var
userRoles
=
_userroleRepository
.
GetEntities
();
var
userHospitals
=
_userhospitalRepository
.
GetEntities
();
...
...
@@ -143,6 +151,18 @@ public List<UserResponse> GetUserList(int userID)
var
roles
=
_roleRepository
.
GetEntities
();
var
userrole
=
userRoles
?.
FirstOrDefault
(
t
=>
t
.
UserID
==
userID
);
if
(
roleType
==
12
)
{
var
jxQuery
=
userRoles
.
Where
(
t
=>
t
.
RoleID
==
roles
?.
FirstOrDefault
(
c
=>
c
.
RoleName
==
"绩效查询"
)?.
ID
).
Select
(
t
=>
t
.
UserID
);
users
=
users
.
Where
(
t
=>
jxQuery
.
Contains
(
t
.
ID
)).
ToList
();
}
else
{
var
jxQuery
=
userRoles
.
Where
(
t
=>
roles
.
Where
(
c
=>
c
.
RoleName
!=
"绩效查询"
).
Select
(
c
=>
c
.
ID
).
Contains
(
t
.
RoleID
)).
Select
(
t
=>
t
.
UserID
);
users
=
users
.
Where
(
t
=>
jxQuery
.
Contains
(
t
.
ID
)).
ToList
();
}
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"用户未配置角色"
);
var
role
=
roles
?.
FirstOrDefault
(
t
=>
t
.
ID
==
userrole
.
RoleID
);
...
...
@@ -727,6 +747,11 @@ public HandsonTable GetUserHandsFlat()
return
result
;
}
/// <summary>
/// 批量保存用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
string
SaveUserHandsFlat
(
UserCollectData
request
)
{
try
...
...
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