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
0b92b558
Commit
0b92b558
authored
Jan 21, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some update
parent
a24b590c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
3 deletions
+41
-3
FixtureToolsAssemblyController.cs
...iger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
+41
-3
No files found.
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
View file @
0b92b558
...
...
@@ -61,6 +61,10 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
if
(
parent
==
null
)
{
}
var
parentGuid
=
parent
?.
guid
??
""
;
var
exsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
son
.
guid
&&
q
.
parent
==
parentGuid
);
if
(
exsit
!=
null
)
...
...
@@ -93,7 +97,6 @@ namespace Siger.ApiACC.Controllers
}
}
[
HttpPost
]
public
IActionResult
Update
([
FromBody
]
RequestUpdateFixtureToolAssembly
req
)
{
...
...
@@ -139,9 +142,44 @@ namespace Siger.ApiACC.Controllers
}
[
HttpGet
]
public
IActionResult
Delete
()
public
IActionResult
Delete
(
int
id
)
{
return
Ok
();
var
entity
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
id
==
id
);
if
(
entity
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
_toolsAssemblyRepository
.
Delete
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
Deletes
([
FromBody
]
RequestDeleteRange
req
)
{
if
(
req
.
ids
==
null
||
!
req
.
ids
.
Any
())
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entities
=
_toolsAssemblyRepository
.
GetList
(
t
=>
req
.
ids
.
Contains
(
t
.
id
)
&&
t
.
projectId
==
ProjectId
).
ToList
();
if
(!
entities
.
Any
())
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
foreach
(
var
entity
in
entities
)
{
_toolsAssemblyRepository
.
Delete
(
entity
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
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