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
fc5b7f20
Commit
fc5b7f20
authored
Feb 16, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次分配保存验证状态
parent
fc3a95ba
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
6 deletions
+41
-6
performance/Performance.Api/Controllers/SecondAllotController.cs
+3
-0
performance/Performance.DtoModels/Enum.cs
+10
-0
performance/Performance.Repository/PerforAgsecondallotRepository.cs
+7
-0
performance/Performance.Services/SecondAllotService.cs
+21
-6
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
fc5b7f20
...
...
@@ -745,6 +745,9 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
var
second
=
secondAllotService
.
GetSecondAllot
(
request
.
SecondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"参数SecondId无效!"
);
if
(
second
.
Status
==
(
int
)
SecondAllot
.
Status
.
等待审核
||
second
.
Status
==
(
int
)
SecondAllot
.
Status
.
审核通过
)
throw
new
PerformanceException
(
"保存失败,当前二次分配已提交!"
);
var
allot
=
_allotService
.
GetAllot
(
second
.
AllotId
.
Value
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
...
...
performance/Performance.DtoModels/Enum.cs
View file @
fc5b7f20
...
...
@@ -134,4 +134,14 @@ public enum Role
数据收集
=
11
,
绩效查询
=
12
,
}
public
class
SecondAllot
{
public
enum
Status
{
未提交
=
1
,
等待审核
=
2
,
审核通过
=
3
,
驳回
=
4
,
}
}
}
performance/Performance.Repository/PerforAgsecondallotRepository.cs
View file @
fc5b7f20
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -42,5 +43,11 @@ public List<view_second_compute_collect> GetComputeBySecond(int secondId)
return
new
List
<
view_second_compute_collect
>();
}
public
int
Submit
(
int
secondId
,
int
tempId
,
decimal
realGiveFee
,
string
remark
=
""
)
{
string
sql
=
"UPDATE ag_secondallot SET UseTempId = @tempId,NursingDeptStatus = @status, Status = @status, SubmitTime = @date, Remark = @remark WHERE Id = @secondId AND RealGiveFee = @fee"
;
return
Execute
(
sql
,
new
{
secondId
,
tempId
,
status
=
2
,
date
=
DateTime
.
Now
,
fee
=
realGiveFee
,
remark
});
}
}
}
performance/Performance.Services/SecondAllotService.cs
View file @
fc5b7f20
...
...
@@ -1620,6 +1620,11 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
var
total
=
data
.
Sum
(
t
=>
(
t
.
DistPerformance
??
0
)
+
(
t
.
NightWorkPerformance
??
0
));
// 其他模板 = 可分配绩效 + 夜班绩效
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
}
,提交金额:
{
total
}
"
);
var
res
=
agsecondallotRepository
.
Submit
(
second
.
Id
,
temp
.
UseTempId
??
0
,
total
);
if
(
res
==
0
)
throw
new
PerformanceException
(
$"提交失败,当前绩效分配可能发生改变!"
);
return
true
;
}
else
if
(
new
int
[]
{
7
,
8
}.
Contains
(
temp
.
UseTempId
.
Value
))
{
...
...
@@ -1631,6 +1636,11 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
.
Sum
(
t
=>
t
.
Sum
(
item
=>
ConvertHelper
.
To
<
decimal
>(
item
.
ItemValue
)));
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
}
,提交金额:
{
total
}
"
);
var
res
=
agsecondallotRepository
.
Submit
(
second
.
Id
,
temp
.
UseTempId
??
0
,
total
);
if
(
res
==
0
)
throw
new
PerformanceException
(
$"提交失败,当前绩效分配可能发生改变!"
);
return
true
;
}
else
/*if (new int[] { 9, 10 }.Contains(temp.UseTempId.Value))*/
{
...
...
@@ -1645,14 +1655,19 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
var
total
=
data
.
Sum
(
t
=>
(
t
.
DistPerformance
??
0
)
+
(
t
.
NightWorkPerformance
??
0
));
if
(!
VerifySubmissioAmount
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
$"总金额与考核后金额不一致!可分配金额:
{
second
.
RealGiveFee
:
0.
####
}
,提交金额:
{
total
:
0.
####
}
"
);
var
res
=
agsecondallotRepository
.
Submit
(
second
.
Id
,
temp
.
UseTempId
??
0
,
total
);
if
(
res
==
0
)
throw
new
PerformanceException
(
$"提交失败,当前绩效分配可能发生改变!"
);
return
true
;
}
second
.
UseTempId
=
temp
.
UseTempId
;
second
.
Status
=
2
;
second
.
NursingDeptStatus
=
2
;
second
.
SubmitType
=
temp
.
UseTempId
==
6
?
2
:
1
;
second
.
SubmitTime
=
DateTime
.
Now
;
//
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
);
//
return agsecondallotRepository.Update(second);
}
/// <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