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
35815337
Commit
35815337
authored
Sep 26, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除保底绩效
parent
f0a35d36
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
performance/Performance.Api/Controllers/GuaranteeController.cs
+1
-1
performance/Performance.DtoModels/Request/GuaranteeRequest.cs
+8
-5
performance/Performance.Services/GuaranteeService.cs
+4
-4
No files found.
performance/Performance.Api/Controllers/GuaranteeController.cs
View file @
35815337
...
@@ -75,7 +75,7 @@ public ApiResponse<List<cof_guarantee>> GuarantUpdate([CustomizeValidator(RuleSe
...
@@ -75,7 +75,7 @@ public ApiResponse<List<cof_guarantee>> GuarantUpdate([CustomizeValidator(RuleSe
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
<
cof_guarantee
>
GuarantDelete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
GuaranteeRequest
request
)
public
ApiResponse
<
cof_guarantee
>
GuarantDelete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
GuaranteeRequest
request
)
{
{
var
result
=
guaranteeService
.
GuarantDelete
(
request
.
Id
);
var
result
=
guaranteeService
.
GuarantDelete
(
request
);
if
(
result
)
if
(
result
)
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
OK
,
"删除配置成功"
);
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
OK
,
"删除配置成功"
);
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
Fail
,
"删除配置失败"
);
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
Fail
,
"删除配置失败"
);
...
...
performance/Performance.DtoModels/Request/GuaranteeRequest.cs
View file @
35815337
...
@@ -42,14 +42,17 @@ public GuaranteeRequestValidator()
...
@@ -42,14 +42,17 @@ public GuaranteeRequestValidator()
RuleFor
(
x
=>
x
.
Priority
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Priority
).
NotNull
().
GreaterThan
(
0
);
});
});
RuleSet
(
"Update"
,
()
=>
//
RuleSet("Update", () =>
{
//
{
RuleFor
(
x
=>
x
.
Id
).
NotNull
().
GreaterThan
(
0
);
//
RuleFor(x => x.Id).NotNull().GreaterThan(0);
});
//
});
RuleSet
(
"Delete"
,
()
=>
RuleSet
(
"Delete"
,
()
=>
{
{
RuleFor
(
x
=>
x
.
Id
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
AllotId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Priority
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
UnitType
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Target
).
NotEmpty
();
});
});
}
}
}
}
...
...
performance/Performance.Services/GuaranteeService.cs
View file @
35815337
...
@@ -166,12 +166,12 @@ public List<cof_guarantee> GuarantUpdate(GuaranteeRequest request)
...
@@ -166,12 +166,12 @@ public List<cof_guarantee> GuarantUpdate(GuaranteeRequest request)
/// </summary>
/// </summary>
/// <param name="allotId"></param>
/// <param name="allotId"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
GuarantDelete
(
int
id
)
public
bool
GuarantDelete
(
GuaranteeRequest
request
)
{
{
var
guarantee
=
perforCofguaranteeRepository
.
GetEntity
(
t
=>
t
.
Id
==
id
);
var
list
=
perforCofguaranteeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
UnitType
==
request
.
UnitType
&&
t
.
Target
==
request
.
Target
&&
t
.
Priority
==
request
.
Priority
);
if
(
guarantee
==
null
)
if
(
list
==
null
)
return
false
;
return
false
;
return
perforCofguaranteeRepository
.
Remove
(
guarantee
);
return
perforCofguaranteeRepository
.
Remove
Range
(
list
.
ToArray
()
);
}
}
/// <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