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
c9cdca5e
Commit
c9cdca5e
authored
Mar 03, 2021
by
lcx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2020morge' into v2020morge-signalr
parents
dc84b5e4
59ce6d53
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
903 additions
and
127 deletions
+903
-127
performance/Performance.Api/Controllers/AccountController.cs
+73
-0
performance/Performance.Api/Controllers/AllotController.cs
+47
-0
performance/Performance.Api/Controllers/ComputeController.cs
+16
-2
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+20
-5
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+35
-10
performance/Performance.DtoModels/HandsonTable.cs
+1
-1
performance/Performance.DtoModels/PerExcel/ComputeEmployee.cs
+5
-0
performance/Performance.DtoModels/PerExcel/ComputeResult.cs
+5
-0
performance/Performance.DtoModels/PerExcel/PerDataAccountBaisc.cs
+5
-0
performance/Performance.DtoModels/PerExcel/PerDataLogisticsEmployee.cs
+5
-0
performance/Performance.DtoModels/Request/HospitalRequest.cs
+4
-4
performance/Performance.DtoModels/Request/UserRequest.cs
+7
-3
performance/Performance.DtoModels/Response/RoleResponse.cs
+2
-0
performance/Performance.DtoModels/Response/UserResponse.cs
+2
-0
performance/Performance.EntityModels/Entity/Sys_User.cs
+5
-0
performance/Performance.EntityModels/Entity/ag_othersource.cs
+34
-19
performance/Performance.EntityModels/Entity/im_employee_logistics.cs
+5
-0
performance/Performance.EntityModels/Entity/res_account.cs
+5
-0
performance/Performance.EntityModels/Entity/res_compute.cs
+4
-0
performance/Performance.EntityModels/Entity/sys_hospital.cs
+4
-4
performance/Performance.Extract.Api/Performance.Extract.Api.csproj
+1
-0
performance/Performance.Extract.Api/Properties/PublishProfiles/FolderProfile.pubxml
+4
-1
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+1
-0
performance/Performance.Services/AllotCompute/ResultComputeService.cs
+10
-5
performance/Performance.Services/CollectService.cs
+141
-3
performance/Performance.Services/ComputeService.cs
+72
-30
performance/Performance.Services/Details/SecondAllotDetails.cs
+148
-31
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+2
-2
performance/Performance.Services/HospitalService.cs
+1
-1
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
+4
-0
performance/Performance.Services/PerExcelService/ExcelReadConfig.cs
+1
-0
performance/Performance.Services/RoleService.cs
+53
-1
performance/Performance.Services/SecondAllotService.cs
+6
-3
performance/Performance.Services/UserService.cs
+175
-2
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
c9cdca5e
...
@@ -294,5 +294,77 @@ public ApiResponse<UserResponse> Password(int userId)
...
@@ -294,5 +294,77 @@ public ApiResponse<UserResponse> Password(int userId)
var
user
=
_userService
.
ResetPwd
(
userId
,
loginUserId
);
var
user
=
_userService
.
ResetPwd
(
userId
,
loginUserId
);
return
new
ApiResponse
<
UserResponse
>(
ResponseType
.
OK
,
user
);
return
new
ApiResponse
<
UserResponse
>(
ResponseType
.
OK
,
user
);
}
}
#
region
多角色
/// <summary>
/// 查询用户信息
/// </summary>
/// <returns></returns>
[
Route
(
"selfInfos"
)]
[
HttpPost
]
public
ApiResponse
SelfInfos
()
{
var
userid
=
_claim
.
GetUserId
();
var
user
=
_userService
.
GetUser
(
userid
);
user
.
Role
=
_roleService
.
GetUsersRole
(
user
.
UserID
);
user
.
Hospital
=
_hospitalService
.
GetUserHopital
(
user
.
UserID
);
int
[]
roleArray
=
new
int
[]
{
_options
.
NurseRole
,
_options
.
DirectorRole
,
_options
.
SpecialRole
,
_options
.
OfficeRole
};
user
.
IsAgainAdmin
=
user
.
Role
!=
null
?
roleArray
.
Contains
(
user
.
Role
.
First
().
Type
??
0
)
:
false
;
return
new
ApiResponse
(
ResponseType
.
OK
,
user
);
}
/// <summary>
/// 新增用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"InsertUser"
)]
[
HttpPost
]
public
ApiResponse
<
UserResponse
>
InsertUser
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
UserRequest
request
)
{
var
userId
=
_claim
.
GetUserId
();
var
user
=
_userService
.
InsertUser
(
request
,
userId
);
user
.
RoleArr
=
request
.
RoleArr
;
return
new
ApiResponse
<
UserResponse
>(
ResponseType
.
OK
,
user
);
}
/// <summary>
/// 编辑用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"UpdateUser"
)]
[
HttpPost
]
public
ApiResponse
<
UserResponse
>
UpdateUser
([
CustomizeValidator
(
RuleSet
=
"Update"
),
FromBody
]
UserRequest
request
)
{
var
userId
=
_claim
.
GetUserId
();
int
[]
roleArray
=
new
int
[]
{
_options
.
NurseRole
,
_options
.
DirectorRole
,
_options
.
SpecialRole
,
_options
.
OfficeRole
};
var
roles
=
_roleService
.
GetUsersRole
(
userId
);
//var roleType = roles.Select(c => c.Type).ToArray();
var
intersect
=
roleArray
.
Intersect
(
roles
.
Select
(
c
=>(
int
)
c
.
Type
).
ToArray
());
var
isAgainAdmin
=
roles
!=
null
?
intersect
.
Any
()
:
false
;
var
user
=
_userService
.
UpdateUser
(
request
,
isAgainAdmin
);
user
.
RoleArr
=
request
.
RoleArr
;
return
new
ApiResponse
<
UserResponse
>(
ResponseType
.
OK
,
user
);
}
/// <summary>
/// 新增用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"DeleteUser"
)]
[
HttpPost
]
public
ApiResponse
DeleteUser
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
UserRequest
request
)
{
return
_userService
.
DeleteUser
(
request
.
ID
);
}
#
endregion
}
}
}
}
\ No newline at end of file
performance/Performance.Api/Controllers/AllotController.cs
View file @
c9cdca5e
...
@@ -173,6 +173,53 @@ public ApiResponse Import([FromForm] IFormCollection form)
...
@@ -173,6 +173,53 @@ public ApiResponse Import([FromForm] IFormCollection form)
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
/// <summary>
/// 上传文件
/// </summary>
/// <param name="form"></param>
/// <returns></returns>
[
Route
(
"ImportExtraction/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
ImportExtraction
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"allotid不存在"
);
var
extract
=
allot
.
ExtractPath
.
Split
(
"\\"
).
Last
();
var
fileName
=
System
.
Text
.
RegularExpressions
.
Regex
.
Replace
(
extract
,
@"\d"
,
""
);
//var file = ((FormFileCollection)allot.ExtractPath).FirstOrDefault();
//if (file == null)
// return new ApiResponse(ResponseType.Fail, "参数错误", "文件无效");
var
name
=
FileHelper
.
GetFileNameNoExtension
(
fileName
)
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
ext
=
FileHelper
.
GetExtension
(
fileName
);
var
dpath
=
Path
.
Combine
(
_evn
.
ContentRootPath
,
"Files"
,
$"
{
allot
.
HospitalId
}
"
,
$"
{
allot
.
Year
}{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
var
path
=
Path
.
Combine
(
dpath
,
$"
{
name
}{
ext
}
"
);
using
(
var
stream
=
System
.
IO
.
File
.
OpenRead
(
allot
.
ExtractPath
))
{
byte
[]
bytes
=
new
byte
[
stream
.
Length
];
stream
.
Read
(
bytes
,
0
,
bytes
.
Length
);
if
(!
FileHelper
.
CreateFile
(
path
,
bytes
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"上传失败"
);
allot
.
Path
=
path
;
allot
.
States
=
(
int
)
AllotStates
.
FileUploaded
;
allot
.
Remark
=
EnumHelper
.
GetDescription
(
AllotStates
.
FileUploaded
);
allot
.
UploadDate
=
DateTime
.
Now
;
allot
.
Generate
=
(
int
)
AllotGenerate
.
Init
;
if
(!
_allotService
.
Update
(
allot
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"上传成功,修改状态失败"
);
_configService
.
Clear
(
allot
.
ID
);
}
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// <summary>
/// 绩效生成
/// 绩效生成
/// </summary>
/// </summary>
...
...
performance/Performance.Api/Controllers/ComputeController.cs
View file @
c9cdca5e
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
namespace
Performance.Api.Controllers
namespace
Performance.Api.Controllers
...
@@ -300,8 +301,21 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
...
@@ -300,8 +301,21 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
OthePerfor
=
t
.
Sum
(
s
=>
s
.
OthePerfor
),
OthePerfor
=
t
.
Sum
(
s
=>
s
.
OthePerfor
),
NightWorkPerfor
=
t
.
Sum
(
s
=>
s
.
NightWorkPerfor
),
NightWorkPerfor
=
t
.
Sum
(
s
=>
s
.
NightWorkPerfor
),
RealGiveFee
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
RealGiveFee
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
//ReservedRatio = t.Sum(s => s.ReservedRatio),
ReservedRatio
=
t
.
Sum
(
s
=>
s
.
ReservedRatio
),
//ReservedRatioFee = t.Sum(s => s.ReservedRatioFee),
ReservedRatioFee
=
t
.
Sum
(
s
=>
s
.
ReservedRatioFee
),
}).
OrderBy
(
t
=>
{
string
value
=
t
.
JobNumber
;
switch
(
value
)
{
case
string
val
when
string
.
IsNullOrEmpty
(
val
):
break
;
case
string
val
when
Regex
.
IsMatch
(
val
,
@"^[+-]?\d*$"
):
value
=
value
.
PadLeft
(
20
,
'0'
);
break
;
}
return
value
;
});
});
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
result
);
}
}
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
c9cdca5e
...
@@ -536,6 +536,11 @@
...
@@ -536,6 +536,11 @@
夜班费
夜班费
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.ComputeEmployee.NeedSecondAllot"
>
<summary>
是否需要二次分配
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ComputeResult.AccountType"
>
<member
name=
"P:Performance.DtoModels.ComputeResult.AccountType"
>
<summary>
<summary>
科室类别(例如 医技科室 临床科室 其他科室)
科室类别(例如 医技科室 临床科室 其他科室)
...
@@ -706,6 +711,11 @@
...
@@ -706,6 +711,11 @@
夜班费
夜班费
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.ComputeResult.NeedSecondAllot"
>
<summary>
是否需要二次分配
</summary>
</member>
<member
name=
"T:Performance.DtoModels.UnitType"
>
<member
name=
"T:Performance.DtoModels.UnitType"
>
<summary>
核算单元类型
</summary>
<summary>
核算单元类型
</summary>
</member>
</member>
...
@@ -1089,6 +1099,11 @@
...
@@ -1089,6 +1099,11 @@
实发绩效
实发绩效
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.PerDataAccountBaisc.NeedSecondAllot"
>
<summary>
是否需要二次分配
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerDataClinicEmployee.UnitType"
>
<member
name=
"P:Performance.DtoModels.PerDataClinicEmployee.UnitType"
>
<summary>
<summary>
核算单元分类
核算单元分类
...
@@ -1354,6 +1369,11 @@
...
@@ -1354,6 +1369,11 @@
调节后其他绩效
调节后其他绩效
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.PerDataLogisticsEmployee.NeedSecondAllot"
>
<summary>
是否需要二次分配
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerDataLogisticsEmployee.RowNumber"
>
<member
name=
"P:Performance.DtoModels.PerDataLogisticsEmployee.RowNumber"
>
<summary>
<summary>
行号
行号
...
@@ -2056,11 +2076,6 @@
...
@@ -2056,11 +2076,6 @@
是否开启科室CMI占比 1 启用 2 禁用
是否开启科室CMI占比 1 启用 2 禁用
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.HospitalRequest.IsOpenLogisticsSecondAllot"
>
<summary>
是否开启行政后勤二次绩效分配 1 启用 2 禁用
</summary>
</member>
<member
name=
"P:Performance.DtoModels.IncomeRequest.SheetNameKeyword"
>
<member
name=
"P:Performance.DtoModels.IncomeRequest.SheetNameKeyword"
>
<summary>
<summary>
关键字匹配
关键字匹配
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
c9cdca5e
...
@@ -717,14 +717,14 @@
...
@@ -717,14 +717,14 @@
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.Id"
>
<member
name=
"P:Performance.EntityModels.ag_othersource.Id"
>
<summary>
<summary>
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.SecondId"
>
<member
name=
"P:Performance.EntityModels.ag_othersource.SecondId"
>
<summary>
<summary>
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.WorkNumber"
>
<member
name=
"P:Performance.EntityModels.ag_othersource.WorkNumber"
>
<summary>
<summary>
...
@@ -758,7 +758,7 @@
...
@@ -758,7 +758,7 @@
</member>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.DeptReward"
>
<member
name=
"P:Performance.EntityModels.ag_othersource.DeptReward"
>
<summary>
<summary>
科室单项奖励
科室单项奖励
(只读)
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.DistPerformance"
>
<member
name=
"P:Performance.EntityModels.ag_othersource.DistPerformance"
>
...
@@ -791,6 +791,21 @@
...
@@ -791,6 +791,21 @@
预留金额
预留金额
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.ManagementAllowance"
>
<summary>
管理津贴
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.IndividualReward"
>
<summary>
单项奖励
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.AllocationOfKeySpecialty"
>
<summary>
重点专科分配
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_secondallot"
>
<member
name=
"T:Performance.EntityModels.ag_secondallot"
>
<summary>
<summary>
二次绩效列表
二次绩效列表
...
@@ -2706,6 +2721,11 @@
...
@@ -2706,6 +2721,11 @@
调节后其他绩效
调节后其他绩效
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.im_employee_logistics.NeedSecondAllot"
>
<summary>
是否需要二次分配
</summary>
</member>
<member
name=
"T:Performance.EntityModels.im_header"
>
<member
name=
"T:Performance.EntityModels.im_header"
>
<summary>
<summary>
...
@@ -4511,6 +4531,11 @@
...
@@ -4511,6 +4531,11 @@
变更日志
变更日志
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.res_account.NeedSecondAllot"
>
<summary>
是否需要二次分配
</summary>
</member>
<member
name=
"T:Performance.EntityModels.res_accountdoctor"
>
<member
name=
"T:Performance.EntityModels.res_accountdoctor"
>
<summary>
<summary>
医生科室核算结果
医生科室核算结果
...
@@ -4981,6 +5006,11 @@
...
@@ -4981,6 +5006,11 @@
调节后其他绩效
调节后其他绩效
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.res_compute.NeedSecondAllot"
>
<summary>
是否需要二次分配 是 否
</summary>
</member>
<member
name=
"T:Performance.EntityModels.res_reserved"
>
<member
name=
"T:Performance.EntityModels.res_reserved"
>
<summary>
<summary>
...
@@ -5386,11 +5416,6 @@
...
@@ -5386,11 +5416,6 @@
是否显示二次绩效科主任1 启用 2 禁用
是否显示二次绩效科主任1 启用 2 禁用
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.sys_hospital.IsOpenLogisticsSecondAllot"
>
<summary>
是否开启行政后勤二次绩效分配 1 启用 2 禁用
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_hospital.IsSingleProject"
>
<member
name=
"P:Performance.EntityModels.sys_hospital.IsSingleProject"
>
<summary>
<summary>
抽取项目是否在同一环境 1 是 2 否
抽取项目是否在同一环境 1 是 2 否
...
...
performance/Performance.DtoModels/HandsonTable.cs
View file @
c9cdca5e
...
@@ -124,7 +124,7 @@ public HandsonColumn(string data, bool readOnly = false, DataFormat format = Dat
...
@@ -124,7 +124,7 @@ public HandsonColumn(string data, bool readOnly = false, DataFormat format = Dat
public
bool
ReadOnly
{
get
;
set
;
}
public
bool
ReadOnly
{
get
;
set
;
}
public
string
Type
{
get
;
set
;
}
public
string
Type
{
get
;
set
;
}
public
string
[]
Source
{
get
;
set
;
}
public
string
[]
Source
{
get
;
set
;
}
public
bool
Strict
{
get
;
set
;
}
=
false
;
public
bool
Strict
{
get
;
set
;
}
=
false
;
public
NumericFormat
NumericFormat
{
get
;
set
;
}
public
NumericFormat
NumericFormat
{
get
;
set
;
}
}
}
...
...
performance/Performance.DtoModels/PerExcel/ComputeEmployee.cs
View file @
c9cdca5e
...
@@ -160,5 +160,10 @@ public class ComputeEmployee
...
@@ -160,5 +160,10 @@ public class ComputeEmployee
/// 夜班费
/// 夜班费
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
NightWorkPerfor
{
get
;
set
;
}
public
Nullable
<
decimal
>
NightWorkPerfor
{
get
;
set
;
}
/// <summary>
/// 是否需要二次分配
/// </summary>
public
string
NeedSecondAllot
{
get
;
set
;
}
}
}
}
}
performance/Performance.DtoModels/PerExcel/ComputeResult.cs
View file @
c9cdca5e
...
@@ -198,5 +198,10 @@ public class ComputeResult
...
@@ -198,5 +198,10 @@ public class ComputeResult
/// 夜班费
/// 夜班费
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
NightWorkPerfor
{
get
;
set
;
}
public
Nullable
<
decimal
>
NightWorkPerfor
{
get
;
set
;
}
/// <summary>
/// 是否需要二次分配
/// </summary>
public
string
NeedSecondAllot
{
get
;
set
;
}
}
}
}
}
performance/Performance.DtoModels/PerExcel/PerDataAccountBaisc.cs
View file @
c9cdca5e
...
@@ -232,6 +232,11 @@ public class PerDataAccountBaisc : IPerData
...
@@ -232,6 +232,11 @@ public class PerDataAccountBaisc : IPerData
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 是否需要二次分配
/// </summary>
public
string
NeedSecondAllot
{
get
;
set
;
}
#
endregion
由计算得出
#
endregion
由计算得出
}
}
}
}
performance/Performance.DtoModels/PerExcel/PerDataLogisticsEmployee.cs
View file @
c9cdca5e
...
@@ -67,6 +67,11 @@ public class PerDataLogisticsEmployee : IPerData
...
@@ -67,6 +67,11 @@ public class PerDataLogisticsEmployee : IPerData
public
Nullable
<
decimal
>
AdjustLaterOtherFee
{
get
;
set
;
}
public
Nullable
<
decimal
>
AdjustLaterOtherFee
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否需要二次分配
/// </summary>
public
string
NeedSecondAllot
{
get
;
set
;
}
/// <summary>
/// 行号
/// 行号
/// </summary>
/// </summary>
public
int
RowNumber
{
get
;
set
;
}
public
int
RowNumber
{
get
;
set
;
}
...
...
performance/Performance.DtoModels/Request/HospitalRequest.cs
View file @
c9cdca5e
...
@@ -60,10 +60,10 @@ public class HospitalRequest
...
@@ -60,10 +60,10 @@ public class HospitalRequest
/// </summary>
/// </summary>
public
Nullable
<
int
>
IsOpenCMIPercent
{
get
;
set
;
}
public
Nullable
<
int
>
IsOpenCMIPercent
{
get
;
set
;
}
/// <summary>
///
//
<summary>
/// 是否开启行政后勤二次绩效分配 1 启用 2 禁用
///
//
是否开启行政后勤二次绩效分配 1 启用 2 禁用
/// </summary>
///
//
</summary>
public
Nullable
<
int
>
IsOpenLogisticsSecondAllot
{
get
;
set
;
}
//
public Nullable<int> IsOpenLogisticsSecondAllot { get; set; }
}
}
public
class
HospitalRequestValidator
:
AbstractValidator
<
HospitalRequest
>
public
class
HospitalRequestValidator
:
AbstractValidator
<
HospitalRequest
>
...
...
performance/Performance.DtoModels/Request/UserRequest.cs
View file @
c9cdca5e
...
@@ -42,7 +42,11 @@ public class UserRequest
...
@@ -42,7 +42,11 @@ public class UserRequest
/// 角色
/// 角色
/// </summary>
/// </summary>
public
int
Role
{
get
;
set
;
}
public
int
Role
{
get
;
set
;
}
/// <summary>
/// 角色Arr
/// </summary>
public
int
[]
RoleArr
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 用户医院ID
/// 用户医院ID
/// </summary>
/// </summary>
...
@@ -69,7 +73,7 @@ public UserRequestValidator()
...
@@ -69,7 +73,7 @@ public UserRequestValidator()
RuleSet
(
"Insert"
,
()
=>
RuleSet
(
"Insert"
,
()
=>
{
{
action
();
action
();
RuleFor
(
x
=>
x
.
Role
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Role
Arr
).
NotNull
().
NotEmpty
(
);
RuleFor
(
x
=>
x
.
Password
).
NotNull
().
NotEmpty
().
Length
(
4
,
20
);
RuleFor
(
x
=>
x
.
Password
).
NotNull
().
NotEmpty
().
Length
(
4
,
20
);
RuleFor
(
x
=>
x
.
HosIDArray
).
NotNull
().
NotEmpty
().
Must
(
f
=>
f
.
Length
>
0
);
RuleFor
(
x
=>
x
.
HosIDArray
).
NotNull
().
NotEmpty
().
Must
(
f
=>
f
.
Length
>
0
);
});
});
...
@@ -80,7 +84,7 @@ public UserRequestValidator()
...
@@ -80,7 +84,7 @@ public UserRequestValidator()
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
States
).
InclusiveBetween
(
1
,
2
);
RuleFor
(
x
=>
x
.
States
).
InclusiveBetween
(
1
,
2
);
//RuleFor(x => x.Password).Length(4, 20);
//RuleFor(x => x.Password).Length(4, 20);
RuleFor
(
x
=>
x
.
Role
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Role
Arr
).
NotNull
().
NotEmpty
(
);
RuleFor
(
x
=>
x
.
HosIDArray
).
NotNull
().
NotEmpty
().
Must
(
f
=>
f
.
Length
>
0
);
RuleFor
(
x
=>
x
.
HosIDArray
).
NotNull
().
NotEmpty
().
Must
(
f
=>
f
.
Length
>
0
);
});
});
...
...
performance/Performance.DtoModels/Response/RoleResponse.cs
View file @
c9cdca5e
...
@@ -32,5 +32,7 @@ public class RoleResponse
...
@@ -32,5 +32,7 @@ public class RoleResponse
/// 首页地址
/// 首页地址
/// </summary>
/// </summary>
public
string
IndexUrl
{
get
;
set
;
}
public
string
IndexUrl
{
get
;
set
;
}
public
int
Value
{
get
;
set
;
}
}
}
}
}
performance/Performance.DtoModels/Response/UserResponse.cs
View file @
c9cdca5e
...
@@ -17,5 +17,7 @@ public class UserResponse
...
@@ -17,5 +17,7 @@ public class UserResponse
public
string
Hospital
{
get
;
set
;
}
public
string
Hospital
{
get
;
set
;
}
public
int
Role
{
get
;
set
;
}
public
int
Role
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
int
[]
RoleArr
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/Sys_User.cs
View file @
c9cdca5e
...
@@ -70,5 +70,10 @@ public class sys_user
...
@@ -70,5 +70,10 @@ public class sys_user
/// 删除状态 1可用 2删除
/// 删除状态 1可用 2删除
/// </summary>
/// </summary>
public
Nullable
<
int
>
IsDelete
{
get
;
set
;
}
public
Nullable
<
int
>
IsDelete
{
get
;
set
;
}
/// <summary>
/// 父级ID
/// </summary>
public
Nullable
<
int
>
ParentID
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/ag_othersource.cs
View file @
c9cdca5e
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// <copyright file=" ag_othersource.cs">
// <copyright file=" ag_othersource.cs">
// * FileName: 二次绩效其他绩效来源.cs
// * FileName: 二次绩效其他绩效来源.cs
// </copyright>
// </copyright>
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using
System
;
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
namespace
Performance.EntityModels
{
{
/// <summary>
/// <summary>
/// 二次绩效其他绩效来源
/// 二次绩效其他绩效来源
/// </summary>
/// </summary>
[
Table
(
"ag_othersource"
)]
[
Table
(
"ag_othersource"
)]
public
class
ag_othersource
public
class
ag_othersource
{
{
/// <summary>
/// <summary>
///
///
/// </summary>
/// </summary>
[
Key
]
[
Key
]
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
/// <summary>
/// <summary>
///
///
/// </summary>
/// </summary>
public
Nullable
<
int
>
SecondId
{
get
;
set
;
}
public
Nullable
<
int
>
SecondId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 工号
/// 工号
/// </summary>
/// </summary>
public
string
WorkNumber
{
get
;
set
;
}
public
string
WorkNumber
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 姓名
/// 姓名
/// </summary>
/// </summary>
public
string
Name
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 科室
/// 科室
/// </summary>
/// </summary>
public
string
Department
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 职称
/// 职称
/// </summary>
/// </summary>
public
string
WorkPost
{
get
;
set
;
}
public
string
WorkPost
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 职称绩效
/// 职称绩效
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
TitlePerformance
{
get
;
set
;
}
public
Nullable
<
decimal
>
TitlePerformance
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 工作量绩效工资
/// 工作量绩效工资
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
WorkPerformance
{
get
;
set
;
}
public
Nullable
<
decimal
>
WorkPerformance
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 科室单项奖励
/// 科室单项奖励
(只读)
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
DeptReward
{
get
;
set
;
}
public
Nullable
<
decimal
>
DeptReward
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 可分配绩效
/// 可分配绩效
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
DistPerformance
{
get
;
set
;
}
public
Nullable
<
decimal
>
DistPerformance
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 医院其他绩效
/// 医院其他绩效
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
OtherPerformance
{
get
;
set
;
}
public
Nullable
<
decimal
>
OtherPerformance
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 夜班工作量绩效
/// 夜班工作量绩效
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
NightWorkPerformance
{
get
;
set
;
}
public
Nullable
<
decimal
>
NightWorkPerformance
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 实发绩效工资金额
/// 实发绩效工资金额
/// </summary>
/// </summary>
...
@@ -90,5 +90,20 @@ public class ag_othersource
...
@@ -90,5 +90,20 @@ public class ag_othersource
/// 预留金额
/// 预留金额
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
ReservedAmount
{
get
;
set
;
}
public
Nullable
<
decimal
>
ReservedAmount
{
get
;
set
;
}
/// <summary>
/// 管理津贴
/// </summary>
public
Nullable
<
decimal
>
ManagementAllowance
{
get
;
set
;
}
/// <summary>
/// 单项奖励
/// </summary>
public
Nullable
<
decimal
>
IndividualReward
{
get
;
set
;
}
/// <summary>
/// 重点专科分配
/// </summary>
public
Nullable
<
decimal
>
AllocationOfKeySpecialty
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/im_employee_logistics.cs
View file @
c9cdca5e
...
@@ -153,5 +153,10 @@ public class im_employee_logistics
...
@@ -153,5 +153,10 @@ public class im_employee_logistics
/// 调节后其他绩效
/// 调节后其他绩效
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
AdjustLaterOtherFee
{
get
;
set
;
}
public
Nullable
<
decimal
>
AdjustLaterOtherFee
{
get
;
set
;
}
/// <summary>
/// 是否需要二次分配
/// </summary>
public
string
NeedSecondAllot
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/res_account.cs
View file @
c9cdca5e
...
@@ -187,5 +187,10 @@ public class res_account
...
@@ -187,5 +187,10 @@ public class res_account
/// 变更日志
/// 变更日志
/// </summary>
/// </summary>
public
string
ChangeLog
{
get
;
set
;
}
public
string
ChangeLog
{
get
;
set
;
}
/// <summary>
/// 是否需要二次分配
/// </summary>
public
string
NeedSecondAllot
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/res_compute.cs
View file @
c9cdca5e
...
@@ -223,5 +223,9 @@ public class res_compute
...
@@ -223,5 +223,9 @@ public class res_compute
/// 调节后其他绩效
/// 调节后其他绩效
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
AdjustLaterOtherFee
{
get
;
set
;
}
public
Nullable
<
decimal
>
AdjustLaterOtherFee
{
get
;
set
;
}
/// <summary>
/// 是否需要二次分配 是 否
/// </summary>
public
string
NeedSecondAllot
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/sys_hospital.cs
View file @
c9cdca5e
...
@@ -101,10 +101,10 @@ public class sys_hospital
...
@@ -101,10 +101,10 @@ public class sys_hospital
/// </summary>
/// </summary>
public
Nullable
<
int
>
IsShowSecondDirector
{
get
;
set
;
}
public
Nullable
<
int
>
IsShowSecondDirector
{
get
;
set
;
}
/// <summary>
///
//
<summary>
/// 是否开启行政后勤二次绩效分配 1 启用 2 禁用
///
//
是否开启行政后勤二次绩效分配 1 启用 2 禁用
/// </summary>
///
//
</summary>
public
Nullable
<
int
>
IsOpenLogisticsSecondAllot
{
get
;
set
;
}
//
public Nullable<int> IsOpenLogisticsSecondAllot { get; set; }
/// <summary>
/// <summary>
/// 抽取项目是否在同一环境 1 是 2 否
/// 抽取项目是否在同一环境 1 是 2 否
...
...
performance/Performance.Extract.Api/Performance.Extract.Api.csproj
View file @
c9cdca5e
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<UserSecretsId>3af57781-f816-4c0e-ab66-9b69387e7d35</UserSecretsId>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
...
...
performance/Performance.Extract.Api/Properties/PublishProfiles/FolderProfile.pubxml
View file @
c9cdca5e
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
<ExcludeApp_Data>
False
</ExcludeApp_Data>
<ExcludeApp_Data>
False
</ExcludeApp_Data>
<ProjectGuid>
a7ae6d0f-7b11-4eef-9fea-a279001ea54d
</ProjectGuid>
<ProjectGuid>
a7ae6d0f-7b11-4eef-9fea-a279001ea54d
</ProjectGuid>
<publishUrl>
bin\Release\netcoreapp2.2\publish\
</publishUrl>
<publishUrl>
bin\Release\netcoreapp2.2\publish\
</publishUrl>
<DeleteExistingFiles>
False
</DeleteExistingFiles>
<DeleteExistingFiles>
True
</DeleteExistingFiles>
<TargetFramework>
netcoreapp2.2
</TargetFramework>
<SelfContained>
false
</SelfContained>
</PropertyGroup>
</PropertyGroup>
</Project>
</Project>
\ No newline at end of file
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
c9cdca5e
...
@@ -377,6 +377,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
...
@@ -377,6 +377,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
dept
.
ScoringAverage
=
resAccount
?.
ScoringAverage
==
null
?
0
:
resAccount
.
ScoringAverage
;
dept
.
ScoringAverage
=
resAccount
?.
ScoringAverage
==
null
?
0
:
resAccount
.
ScoringAverage
;
dept
.
AdjustFactor
=
(
isBudget
?
adjust
:
resAccount
?.
AdjustFactor
)
??
1
;
dept
.
AdjustFactor
=
(
isBudget
?
adjust
:
resAccount
?.
AdjustFactor
)
??
1
;
dept
.
Income
=
empolyees
.
Sum
(
w
=>
w
.
PerforTotal
??
0
);
dept
.
Income
=
empolyees
.
Sum
(
w
=>
w
.
PerforTotal
??
0
);
dept
.
NeedSecondAllot
=
empolyees
.
Any
(
w
=>
w
.
NeedSecondAllot
==
"是"
)
?
"是"
:
"否"
;
//dept.Extra = (extra ?? 0);
//dept.Extra = (extra ?? 0);
//dept.MedicineExtra = 0;// (drugExtra ?? 0);
//dept.MedicineExtra = 0;// (drugExtra ?? 0);
//dept.MaterialsExtra = 0;//(materialsExtra ?? 0);
//dept.MaterialsExtra = 0;//(materialsExtra ?? 0);
...
...
performance/Performance.Services/AllotCompute/ResultComputeService.cs
View file @
c9cdca5e
...
@@ -514,13 +514,18 @@ public void GenerateSecondAllot(per_allot allot)
...
@@ -514,13 +514,18 @@ public void GenerateSecondAllot(per_allot allot)
List
<
ag_secondallot
>
insSecond
=
new
List
<
ag_secondallot
>();
List
<
ag_secondallot
>
insSecond
=
new
List
<
ag_secondallot
>();
List
<
ag_secondallot
>
updSecond
=
new
List
<
ag_secondallot
>();
List
<
ag_secondallot
>
updSecond
=
new
List
<
ag_secondallot
>();
var
types
=
new
List
<
int
>
{
(
int
)
UnitType
.
行政高层
,
(
int
)
UnitType
.
行政中层
};
var
types
=
new
List
<
int
>
{
(
int
)
UnitType
.
行政高层
,
(
int
)
UnitType
.
行政中层
,
(
int
)
UnitType
.
行政后勤
};
// 获取医院是否开启后勤二次分配
//
//
获取医院是否开启后勤二次分配
var
hospital
=
hospitalRepository
.
GetEntity
(
w
=>
w
.
ID
==
allot
.
HospitalId
);
//
var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId);
if
(
hospital
?.
IsOpenLogisticsSecondAllot
!=
1
)
//
if (hospital?.IsOpenLogisticsSecondAllot != 1)
types
.
Add
((
int
)
UnitType
.
行政后勤
);
//
types.Add((int)UnitType.行政后勤);
var
accountUnit
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
!
types
.
Contains
(
t
.
UnitType
.
Value
));
var
accountUnit
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
!
types
.
Contains
(
t
.
UnitType
.
Value
));
// 查询需要进行二次分配的行政后勤科室
var
xzAccountUnit
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
t
.
UnitType
.
Value
==
(
int
)
UnitType
.
行政后勤
&&
t
.
NeedSecondAllot
==
"是"
);
if
(
xzAccountUnit
!=
null
&&
xzAccountUnit
.
Count
>
0
)
(
accountUnit
??
new
List
<
res_account
>()).
AddRange
(
xzAccountUnit
);
var
specialList
=
perforResspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
var
specialList
=
perforResspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
accountUnit
!=
null
)
if
(
accountUnit
!=
null
)
...
...
performance/Performance.Services/CollectService.cs
View file @
c9cdca5e
...
@@ -30,6 +30,7 @@ public class CollectService : IAutoInjection
...
@@ -30,6 +30,7 @@ public class CollectService : IAutoInjection
private
readonly
PerforCollectpermissionRepository
perforcollectpermissionRepository
;
private
readonly
PerforCollectpermissionRepository
perforcollectpermissionRepository
;
private
readonly
PerforUserroleRepository
userroleRepository
;
private
readonly
PerforUserroleRepository
userroleRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforPerdeptdicRepository
perforPerdeptdicRepository
;
private
readonly
SheetSevice
sheetSevice
;
private
readonly
SheetSevice
sheetSevice
;
private
readonly
Application
options
;
private
readonly
Application
options
;
...
@@ -46,6 +47,7 @@ public class CollectService : IAutoInjection
...
@@ -46,6 +47,7 @@ public class CollectService : IAutoInjection
PerforCollectpermissionRepository
perforcollectpermissionRepository
,
PerforCollectpermissionRepository
perforcollectpermissionRepository
,
PerforUserroleRepository
userroleRepository
,
PerforUserroleRepository
userroleRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforPerdeptdicRepository
perforPerdeptdicRepository
,
SheetSevice
sheetSevice
,
SheetSevice
sheetSevice
,
IOptions
<
Application
>
options
)
IOptions
<
Application
>
options
)
{
{
...
@@ -61,6 +63,7 @@ public class CollectService : IAutoInjection
...
@@ -61,6 +63,7 @@ public class CollectService : IAutoInjection
this
.
perforcollectpermissionRepository
=
perforcollectpermissionRepository
;
this
.
perforcollectpermissionRepository
=
perforcollectpermissionRepository
;
this
.
userroleRepository
=
userroleRepository
;
this
.
userroleRepository
=
userroleRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforPerdeptdicRepository
=
perforPerdeptdicRepository
;
this
.
sheetSevice
=
sheetSevice
;
this
.
sheetSevice
=
sheetSevice
;
this
.
options
=
options
.
Value
;
this
.
options
=
options
.
Value
;
}
}
...
@@ -368,11 +371,27 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
...
@@ -368,11 +371,27 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
LogisticsEmployee
)
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
LogisticsEmployee
)
rowDatas
=
GetLogisticsEmployee
(
sheet
);
rowDatas
=
GetLogisticsEmployee
(
sheet
);
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountBasic
)
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountBasic
)
rowDatas
=
GetAccountBasic
(
sheet
);
{
List
<
HandsonCellData
>
cells
=
new
List
<
HandsonCellData
>();
var
dept
=
perforPerdeptdicRepository
.
GetAccountBasicAccountingUnit
(
allot
.
HospitalId
);
rowDatas
=
GetAccountBasic
(
sheet
,
dept
,
cells
);
}
else
else
rowDatas
=
GetCommonData
(
sheet
);
rowDatas
=
GetCommonData
(
sheet
);
}
}
//补全核算单元和类型
var
sTypes
=
new
[]
{
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
PersonExtra
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
};
var
sTypeName
=
new
[]
{
"6.1目标考核"
,
"6.6 科室预算比例"
};
if
(
sTypes
.
Contains
((
int
)
sheet
.
SheetType
)
||
sTypeName
.
Contains
(
sheet
.
SheetName
))
{
List
<
HandsonCellData
>
cells
=
new
List
<
HandsonCellData
>();
var
perSheet
=
perforPersheetRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetName
==
"4.1 临床科室医护绩效测算表"
);
var
dept
=
perforPerdeptdicRepository
.
GetAccountBasicAccountingUnit
(
allot
.
HospitalId
);
GetAccountBasic
(
perSheet
,
dept
,
cells
);
UnitFit
(
rowDatas
,
cells
,
sheet
);
}
if
(
rowDatas
==
null
||
!
rowDatas
.
Any
())
if
(
rowDatas
==
null
||
!
rowDatas
.
Any
())
rowDatas
=
GetAccountExtra
(
allot
,
sheet
.
SheetType
.
Value
);
rowDatas
=
GetAccountExtra
(
allot
,
sheet
.
SheetType
.
Value
);
...
@@ -514,10 +533,11 @@ private HandsonRowData CreateRowData(int row, ColumnInfo[] columns, SortedDictio
...
@@ -514,10 +533,11 @@ private HandsonRowData CreateRowData(int row, ColumnInfo[] columns, SortedDictio
return
xx
;
return
xx
;
}
}
private
List
<
HandsonRowData
>
GetAccountBasic
(
per_sheet
sheet
)
private
List
<
HandsonRowData
>
GetAccountBasic
(
per_sheet
sheet
,
IEnumerable
<
per_dept_dic
>
dept
,
List
<
HandsonCellData
>
cells
)
{
{
//var accounts = sheetSevice.SheetExport(sheet.ID);
//var accounts = sheetSevice.SheetExport(sheet.ID);
var
result
=
new
List
<
HandsonRowData
>();
var
result
=
new
List
<
HandsonRowData
>();
var
groupAccount
=
perforImdataRepository
.
GetEntities
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
//.OrderBy(c=>c.RowNumber).GroupBy(c => c.RowNumber);
var
groupAccount
=
perforImdataRepository
.
GetEntities
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
//.OrderBy(c=>c.RowNumber).GroupBy(c => c.RowNumber);
if
(
groupAccount
!=
null
&&
groupAccount
.
Any
())
if
(
groupAccount
!=
null
&&
groupAccount
.
Any
())
{
{
...
@@ -551,14 +571,28 @@ private List<HandsonRowData> GetAccountBasic(per_sheet sheet)
...
@@ -551,14 +571,28 @@ private List<HandsonRowData> GetAccountBasic(per_sheet sheet)
break
;
break
;
}
}
var
rowData
=
new
HandsonRowData
(
rowNumber
.
Value
,
data
);
var
rowData
=
new
HandsonRowData
(
rowNumber
.
Value
,
data
);
result
.
Add
(
rowData
);
result
.
Add
(
rowData
);
string
unit
=
""
;
string
type
=
""
;
foreach
(
var
cell
in
data
)
{
if
(
cell
.
Name
==
"核算单元"
)
{
unit
=
cell
.
Value
.
ToString
();
}
else
if
(
cell
.
Name
==
"核算单元类型"
)
{
type
=
cell
.
Value
.
ToString
();
}
}
cells
.
Add
(
new
HandsonCellData
(
unit
,
type
));
}
}
//var temps = accounts.Row.Select(item => new { row = item.Rownumber, dic = JsonHelper.Deserialize(item) });
//var temps = accounts.Row.Select(item => new { row = item.Rownumber, dic = JsonHelper.Deserialize(item) });
//return new List<HandsonRowData>(temps.Select(temp => CreateRowData(temp.row, ExcelReadConfig.AccountBaisc, temp.dic)));
//return new List<HandsonRowData>(temps.Select(temp => CreateRowData(temp.row, ExcelReadConfig.AccountBaisc, temp.dic)));
}
}
UnitFit
(
result
,
dept
,
cells
);
return
result
;
return
result
;
}
}
...
@@ -669,6 +703,110 @@ public void SaveCollectData(int allotId, SaveCollectData request)
...
@@ -669,6 +703,110 @@ public void SaveCollectData(int allotId, SaveCollectData request)
return
result
;
return
result
;
}
}
private
void
UnitFit
(
List
<
HandsonRowData
>
rowDatas
,
IEnumerable
<
per_dept_dic
>
dept
,
List
<
HandsonCellData
>
cellDatas
)
{
var
rowCount
=
rowDatas
.
Count
;
List
<
HandsonRowData
>
suppRowDatas
=
new
List
<
HandsonRowData
>();
foreach
(
var
dic
in
dept
)
{
bool
exists
=
false
;
bool
exists2
=
false
;
foreach
(
var
rowData
in
rowDatas
)
{
foreach
(
var
cellData
in
rowData
.
CellData
)
{
//var cell = rowData.CellData.Where(c => c.Value == dic.AccountingUnit).ToList();
if
(
cellData
.
Value
?.
ToString
()
==
dic
.
AccountingUnit
)
{
exists
=
true
;
}
if
(
exists
&&
cellData
.
Value
?.
ToString
()
==
dic
.
UnitType
)
{
exists2
=
true
;
}
}
}
if
((
exists
==
false
&&
exists2
==
false
)
||
exists2
==
false
)
{
cellDatas
.
Add
(
new
HandsonCellData
(
dic
.
AccountingUnit
,
dic
.
UnitType
));
var
cells
=
new
List
<
HandsonCellData
>();
cells
.
Add
(
new
HandsonCellData
(
"核算单元"
,
dic
.
AccountingUnit
));
cells
.
Add
(
new
HandsonCellData
(
"核算单元类型"
,
dic
.
UnitType
));
suppRowDatas
.
Add
(
new
HandsonRowData
(
rowCount
++,
cells
));
}
}
cellDatas
.
Distinct
().
ToList
();
rowDatas
.
AddRange
(
suppRowDatas
);
}
private
void
UnitFit
(
List
<
HandsonRowData
>
rowDatas
,
List
<
HandsonCellData
>
cellDatas
,
per_sheet
sheet
)
{
var
rowCount
=
rowDatas
.
Count
;
List
<
HandsonRowData
>
suppRowDatas
=
new
List
<
HandsonRowData
>();
foreach
(
var
cell
in
cellDatas
)
{
bool
exists
=
false
;
bool
exists2
=
false
;
var
cells
=
new
List
<
HandsonCellData
>();
if
(
cell
.
Name
==
"总务科"
)
{
var
ss
=
1
;
}
foreach
(
var
rowData
in
rowDatas
)
{
foreach
(
var
cellData
in
rowData
.
CellData
)
{
//var cell = rowData.CellData.Where(c => c.Value == dic.AccountingUnit).ToList();
if
(
cellData
.
Value
?.
ToString
()
==
cell
.
Name
)
{
exists
=
true
;
}
if
(
cellData
.
Name
==
"核算单元分类"
&&
cellData
.
Value
==
cell
.
Value
)
{
exists2
=
true
;
}
else
if
(
cellData
.
Name
==
"核算组别"
&&
cellData
.
Value
==
cell
.
Value
)
{
exists2
=
true
;
}
else
if
(
cellData
.
Name
==
"核算单元类型"
&&
cellData
.
Value
==
cell
.
Value
)
{
exists2
=
true
;
}
else
{
exists2
=
true
;
}
}
}
if
(
exists
==
false
||
(
exists
==
false
&&
exists2
==
false
)
||
exists2
==
false
)
{
cells
.
Add
(
new
HandsonCellData
(
"核算单元"
,
cell
.
Name
));
if
(
sheet
.
SheetName
==
"5.2业务中层行政中高层医院奖罚"
)
{
cells
.
Add
(
new
HandsonCellData
(
"核算单元分类"
,
cell
.
Value
));
}
else
if
(
sheet
.
SheetName
==
"5.1 科室绩效医院奖罚"
)
{
cells
.
Add
(
new
HandsonCellData
(
"核算组别"
,
cell
.
Value
));
}
else
{
cells
.
Add
(
new
HandsonCellData
(
"核算单元类型"
,
cell
.
Value
));
}
suppRowDatas
.
Add
(
new
HandsonRowData
(++
rowCount
,
cells
));
}
}
rowDatas
.
AddRange
(
suppRowDatas
);
}
}
}
public
class
CollectDataConfig
public
class
CollectDataConfig
...
...
performance/Performance.Services/ComputeService.cs
View file @
c9cdca5e
...
@@ -188,6 +188,8 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
...
@@ -188,6 +188,8 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
else
else
{
{
var
compute
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
AccountType
==
items
.
FirstOrDefault
(
p
=>
p
.
Value
==
type
).
Name
);
var
compute
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
AccountType
==
items
.
FirstOrDefault
(
p
=>
p
.
Value
==
type
).
Name
);
if
(
type
==
(
int
)
AccountUnitType
.
行政工勤
)
compute
=
compute
?.
Where
(
w
=>
w
.
NeedSecondAllot
==
"否"
)?.
ToList
();
if
(
compute
==
null
||
!
compute
.
Any
())
return
new
List
<
ResComputeResponse
>();
if
(
compute
==
null
||
!
compute
.
Any
())
return
new
List
<
ResComputeResponse
>();
...
@@ -292,7 +294,7 @@ public List<DeptResponse> GetOfficePerformance(int allotId)
...
@@ -292,7 +294,7 @@ public List<DeptResponse> GetOfficePerformance(int allotId)
{
{
var
unitType
=
new
List
<
int
>
{
(
int
)
UnitType
.
行政后勤
};
var
unitType
=
new
List
<
int
>
{
(
int
)
UnitType
.
行政后勤
};
var
list
=
perforResaccountRepository
.
GetEntities
(
t
=>
unitType
.
Contains
(
t
.
UnitType
.
Value
)
&&
t
.
AllotID
==
allotId
)
var
list
=
perforResaccountRepository
.
GetEntities
(
t
=>
unitType
.
Contains
(
t
.
UnitType
.
Value
)
&&
t
.
AllotID
==
allotId
&&
t
.
NeedSecondAllot
==
"是"
)
?.
OrderBy
(
t
=>
t
.
UnitType
)
?.
OrderBy
(
t
=>
t
.
UnitType
)
.
ThenByDescending
(
t
=>
t
.
AccountingUnit
);
.
ThenByDescending
(
t
=>
t
.
AccountingUnit
);
List
<
DeptResponse
>
other
=
Mapper
.
Map
<
List
<
DeptResponse
>>(
list
);
List
<
DeptResponse
>
other
=
Mapper
.
Map
<
List
<
DeptResponse
>>(
list
);
...
@@ -334,20 +336,24 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
...
@@ -334,20 +336,24 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
{
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政中层
.
ToString
()
},
{
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政中层
.
ToString
()
},
{
AccountUnitType
.
行政工勤
.
ToString
(),
AccountUnitType
.
行政工勤
.
ToString
()
}
{
AccountUnitType
.
行政工勤
.
ToString
(),
AccountUnitType
.
行政工勤
.
ToString
()
}
};
};
var
doctors
=
new
string
[]
{
"医生组"
,
"护理组"
,
"医技组"
};
List
<
DeptResponse
>
adminPerfor
=
list
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
AccountType
}).
Select
(
t
=>
List
<
DeptResponse
>
adminPerfor
=
list
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
AccountType
}).
Select
(
t
=>
{
{
string
unitName
=
result
.
Where
(
w
=>
!
dict
.
Values
.
Contains
(
w
.
UnitName
)).
FirstOrDefault
(
w
=>
w
.
AccountingUnit
==
t
.
Key
.
AccountingUnit
)?.
UnitName
??
""
;
string
unitName
=
result
.
Where
(
w
=>
!
dict
.
Values
.
Contains
(
w
.
UnitName
)).
FirstOrDefault
(
w
=>
w
.
AccountingUnit
==
t
.
Key
.
AccountingUnit
)?.
UnitName
??
""
;
return
new
DeptResponse
var
data
=
new
DeptResponse
{
{
UnitName
=
!
dict
.
Values
.
Contains
(
unitName
)
&&
!
string
.
IsNullOrEmpty
(
unitName
)
?
unitName
:
dict
.
ContainsKey
(
t
.
Key
.
AccountType
)
?
dict
[
t
.
Key
.
AccountType
]
:
"未知"
,
UnitName
=
!
dict
.
Values
.
Contains
(
unitName
)
&&
!
string
.
IsNullOrEmpty
(
unitName
)
?
unitName
:
dict
.
ContainsKey
(
t
.
Key
.
AccountType
)
?
dict
[
t
.
Key
.
AccountType
]
:
"未知"
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
Department
=
t
.
Key
.
AccountingUnit
,
Department
=
t
.
Key
.
AccountingUnit
,
Number
=
t
.
Count
(),
Number
=
t
.
Count
(),
// OtherPerfor1 = t.Sum(group => group.OtherPerfor),
AssessLaterManagementFee
=
isShowManage
==
1
?
t
.
Sum
(
group
=>
group
.
RealGiveFee
??
0
)
+
t
.
Sum
(
group
=>
group
.
OtherPerfor
??
0
)
//实发绩效
:
Math
.
Round
((
t
.
Max
(
m
=>
m
.
ShouldGiveFee
)
*
t
.
Max
(
m
=>
m
.
ScoreAverageRate
)
*
t
.
Max
(
m
=>
m
.
Attendance
)
??
0.0
M
)
+
t
.
Max
(
m
=>
m
.
Punishment
??
0.0
M
))
//考核后管理绩效
};
};
if
(
doctors
.
Contains
(
data
.
UnitName
))
{
data
.
AssessLaterManagementFee
=
isShowManage
==
1
?
t
.
Sum
(
group
=>
group
.
RealGiveFee
??
0
)
+
t
.
Sum
(
group
=>
group
.
OtherPerfor
??
0
)
//实发绩效
:
Math
.
Round
((
t
.
Max
(
m
=>
m
.
ShouldGiveFee
)
*
t
.
Max
(
m
=>
m
.
ScoreAverageRate
)
*
t
.
Max
(
m
=>
m
.
Attendance
)
??
0.0
M
)
+
t
.
Max
(
m
=>
m
.
Punishment
??
0.0
M
));
//考核后管理绩效
}
return
data
;
}).
ToList
();
}).
ToList
();
result
.
AddRange
(
adminPerfor
);
result
.
AddRange
(
adminPerfor
);
...
@@ -355,19 +361,22 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
...
@@ -355,19 +361,22 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
var
aprAmounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
)
??
new
List
<
per_apr_amount
>();
var
aprAmounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
)
??
new
List
<
per_apr_amount
>();
var
employees
=
perforPeremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
new
List
<
per_employee
>();
var
employees
=
perforPeremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
new
List
<
per_employee
>();
var
otherPerformances
=
aprAmounts
.
Join
(
employees
,
outer
=>
new
{
outer
.
AccountingUnit
,
outer
.
PersonnelNumber
},
inner
=>
new
{
inner
.
AccountingUnit
,
inner
.
PersonnelNumber
},
(
outer
,
inner
)
=>
new
var
otherPerformances
=
aprAmounts
.
Join
(
employees
,
{
outer
=>
new
{
outer
.
AccountingUnit
,
outer
.
PersonnelNumber
},
AccountingUnit
=
outer
.
AccountingUnit
,
inner
=>
new
{
inner
.
AccountingUnit
,
inner
.
PersonnelNumber
},
UnitType
=
inner
.
UnitType
,
(
outer
,
inner
)
=>
new
PersonnelNumber
=
outer
.
PersonnelNumber
,
{
PersonnelName
=
inner
.
DoctorName
,
AccountingUnit
=
outer
.
AccountingUnit
,
Amount
=
outer
.
Amount
UnitType
=
inner
.
UnitType
,
})?.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
}).
Select
(
t
=>
new
PersonnelNumber
=
inner
.
PersonnelNumber
,
{
PersonnelName
=
outer
.
DoctorName
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
Amount
=
outer
.
Amount
UnitType
=
t
.
Key
.
UnitType
,
})?.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
}).
Select
(
t
=>
new
Amount
=
t
.
Sum
(
s
=>
s
.
Amount
)
{
});
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
UnitType
=
t
.
Key
.
UnitType
,
Amount
=
t
.
Sum
(
s
=>
s
.
Amount
)
});
result
=
result
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitName
}).
Select
(
t
=>
new
DeptResponse
result
=
result
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitName
}).
Select
(
t
=>
new
DeptResponse
{
{
...
@@ -381,7 +390,7 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
...
@@ -381,7 +390,7 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
MedicineExtra
=
t
.
Sum
(
group
=>
group
.
MedicineExtra
),
MedicineExtra
=
t
.
Sum
(
group
=>
group
.
MedicineExtra
),
Extra
=
t
.
Sum
(
group
=>
group
.
Extra
),
Extra
=
t
.
Sum
(
group
=>
group
.
Extra
),
AssessLaterOtherFee
=
t
.
Sum
(
group
=>
group
.
AssessLaterOtherFee
),
AssessLaterOtherFee
=
t
.
Sum
(
group
=>
group
.
AssessLaterOtherFee
),
AdjustFactor
=
t
.
Sum
(
group
=>
group
.
AdjustFactor
),
AdjustFactor
=
t
.
Max
(
group
=>
group
.
AdjustFactor
),
AdjustLaterOtherFee
=
t
.
Sum
(
group
=>
group
.
AdjustLaterOtherFee
),
AdjustLaterOtherFee
=
t
.
Sum
(
group
=>
group
.
AdjustLaterOtherFee
),
PerforTotal
=
t
.
Sum
(
group
=>
group
.
PerforTotal
),
PerforTotal
=
t
.
Sum
(
group
=>
group
.
PerforTotal
),
AssessLaterPerforTotal
=
t
.
Sum
(
group
=>
group
.
AssessLaterPerforTotal
),
AssessLaterPerforTotal
=
t
.
Sum
(
group
=>
group
.
AssessLaterPerforTotal
),
...
@@ -391,6 +400,36 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
...
@@ -391,6 +400,36 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
+
(
otherPerformances
?.
FirstOrDefault
(
w
=>
w
.
AccountingUnit
==
t
.
Key
.
AccountingUnit
&&
w
.
UnitType
==
t
.
Key
.
UnitName
)?.
Amount
??
0
),
+
(
otherPerformances
?.
FirstOrDefault
(
w
=>
w
.
AccountingUnit
==
t
.
Key
.
AccountingUnit
&&
w
.
UnitType
==
t
.
Key
.
UnitName
)?.
Amount
??
0
),
}).
ToList
();
}).
ToList
();
var
specialData
=
_perforResspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
if
(
specialData
!=
null
&&
specialData
.
Any
())
{
result
.
AddRange
(
specialData
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
Department
}).
Select
(
t
=>
{
var
data
=
new
DeptResponse
{
UnitName
=
"特殊核算组"
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
Department
=
t
.
Key
.
Department
,
PerforFee
=
t
.
Max
(
max
=>
max
.
GiveFee
),
WorkloadFee
=
0
,
AssessBeforeOtherFee
=
t
.
Max
(
max
=>
max
.
AssessBeforeOtherFee
),
PerforTotal
=
t
.
Max
(
max
=>
max
.
PerforTotal
),
ScoringAverage
=
t
.
Max
(
max
=>
max
.
ScoringAverage
),
MedicineExtra
=
t
.
Max
(
max
=>
max
.
MedicineExtra
),
MaterialsExtra
=
t
.
Max
(
max
=>
max
.
MaterialsExtra
),
Extra
=
0
,
AssessLaterOtherFee
=
t
.
Max
(
max
=>
max
.
AssessLaterOtherFee
),
AdjustFactor
=
t
.
Max
(
max
=>
max
.
Adjust
),
AdjustLaterOtherFee
=
t
.
Max
(
max
=>
max
.
AdjustLaterOtherFee
),
AssessLaterManagementFee
=
0
,
AprPerforAmount
=
0
,
RealGiveFee
=
t
.
Max
(
max
=>
max
.
RealGiveFee
),
};
data
.
AssessLaterPerforTotal
=
Math
.
Round
(((
data
.
PerforTotal
*
data
.
ScoringAverage
)
??
0
)
+
(
data
.
MedicineExtra
??
0
)
+
(
data
.
MaterialsExtra
??
0
)
+
(
data
.
AssessLaterOtherFee
??
0
));
return
data
;
}));
}
var
enumItems
=
EnumHelper
.
GetItems
<
AccountUnitType
>();
var
enumItems
=
EnumHelper
.
GetItems
<
AccountUnitType
>();
result
=
result
.
OrderBy
(
t
=>
enumItems
.
FirstOrDefault
(
e
=>
e
.
Name
==
t
.
UnitName
)?.
Value
)
/*.ThenBy(t => t.AccountingUnit)*/
.
ToList
();
result
=
result
.
OrderBy
(
t
=>
enumItems
.
FirstOrDefault
(
e
=>
e
.
Name
==
t
.
UnitName
)?.
Value
)
/*.ThenBy(t => t.AccountingUnit)*/
.
ToList
();
...
@@ -541,15 +580,20 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
...
@@ -541,15 +580,20 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
/// <returns></returns>
/// <returns></returns>
private
List
<
ComputeResponse
>
GetAllotPerformance
(
int
allotId
,
int
hospitalId
,
int
isShowManage
)
private
List
<
ComputeResponse
>
GetAllotPerformance
(
int
allotId
,
int
hospitalId
,
int
isShowManage
)
{
{
var
mTypes
=
new
List
<
string
>
{
AccountUnitType
.
护士长
.
ToString
(),
AccountUnitType
.
科主任
.
ToString
(),
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政高层
.
ToString
()
};
var
mTypes
=
new
List
<
string
>
// 获取医院是否开启后勤二次分配
{
var
hospital
=
hospitalRepository
.
GetEntity
(
w
=>
w
.
ID
==
hospitalId
);
AccountUnitType
.
护士长
.
ToString
(),
AccountUnitType
.
科主任
.
ToString
(),
if
(
hospital
?.
IsOpenLogisticsSecondAllot
!=
1
)
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政高层
.
ToString
(),
mTypes
.
Add
(
AccountUnitType
.
行政工勤
.
ToString
());
AccountUnitType
.
行政工勤
.
ToString
()
};
//// 获取医院是否开启后勤二次分配
//var hospital = hospitalRepository.GetEntity(w => w.ID == hospitalId);
//if (hospital?.IsOpenLogisticsSecondAllot != 1)
// mTypes.Add(AccountUnitType.行政工勤.ToString());
var
types1
=
new
List
<
string
>
{
AccountUnitType
.
护士长
.
ToString
(),
AccountUnitType
.
科主任
.
ToString
()
};
var
types1
=
new
List
<
string
>
{
AccountUnitType
.
护士长
.
ToString
(),
AccountUnitType
.
科主任
.
ToString
()
};
var
types2
=
new
List
<
string
>
{
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政高层
.
ToString
()
};
var
types2
=
new
List
<
string
>
{
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政高层
.
ToString
()
};
var
types3
=
(
hospital
?.
IsOpenLogisticsSecondAllot
!=
1
)
?
new
List
<
string
>
{
AccountUnitType
.
行政工勤
.
ToString
()
}
:
new
List
<
string
>()
;
var
types3
=
new
List
<
string
>
{
AccountUnitType
.
行政工勤
.
ToString
()
}
;
//// 业务中层人员信息
//// 业务中层人员信息
//var empolyeeList = _perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allotId);
//var empolyeeList = _perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allotId);
...
@@ -584,7 +628,7 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
...
@@ -584,7 +628,7 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
comp
.
PerforSumFee
=
t
.
Avg
;
comp
.
PerforSumFee
=
t
.
Avg
;
}
}
// 行政工勤
// 行政工勤
if
(
types3
.
Contains
(
t
.
AccountType
))
if
(
types3
.
Contains
(
t
.
AccountType
)
&&
t
.
NeedSecondAllot
?.
Trim
()
==
"是"
)
{
{
comp
.
PerforSumFee
=
t
.
GiveFee
;
comp
.
PerforSumFee
=
t
.
GiveFee
;
comp
.
AdjustLaterOtherFee
=
0
;
comp
.
AdjustLaterOtherFee
=
0
;
...
@@ -871,9 +915,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
...
@@ -871,9 +915,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
private
decimal
?
GetFactors
(
List
<
per_sheet
>
persheet
,
List
<
im_data
>
basicData
,
UnitType
type
,
SheetType
sheetType
)
private
decimal
?
GetFactors
(
List
<
per_sheet
>
persheet
,
List
<
im_data
>
basicData
,
UnitType
type
,
SheetType
sheetType
)
{
{
var
sheet
=
persheet
.
FirstOrDefault
(
w
=>
w
.
SheetType
==
(
int
)
sheetType
);
var
sheet
=
persheet
.
FirstOrDefault
(
w
=>
w
.
SheetType
==
(
int
)
sheetType
);
if
(
sheet
==
null
)
return
basicData
.
FirstOrDefault
(
t
=>
t
.
SheetID
==
sheet
?.
ID
&&
t
.
UnitType
==
(
int
)
type
&&
t
.
IsTotal
==
1
)?.
CellValue
;
return
null
;
return
basicData
.
FirstOrDefault
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
type
&&
t
.
IsTotal
==
1
)?.
CellValue
;
}
}
private
(
int
sheettype
,
decimal
amount
)
ClinicDepartmentDetail
(
List
<
per_sheet
>
persheet
,
res_account
account
,
List
<
im_data
>
basicData
,
per_sheet
sheet
,
UnitType
type
,
string
sheetName
)
private
(
int
sheettype
,
decimal
amount
)
ClinicDepartmentDetail
(
List
<
per_sheet
>
persheet
,
res_account
account
,
List
<
im_data
>
basicData
,
per_sheet
sheet
,
UnitType
type
,
string
sheetName
)
...
...
performance/Performance.Services/Details/SecondAllotDetails.cs
View file @
c9cdca5e
...
@@ -257,7 +257,7 @@ public List<BodyItem> GetEmployeeFromSavedData(int userId, ag_secondallot second
...
@@ -257,7 +257,7 @@ public List<BodyItem> GetEmployeeFromSavedData(int userId, ag_secondallot second
tableFixedDataList
.
Add
(
tableFixedData
);
tableFixedDataList
.
Add
(
tableFixedData
);
}
}
}
}
SupplementOtherPerfor
(
secondAllot
,
tableFixedDataList
,
employeeList
);
SupplementOtherPerfor
(
secondAllot
,
tableFixedDataList
,
employeeList
,
otherShowColumns
);
}
}
return
tableFixedDataList
;
return
tableFixedDataList
;
}
}
...
@@ -293,7 +293,7 @@ public List<BodyItem> GetEmployeeFromEmployeeDict(int userId, ag_secondallot sec
...
@@ -293,7 +293,7 @@ public List<BodyItem> GetEmployeeFromEmployeeDict(int userId, ag_secondallot sec
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"出勤"
,
"ActualAttendance"
,
(
t
)
=>
t
.
AttendanceDay
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"出勤"
,
"ActualAttendance"
,
(
t
)
=>
t
.
AttendanceDay
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"人员系数"
,
"StaffCoefficient"
,
(
t
)
=>
1
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"人员系数"
,
"StaffCoefficient"
,
(
t
)
=>
1
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"职称"
,
"JobTitle"
,
(
t
)
=>
t
.
JobTitle
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"职称"
,
"JobTitle"
,
(
t
)
=>
t
.
JobTitle
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"预留比例"
,
"ReservedRatio"
,
(
t
)
=>
t
.
ReservedRatio
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"预留
年度考核
比例"
,
"ReservedRatio"
,
(
t
)
=>
t
.
ReservedRatio
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"医院其他绩效"
,
"OtherPerformance"
,
(
t
)
=>
0
)
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"医院其他绩效"
,
"OtherPerformance"
,
(
t
)
=>
0
)
};
};
...
@@ -314,7 +314,7 @@ public List<BodyItem> GetEmployeeFromEmployeeDict(int userId, ag_secondallot sec
...
@@ -314,7 +314,7 @@ public List<BodyItem> GetEmployeeFromEmployeeDict(int userId, ag_secondallot sec
}
}
rowNumber
++;
rowNumber
++;
}
}
SupplementOtherPerfor
(
secondAllot
,
tableFixedDataList
,
employeeList
);
SupplementOtherPerfor
(
secondAllot
,
tableFixedDataList
,
employeeList
,
otherShowColumns
);
return
tableFixedDataList
;
return
tableFixedDataList
;
}
}
...
@@ -382,7 +382,7 @@ public List<BodyItem> GetEmployeeFromPrevData(int userId, ag_secondallot secondA
...
@@ -382,7 +382,7 @@ public List<BodyItem> GetEmployeeFromPrevData(int userId, ag_secondallot secondA
#
endregion
获取人员字典中录入的出勤
#
endregion
获取人员字典中录入的出勤
}
}
SupplementOtherPerfor
(
secondAllot
,
tableFixedDataList
,
employeeList
);
SupplementOtherPerfor
(
secondAllot
,
tableFixedDataList
,
employeeList
,
otherShowColumns
);
}
}
return
tableFixedDataList
;
return
tableFixedDataList
;
}
}
...
@@ -461,11 +461,12 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body
...
@@ -461,11 +461,12 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body
/// 补充 医院其他绩效
/// 补充 医院其他绩效
/// </summary>
/// </summary>
/// <param name="result"></param>
/// <param name="result"></param>
private
void
SupplementOtherPerfor
(
ag_secondallot
secondAllot
,
List
<
BodyItem
>
bodyItems
,
List
<
per_employee
>
employeeList
)
private
void
SupplementOtherPerfor
(
ag_secondallot
secondAllot
,
List
<
BodyItem
>
bodyItems
,
List
<
per_employee
>
employeeList
,
List
<
HeadItem
>
otherShowColumns
)
{
{
if
(
bodyItems
==
null
||
!
bodyItems
.
Any
(
w
=>
w
.
RowNumber
>
-
1
))
return
;
if
(
bodyItems
==
null
||
!
bodyItems
.
Any
(
w
=>
w
.
RowNumber
>
-
1
))
return
;
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
secondAllot
.
AllotId
&&
t
.
Status
==
3
);
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
secondAllot
.
AllotId
&&
t
.
Status
==
3
);
if
(
perapramounts
==
null
||
!
perapramounts
.
Any
())
return
;
var
rowNumberList
=
bodyItems
.
Where
(
w
=>
w
.
RowNumber
>
-
1
).
Select
(
w
=>
w
.
RowNumber
).
Distinct
().
OrderBy
(
t
=>
t
).
ToList
();
var
rowNumberList
=
bodyItems
.
Where
(
w
=>
w
.
RowNumber
>
-
1
).
Select
(
w
=>
w
.
RowNumber
).
Distinct
().
OrderBy
(
t
=>
t
).
ToList
();
foreach
(
var
rownum
in
rowNumberList
)
foreach
(
var
rownum
in
rowNumberList
)
...
@@ -477,14 +478,75 @@ private void SupplementOtherPerfor(ag_secondallot secondAllot, List<BodyItem> bo
...
@@ -477,14 +478,75 @@ private void SupplementOtherPerfor(ag_secondallot secondAllot, List<BodyItem> bo
var
employee
=
employeeList
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
personnelNumber
);
var
employee
=
employeeList
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
personnelNumber
);
if
(
employee
==
null
)
continue
;
if
(
employee
==
null
)
continue
;
var
amount
=
secondAllot
.
Department
==
employee
.
AccountingUnit
?
perapramounts
var
hasAmountData
=
perapramounts
?.
Where
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
personnelNumber
?.
Trim
());
?.
Where
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
personnelNumber
?.
Trim
())
if
(
hasAmountData
==
null
||
!
hasAmountData
.
Any
())
continue
;
?.
Sum
(
w
=>
w
.
Amount
)
:
0
;
var
amount
=
secondAllot
.
Department
==
employee
.
AccountingUnit
?
hasAmountData
.
Sum
(
w
=>
w
.
Amount
)
:
0
;
perapramounts
.
RemoveAll
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
personnelNumber
?.
Trim
());
var
otherPerfor
=
rowData
.
FirstOrDefault
(
w
=>
w
.
FiledId
==
"OtherPerformance"
);
var
otherPerfor
=
rowData
.
FirstOrDefault
(
w
=>
w
.
FiledId
==
"OtherPerformance"
);
if
(
otherPerfor
!=
null
)
if
(
otherPerfor
!=
null
)
otherPerfor
.
Value
=
amount
?.
ToString
();
otherPerfor
.
Value
=
amount
?.
ToString
();
}
}
// 补充字典中该科室不存在,但有其它绩效的人员信息
if
(
perapramounts
!=
null
&&
perapramounts
.
Any
(
t
=>
t
.
AccountingUnit
==
secondAllot
.
Department
))
{
var
groupData
=
perapramounts
.
Where
(
t
=>
t
.
AccountingUnit
==
secondAllot
.
Department
).
GroupBy
(
t
=>
t
.
PersonnelNumber
)
.
Select
(
t
=>
new
{
PersonnelNumber
=
t
.
Key
,
DoctorName
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
DoctorName
))?.
DoctorName
,
Amount
=
t
.
Sum
(
w
=>
w
.
Amount
)?.
ToString
()
});
var
lastNumber
=
rowNumberList
.
Max
()
+
1
;
var
employeeColumns
=
new
List
<
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>>
{
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"人员工号"
,
"PersonnelNumber"
,
(
t
)
=>
t
.
PersonnelNumber
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"姓名"
,
"FullName"
,
(
t
)
=>
t
.
DoctorName
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"岗位"
,
"Post"
,
(
t
)
=>
(
t
.
Duty
?.
IndexOf
(
"主任"
)
>
-
1
||
t
.
Duty
?.
IndexOf
(
"护士长"
)
>
-
1
)
?
"科主任/护士长"
:
"其他"
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"出勤"
,
"ActualAttendance"
,
(
t
)
=>
t
.
AttendanceDay
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"人员系数"
,
"StaffCoefficient"
,
(
t
)
=>
1
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"职称"
,
"JobTitle"
,
(
t
)
=>
t
.
JobTitle
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"预留年度考核比例"
,
"ReservedRatio"
,
(
t
)
=>
t
.
ReservedRatio
),
new
Tuple
<
string
,
string
,
Func
<
per_employee
,
object
>>(
"医院其他绩效"
,
"OtherPerformance"
,
(
t
)
=>
0
)
};
var
specialColumns
=
new
string
[]
{
"FullName"
,
"OtherPerformance"
};
foreach
(
var
item
in
groupData
)
{
foreach
(
var
column
in
employeeColumns
)
{
if
(
employeeList
.
Any
(
t
=>
t
.
PersonnelNumber
==
item
.
PersonnelNumber
)
&&
employeeList
.
FirstOrDefault
(
t
=>
t
.
PersonnelNumber
==
item
.
PersonnelNumber
)
is
per_employee
employee
&&
employee
.
UnitType
==
secondAllot
.
UnitType
)
{
var
headItem
=
otherShowColumns
.
FirstOrDefault
(
w
=>
w
.
FiledName
==
column
.
Item1
&&
w
.
FiledId
==
column
.
Item2
&&
w
.
Type
==
(
int
)
TempColumnType
.
TableFixedColumns
);
if
(
headItem
==
null
)
continue
;
var
data
=
new
BodyItem
(
headItem
);
data
.
RowNumber
=
lastNumber
;
if
(
specialColumns
.
Contains
(
column
.
Item2
))
{
data
.
Value
=
column
.
Item2
==
"OtherPerformance"
?
item
.
Amount
:
item
.
DoctorName
;
}
else
{
var
value
=
column
.
Item3
.
Invoke
(
employee
);
data
.
Value
=
value
?.
ToString
();
}
bodyItems
.
Add
(
data
);
}
}
lastNumber
++;
}
}
}
}
/// <summary>
/// <summary>
...
@@ -577,9 +639,10 @@ public HandsonTable GetOtherTempData(int userId, int secondId, int isArchive, in
...
@@ -577,9 +639,10 @@ public HandsonTable GetOtherTempData(int userId, int secondId, int isArchive, in
var
secondAllot
=
agsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
secondId
);
var
secondAllot
=
agsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
secondId
);
var
readColumns
=
new
int
[]
{
2
,
3
,
}.
Contains
(
secondAllot
.
Status
.
Value
)
?
OtherTemp
.
Select
(
t
=>
t
.
Value
).
ToArray
()
var
readColumns
=
new
int
[]
{
2
,
3
,
}.
Contains
(
secondAllot
.
Status
.
Value
)
?
:
new
string
[]
{
"可分配绩效"
,
"医院其他绩效"
,
"预留比例"
,
"预留金额"
,
"实发绩效工资金额"
};
OtherTemp
.
Select
(
t
=>
t
.
Value
).
ToArray
()
:
new
string
[]
{
"可分配绩效"
,
"科室单项奖励"
,
"医院其他绩效"
,
"预留年度考核比例"
,
"年度考核发放金额"
,
"预发绩效工资金额"
};
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
OtherTemp
.
Select
(
t
=>
t
.
Value
).
ToArray
(),
OtherTemp
.
Select
(
t
=>
new
collect_permission
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
OtherTemp
.
Select
(
t
=>
t
.
Value
).
ToArray
(),
OtherTemp
.
Select
(
t
=>
new
collect_permission
{
{
...
@@ -615,9 +678,8 @@ public HandsonTable GetOtherTempData(int userId, int secondId, int isArchive, in
...
@@ -615,9 +678,8 @@ public HandsonTable GetOtherTempData(int userId, int secondId, int isArchive, in
var
json
=
JsonHelper
.
Serialize
(
item
);
var
json
=
JsonHelper
.
Serialize
(
item
);
var
firstDic
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
string
>>(
json
);
var
firstDic
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
string
>>(
json
);
var
cells
=
(
from
conf
in
OtherTemp
var
cells
=
(
from
conf
in
OtherTemp
join
fst
in
firstDic
on
conf
.
Key
.
ToUpper
()
equals
fst
.
Key
.
ToUpper
()
select
new
HandsonCellData
(
conf
.
Value
,
fst
.
Value
)).
ToList
();
join
fst
in
firstDic
on
conf
.
Key
.
ToUpper
()
equals
fst
.
Key
.
ToUpper
()
select
new
HandsonCellData
(
conf
.
Value
,
fst
.
Value
)).
ToList
();
cells
.
Add
(
new
HandsonCellData
(
nameof
(
ag_othersource
.
Id
),
item
.
Id
));
cells
.
Add
(
new
HandsonCellData
(
nameof
(
ag_othersource
.
Id
),
item
.
Id
));
rowDatas
.
Add
(
new
HandsonRowData
(
i
,
cells
));
rowDatas
.
Add
(
new
HandsonRowData
(
i
,
cells
));
...
@@ -751,34 +813,89 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
...
@@ -751,34 +813,89 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
if
(
second
.
UnitType
==
UnitType
.
行政后勤
.
ToString
())
if
(
second
.
UnitType
==
UnitType
.
行政后勤
.
ToString
())
{
{
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
if
(
string
.
IsNullOrEmpty
(
item
.
WorkNumber
))
if
(
string
.
IsNullOrEmpty
(
item
.
WorkNumber
))
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
{
var
hasAmountData
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
());
if
(
hasAmountData
==
null
||
!
hasAmountData
.
Any
())
continue
;
item
.
OtherPerformance
=
hasAmountData
.
Sum
(
w
=>
w
.
Amount
);
perapramounts
.
RemoveAll
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
());
}
else
{
var
hasAmountData
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
());
if
(
hasAmountData
==
null
||
!
hasAmountData
.
Any
())
continue
;
item
.
OtherPerformance
=
hasAmountData
.
Sum
(
w
=>
w
.
Amount
);
perapramounts
.
RemoveAll
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
());
}
}
}
else
if
(!
string
.
IsNullOrEmpty
(
empl
?.
AccountingUnit
))
else
if
(!
string
.
IsNullOrEmpty
(
empl
?.
AccountingUnit
))
{
{
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
empl
?.
AccountingUnit
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
if
(
string
.
IsNullOrEmpty
(
item
.
WorkNumber
))
if
(
string
.
IsNullOrEmpty
(
item
.
WorkNumber
))
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
empl
?.
AccountingUnit
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
{
var
hasAmountData
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
());
if
(
hasAmountData
==
null
||
!
hasAmountData
.
Any
())
continue
;
item
.
OtherPerformance
=
hasAmountData
.
Sum
(
w
=>
w
.
Amount
);
perapramounts
.
RemoveAll
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
());
}
else
{
var
hasAmountData
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
());
if
(
hasAmountData
==
null
||
!
hasAmountData
.
Any
())
continue
;
item
.
OtherPerformance
=
hasAmountData
.
Sum
(
w
=>
w
.
Amount
);
perapramounts
.
RemoveAll
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
());
}
}
}
}
}
// 补充字典中该科室不存在,但有其它绩效的人员信息
if
(
perapramounts
!=
null
&&
perapramounts
.
Any
(
t
=>
t
.
AccountingUnit
==
second
.
Department
))
{
var
groupData
=
perapramounts
.
Where
(
t
=>
t
.
AccountingUnit
==
second
.
Department
).
GroupBy
(
t
=>
t
.
PersonnelNumber
)
.
Select
(
t
=>
new
ag_othersource
{
SecondId
=
second
.
Id
,
WorkNumber
=
t
.
Key
,
Name
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
DoctorName
))?.
DoctorName
,
OtherPerformance
=
t
.
Sum
(
w
=>
w
.
Amount
)
});
foreach
(
var
item
in
groupData
)
{
if
(
employees
.
Any
(
t
=>
t
.
PersonnelNumber
==
item
.
WorkNumber
)
&&
employees
.
FirstOrDefault
(
t
=>
t
.
PersonnelNumber
==
item
.
WorkNumber
)
is
per_employee
employee
&&
employee
.
UnitType
==
second
.
UnitType
)
{
item
.
ReservedRatio
=
employee
.
ReservedRatio
;
item
.
Department
=
employee
.
AccountingUnit
;
item
.
WorkPost
=
employee
.
JobTitle
;
result
.
Add
(
item
);
}
}
}
}
}
public
static
Dictionary
<
string
,
string
>
OtherTemp
{
get
;
}
=
new
Dictionary
<
string
,
string
>
public
static
Dictionary
<
string
,
string
>
OtherTemp
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
{
nameof
(
ag_othersource
.
WorkNumber
),
"工号"
},
{
nameof
(
ag_othersource
.
WorkNumber
),
"工号"
},
{
nameof
(
ag_othersource
.
Name
),
"姓名"
},
{
nameof
(
ag_othersource
.
Name
),
"姓名"
},
{
nameof
(
ag_othersource
.
Department
),
"科室"
},
{
nameof
(
ag_othersource
.
Department
),
"科室"
},
{
nameof
(
ag_othersource
.
WorkPost
),
"职称"
},
{
nameof
(
ag_othersource
.
WorkPost
),
"职称"
},
{
nameof
(
ag_othersource
.
TitlePerformance
),
"职称绩效"
},
{
nameof
(
ag_othersource
.
TitlePerformance
),
"职称绩效"
},
{
nameof
(
ag_othersource
.
WorkPerformance
),
"工作量绩效工资"
},
{
nameof
(
ag_othersource
.
WorkPerformance
),
"工作量绩效工资"
},
{
nameof
(
ag_othersource
.
DeptReward
),
"科室单项奖励"
},
{
nameof
(
ag_othersource
.
ManagementAllowance
),
"管理津贴"
},
{
nameof
(
ag_othersource
.
DistPerformance
),
"可分配绩效"
},
{
nameof
(
ag_othersource
.
IndividualReward
),
"单项奖励"
},
{
nameof
(
ag_othersource
.
OtherPerformance
),
"医院其他绩效"
},
{
nameof
(
ag_othersource
.
AllocationOfKeySpecialty
),
"重点专科分配"
},
{
nameof
(
ag_othersource
.
NightWorkPerformance
),
"夜班工作量绩效"
},
{
nameof
(
ag_othersource
.
DeptReward
),
"科室单项奖励"
},
{
nameof
(
ag_othersource
.
ReservedRatio
),
"预留比例"
},
{
nameof
(
ag_othersource
.
DistPerformance
),
"可分配绩效"
},
{
nameof
(
ag_othersource
.
ReservedAmount
),
"预留金额"
},
{
nameof
(
ag_othersource
.
OtherPerformance
),
"医院其他绩效"
},
{
nameof
(
ag_othersource
.
RealAmount
),
"实发绩效工资金额"
},
{
nameof
(
ag_othersource
.
NightWorkPerformance
),
"夜班工作量绩效"
},
{
nameof
(
ag_othersource
.
ReservedRatio
),
"预留年度考核比例"
},
{
nameof
(
ag_othersource
.
ReservedAmount
),
"年度考核发放金额"
},
{
nameof
(
ag_othersource
.
RealAmount
),
"预发绩效工资金额"
},
};
};
#
endregion
其他模板详情
#
endregion
其他模板详情
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
c9cdca5e
...
@@ -114,7 +114,6 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
...
@@ -114,7 +114,6 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
}
}
}
}
}
}
public
static
void
ClearSheetTemplate
(
ISheet
sheet
,
PerSheetPoint
point
,
SheetType
sheetType
)
public
static
void
ClearSheetTemplate
(
ISheet
sheet
,
PerSheetPoint
point
,
SheetType
sheetType
)
{
{
if
(
sheet
==
null
)
if
(
sheet
==
null
)
...
@@ -155,7 +154,7 @@ public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetTy
...
@@ -155,7 +154,7 @@ public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetTy
sheet
.
ShiftRows
(
point
.
DataFirstRowNum
.
Value
,
sheet
.
LastRowNum
+
1
,
-
1
);
sheet
.
ShiftRows
(
point
.
DataFirstRowNum
.
Value
,
sheet
.
LastRowNum
+
1
,
-
1
);
}
}
}
}
public
static
void
CloseAutoFilter
(
string
path
)
public
static
void
CloseAutoFilter
(
string
path
)
{
{
try
try
...
@@ -198,5 +197,6 @@ public static bool IsXlsxFile(string filename)
...
@@ -198,5 +197,6 @@ public static bool IsXlsxFile(string filename)
}
}
return
ext
.
ToLower
()
==
ExcelVersion
.
xlsx
.
ToString
().
ToLower
();
return
ext
.
ToLower
()
==
ExcelVersion
.
xlsx
.
ToString
().
ToLower
();
}
}
}
}
}
}
performance/Performance.Services/HospitalService.cs
View file @
c9cdca5e
...
@@ -134,7 +134,7 @@ public HospitalResponse Update(HospitalRequest request)
...
@@ -134,7 +134,7 @@ public HospitalResponse Update(HospitalRequest request)
hospital
.
IsOpenDrugprop
=
request
.
IsOpenDrugprop
;
hospital
.
IsOpenDrugprop
=
request
.
IsOpenDrugprop
;
hospital
.
IsShowManage
=
request
.
IsShowManage
;
hospital
.
IsShowManage
=
request
.
IsShowManage
;
hospital
.
IsOpenCMIPercent
=
request
.
IsOpenCMIPercent
;
hospital
.
IsOpenCMIPercent
=
request
.
IsOpenCMIPercent
;
hospital
.
IsOpenLogisticsSecondAllot
=
request
.
IsOpenLogisticsSecondAllot
;
//
hospital.IsOpenLogisticsSecondAllot = request.IsOpenLogisticsSecondAllot;
//hospital.IsOpenIncome = request.IsOpenIncome;
//hospital.IsOpenIncome = request.IsOpenIncome;
if
(!
_hospitalRepository
.
Update
(
hospital
))
if
(!
_hospitalRepository
.
Update
(
hospital
))
...
...
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
View file @
c9cdca5e
...
@@ -512,6 +512,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
...
@@ -512,6 +512,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
if
(
AccountUnitType
.
行政高层
.
ToString
()
==
involve
||
AccountUnitType
.
行政中层
.
ToString
()
==
involve
)
if
(
AccountUnitType
.
行政高层
.
ToString
()
==
involve
||
AccountUnitType
.
行政中层
.
ToString
()
==
involve
)
{
{
// 行政高层、行政中层 默认不需要二次分配
compute
.
NeedSecondAllot
=
"否"
;
// 行政高层 行政中层 夜班费
// 行政高层 行政中层 夜班费
compute
.
NightWorkPerfor
=
item
.
NightWorkPerfor
;
compute
.
NightWorkPerfor
=
item
.
NightWorkPerfor
;
//考核前绩效
//考核前绩效
...
@@ -523,6 +525,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
...
@@ -523,6 +525,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
}
}
else
if
(
AccountUnitType
.
行政工勤
.
ToString
()
==
involve
)
else
if
(
AccountUnitType
.
行政工勤
.
ToString
()
==
involve
)
{
{
// 行政工勤 根据测算表判读是否需要二次分配 默认不需要
compute
.
NeedSecondAllot
=
string
.
IsNullOrWhiteSpace
(
item
.
NeedSecondAllot
)
?
"否"
:
item
.
NeedSecondAllot
;
//考核前绩效
//考核前绩效
compute
.
PerforTotal
=
Math
.
Round
(
compute
.
BaiscNormValue
*
compute
.
PostCoefficient
*
compute
.
Attendance
+
compute
.
OtherPerfor
??
0
);
compute
.
PerforTotal
=
Math
.
Round
(
compute
.
BaiscNormValue
*
compute
.
PostCoefficient
*
compute
.
Attendance
+
compute
.
OtherPerfor
??
0
);
//考核后绩效 更加开关来控制显示
//考核后绩效 更加开关来控制显示
...
...
performance/Performance.Services/PerExcelService/ExcelReadConfig.cs
View file @
c9cdca5e
...
@@ -70,6 +70,7 @@ public class ExcelReadConfig
...
@@ -70,6 +70,7 @@ public class ExcelReadConfig
new
ColumnInfo
(
nameof
(
PerDataLogisticsEmployee
.
PostCoefficient
),
"岗位系数"
,
true
),
new
ColumnInfo
(
nameof
(
PerDataLogisticsEmployee
.
PostCoefficient
),
"岗位系数"
,
true
),
new
ColumnInfo
(
nameof
(
PerDataLogisticsEmployee
.
Attendance
),
"出勤率"
,
true
),
new
ColumnInfo
(
nameof
(
PerDataLogisticsEmployee
.
Attendance
),
"出勤率"
,
true
),
new
ColumnInfo
(
nameof
(
PerDataLogisticsEmployee
.
OthePerfor
),
"其他绩效"
,
true
),
new
ColumnInfo
(
nameof
(
PerDataLogisticsEmployee
.
OthePerfor
),
"其他绩效"
,
true
),
new
ColumnInfo
(
nameof
(
PerDataLogisticsEmployee
.
NeedSecondAllot
),
"是否需要二次分配"
),
//new ColumnInfo(nameof(PerDataLogisticsEmployee.AdjustLaterOtherFee), "调节后其他绩效", true),
//new ColumnInfo(nameof(PerDataLogisticsEmployee.AdjustLaterOtherFee), "调节后其他绩效", true),
};
};
...
...
performance/Performance.Services/RoleService.cs
View file @
c9cdca5e
...
@@ -13,12 +13,15 @@ public class RoleService : IAutoInjection
...
@@ -13,12 +13,15 @@ public class RoleService : IAutoInjection
{
{
private
PerforRoleRepository
_roleRepository
;
private
PerforRoleRepository
_roleRepository
;
private
PerforUserroleRepository
_userroleRepository
;
private
PerforUserroleRepository
_userroleRepository
;
private
PerforUserRepository
_userRepository
;
public
RoleService
(
PerforRoleRepository
roleRepository
,
public
RoleService
(
PerforRoleRepository
roleRepository
,
PerforUserroleRepository
userroleRepository
)
PerforUserroleRepository
userroleRepository
,
PerforUserRepository
userRepository
)
{
{
this
.
_roleRepository
=
roleRepository
;
this
.
_roleRepository
=
roleRepository
;
this
.
_userroleRepository
=
userroleRepository
;
this
.
_userroleRepository
=
userroleRepository
;
_userRepository
=
userRepository
;
}
}
/// <summary>
/// <summary>
...
@@ -51,5 +54,54 @@ public List<sys_role> GetRole(int userid)
...
@@ -51,5 +54,54 @@ public List<sys_role> GetRole(int userid)
return
roles
;
return
roles
;
}
}
public
List
<
RoleResponse
>
GetUsersRole
(
int
userid
)
{
List
<
RoleResponse
>
roleResponses
=
new
List
<
RoleResponse
>();
var
user
=
_userRepository
.
GetEntity
(
c
=>
c
.
ID
==
userid
);
var
ParentUser
=
_userRepository
.
GetEntities
(
c
=>
c
.
ParentID
==
userid
);
if
(
user
.
ParentID
!=
null
||
user
.
ParentID
==
0
)
{
ParentUser
=
_userRepository
.
GetEntities
(
c
=>
c
.
ID
==
user
.
ParentID
);
}
if
(
user
!=
null
)
{
foreach
(
var
sysUser
in
ParentUser
)
{
var
useRoles
=
GetARole
(
sysUser
.
ID
);
var
role
=
Mapper
.
Map
<
RoleResponse
>(
useRoles
);
role
.
Value
=
sysUser
.
ID
;
roleResponses
.
Add
(
role
);
}
}
var
roles
=
GetARole
(
userid
);
if
(
roles
!=
null
)
{
var
role
=
Mapper
.
Map
<
RoleResponse
>(
roles
);
role
.
Value
=
userid
;
roleResponses
.
Add
(
role
);
}
return
roleResponses
;
}
/// <summary>
/// 获取用户角色
/// </summary>
/// <param name="userid"></param>
/// <returns></returns>
public
sys_role
GetARole
(
int
userid
)
{
if
(
userid
<=
0
)
throw
new
PerformanceException
(
$"userid:
{
userid
}
错误"
);
var
joinList
=
_userroleRepository
.
GetEntities
(
t
=>
t
.
UserID
==
userid
);
if
(
joinList
==
null
)
return
null
;
var
roles
=
_roleRepository
.
GetEntity
(
t
=>
joinList
.
Select
(
j
=>
j
.
RoleID
).
Contains
(
t
.
ID
));
return
roles
;
}
}
}
}
}
performance/Performance.Services/SecondAllotService.cs
View file @
c9cdca5e
...
@@ -1614,9 +1614,9 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
...
@@ -1614,9 +1614,9 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
// return;
// return;
// 补充医院其他绩效 及 预留比例
// 补充医院其他绩效 及 预留比例
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
second
.
AllotId
&&
t
.
Status
==
3
);
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
second
.
AllotId
&&
t
.
Status
==
3
);
Func
<
per_employee
,
decimal
?>
getAprAmount
=
(
t
)
=>
second
.
Department
==
t
.
AccountingUnit
?
perapramounts
Func
<
per_employee
,
decimal
?>
getAprAmount
=
(
t
)
=>
second
.
Department
==
t
.
AccountingUnit
?.
Where
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
()
)
?
perapramounts
?.
Where
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
)
?.
Sum
(
w
=>
w
.
Amount
)
:
0
;
:
0
;
var
distPerformance
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
&&
employees
.
Select
(
s
=>
s
.
PersonnelNumber
).
Contains
(
t
.
JobNumber
));
var
distPerformance
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
&&
employees
.
Select
(
s
=>
s
.
PersonnelNumber
).
Contains
(
t
.
JobNumber
));
Func
<
per_employee
,
decimal
?>
getDistPerformance
=
(
t
)
=>
0
;
Func
<
per_employee
,
decimal
?>
getDistPerformance
=
(
t
)
=>
0
;
...
@@ -1671,6 +1671,9 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request
...
@@ -1671,6 +1671,9 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
OtherPerformance
=
item
.
OtherPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
OtherPerformance
=
item
.
OtherPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
NightWorkPerformance
=
item
.
NightWorkPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
NightWorkPerformance
=
item
.
NightWorkPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
RealAmount
=
item
.
RealAmount
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
RealAmount
=
item
.
RealAmount
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
ManagementAllowance
=
item
.
ManagementAllowance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
IndividualReward
=
item
.
IndividualReward
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
AllocationOfKeySpecialty
=
item
.
AllocationOfKeySpecialty
;
}
}
perforAgothersourceRepository
.
UpdateRange
(
existEntities
.
ToArray
());
perforAgothersourceRepository
.
UpdateRange
(
existEntities
.
ToArray
());
...
...
performance/Performance.Services/UserService.cs
View file @
c9cdca5e
...
@@ -142,7 +142,7 @@ public List<UserResponse> GetUserList(int userID)
...
@@ -142,7 +142,7 @@ public List<UserResponse> GetUserList(int userID)
if
(
role
.
IsViewAllUsers
==
2
)
if
(
role
.
IsViewAllUsers
==
2
)
{
{
var
userlist
=
_userRepository
.
GetEntities
(
t
=>
t
.
CreateUser
==
userID
&&
t
.
IsDelete
==
1
);
var
userlist
=
_userRepository
.
GetEntities
(
t
=>
t
.
CreateUser
==
userID
&&
t
.
IsDelete
==
1
&&
(
t
.
ParentID
==
0
||
t
.
ParentID
==
null
)
);
result
=
Mapper
.
Map
<
List
<
UserResponse
>>(
userlist
);
result
=
Mapper
.
Map
<
List
<
UserResponse
>>(
userlist
);
}
}
else
else
...
@@ -151,7 +151,7 @@ public List<UserResponse> GetUserList(int userID)
...
@@ -151,7 +151,7 @@ public List<UserResponse> GetUserList(int userID)
if
(
hospitalIds
==
null
||
!
hospitalIds
.
Any
())
return
result
;
if
(
hospitalIds
==
null
||
!
hospitalIds
.
Any
())
return
result
;
var
userIds
=
_userhospitalRepository
.
GetEntities
(
t
=>
hospitalIds
.
Contains
(
t
.
HospitalID
)).
Select
(
t
=>
t
.
UserID
).
Distinct
();
var
userIds
=
_userhospitalRepository
.
GetEntities
(
t
=>
hospitalIds
.
Contains
(
t
.
HospitalID
)).
Select
(
t
=>
t
.
UserID
).
Distinct
();
var
userlist
=
_userRepository
.
GetEntities
(
t
=>
t
.
ID
!=
userID
&&
userIds
.
Contains
(
t
.
ID
)
&&
t
.
IsDelete
==
1
);
var
userlist
=
_userRepository
.
GetEntities
(
t
=>
t
.
ID
!=
userID
&&
userIds
.
Contains
(
t
.
ID
)
&&
t
.
IsDelete
==
1
&&
(
t
.
ParentID
==
0
||
t
.
ParentID
==
null
)
);
result
=
Mapper
.
Map
<
List
<
UserResponse
>>(
userlist
);
result
=
Mapper
.
Map
<
List
<
UserResponse
>>(
userlist
);
}
}
if
(
result
!=
null
&&
result
.
Count
>
0
)
if
(
result
!=
null
&&
result
.
Count
>
0
)
...
@@ -163,9 +163,26 @@ public List<UserResponse> GetUserList(int userID)
...
@@ -163,9 +163,26 @@ public List<UserResponse> GetUserList(int userID)
{
{
item
.
Hospital
=
string
.
Join
(
","
,
hoslist
.
Select
(
p
=>
p
.
HospitalID
.
Value
));
item
.
Hospital
=
string
.
Join
(
","
,
hoslist
.
Select
(
p
=>
p
.
HospitalID
.
Value
));
}
}
List
<
int
>
roleId
=
new
List
<
int
>();
var
userRole
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
item
.
UserID
);
var
userRole
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
item
.
UserID
);
if
(
userRole
!=
null
)
if
(
userRole
!=
null
)
{
item
.
Role
=
userRole
.
RoleID
;
item
.
Role
=
userRole
.
RoleID
;
roleId
.
Add
(
userRole
.
RoleID
);
}
var
diffUserRole
=
_userRepository
.
GetEntities
(
c
=>
c
.
ParentID
==
item
.
UserID
);
if
(
diffUserRole
!=
null
)
{
foreach
(
var
user
in
diffUserRole
)
{
var
diffRole
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
user
.
ID
);
roleId
.
Add
(
diffRole
.
RoleID
);
}
}
item
.
RoleArr
=
roleId
?.
ToArray
();
}
}
}
}
return
result
;
return
result
;
...
@@ -496,5 +513,160 @@ public UserResponse ResetPwd(int userId, int loginUserId)
...
@@ -496,5 +513,160 @@ public UserResponse ResetPwd(int userId, int loginUserId)
throw
new
PerformanceException
(
"重置失败"
);
throw
new
PerformanceException
(
"重置失败"
);
return
Mapper
.
Map
<
UserResponse
>(
user
);
return
Mapper
.
Map
<
UserResponse
>(
user
);
}
}
#
region
多角色
/// <summary>
/// 新增用户
/// </summary>
/// <param name="request"></param>
public
UserResponse
InsertUser
(
UserRequest
request
,
int
userid
)
{
if
(
null
!=
_userRepository
.
GetEntity
(
t
=>
t
.
Login
==
request
.
Login
&&
t
.
IsDelete
==
1
))
throw
new
PerformanceException
(
"登录名重复"
);
if
(
request
.
HosIDArray
.
Length
>
1
)
throw
new
PerformanceException
(
"二次绩效管理员只支持单家医院"
);
int
[]
roleArray
=
new
int
[]
{
application
.
NurseRole
,
application
.
DirectorRole
,
application
.
SpecialRole
,
application
.
OfficeRole
};
if
(
roleArray
.
Intersect
(
request
.
RoleArr
).
Any
()
&&
string
.
IsNullOrEmpty
(
request
.
Department
))
throw
new
PerformanceException
(
"二次绩效管理员科室不能为空"
);
var
user
=
Mapper
.
Map
<
sys_user
>(
request
);
user
.
CreateDate
=
DateTime
.
Now
;
user
.
CreateUser
=
userid
;
user
.
States
=
(
int
)
States
.
Enabled
;
user
.
Department
=
roleArray
.
Contains
(
request
.
RoleArr
[
0
])
?
request
.
Department
:
""
;
user
.
IsDelete
=
1
;
if
(!
_userRepository
.
Add
(
user
))
throw
new
PerformanceException
(
"保存失败"
);
//添加用户角色关联关系
_userroleRepository
.
Add
(
new
sys_user_role
{
UserID
=
user
.
ID
,
RoleID
=
request
.
RoleArr
[
0
]
});
//添加用户医院
SetHospital
(
user
.
ID
,
request
.
HosIDArray
);
var
userID
=
user
.
ID
;
for
(
int
i
=
1
;
i
<
request
.
RoleArr
.
Length
;
i
++)
{
user
.
Login
=
request
.
Login
+
i
;
user
.
ParentID
=
userID
;
user
.
Department
=
roleArray
.
Contains
(
request
.
RoleArr
[
i
])
?
request
.
Department
:
""
;
user
.
ID
++;
_userRepository
.
Add
(
user
);
//添加用户角色关联关系
_userroleRepository
.
Add
(
new
sys_user_role
{
UserID
=
user
.
ID
,
RoleID
=
request
.
RoleArr
[
i
]
});
//添加用户医院
SetHospital
(
user
.
ID
,
request
.
HosIDArray
);
}
return
Mapper
.
Map
<
UserResponse
>(
user
);
}
/// <summary>
/// 修改用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
UserResponse
UpdateUser
(
UserRequest
request
,
bool
isAgainAdmin
)
{
var
user
=
_userRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ID
&&
t
.
IsDelete
==
1
);
if
(
null
==
user
)
throw
new
PerformanceException
(
$"用户不存在 UserId:
{
request
.
ID
}
"
);
var
vlist
=
_userRepository
.
GetEntities
(
t
=>
t
.
ID
!=
user
.
ID
&&
t
.
Login
==
request
.
Login
&&
t
.
IsDelete
==
1
);
if
(
null
!=
vlist
&&
vlist
.
Count
()
>
0
)
throw
new
PerformanceException
(
"登录名重复"
);
if
(
isAgainAdmin
&&
string
.
IsNullOrEmpty
(
request
.
Department
))
throw
new
PerformanceException
(
"二次绩效管理员科室不能为空"
);
if
(
isAgainAdmin
&&
request
.
HosIDArray
.
Length
>
1
)
throw
new
PerformanceException
(
"二次绩效管理员只支持单家医院"
);
int
[]
roleArray
=
new
int
[]
{
application
.
NurseRole
,
application
.
DirectorRole
,
application
.
SpecialRole
,
application
.
OfficeRole
};
user
.
Login
=
request
.
Login
;
user
.
Mobile
=
request
.
Mobile
;
user
.
RealName
=
request
.
RealName
;
user
.
Mail
=
request
.
Mail
;
user
.
States
=
request
.
States
;
user
.
Password
=
string
.
IsNullOrEmpty
(
request
.
Password
)
?
user
.
Password
:
request
.
Password
;
user
.
Department
=
roleArray
.
Contains
(
request
.
RoleArr
[
0
])
?
request
.
Department
:
""
;
if
(!
_userRepository
.
Update
(
user
))
throw
new
PerformanceException
(
"保存失败"
);
//删除用户角色关联关系
var
userRole
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
user
.
ID
);
if
(
null
!=
userRole
)
_userroleRepository
.
Remove
(
userRole
);
//添加用户角色关联关系
_userroleRepository
.
Add
(
new
sys_user_role
{
UserID
=
user
.
ID
,
RoleID
=
request
.
RoleArr
[
0
]
});
//添加用户医院
SetHospital
(
user
.
ID
,
request
.
HosIDArray
);
//删除子用户角色关联关系
var
userSubset
=
_userRepository
.
GetEntities
(
c
=>
c
.
ParentID
==
user
.
ID
);
if
(
userSubset
!=
null
)
{
foreach
(
var
item
in
userSubset
)
{
var
diffUserRole
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
item
.
ID
);
if
(
null
!=
diffUserRole
)
_userroleRepository
.
Remove
(
diffUserRole
);
}
_userRepository
.
RemoveRange
(
userSubset
.
ToArray
());
}
var
userID
=
user
.
ID
;
var
userLogin
=
user
.
Login
;
for
(
int
i
=
1
;
i
<
request
.
RoleArr
.
Length
;
i
++)
{
sys_user
diffUser
=
new
sys_user
();
diffUser
.
CreateDate
=
DateTime
.
Now
;
diffUser
.
CreateUser
=
user
.
CreateUser
;
diffUser
.
IsDelete
=
1
;
diffUser
.
Login
=
userLogin
+
i
;
diffUser
.
ParentID
=
userID
;
diffUser
.
Mobile
=
request
.
Mobile
;
diffUser
.
RealName
=
request
.
RealName
;
diffUser
.
Mail
=
request
.
Mail
;
diffUser
.
States
=
request
.
States
;
diffUser
.
Password
=
string
.
IsNullOrEmpty
(
request
.
Password
)
?
user
.
Password
:
request
.
Password
;
diffUser
.
Department
=
roleArray
.
Contains
(
request
.
RoleArr
[
0
])
?
request
.
Department
:
""
;
if
(!
_userRepository
.
Add
(
diffUser
))
throw
new
PerformanceException
(
"保存失败"
);
//添加子用户角色关联关系
_userroleRepository
.
Add
(
new
sys_user_role
{
UserID
=
diffUser
.
ID
,
RoleID
=
request
.
RoleArr
[
i
]
});
//添加子用户医院
SetHospital
(
diffUser
.
ID
,
request
.
HosIDArray
);
}
return
Mapper
.
Map
<
UserResponse
>(
user
);
}
public
ApiResponse
DeleteUser
(
int
iD
)
{
var
user
=
_userRepository
.
GetEntity
(
t
=>
t
.
ID
==
iD
&&
t
.
IsDelete
==
1
);
if
(
null
==
user
)
throw
new
PerformanceException
(
$"用户不存在 UserId:
{
iD
}
"
);
user
.
IsDelete
=
2
;
var
result
=
_userRepository
.
Remove
(
user
);
var
users
=
_userRepository
.
GetEntities
(
t
=>
t
.
ParentID
==
user
.
ID
&&
t
.
IsDelete
==
1
)?.
ToArray
();
if
(
users
!=
null
)
{
_userRepository
.
RemoveRange
(
users
);
foreach
(
var
item
in
users
)
{
var
userRole
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
item
.
ID
);
if
(
null
!=
userRole
)
_userroleRepository
.
Remove
(
userRole
);
}
}
return
result
?
new
ApiResponse
(
ResponseType
.
OK
)
:
new
ApiResponse
(
ResponseType
.
Fail
);
}
#
endregion
}
}
}
}
\ 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