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
fee18f0b
Commit
fee18f0b
authored
Nov 13, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存二次绩效信息时,增加删除功能
parent
a02ec5e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
+37
-7
performance/Performance.Api/Controllers/SecondAllotController.cs
+5
-2
performance/Performance.Api/wwwroot/Performance.Api.xml
+1
-1
performance/Performance.Services/SecondAllotService.cs
+31
-4
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
fee18f0b
...
@@ -44,10 +44,13 @@ public ApiResponse List()
...
@@ -44,10 +44,13 @@ public ApiResponse List()
/// 二次绩效项目内容保存
/// 二次绩效项目内容保存
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
Route
(
"api/second/savevalue"
)]
[
Route
(
"api/second/savevalue
/{secondid}
"
)]
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
SaveValue
([
FromBody
]
List
<
ag_fixatitem
>
request
)
public
ApiResponse
SaveValue
(
int
secondid
,
[
FromBody
]
List
<
ag_fixatitem
>
request
)
{
{
if
(
secondid
!=
0
&&
(
request
==
null
||
request
.
Count
==
0
))
secondAllotService
.
DelValue
(
secondid
,
request
);
var
allotCount
=
request
.
Where
(
t
=>
t
.
AllotId
>
0
).
Select
(
t
=>
t
.
AllotId
).
Distinct
().
Count
();
var
allotCount
=
request
.
Where
(
t
=>
t
.
AllotId
>
0
).
Select
(
t
=>
t
.
AllotId
).
Distinct
().
Count
();
if
(
allotCount
!=
1
||
request
.
Any
(
t
=>
t
.
AllotId
==
0
))
if
(
allotCount
!=
1
||
request
.
Any
(
t
=>
t
.
AllotId
==
0
))
throw
new
PerformanceException
(
"一次绩效ID错误"
);
throw
new
PerformanceException
(
"一次绩效ID错误"
);
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
fee18f0b
...
@@ -745,7 +745,7 @@
...
@@ -745,7 +745,7 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.SaveValue(System.Collections.Generic.List{Performance.EntityModels.ag_fixatitem})"
>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.SaveValue(System.
Int32,System.
Collections.Generic.List{Performance.EntityModels.ag_fixatitem})"
>
<summary>
<summary>
二次绩效项目内容保存
二次绩效项目内容保存
</summary>
</summary>
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
fee18f0b
...
@@ -182,6 +182,8 @@ public bool UseTemp(UseTempRequest request)
...
@@ -182,6 +182,8 @@ public bool UseTemp(UseTempRequest request)
return
result
;
return
result
;
var
fixatList
=
perforAgfixatitemRepository
.
GetEntities
(
t
=>
secondId
.
Contains
(
t
.
SecondId
.
Value
));
var
fixatList
=
perforAgfixatitemRepository
.
GetEntities
(
t
=>
secondId
.
Contains
(
t
.
SecondId
.
Value
));
#
region
获取需要添加的数据
和
无需操作的数据
foreach
(
var
second
in
secondList
)
foreach
(
var
second
in
secondList
)
{
{
foreach
(
var
head
in
headItems
)
foreach
(
var
head
in
headItems
)
...
@@ -213,6 +215,7 @@ public bool UseTemp(UseTempRequest request)
...
@@ -213,6 +215,7 @@ public bool UseTemp(UseTempRequest request)
}
}
}
}
}
}
#
endregion
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
var
delList
=
fixatList
.
Except
(
list
);
var
delList
=
fixatList
.
Except
(
list
);
...
@@ -318,7 +321,7 @@ public bool SaveValue(List<ag_fixatitem> request)
...
@@ -318,7 +321,7 @@ public bool SaveValue(List<ag_fixatitem> request)
perforAgfixatitemRepository
.
Add
(
item
);
perforAgfixatitemRepository
.
Add
(
item
);
}
}
}
}
return
true
;
return
DelValue
(
second
.
Id
,
request
)
;
}
}
/// <summary>
/// <summary>
...
@@ -353,7 +356,7 @@ public bool SaveCompute(List<ag_compute> request)
...
@@ -353,7 +356,7 @@ public bool SaveCompute(List<ag_compute> request)
}
}
/// <summary>
/// <summary>
/// 新增
/// 新增
工作量绩效配置
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
...
@@ -382,7 +385,7 @@ public bool WorkloadAdd(WorkloadRequest request)
...
@@ -382,7 +385,7 @@ public bool WorkloadAdd(WorkloadRequest request)
}
}
/// <summary>
/// <summary>
/// 修改
/// 修改
工作量绩效配置
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
...
@@ -405,7 +408,7 @@ public bool WorkloadUpdate(WorkloadRequest request)
...
@@ -405,7 +408,7 @@ public bool WorkloadUpdate(WorkloadRequest request)
}
}
/// <summary>
/// <summary>
/// 删除
/// 删除
工作量绩效配置
/// </summary>
/// </summary>
/// <param name="id"></param>
/// <param name="id"></param>
/// <returns></returns>
/// <returns></returns>
...
@@ -504,6 +507,30 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
...
@@ -504,6 +507,30 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
};
};
}
}
/// <summary>
/// 删除未保存的历史数据
/// </summary>
/// <param name="secondId"></param>
/// <param name="fixatitems"></param>
/// <returns></returns>
public
bool
DelValue
(
int
secondId
,
List
<
ag_fixatitem
>
fixatitems
)
{
if
(
secondId
==
0
)
throw
new
PerformanceException
(
"二次绩效Id无效"
);
var
fixatlist
=
perforAgfixatitemRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
if
(
fixatitems
==
null
||
fixatitems
.
Count
==
0
)
{
return
perforAgfixatitemRepository
.
RemoveRange
(
fixatlist
.
ToArray
());
}
var
saveRows
=
fixatitems
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
();
var
delRows
=
fixatlist
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
().
Except
(
saveRows
);
if
(
delRows
!=
null
&&
delRows
.
Count
()
>
0
)
return
perforAgfixatitemRepository
.
RemoveRange
(
fixatlist
.
Where
(
t
=>
delRows
.
Contains
(
t
.
RowNumber
)).
ToArray
());
return
true
;
}
/// <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