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
bced5a61
Commit
bced5a61
authored
Jun 24, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跳过Delete删除的数据
parent
9d909f61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
21 deletions
+38
-21
performance/Performance.Api/Controllers/SecondAllotController.cs
+7
-5
performance/Performance.Services/RedistributionService.cs
+31
-16
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
bced5a61
...
...
@@ -598,9 +598,9 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
// 年资职称绩效占比与工作量绩效占比 校验
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
if
((
ComputeMode
)
request
.
ComputeMode
!=
ComputeMode
.
NotCalculate
)
{
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
seniorityTitlesAccountedPerformance
=
request
.
Head
.
GetValue
(
nameof
(
ag_headsource
.
SeniorityTitlesAccountedPerformance
),
0
m
);
var
workloadRatio
=
workloadGroups
.
Sum
(
w
=>
request
.
Head
.
GetValue
(
$"Workload_Ratio_
{
w
.
Name
}
"
,
0
m
));
...
...
@@ -610,7 +610,7 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
throw
new
PerformanceException
(
"年资职称绩效占比与工作量绩效占比总和,不足100%!"
);
}
// 二次分配人员信息 校验
var
result
=
_redistributionService
.
CheckData
(
second
,
request
.
Body
);
var
result
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
catch
(
PerformanceException
ex
)
...
...
@@ -662,7 +662,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
}
// 二次分配人员信息 校验
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
request
.
Body
);
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
if
(
checkDatas
!=
null
&&
checkDatas
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkDatas
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
...
...
@@ -709,8 +709,9 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
// 二次分配人员信息 校验
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
request
.
Body
);
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
if
(
checkDatas
!=
null
&&
checkDatas
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkDatas
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
...
...
@@ -754,8 +755,9 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
// 二次分配人员信息 校验
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
request
.
Body
);
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
if
(
checkDatas
!=
null
&&
checkDatas
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkDatas
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
...
...
performance/Performance.Services/RedistributionService.cs
View file @
bced5a61
...
...
@@ -92,21 +92,8 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
var
loads
=
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
(
colHeaderCustoms
,
columnCustoms
)
=
GetCustomColumns
(
computeMode
,
loads
);
HandsonTableBase
handson
=
new
HandsonTableBase
();
switch
(
computeMode
)
{
case
ComputeMode
.
NotCalculate
:
handson
=
ComputeMode_Format1
(
colHeaderCustoms
,
columnCustoms
);
break
;
case
ComputeMode
.
Horizontal
:
handson
=
ComputeMode_Format2
(
colHeaderCustoms
,
columnCustoms
);
break
;
case
ComputeMode
.
Vertical
:
handson
=
ComputeMode_Format3
(
colHeaderCustoms
,
columnCustoms
,
loads
);
break
;
}
HandsonTableBase
handson
=
GetHandsonTable
(
computeMode
,
loads
);
// 先占位,更加选择加载指定范围数据
// 加载方式分 保存,上次,字典,测算表
var
loadEmployees
=
LoadEmployees
(
allot
,
second
,
overrideMode
);
...
...
@@ -136,6 +123,32 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
return
new
SecondDetailDto
{
Head
=
head
,
Body
=
handson
,
Dic
=
dic
};
}
/// <summary>
/// 获取HandonTable内容配置信息
/// </summary>
/// <param name="computeMode"></param>
/// <param name="loads"></param>
/// <returns></returns>
public
HandsonTableBase
GetHandsonTable
(
ComputeMode
computeMode
,
List
<
TitleValue
<
string
,
decimal
?>>
loads
)
{
var
(
colHeaderCustoms
,
columnCustoms
)
=
GetCustomColumns
(
computeMode
,
loads
);
HandsonTableBase
handson
=
new
HandsonTableBase
();
switch
(
computeMode
)
{
case
ComputeMode
.
NotCalculate
:
handson
=
ComputeMode_Format1
(
colHeaderCustoms
,
columnCustoms
);
break
;
case
ComputeMode
.
Horizontal
:
handson
=
ComputeMode_Format2
(
colHeaderCustoms
,
columnCustoms
);
break
;
case
ComputeMode
.
Vertical
:
handson
=
ComputeMode_Format3
(
colHeaderCustoms
,
columnCustoms
,
loads
);
break
;
}
return
handson
;
}
/// <summary>
/// 表格及列头 字典信息
...
...
@@ -1116,7 +1129,7 @@ public List<SecondWorkLoadDto> GetTopWorkloadBodyGroups(List<TitleValue<string,
/// <param name="second"></param>
/// <param name="body"></param>
/// <returns></returns>
public
List
<
SecondComputeCheckResultDto
>
CheckData
(
ag_secondallot
second
,
List
<
Dictionary
<
string
,
object
>>
body
)
public
List
<
SecondComputeCheckResultDto
>
CheckData
(
ag_secondallot
second
,
ComputeMode
computeMode
,
List
<
Dictionary
<
string
,
object
>>
body
,
List
<
TitleValue
<
string
,
decimal
?>>
loads
)
{
if
(
body
==
null
||
body
.
Count
==
0
)
throw
new
PerformanceException
(
"分配人员信息不存在!"
);
...
...
@@ -1126,10 +1139,12 @@ public List<SecondComputeCheckResultDto> CheckData(ag_secondallot second, List<D
var
employees
=
_peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
second
.
AllotId
)
.
Select
(
w
=>
new
{
w
.
PersonnelNumber
,
w
.
DoctorName
,
w
.
AccountingUnit
,
w
.
UnitType
,
w
.
ReservedRatio
});
var
handsonTable
=
GetHandsonTable
(
computeMode
,
loads
);
var
fixat
=
new
string
[]
{
nameof
(
ag_bodysource
.
Id
).
ToLower
(),
nameof
(
ag_bodysource
.
SecondId
).
ToLower
(),
nameof
(
ag_bodysource
.
Department
).
ToLower
()
};
for
(
int
i
=
0
;
i
<
body
.
Count
;
i
++)
{
var
item
=
body
[
i
];
if
(
item
.
Where
(
w
=>
w
.
Value
!=
null
&&
!
string
.
IsNullOrEmpty
(
w
.
Value
.
ToString
())).
Count
()
>
0
)
if
(
item
.
Where
(
w
=>
handsonTable
.
Columns
.
Any
(
col
=>
col
.
Data
.
EqualsIgnoreCase
(
w
.
Key
))
&&
w
.
Value
!=
null
&&
!
string
.
IsNullOrEmpty
(
w
.
Value
.
ToString
())).
Count
()
>
0
)
{
var
number
=
item
.
GetString
(
nameof
(
ag_bodysource
.
WorkNumber
));
var
name
=
item
.
GetString
(
nameof
(
ag_bodysource
.
Name
));
...
...
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