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
a4ab1188
Commit
a4ab1188
authored
Jan 23, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://test.siger-data.com:9000/jiawei.su/Laisi_AutoMES2
parents
e41af7d6
16d27a70
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
131 additions
and
3 deletions
+131
-3
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+19
-2
FixtureToolsController.cs
...r/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
+8
-0
LocationController.cs
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
+63
-0
AutomationFixtureToolsRepository.cs
...pository/Repositories/AutomationFixtureToolsRepository.cs
+28
-0
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+6
-1
IAutomationFixtureToolsRepository.cs
...positories/Interface/IAutomationFixtureToolsRepository.cs
+3
-0
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 @
a4ab1188
...
...
@@ -42,6 +42,7 @@ namespace Siger.ApiACC.Controllers
{
var
data
=
_autoLocationRepository
.
GetPagedList
(
wavehouseid
.
ToInt
(),
locationid
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
var
list
=
new
List
<
ResponseAutomationLocation
>();
var
locations
=
_autoLocationRepository
.
GetLocationList
(
ProjectId
);
foreach
(
var
item
in
data
.
Data
)
{
if
(
item
.
fixturetoolid
>
0
&&
string
.
IsNullOrEmpty
(
item
.
sn
))
...
...
@@ -72,10 +73,26 @@ namespace Siger.ApiACC.Controllers
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
);
}
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
]
public
IActionResult
Add
([
FromBody
]
RequestAddAutomationLocation
req
)
{
...
...
@@ -103,7 +120,7 @@ namespace Siger.ApiACC.Controllers
var
entity
=
new
siger_automation_location
{
guid
=
Guid
.
NewGuid
().
ToString
(),
locationid
=
req
.
locationid
.
ToInt
()
,
locationid
=
location
.
locationid
,
fixturetools
=
fixturetool
.
guid
,
attachment
=
req
.
fileurl
,
filename
=
req
.
filename
,
...
...
@@ -152,7 +169,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
entity
.
locationid
=
req
.
locationid
.
ToInt
()
;
entity
.
locationid
=
location
.
locationid
;
entity
.
fixturetools
=
fixturetool
.
guid
;
entity
.
attachment
=
req
.
fileurl
;
entity
.
filename
=
req
.
filename
;
...
...
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
View file @
a4ab1188
...
...
@@ -370,5 +370,13 @@ namespace Siger.ApiACC.Controllers
}
return
resp
;
}
[
HttpGet
]
public
IActionResult
GetFixtureToolList
()
{
var
list
=
_toolsRepository
.
GetDataList
(
ProjectId
);
return
new
ObjectResult
(
list
);
}
}
}
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
View file @
a4ab1188
...
...
@@ -1127,5 +1127,67 @@ namespace Siger.ApiWMS.Controllers
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetSonTypes
(
t
.
id
,
types
)));
}
[
HttpGet
]
public
IActionResult
GetLocationTree
(
int
warehouseid
)
{
var
locationTypes
=
locationtype
.
GetList
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
sonLocationTypes
=
GetSonTypes
(
0
,
locationTypes
).
ToList
();
var
lastLocationId
=
sonLocationTypes
.
LastOrDefault
()?.
id
??
0
;
var
allLocas
=
location
.
GetList
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
locations
=
allLocas
.
Where
(
q
=>
q
.
typeid
==
lastLocationId
);
if
(
warehouseid
>
0
)
{
locations
=
locations
.
Where
(
q
=>
q
.
storageid
==
warehouseid
);
}
var
locationTreeList
=
new
List
<
LevelSectionTree
>();
foreach
(
var
loca
in
locations
)
{
var
locas
=
GetParentLocations
(
loca
.
id
,
allLocas
.
Select
(
q
=>
new
LevelSectionTree
{
id
=
q
.
id
,
pid
=
q
.
parentid
,
title
=
q
.
name
,
name
=
q
.
name
}));
locationTreeList
.
AddRange
(
locas
);
}
var
locationTree
=
locationTreeList
.
GroupBy
(
q
=>
q
.
id
).
Select
(
q
=>
q
.
FirstOrDefault
()).
ToList
();
return
new
ObjectResult
(
ConvertToTree
(
locationTree
));
}
private
IEnumerable
<
LevelSectionTree
>
GetParentLocations
(
int
pid
,
IEnumerable
<
LevelSectionTree
>
types
)
{
var
query
=
from
c
in
types
where
c
.
id
==
pid
select
c
;
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetParentLocations
(
t
.
pid
,
types
)));
}
private
IList
<
LevelSectionTree
>
ConvertToTree
(
IEnumerable
<
LevelSectionTree
>
models
)
{
var
section
=
new
Dictionary
<
int
,
LevelSectionTree
>();
foreach
(
var
item
in
models
)
{
section
.
Add
(
item
.
id
,
item
);
}
var
result
=
new
List
<
LevelSectionTree
>();
foreach
(
var
item
in
section
.
Values
)
{
if
(
item
.
pid
==
0
)
{
result
.
Add
(
item
);
}
else
{
if
(
section
.
ContainsKey
(
item
.
pid
))
{
section
[
item
.
pid
].
AddChilrden
(
item
);
}
}
}
return
result
;
}
}
}
\ No newline at end of file
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsRepository.cs
View file @
a4ab1188
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
...
...
@@ -73,5 +74,32 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseFixtureTools
>(
entities
,
totalCount
);
}
public
IEnumerable
<
ResponseFixtureTools
>
GetDataList
(
int
projectid
)
{
var
query
=
from
q
in
_context
.
siger_automation_fixture_tools
join
p
in
_context
.
siger_automation_fixture_tools_category
on
q
.
category
equals
p
.
guid
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseFixtureTools
{
id
=
q
.
id
,
name
=
q
.
name
,
guid
=
q
.
guid
,
cate_guid
=
p
.
guid
,
categoryid
=
p
.
id
,
category
=
p
.
name
,
managetype
=
q
.
managetype
,
partnumber
=
q
.
partnumber
,
specification
=
q
.
specification
,
number
=
q
.
number
,
remark
=
q
.
remark
,
code
=
q
.
code
,
status
=
q
.
status
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
};
var
entities
=
query
.
OrderByDescending
(
q
=>
q
.
id
).
AsNoTracking
().
ToList
();
return
entities
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
a4ab1188
...
...
@@ -68,7 +68,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
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
)
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsRepository.cs
View file @
a4ab1188
...
...
@@ -2,6 +2,7 @@
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
using
System.Collections.Generic
;
namespace
Siger.Middlelayer.AccRepository.Repositories.Interface
{
...
...
@@ -9,5 +10,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
IPagedCollectionResult
<
ResponseFixtureTools
>
GetPagedList
(
int
category
,
string
code
,
string
name
,
int
state
,
int
projectid
,
int
page
,
int
pagesize
);
IEnumerable
<
ResponseFixtureTools
>
GetDataList
(
int
projectid
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationLocationRepository.cs
View file @
a4ab1188
...
...
@@ -14,5 +14,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
siger_wms_storage_location
GetLocation
(
int
id
,
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 @
a4ab1188
...
...
@@ -47,6 +47,8 @@ namespace Siger.Middlelayer.AccRepository.Response
public
string
updatetime
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
List
<
int
>
locationIds
{
get
;
set
;
}
=
new
List
<
int
>();
}
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