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
616965b0
Commit
616965b0
authored
May 09, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实发绩效
parent
2a50eb79
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
1 deletions
+92
-1
performance/Performance.Api/Controllers/ComputeController.cs
+22
-1
performance/Performance.DtoModels/ChangeLog.cs
+17
-0
performance/Performance.DtoModels/Request/ComputerRequest.cs
+16
-0
performance/Performance.EntityModels/Entity/res_compute.cs
+5
-0
performance/Performance.Services/ComputeService.cs
+32
-0
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
616965b0
...
...
@@ -20,11 +20,14 @@ public class ComputeController : Controller
{
private
ComputeService
_computeService
;
private
AllotService
_allotService
;
private
ClaimService
_claim
;
public
ComputeController
(
AllotService
allotService
,
ComputeService
computeService
)
ComputeService
computeService
,
ClaimService
claim
)
{
_allotService
=
allotService
;
_computeService
=
computeService
;
_claim
=
claim
;
}
/// <summary>
...
...
@@ -123,5 +126,22 @@ public ApiResponse AllCompute([FromBody]ComputerRequest request)
var
list
=
_computeService
.
AllCompute
(
request
.
AllotId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 修改实发绩效
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"updatereal"
)]
[
HttpPost
]
public
ApiResponse
UpdateRealfee
([
CustomizeValidator
(
RuleSet
=
"UpdateReal"
),
FromBody
]
ComputerRequest
request
)
{
var
user
=
_claim
.
At
(
request
);
var
compute
=
_computeService
.
GetComputeSingle
(
request
.
ComputeId
);
if
(
null
==
compute
)
throw
new
PerformanceException
(
"当前数据记录不存在"
);
compute
=
_computeService
.
UpdateRealfee
(
request
,
user
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"修改成功"
,
compute
);
}
}
}
\ No newline at end of file
performance/Performance.DtoModels/ChangeLog.cs
0 → 100644
View file @
616965b0
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
ChangeLog
{
public
int
uid
{
get
;
set
;
}
public
string
user
{
get
;
set
;
}
public
DateTime
date
{
get
;
set
;
}
public
decimal
?
value
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/Request/ComputerRequest.cs
View file @
616965b0
...
...
@@ -8,6 +8,16 @@ namespace Performance.DtoModels
public
class
ComputerRequest
:
ApiRequest
{
/// <summary>
/// 绩效数据id
/// </summary>
public
int
ComputeId
{
get
;
set
;
}
/// <summary>
/// 实发绩效
/// </summary>
public
decimal
?
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 绩效id
/// </summary>
public
int
AllotId
{
get
;
set
;
}
...
...
@@ -27,6 +37,12 @@ public ComputerRequestValidator()
{
RuleFor
(
x
=>
x
.
Type
).
NotNull
().
NotEmpty
();
});
RuleSet
(
"UpdateReal"
,
()
=>
{
RuleFor
(
x
=>
x
.
ComputeId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
RealGiveFee
).
NotNull
();
});
}
}
}
performance/Performance.EntityModels/Entity/res_compute.cs
View file @
616965b0
...
...
@@ -150,5 +150,10 @@ public class res_compute
/// 实发绩效
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 变更日志
/// </summary>
public
string
ChangeLog
{
get
;
set
;
}
}
}
performance/Performance.Services/ComputeService.cs
View file @
616965b0
...
...
@@ -237,5 +237,37 @@ public List<ComputeResponse> AllCompute(int allotId)
}
return
list
;
}
public
res_compute
GetComputeSingle
(
int
computeid
)
{
return
_perforRescomputeRepository
.
GetEntity
(
t
=>
t
.
ID
==
computeid
);
}
/// <summary>
/// 修改实发绩效
/// </summary>
/// <param name="type"></param>
/// <param name="id"></param>
/// <param name="score"></param>
/// <returns></returns>
public
res_compute
UpdateRealfee
(
ComputerRequest
request
,
UserIdentity
user
)
{
var
compute
=
_perforRescomputeRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ComputeId
);
var
log
=
JsonHelper
.
Deserialize
<
List
<
ChangeLog
>>(
compute
.
ChangeLog
);
log
=
log
??
new
List
<
ChangeLog
>();
log
.
Add
(
new
ChangeLog
{
uid
=
user
.
UserID
,
user
=
user
.
RealName
,
date
=
DateTime
.
Now
,
value
=
compute
.
RealGiveFee
});
compute
.
RealGiveFee
=
request
.
RealGiveFee
;
compute
.
ChangeLog
=
JsonHelper
.
Serialize
(
log
);
if
(!
_perforRescomputeRepository
.
Update
(
compute
))
throw
new
PerformanceException
(
"修改失败"
);
return
compute
;
}
}
}
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