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
429f84ce
Commit
429f84ce
authored
Jan 23, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some update
parent
abc0a987
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
10 deletions
+29
-10
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+19
-2
LocationController.cs
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
+0
-7
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+6
-1
IAutomationLocationRepository.cs
...y/Repositories/Interface/IAutomationLocationRepository.cs
+2
-0
ResponseAutomationLocation.cs
...ayer.AccRepository/Response/ResponseAutomationLocation.cs
+2
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
View file @
429f84ce
...
@@ -42,6 +42,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -42,6 +42,7 @@ namespace Siger.ApiACC.Controllers
{
{
var
data
=
_autoLocationRepository
.
GetPagedList
(
wavehouseid
.
ToInt
(),
locationid
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
var
data
=
_autoLocationRepository
.
GetPagedList
(
wavehouseid
.
ToInt
(),
locationid
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
var
list
=
new
List
<
ResponseAutomationLocation
>();
var
list
=
new
List
<
ResponseAutomationLocation
>();
var
locations
=
_autoLocationRepository
.
GetLocationList
(
ProjectId
);
foreach
(
var
item
in
data
.
Data
)
foreach
(
var
item
in
data
.
Data
)
{
{
if
(
item
.
fixturetoolid
>
0
&&
string
.
IsNullOrEmpty
(
item
.
sn
))
if
(
item
.
fixturetoolid
>
0
&&
string
.
IsNullOrEmpty
(
item
.
sn
))
...
@@ -72,10 +73,26 @@ namespace Siger.ApiACC.Controllers
...
@@ -72,10 +73,26 @@ namespace Siger.ApiACC.Controllers
item
.
routenumber
=
route
.
serialNumber
.
ToString
();
item
.
routenumber
=
route
.
serialNumber
.
ToString
();
}
}
}
}
var
loca
=
locations
.
FirstOrDefault
(
q
=>
q
.
locationid
==
item
.
locationid
);
if
(
loca
!=
null
)
{
var
locas
=
GetParentLocations
(
loca
.
id
,
locations
);
var
locationIds
=
locas
.
Select
(
q
=>
q
.
id
).
ToList
();
locationIds
.
Distinct
().
Reverse
();
item
.
locationIds
=
locationIds
;
}
}
}
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
}
private
IEnumerable
<
siger_wms_storage_location
>
GetParentLocations
(
int
pid
,
IEnumerable
<
siger_wms_storage_location
>
types
)
{
var
query
=
from
c
in
types
where
c
.
id
==
pid
select
c
;
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetParentLocations
(
t
.
parentid
,
types
)));
}
[
HttpPost
]
[
HttpPost
]
public
IActionResult
Add
([
FromBody
]
RequestAddAutomationLocation
req
)
public
IActionResult
Add
([
FromBody
]
RequestAddAutomationLocation
req
)
{
{
...
@@ -103,7 +120,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -103,7 +120,7 @@ namespace Siger.ApiACC.Controllers
var
entity
=
new
siger_automation_location
var
entity
=
new
siger_automation_location
{
{
guid
=
Guid
.
NewGuid
().
ToString
(),
guid
=
Guid
.
NewGuid
().
ToString
(),
locationid
=
req
.
locationid
.
ToInt
()
,
locationid
=
location
.
locationid
,
fixturetools
=
fixturetool
.
guid
,
fixturetools
=
fixturetool
.
guid
,
attachment
=
req
.
fileurl
,
attachment
=
req
.
fileurl
,
filename
=
req
.
filename
,
filename
=
req
.
filename
,
...
@@ -152,7 +169,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -152,7 +169,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
}
entity
.
locationid
=
req
.
locationid
.
ToInt
()
;
entity
.
locationid
=
location
.
locationid
;
entity
.
fixturetools
=
fixturetool
.
guid
;
entity
.
fixturetools
=
fixturetool
.
guid
;
entity
.
attachment
=
req
.
fileurl
;
entity
.
attachment
=
req
.
fileurl
;
entity
.
filename
=
req
.
filename
;
entity
.
filename
=
req
.
filename
;
...
...
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
View file @
429f84ce
...
@@ -1153,13 +1153,6 @@ namespace Siger.ApiWMS.Controllers
...
@@ -1153,13 +1153,6 @@ namespace Siger.ApiWMS.Controllers
}));
}));
locationTreeList
.
AddRange
(
locas
);
locationTreeList
.
AddRange
(
locas
);
}
}
var
locationModels
=
locations
.
Select
(
q
=>
new
LevelSectionTree
{
id
=
q
.
id
,
pid
=
q
.
parentid
,
title
=
q
.
name
,
name
=
q
.
name
}).
ToList
();
var
locationTree
=
locationTreeList
.
GroupBy
(
q
=>
q
.
id
).
Select
(
q
=>
q
.
FirstOrDefault
()).
ToList
();
var
locationTree
=
locationTreeList
.
GroupBy
(
q
=>
q
.
id
).
Select
(
q
=>
q
.
FirstOrDefault
()).
ToList
();
return
new
ObjectResult
(
ConvertToTree
(
locationTree
));
return
new
ObjectResult
(
ConvertToTree
(
locationTree
));
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
429f84ce
...
@@ -68,7 +68,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
...
@@ -68,7 +68,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
)
public
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
)
{
{
return
_context
.
siger_wms_storage_location
.
FirstOrDefault
(
q
=>
q
.
locationid
==
id
&&
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
return
_context
.
siger_wms_storage_location
.
FirstOrDefault
(
q
=>
q
.
id
==
id
&&
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
}
public
IEnumerable
<
siger_wms_storage_location
>
GetLocationList
(
int
projectid
)
{
return
_context
.
siger_wms_storage_location
.
Where
(
q
=>
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
}
}
public
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
)
public
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
)
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationLocationRepository.cs
View file @
429f84ce
...
@@ -14,5 +14,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
...
@@ -14,5 +14,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
);
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
);
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
);
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
);
IEnumerable
<
siger_wms_storage_location
>
GetLocationList
(
int
projectid
);
}
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationLocation.cs
View file @
429f84ce
...
@@ -47,6 +47,8 @@ namespace Siger.Middlelayer.AccRepository.Response
...
@@ -47,6 +47,8 @@ namespace Siger.Middlelayer.AccRepository.Response
public
string
updatetime
{
get
;
set
;
}
public
string
updatetime
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
List
<
int
>
locationIds
{
get
;
set
;
}
=
new
List
<
int
>();
}
}
public
class
ResponseAutomationLocationList
public
class
ResponseAutomationLocationList
...
...
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