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
0d417378
Commit
0d417378
authored
Nov 23, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/二次分配格式验证' into develop
parents
08b3652d
fb8bf243
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
3 deletions
+40
-3
performance/Performance.Api/Controllers/SecondAllotController.cs
+29
-2
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+5
-0
performance/Performance.DtoModels/Second/SecondColumnDictionary.cs
+6
-1
performance/Performance.Services/RedistributionService.cs
+0
-0
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
0d417378
...
@@ -613,9 +613,10 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
...
@@ -613,9 +613,10 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
throw
new
PerformanceException
(
"绩效记录不存在!"
);
// 年资职称绩效占比与工作量绩效占比 校验
// 年资职称绩效占比与工作量绩效占比 校验
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
if
((
ComputeMode
)
request
.
ComputeMode
!=
ComputeMode
.
NotCalculate
)
if
((
ComputeMode
)
request
.
ComputeMode
!=
ComputeMode
.
NotCalculate
)
{
{
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
workloadRatio
=
workloadGroups
.
Select
(
w
=>
request
.
Head
.
GetValue
(
$"Workload_Ratio_
{
w
.
Name
}
"
,
0
m
));
var
workloadRatio
=
workloadGroups
.
Select
(
w
=>
request
.
Head
.
GetValue
(
$"Workload_Ratio_
{
w
.
Name
}
"
,
0
m
));
if
(
workloadRatio
.
Any
(
w
=>
w
>
1
||
w
<
0
))
if
(
workloadRatio
.
Any
(
w
=>
w
>
1
||
w
<
0
))
throw
new
PerformanceException
(
"工作量绩效占比存在异常值!"
);
throw
new
PerformanceException
(
"工作量绩效占比存在异常值!"
);
...
@@ -629,8 +630,20 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
...
@@ -629,8 +630,20 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
else
if
(
seniorityTitlesAccountedPerformance
+
workloadRatio
.
Sum
()
<
1
)
else
if
(
seniorityTitlesAccountedPerformance
+
workloadRatio
.
Sum
()
<
1
)
throw
new
PerformanceException
(
"年资职称绩效占比与工作量绩效占比总和,不足100%!"
);
throw
new
PerformanceException
(
"年资职称绩效占比与工作量绩效占比总和,不足100%!"
);
}
}
List
<
SecondComputeCheckResultDto
>
result
=
new
List
<
SecondComputeCheckResultDto
>();
// 二次分配人员信息 校验
// 二次分配人员信息 校验
var
result
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
var
checkData
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
if
(
checkData
!=
null
&&
checkData
.
Count
>
0
)
result
.
AddRange
(
checkData
);
// 二次分配提交数据格式 校验
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
var
checkFormat
=
_redistributionService
.
CheckFormat
(
request
.
Head
,
request
.
Body
,
dic
);
if
(
checkFormat
!=
null
&&
checkFormat
.
Count
>
0
)
result
.
AddRange
(
checkFormat
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
}
catch
(
PerformanceException
ex
)
catch
(
PerformanceException
ex
)
...
@@ -737,10 +750,16 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
...
@@ -737,10 +750,16 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
throw
new
PerformanceException
(
"绩效记录不存在!"
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
// 二次分配人员信息 校验
// 二次分配人员信息 校验
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
if
(
checkDatas
!=
null
&&
checkDatas
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
if
(
checkDatas
!=
null
&&
checkDatas
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkDatas
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkDatas
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
// 二次分配提交数据格式 校验
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
var
checkFormat
=
_redistributionService
.
CheckFormat
(
request
.
Head
,
request
.
Body
,
dic
);
if
(
checkFormat
!=
null
&&
checkFormat
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkFormat
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
// 清理无效数据 没有Tab标签的数据才是要计算的数据
// 清理无效数据 没有Tab标签的数据才是要计算的数据
var
cleanDatas
=
request
.
Body
.
Where
(
w
=>
w
.
Count
>
0
&&
w
.
GetValue
(
nameof
(
ResponseType
),
""
)
==
ResponseType
.
OK
.
ToString
()).
ToList
();
var
cleanDatas
=
request
.
Body
.
Where
(
w
=>
w
.
Count
>
0
&&
w
.
GetValue
(
nameof
(
ResponseType
),
""
)
==
ResponseType
.
OK
.
ToString
()).
ToList
();
...
@@ -786,11 +805,19 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
...
@@ -786,11 +805,19 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
throw
new
PerformanceException
(
"绩效未下发,无法提交!"
);
throw
new
PerformanceException
(
"绩效未下发,无法提交!"
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
loads
=
_redistributionService
.
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
// 二次分配人员信息 校验
// 二次分配人员信息 校验
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
var
checkDatas
=
_redistributionService
.
CheckData
(
second
,
(
ComputeMode
)
request
.
ComputeMode
,
request
.
Body
,
loads
);
if
(
checkDatas
!=
null
&&
checkDatas
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
if
(
checkDatas
!=
null
&&
checkDatas
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkDatas
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkDatas
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
// 二次分配提交数据格式 校验
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
var
checkFormat
=
_redistributionService
.
CheckFormat
(
request
.
Head
,
request
.
Body
,
dic
);
if
(
checkFormat
!=
null
&&
checkFormat
.
Any
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"数据验证未通过,请修复后查看计算结果!"
,
checkFormat
.
Where
(
w
=>
w
.
Level
==
ResponseType
.
Error
.
ToString
()));
// 清理无效数据 没有Tab标签的数据才是要计算的数据
// 清理无效数据 没有Tab标签的数据才是要计算的数据
var
cleanDatas
=
request
.
Body
.
Where
(
w
=>
w
.
Count
>
0
&&
w
.
GetValue
(
nameof
(
ResponseType
),
""
)
==
ResponseType
.
OK
.
ToString
()).
ToList
();
var
cleanDatas
=
request
.
Body
.
Where
(
w
=>
w
.
Count
>
0
&&
w
.
GetValue
(
nameof
(
ResponseType
),
""
)
==
ResponseType
.
OK
.
ToString
()).
ToList
();
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
0d417378
...
@@ -4108,6 +4108,11 @@
...
@@ -4108,6 +4108,11 @@
颜色class名称
颜色class名称
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.SecondColumnDictionary.IsNumber"
>
<summary>
格式
</summary>
</member>
<member
name=
"P:Performance.DtoModels.SecondEmployeeDto.ComputeMode"
>
<member
name=
"P:Performance.DtoModels.SecondEmployeeDto.ComputeMode"
>
<summary>
<summary>
计算方式:11 不计算 12 横向计算 13 纵向计算
计算方式:11 不计算 12 横向计算 13 纵向计算
...
...
performance/Performance.DtoModels/Second/SecondColumnDictionary.cs
View file @
0d417378
...
@@ -34,12 +34,16 @@ public class SecondColumnDictionary
...
@@ -34,12 +34,16 @@ public class SecondColumnDictionary
/// 颜色class名称
/// 颜色class名称
/// </summary>
/// </summary>
public
string
Color
{
get
;
set
;
}
public
string
Color
{
get
;
set
;
}
/// <summary>
/// 格式
/// </summary>
public
bool
IsNumber
{
get
;
set
;
}
public
SecondColumnDictionary
()
public
SecondColumnDictionary
()
{
{
}
}
public
SecondColumnDictionary
(
string
label
,
string
key
,
bool
isTrue
,
int
sort
,
string
site
=
"Table"
,
string
type
=
""
,
string
color
=
""
,
int
?
width
=
null
)
public
SecondColumnDictionary
(
string
label
,
string
key
,
bool
isTrue
,
int
sort
,
string
site
=
"Table"
,
string
type
=
""
,
string
color
=
""
,
int
?
width
=
null
,
bool
isNumber
=
true
)
{
{
Label
=
label
;
Label
=
label
;
Key
=
key
;
Key
=
key
;
...
@@ -49,6 +53,7 @@ public SecondColumnDictionary(string label, string key, bool isTrue, int sort, s
...
@@ -49,6 +53,7 @@ public SecondColumnDictionary(string label, string key, bool isTrue, int sort, s
Type
=
type
;
Type
=
type
;
Color
=
color
;
Color
=
color
;
Width
=
width
.
HasValue
?
width
.
ToString
()
:
((
label
??
""
).
Length
*
20
+
10
).
ToString
();
Width
=
width
.
HasValue
?
width
.
ToString
()
:
((
label
??
""
).
Length
*
20
+
10
).
ToString
();
IsNumber
=
isNumber
;
}
}
}
}
}
}
performance/Performance.Services/RedistributionService.cs
View file @
0d417378
This diff is collapsed.
Click to expand it.
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