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
80d1f73b
Commit
80d1f73b
authored
Apr 26, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次绩效其他模板,修改数据方法调整
parent
201526a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
19 deletions
+15
-19
performance/Performance.Repository/BaseRepository.cs
+10
-0
performance/Performance.Services/SecondAllotService.cs
+5
-19
No files found.
performance/Performance.Repository/BaseRepository.cs
View file @
80d1f73b
...
@@ -118,6 +118,16 @@ public bool UpdateByState(TEntity entity)
...
@@ -118,6 +118,16 @@ public bool UpdateByState(TEntity entity)
return
context
.
SaveChanges
()
>
0
;
return
context
.
SaveChanges
()
>
0
;
}
}
public
bool
UpdateRangeByState
(
IEnumerable
<
TEntity
>
entities
)
{
foreach
(
var
entity
in
entities
)
{
var
entry
=
context
.
Entry
(
entity
);
entry
.
State
=
EntityState
.
Modified
;
}
return
context
.
SaveChanges
()
>
0
;
}
public
bool
Update
(
TEntity
entity
,
Action
<
TEntity
>
action
)
public
bool
Update
(
TEntity
entity
,
Action
<
TEntity
>
action
)
{
{
action
?.
Invoke
(
entity
);
action
?.
Invoke
(
entity
);
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
80d1f73b
...
@@ -1999,28 +1999,14 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
...
@@ -1999,28 +1999,14 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
public
List
<
ag_othersource
>
OtherSave
(
int
secondId
,
List
<
ag_othersource
>
request
)
public
List
<
ag_othersource
>
OtherSave
(
int
secondId
,
List
<
ag_othersource
>
request
)
{
{
if
(
request
==
null
||
!
request
.
Any
())
return
new
List
<
ag_othersource
>();
if
(
request
.
Any
(
t
=>
t
.
Id
!=
0
))
agothersourceRepository
.
UpdateRangeByState
(
request
.
Where
(
t
=>
t
.
Id
!=
0
));
var
existEntities
=
agothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
var
existEntities
=
agothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
if
(
existEntities
!=
null
&&
existEntities
.
Any
())
if
(
existEntities
!=
null
&&
existEntities
.
Any
())
{
{
foreach
(
var
item
in
request
.
Where
(
t
=>
t
.
Id
!=
0
))
{
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
WorkNumber
=
item
.
WorkNumber
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
Name
=
item
.
Name
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
Department
=
item
.
Department
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
WorkPost
=
item
.
WorkPost
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
TitlePerformance
=
item
.
TitlePerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
WorkPerformance
=
item
.
WorkPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
DeptReward
=
item
.
DeptReward
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
DistPerformance
=
item
.
DistPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
OtherPerformance
=
item
.
OtherPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
NightWorkPerformance
=
item
.
NightWorkPerformance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
RealAmount
=
item
.
RealAmount
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
ManagementAllowance
=
item
.
ManagementAllowance
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
IndividualReward
=
item
.
IndividualReward
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
AllocationOfKeySpecialty
=
item
.
AllocationOfKeySpecialty
;
}
agothersourceRepository
.
UpdateRange
(
existEntities
.
ToArray
());
var
delIds
=
existEntities
.
Select
(
t
=>
t
.
Id
).
Except
(
request
.
Select
(
t
=>
t
.
Id
));
var
delIds
=
existEntities
.
Select
(
t
=>
t
.
Id
).
Except
(
request
.
Select
(
t
=>
t
.
Id
));
if
(
delIds
!=
null
)
if
(
delIds
!=
null
)
agothersourceRepository
.
RemoveRange
(
existEntities
.
Where
(
t
=>
delIds
.
Contains
(
t
.
Id
)).
ToArray
());
agothersourceRepository
.
RemoveRange
(
existEntities
.
Where
(
t
=>
delIds
.
Contains
(
t
.
Id
)).
ToArray
());
...
...
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