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
61bf169d
Commit
61bf169d
authored
Apr 28, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次分配提交数据带出
parent
b6f54e76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
22 deletions
+45
-22
performance/Performance.Api/Controllers/SecondAllotController.cs
+5
-5
performance/Performance.Services/RedistributionService.cs
+40
-17
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
61bf169d
...
@@ -633,7 +633,7 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
...
@@ -633,7 +633,7 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
throw
new
PerformanceException
(
"绩效记录不存在!"
);
// 年资职称绩效占比与工作量绩效占比 校验
// 年资职称绩效占比与工作量绩效占比 校验
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
,
second
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
if
((
ComputeMode
)
request
.
ComputeMode
!=
ComputeMode
.
NotCalculate
)
if
((
ComputeMode
)
request
.
ComputeMode
!=
ComputeMode
.
NotCalculate
)
...
@@ -702,7 +702,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
...
@@ -702,7 +702,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
throw
new
PerformanceException
(
"绩效记录不存在!"
);
// 年资职称绩效占比与工作量绩效占比 校验
// 年资职称绩效占比与工作量绩效占比 校验
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
,
second
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
if
((
ComputeMode
)
request
.
ComputeMode
!=
ComputeMode
.
NotCalculate
)
if
((
ComputeMode
)
request
.
ComputeMode
!=
ComputeMode
.
NotCalculate
)
...
@@ -771,7 +771,7 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
...
@@ -771,7 +771,7 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
throw
new
PerformanceException
(
"绩效记录不存在!"
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
,
second
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
// 二次分配人员信息 校验
// 二次分配人员信息 校验
var
checkDatas
=
_redistributionService
.
CheckData
(
allot
,
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
var
checkDatas
=
_redistributionService
.
CheckData
(
allot
,
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
...
@@ -833,7 +833,7 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
...
@@ -833,7 +833,7 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
if
(!
new
int
[]
{
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
Archive
}.
Contains
(
allot
.
States
))
if
(!
new
int
[]
{
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
Archive
}.
Contains
(
allot
.
States
))
throw
new
PerformanceException
(
"绩效未下发,无法提交!"
);
throw
new
PerformanceException
(
"绩效未下发,无法提交!"
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
,
second
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
// 二次分配人员信息 校验
// 二次分配人员信息 校验
...
@@ -932,7 +932,7 @@ public ApiResponse RedistributionDetail([FromBody] SecondBaseDto request)
...
@@ -932,7 +932,7 @@ public ApiResponse RedistributionDetail([FromBody] SecondBaseDto request)
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
throw
new
PerformanceException
(
"绩效记录不存在!"
);
// 年资职称绩效占比与工作量绩效占比 校验
// 年资职称绩效占比与工作量绩效占比 校验
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
,
second
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
// 返回信息
// 返回信息
...
...
performance/Performance.Services/RedistributionService.cs
View file @
61bf169d
...
@@ -100,7 +100,7 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
...
@@ -100,7 +100,7 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
// 填报模板带出 行政工勤 绩效
// 填报模板带出 行政工勤 绩效
var
computes
=
_rescomputeRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
UnitTypeUtil
.
Office
.
Contains
(
w
.
AccountType
));
var
computes
=
_rescomputeRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
UnitTypeUtil
.
Office
.
Contains
(
w
.
AccountType
));
var
loads
=
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
GetWorkLoads
(
allot
,
second
);
var
employees
=
_peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
second
.
AllotId
);
var
employees
=
_peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
second
.
AllotId
);
HandsonTableBase
handson
=
GetHandsonTable
(
allot
,
computeMode
,
loads
);
HandsonTableBase
handson
=
GetHandsonTable
(
allot
,
computeMode
,
loads
);
...
@@ -277,7 +277,10 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
...
@@ -277,7 +277,10 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
if
(
second
.
Status
.
HasValue
&&
status
.
Contains
(
second
.
Status
.
Value
))
if
(
second
.
Status
.
HasValue
&&
status
.
Contains
(
second
.
Status
.
Value
))
{
{
var
headDynamic
=
_agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
)
??
new
List
<
ag_worktype_source
>();
var
headDynamic
=
_agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
)
??
new
List
<
ag_worktype_source
>();
foreach
(
var
item
in
headDynamic
.
OrderBy
(
t
=>
t
.
Id
))
var
groupDatas
=
headDynamic
.
GroupBy
(
w
=>
new
{
w
.
WorkTypeId
,
w
.
SecondId
,
w
.
FieldId
,
w
.
FieldName
})
.
Select
(
w
=>
w
.
OrderByDescending
(
w
=>
w
.
Id
).
FirstOrDefault
());
foreach
(
var
item
in
groupDatas
.
OrderBy
(
t
=>
t
.
Id
))
{
{
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
FieldName
,
item
.
FieldId
,
true
,
1
,
"Top"
,
isNumber
:
true
));
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
FieldName
,
item
.
FieldId
,
true
,
1
,
"Top"
,
isNumber
:
true
));
}
}
...
@@ -322,7 +325,7 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
...
@@ -322,7 +325,7 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
foreach
(
var
row
in
rows
)
foreach
(
var
row
in
rows
)
{
{
var
number
=
row
.
GetString
(
nameof
(
ag_bodysource
.
WorkNumber
));
var
number
=
row
.
GetString
(
nameof
(
ag_bodysource
.
WorkNumber
));
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>();
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>();
var
emp
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
number
);
var
emp
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
number
);
...
@@ -464,9 +467,14 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
...
@@ -464,9 +467,14 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
// 已提交
// 已提交
if
(
second
.
Status
.
HasValue
&&
status
.
Contains
(
second
.
Status
.
Value
))
if
(
second
.
Status
.
HasValue
&&
status
.
Contains
(
second
.
Status
.
Value
))
{
{
foreach
(
var
item
in
headDynamic
.
Where
(
w
=>
w
.
FieldId
.
StartsWithIgnoreCase
(
"Workload_Ratio_"
)).
OrderBy
(
t
=>
t
.
Id
))
var
groupDatas
=
headDynamic
.
Where
(
w
=>
w
.
FieldId
.
StartsWithIgnoreCase
(
"Workload_Ratio_"
))
.
GroupBy
(
w
=>
new
{
w
.
WorkTypeId
,
w
.
SecondId
,
w
.
FieldId
,
w
.
FieldName
})
.
Select
(
w
=>
new
{
w
.
Key
.
FieldId
,
Value
=
w
.
OrderByDescending
(
w
=>
w
.
Id
).
FirstOrDefault
()?.
Value
??
0
});
foreach
(
var
item
in
groupDatas
)
{
{
head
.
AddOrUpdate
(
item
.
FieldId
,
item
.
Value
??
0
);
head
.
AddOrUpdate
(
item
.
FieldId
,
item
.
Value
);
}
}
}
}
// 未提交
// 未提交
...
@@ -742,19 +750,34 @@ private List<string> LoadEmployees_OfficeExcel(ag_secondallot second)
...
@@ -742,19 +750,34 @@ private List<string> LoadEmployees_OfficeExcel(ag_secondallot second)
/// <summary>
/// <summary>
/// 获取工作量及单项奖励
/// 获取工作量及单项奖励
/// </summary>
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="allot"></param>
/// <param name="unitType"></param>
/// <param name="second"></param>
/// <param name="accountingUnit"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
TitleValue
<
string
,
decimal
?>>
GetWorkLoads
(
int
hospitalId
,
string
unitType
,
string
accountingUnit
)
public
List
<
TitleValue
<
string
,
decimal
?>>
GetWorkLoads
(
per_allot
allot
,
ag_secondallot
second
)
{
{
var
workloads
=
_agworkloadRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Department
==
accountingUnit
&&
t
.
UnitType
==
unitType
)
??
new
List
<
ag_workload
>();
var
status
=
(
new
int
[]
{
(
int
)
SecondAllotStatus
.
WaitReview
,
(
int
)
SecondAllotStatus
.
PassAudit
});
var
loads
=
workloads
// 已提交
.
OrderBy
(
t
=>
t
.
WorkTypeId
).
ThenBy
(
t
=>
t
.
Sort
)
if
(
second
.
Status
.
HasValue
&&
status
.
Contains
(
second
.
Status
.
Value
))
.
Select
(
t
=>
new
TitleValue
<
string
,
decimal
?>
{
Title
=
t
.
ItemId
,
Value
=
t
.
ItemName
,
State
=
t
.
FactorValue
})
{
.
ToList
();
var
bodys
=
_agbodysourceRepository
.
GetEntities
(
w
=>
w
.
SecondId
==
second
.
Id
);
var
ids
=
bodys
.
Select
(
w
=>
w
.
Id
).
ToList
();
return
loads
;
var
sources
=
_agworkloadsourceRepository
.
GetEntities
(
w
=>
ids
.
Contains
(
w
.
BodyId
))
??
new
List
<
ag_workload_source
>();
var
loads
=
sources
.
OrderBy
(
t
=>
t
.
WorkTypeId
).
ThenBy
(
t
=>
t
.
Sort
)
.
GroupBy
(
w
=>
new
{
w
.
ItemId
,
w
.
ItemName
})
.
Select
(
t
=>
new
TitleValue
<
string
,
decimal
?>
{
Title
=
t
.
Key
.
ItemId
,
Value
=
t
.
Key
.
ItemName
,
State
=
t
.
FirstOrDefault
()?.
FactorValue
??
0
})
.
ToList
();
return
loads
;
}
else
{
var
workloads
=
_agworkloadRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Department
==
second
.
Department
&&
t
.
UnitType
==
second
.
UnitType
)
??
new
List
<
ag_workload
>();
var
loads
=
workloads
.
OrderBy
(
t
=>
t
.
WorkTypeId
).
ThenBy
(
t
=>
t
.
Sort
)
.
Select
(
t
=>
new
TitleValue
<
string
,
decimal
?>
{
Title
=
t
.
ItemId
,
Value
=
t
.
ItemName
,
State
=
t
.
FactorValue
})
.
ToList
();
return
loads
;
}
}
}
#
endregion
#
endregion
...
@@ -1579,7 +1602,7 @@ public object RedistributionEmployee(SecondEmployeeDto request)
...
@@ -1579,7 +1602,7 @@ public object RedistributionEmployee(SecondEmployeeDto request)
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
throw
new
PerformanceException
(
"绩效记录不存在!"
);
// 当前二次分配配置工作量
// 当前二次分配配置工作量
var
loads
=
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
GetWorkLoads
(
allot
,
second
);
Expression
<
Func
<
per_employee
,
bool
>>
exp
=
t
=>
t
.
AllotId
==
second
.
AllotId
;
Expression
<
Func
<
per_employee
,
bool
>>
exp
=
t
=>
t
.
AllotId
==
second
.
AllotId
;
...
...
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