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
f11af623
Commit
f11af623
authored
Apr 28, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板parentID更改
parent
2a95f8e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
performance/Performance.Services/AssessService.cs
+13
-5
No files found.
performance/Performance.Services/AssessService.cs
View file @
f11af623
...
...
@@ -162,8 +162,8 @@ public ApiResponse AddColumn(int assessID, int parentID, string columnName, int
var
clist
=
perforAscolumnsRepository
.
GetEntities
(
t
=>
t
.
ParentID
==
parentID
&&
t
.
AssessID
==
assessID
&&
t
.
Sort
>=
sort
);
if
(
clist
!=
null
&&
clist
.
Count
>
0
)
{
int
atsort
=
sort
;
clist
.
ForEach
(
t
=>
{
t
.
Sort
=
atsort
+
1
;
atsort
++;
});
//
int atsort = sort;
clist
.
ForEach
(
t
=>
t
.
Sort
=
t
.
Sort
+
1
);
//clist.ForEach(t =>
{ t.Sort = atsort + 1; atsort++; });
perforAscolumnsRepository
.
UpdateRange
(
clist
.
ToArray
());
}
var
column
=
new
as_columns
{
AssessID
=
assessID
,
ParentID
=
parentID
,
ColumnName
=
columnName
,
Sort
=
sort
};
...
...
@@ -183,7 +183,7 @@ public ApiResponse EditColumn(int columnID, string columnName, int sort)
if
(
entity
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"考核项目父级ID无效"
);
entity
.
ColumnName
=
columnName
;
entity
.
Sort
=
sort
;
//
entity.Sort = sort;
var
result
=
perforAscolumnsRepository
.
Update
(
entity
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
entity
)
:
new
ApiResponse
(
ResponseType
.
Fail
);
}
...
...
@@ -314,8 +314,16 @@ public ApiResponse UseTemplate(int allotID, int assessID)
result
=
perforAscolumnsRepository
.
AddRange
(
columns
.
ToArray
());
if
(
result
)
{
columns
.
ForEach
(
t
=>
t
.
ParentID
=
columns
.
Where
(
item
=>
item
.
TempColumnID
==
t
.
ParentID
).
FirstOrDefault
().
ID
);
perforAscolumnsRepository
.
UpdateRange
(
columns
.
ToArray
());
var
parentList
=
columns
.
Select
(
t
=>
t
.
ParentID
).
Distinct
();
var
keyvalue
=
new
Dictionary
<
int
?,
int
>();
foreach
(
var
item
in
columns
.
Where
(
t
=>
parentList
.
Contains
(
t
.
TempColumnID
)))
{
keyvalue
.
Add
(
item
.
TempColumnID
,
item
.
ID
);
}
columns
=
columns
.
Where
(
t
=>
t
.
ParentID
!=
null
).
ToList
();
columns
?.
ForEach
(
t
=>
t
.
ParentID
=
keyvalue
[
t
.
ParentID
]);
result
=
perforAscolumnsRepository
.
UpdateRange
(
columns
.
ToArray
());
}
}
return
result
?
new
ApiResponse
(
ResponseType
.
OK
)
:
new
ApiResponse
(
ResponseType
.
Fail
);
...
...
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