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
90ecb151
Commit
90ecb151
authored
Jan 20, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some update
parent
0aa7939e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
FixtureToolsController.cs
...r/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
+32
-1
AutomationFixtureToolsCategoryRepository.cs
.../Repositories/AutomationFixtureToolsCategoryRepository.cs
+1
-0
ResponseFixtureTools.cs
...iddlelayer.AccRepository/Response/ResponseFixtureTools.cs
+15
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
View file @
90ecb151
...
@@ -22,13 +22,15 @@ namespace Siger.ApiACC.Controllers
...
@@ -22,13 +22,15 @@ namespace Siger.ApiACC.Controllers
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
IAutomationFixtureToolsCategoryRepository
_toolsCategoryRepository
;
private
readonly
IAutomationFixtureToolsCategoryRepository
_toolsCategoryRepository
;
private
readonly
IAutomationFixtureToolsAssemblyRepository
_toolsAssemblyRepository
;
private
readonly
IAutomationFixtureToolsAssemblyRepository
_toolsAssemblyRepository
;
private
readonly
IAutomationFixtureToolsRepository
_toolsRepository
;
public
FixtureToolsController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
public
FixtureToolsController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureToolsAssemblyRepository
toolsAssemblyRepository
)
IAutomationFixtureToolsAssemblyRepository
toolsAssemblyRepository
,
IAutomationFixtureToolsRepository
toolsRepository
)
{
{
_unitOfWork
=
unitOfWork
;
_unitOfWork
=
unitOfWork
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
_toolsAssemblyRepository
=
toolsAssemblyRepository
;
_toolsAssemblyRepository
=
toolsAssemblyRepository
;
_toolsRepository
=
toolsRepository
;
}
}
[
HttpGet
]
[
HttpGet
]
...
@@ -163,5 +165,34 @@ namespace Siger.ApiACC.Controllers
...
@@ -163,5 +165,34 @@ namespace Siger.ApiACC.Controllers
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpGet
]
public
IActionResult
GetCategoryList
()
{
var
list
=
_toolsCategoryRepository
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
res
=
GetChildren
(
""
,
list
);
return
new
ObjectResult
(
res
);
}
private
List
<
FixtureToolsCategoryTree
>
GetChildren
(
string
parentid
,
List
<
siger_automation_fixture_tools_category
>
sectionDatas
)
{
var
resp
=
new
List
<
FixtureToolsCategoryTree
>();
var
query
=
sectionDatas
.
Where
(
f
=>
f
.
parent
==
parentid
);
if
(!
query
.
Any
())
{
return
null
;
}
foreach
(
var
section
in
query
)
{
var
data
=
new
FixtureToolsCategoryTree
{
value
=
section
.
id
,
label
=
section
.
name
};
data
.
children
=
GetChildren
(
section
.
guid
,
sectionDatas
);
resp
.
Add
(
data
);
}
return
resp
;
}
}
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsCategoryRepository.cs
View file @
90ecb151
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore
;
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseFixtureTools.cs
0 → 100644
View file @
90ecb151
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Response
{
public
class
FixtureToolsCategoryTree
{
public
int
value
{
get
;
set
;
}
public
string
label
{
get
;
set
;
}
public
List
<
FixtureToolsCategoryTree
>
children
=
new
List
<
FixtureToolsCategoryTree
>();
}
}
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