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
31eab02c
Commit
31eab02c
authored
Jan 27, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
20638bc8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
6 deletions
+24
-6
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+16
-2
FixtureToolsAssemblyController.cs
...iger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
+4
-0
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+3
-3
IAutomationLocationRepository.cs
...y/Repositories/Interface/IAutomationLocationRepository.cs
+1
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
View file @
31eab02c
...
...
@@ -48,9 +48,16 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
public
IActionResult
GetPageList
(
string
wavehouseid
,
string
locationid
,
int
page
,
int
pagesize
,
string
toexcel
)
{
var
data
=
_autoLocationRepository
.
GetPagedList
(
wavehouseid
.
ToInt
(),
locationid
.
ToInt
(),
ProjectId
,
page
,
pagesize
,
toexcel
);
var
list
=
new
List
<
ResponseAutomationLocation
>();
var
locations
=
_autoLocationRepository
.
GetLocationList
(
ProjectId
);
var
locationids
=
new
List
<
int
>();
if
(
locationid
.
ToInt
()
>
0
)
{
var
searchLocations
=
GetSonLocations
(
locationid
.
ToInt
(),
locations
);
locationids
=
searchLocations
.
Select
(
q
=>
q
.
id
).
ToList
();
locationids
.
Add
(
locationid
.
ToInt
());
}
var
data
=
_autoLocationRepository
.
GetPagedList
(
wavehouseid
.
ToInt
(),
locationids
,
ProjectId
,
page
,
pagesize
,
toexcel
);
var
list
=
new
List
<
ResponseAutomationLocation
>();
var
categorys
=
_toolsCategoryRepository
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
foreach
(
var
item
in
data
.
Data
)
{
...
...
@@ -182,6 +189,13 @@ namespace Siger.ApiACC.Controllers
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetParentLocations
(
t
.
parentid
,
types
)));
}
private
IEnumerable
<
siger_wms_storage_location
>
GetSonLocations
(
int
id
,
IEnumerable
<
siger_wms_storage_location
>
types
)
{
var
query
=
from
c
in
types
where
c
.
parentid
==
id
select
c
;
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetSonLocations
(
t
.
id
,
types
)));
}
[
HttpPost
]
public
IActionResult
Add
([
FromBody
]
RequestAddAutomationLocation
req
)
{
...
...
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
View file @
31eab02c
...
...
@@ -69,6 +69,10 @@ namespace Siger.ApiACC.Controllers
var
models
=
new
List
<
ResponseAumationFixtureToolsAssembly
>();
var
details
=
_toolsAssemblyRepository
.
GetDetailList
(
item
.
fixtureguid
,
category
.
ToInt
(),
code
,
name
,
state
,
ProjectId
);
if
(!
details
.
Any
())
{
details
=
_toolsAssemblyRepository
.
GetDetailList
(
item
.
fixtureguid
,
0
,
""
,
""
,
""
,
ProjectId
);
//这里是为了符合测试的逻辑,当父级找到,子级找不到时,也把子级全部显示出来
}
foreach
(
var
model
in
details
)
{
var
cates1
=
GetParentCategoryList
(
model
.
cate_guid
,
categorys
);
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
31eab02c
...
...
@@ -24,7 +24,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context
=
context
;
}
public
IPagedCollectionResult
<
ResponseAutomationLocation
>
GetPagedList
(
int
wavehouseid
,
int
locationid
,
int
projectid
,
int
page
,
int
pagesize
,
string
toexcel
)
public
IPagedCollectionResult
<
ResponseAutomationLocation
>
GetPagedList
(
int
wavehouseid
,
IEnumerable
<
int
>
locationid
,
int
projectid
,
int
page
,
int
pagesize
,
string
toexcel
)
{
var
query
=
from
q
in
_context
.
siger_automation_location
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
...
...
@@ -67,9 +67,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
wavehouseidExpression
=
q
=>
q
.
wavehouseid
==
wavehouseid
;
}
Expression
<
Func
<
ResponseAutomationLocation
,
bool
>>
locationidExpression
=
f
=>
true
;
if
(
locationid
>
0
)
if
(
locationid
.
Any
()
)
{
locationidExpression
=
q
=>
q
.
locationid
==
locationid
;
locationidExpression
=
q
=>
locationid
.
Contains
(
q
.
locationid
)
;
}
var
expression
=
wavehouseidExpression
.
And
(
locationidExpression
);
if
(
toexcel
.
ToInt
()
==
1
)
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationLocationRepository.cs
View file @
31eab02c
...
...
@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationLocationRepository
:
IAccRepositoryBase
<
siger_automation_location
>
{
IPagedCollectionResult
<
ResponseAutomationLocation
>
GetPagedList
(
int
wavehouseid
,
int
locationid
,
int
projectid
,
int
page
,
int
pagesize
,
string
toexcel
);
IPagedCollectionResult
<
ResponseAutomationLocation
>
GetPagedList
(
int
wavehouseid
,
IEnumerable
<
int
>
locationid
,
int
projectid
,
int
page
,
int
pagesize
,
string
toexcel
);
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
);
...
...
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