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
6071efe6
Commit
6071efe6
authored
Feb 15, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/二次分配保存前重新计算' into develop
parents
659f7573
c5955c2a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
6 deletions
+64
-6
performance/Performance.Api/Controllers/SecondAllotController.cs
+19
-0
performance/Performance.Services/RedistributionService.cs
+15
-0
performance/Performance.Services/SecondAllotService.cs
+30
-6
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
6071efe6
...
@@ -766,6 +766,13 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
...
@@ -766,6 +766,13 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
throw
new
PerformanceException
(
"提交参数都是无效数据,请重新填写数据后保存!"
);
throw
new
PerformanceException
(
"提交参数都是无效数据,请重新填写数据后保存!"
);
// 计算提交数据结果
_redistributionService
.
ResultCompute
((
ComputeMode
)
request
.
ComputeMode
,
request
.
Head
,
cleanDatas
,
loads
,
workloadGroups
);
// 补充医院其他绩效
_redistributionService
.
SupplementOtherPerfor
(
second
,
cleanDatas
);
// 重算部分数据
_redistributionService
.
RedistributionCompute
((
ComputeMode
)
request
.
ComputeMode
,
request
.
Head
,
cleanDatas
);
var
result
=
secondAllotService
.
RedistributionSave
(
allot
,
second
,
request
.
Head
,
cleanDatas
);
var
result
=
secondAllotService
.
RedistributionSave
(
allot
,
second
,
request
.
Head
,
cleanDatas
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"保存失败"
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"保存失败"
);
}
}
...
@@ -823,9 +830,21 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
...
@@ -823,9 +830,21 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
throw
new
PerformanceException
(
"提交参数都是无效数据,请重新填写数据后查看计算结果!"
);
throw
new
PerformanceException
(
"提交参数都是无效数据,请重新填写数据后查看计算结果!"
);
// 计算提交数据结果
_redistributionService
.
ResultCompute
((
ComputeMode
)
request
.
ComputeMode
,
request
.
Head
,
cleanDatas
,
loads
,
workloadGroups
);
// 补充医院其他绩效
_redistributionService
.
SupplementOtherPerfor
(
second
,
cleanDatas
);
// 重算部分数据
_redistributionService
.
RedistributionCompute
((
ComputeMode
)
request
.
ComputeMode
,
request
.
Head
,
cleanDatas
);
var
saveResult
=
secondAllotService
.
RedistributionSave
(
allot
,
second
,
request
.
Head
,
cleanDatas
);
var
saveResult
=
secondAllotService
.
RedistributionSave
(
allot
,
second
,
request
.
Head
,
cleanDatas
);
if
(
saveResult
)
if
(
saveResult
)
{
{
var
res
=
_redistributionService
.
ValidationData
(
second
);
if
(!
string
.
IsNullOrEmpty
(
res
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"提交数据中存在无效数据,已经被删除,确认正确后请重新提交;删除工号清单如下:
{
res
}
"
);
var
userid
=
claimService
.
GetUserId
();
var
userid
=
claimService
.
GetUserId
();
var
result
=
secondAllotService
.
AuditSubmit
(
second
,
userid
);
var
result
=
secondAllotService
.
AuditSubmit
(
second
,
userid
);
if
(
result
)
if
(
result
)
...
...
performance/Performance.Services/RedistributionService.cs
View file @
6071efe6
...
@@ -1557,5 +1557,20 @@ private IEnumerable<view_second_workload_result> GetSecondWorkloadByValue(int al
...
@@ -1557,5 +1557,20 @@ private IEnumerable<view_second_workload_result> GetSecondWorkloadByValue(int al
{
{
return
_perallotRepository
.
GetSecondWorkload
(
allotid
,
unittype
,
accountingunit
);
return
_perallotRepository
.
GetSecondWorkload
(
allotid
,
unittype
,
accountingunit
);
}
}
// 验证数据正确性
public
string
ValidationData
(
ag_secondallot
second
)
{
var
datas
=
_agbodysourceRepository
.
GetEntities
(
w
=>
w
.
SecondId
==
second
.
Id
);
var
invalid
=
datas
.
Where
(
w
=>
!
w
.
DistPerformance
.
HasValue
);
string
removeEmp
=
""
;
if
(
invalid
!=
null
&&
invalid
.
Count
()
>
0
)
{
removeEmp
=
string
.
Join
(
","
,
invalid
.
Select
(
w
=>
w
.
WorkNumber
).
ToArray
());
_agbodysourceRepository
.
RemoveRange
(
invalid
.
ToArray
());
}
return
removeEmp
;
}
}
}
}
}
performance/Performance.Services/SecondAllotService.cs
View file @
6071efe6
...
@@ -1620,6 +1620,15 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
...
@@ -1620,6 +1620,15 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
var
total
=
data
.
Sum
(
t
=>
(
t
.
DistPerformance
??
0
)
+
(
t
.
NightWorkPerformance
??
0
));
// 其他模板 = 可分配绩效 + 夜班绩效
var
total
=
data
.
Sum
(
t
=>
(
t
.
DistPerformance
??
0
)
+
(
t
.
NightWorkPerformance
??
0
));
// 其他模板 = 可分配绩效 + 夜班绩效
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
}
,提交金额:
{
total
}
"
);
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
}
,提交金额:
{
total
}
"
);
logger
.
LogCritical
(
"程序虽然抛出异常但是还是执行了后续代码"
);
second
.
UseTempId
=
temp
.
UseTempId
;
second
.
Status
=
2
;
second
.
NursingDeptStatus
=
2
;
second
.
SubmitType
=
temp
.
UseTempId
==
6
?
2
:
1
;
second
.
SubmitTime
=
DateTime
.
Now
;
//second.Remark = "已提交审核,等待审核中";
return
agsecondallotRepository
.
Update
(
second
);
}
}
else
if
(
new
int
[]
{
7
,
8
}.
Contains
(
temp
.
UseTempId
.
Value
))
else
if
(
new
int
[]
{
7
,
8
}.
Contains
(
temp
.
UseTempId
.
Value
))
{
{
...
@@ -1631,21 +1640,32 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
...
@@ -1631,21 +1640,32 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
.
Sum
(
t
=>
t
.
Sum
(
item
=>
ConvertHelper
.
To
<
decimal
>(
item
.
ItemValue
)));
.
Sum
(
t
=>
t
.
Sum
(
item
=>
ConvertHelper
.
To
<
decimal
>(
item
.
ItemValue
)));
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
}
,提交金额:
{
total
}
"
);
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
}
,提交金额:
{
total
}
"
);
logger
.
LogCritical
(
"程序虽然抛出异常但是还是执行了后续代码"
);
second
.
UseTempId
=
temp
.
UseTempId
;
second
.
Status
=
2
;
second
.
NursingDeptStatus
=
2
;
second
.
SubmitType
=
temp
.
UseTempId
==
6
?
2
:
1
;
second
.
SubmitTime
=
DateTime
.
Now
;
//second.Remark = "已提交审核,等待审核中";
return
agsecondallotRepository
.
Update
(
second
);
}
}
else
/*if (new int[] { 9, 10 }.Contains(temp.UseTempId.Value))*/
else
/*if (new int[] { 9, 10 }.Contains(temp.UseTempId.Value))*/
{
{
var
data
=
agbodysourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
);
var
data
=
agbodysourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
);
if
(
data
==
null
||
!
data
.
Any
())
if
(
data
==
null
||
!
data
.
Any
())
throw
new
PerformanceException
(
"提交时未检测到数据!"
);
throw
new
PerformanceException
(
"提交时未检测到数据!"
);
else
var
nightShiftWorkPerforFee
=
data
.
Sum
(
w
=>
w
.
NightWorkPerformance
??
0
);
{
var
nightShiftWorkPerforFee
=
data
?.
Sum
(
w
=>
w
.
NightWorkPerformance
??
0
);
var
total
=
data
?.
Sum
(
t
=>
(
t
.
DistPerformance
??
0
)
+
(
t
.
NightWorkPerformance
??
0
));
if
(!
VerifySubmissioAmount
(
nightShiftWorkPerforFee
,
second
.
NightShiftWorkPerforFee
))
if
(!
VerifySubmissioAmount
(
nightShiftWorkPerforFee
,
second
.
NightShiftWorkPerforFee
))
throw
new
PerformanceException
(
$"夜班绩效金额不一致!夜班绩效金额:
{
second
.
NightShiftWorkPerforFee
??
0
:
0.
####
}
,提交金额:
{
nightShiftWorkPerforFee
:
0.
####
}
"
);
throw
new
PerformanceException
(
$"夜班绩效金额不一致!夜班绩效金额:
{
second
.
NightShiftWorkPerforFee
??
0
:
0.
####
}
,提交金额:
{
nightShiftWorkPerforFee
:
0.
####
}
"
);
else
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
var
total
=
data
.
Sum
(
t
=>
(
t
.
DistPerformance
??
0
)
+
(
t
.
NightWorkPerformance
??
0
));
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
:
0.
####
}
,提交金额:
{
total
:
0.
####
}
"
);
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
:
0.
####
}
,提交金额:
{
total
:
0.
####
}
"
);
}
else
{
// 这段逻辑是为了监测 验证失败后继续修改状态而特意加入的
second
.
UseTempId
=
temp
.
UseTempId
;
second
.
UseTempId
=
temp
.
UseTempId
;
second
.
Status
=
2
;
second
.
Status
=
2
;
second
.
NursingDeptStatus
=
2
;
second
.
NursingDeptStatus
=
2
;
...
@@ -1654,6 +1674,10 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
...
@@ -1654,6 +1674,10 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
//second.Remark = "已提交审核,等待审核中";
//second.Remark = "已提交审核,等待审核中";
return
agsecondallotRepository
.
Update
(
second
);
return
agsecondallotRepository
.
Update
(
second
);
}
}
}
}
logger
.
LogCritical
(
"程序虽然抛出异常但是还是执行了后续代码"
);
}
/// <summary>
/// <summary>
/// 二次绩效撤回提交
/// 二次绩效撤回提交
...
...
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