Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
Laisi_AutoMES2
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiawei.su
Laisi_AutoMES2
Commits
f9b4e17e
Commit
f9b4e17e
authored
Jan 25, 2021
by
yiyu.li
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://test.siger-data.com:9000/jiawei.su/Laisi_AutoMES2
parents
a07dad2b
7ca6b796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
FixtureToolsAssemblyController.cs
...iger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
+17
-2
No files found.
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
View file @
f9b4e17e
...
@@ -248,11 +248,16 @@ namespace Siger.ApiACC.Controllers
...
@@ -248,11 +248,16 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
[
HttpGet
]
public
IActionResult
Delete
(
int
id
)
public
IActionResult
Delete
(
int
id
)
{
{
var
entity
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
id
==
id
);
var
entity
=
_tools
Assembly
Repository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
id
==
id
);
if
(
entity
==
null
)
if
(
entity
==
null
)
{
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
}
var
sons
=
_toolsAssemblyRepository
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
parent
==
entity
.
son
).
ToList
();
foreach
(
var
son
in
sons
)
{
_toolsAssemblyRepository
.
Delete
(
son
);
}
_toolsAssemblyRepository
.
Delete
(
entity
);
_toolsAssemblyRepository
.
Delete
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
if
(
_unitOfWork
.
Commit
()
>
0
)
{
{
...
@@ -276,14 +281,24 @@ namespace Siger.ApiACC.Controllers
...
@@ -276,14 +281,24 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
}
var
sons
=
_toolsAssemblyRepository
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
entities
.
Select
(
t
=>
t
.
son
).
Contains
(
q
.
parent
)).
ToList
();
foreach
(
var
son
in
sons
)
{
_toolsAssemblyRepository
.
Delete
(
son
);
}
foreach
(
var
entity
in
entities
)
foreach
(
var
entity
in
entities
)
{
{
_toolsAssemblyRepository
.
Delete
(
entity
);
_toolsAssemblyRepository
.
Delete
(
entity
);
}
}
if
(
_unitOfWork
.
Commit
()
>
0
)
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
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