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
20ea8ec3
Commit
20ea8ec3
authored
Jan 20, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some update
parent
4e5891a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
LocationController.cs
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
+10
-9
No files found.
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
View file @
20ea8ec3
...
...
@@ -416,7 +416,8 @@ namespace Siger.ApiWMS.Controllers
storageName
=
waveHouseDic
[
item
.
storageid
],
serialNumber
=
item
.
serial_number
,
state
=
item
.
status
,
field
=
new
List
<
string
>()
field
=
new
List
<
string
>(),
storeID
=
item
.
locationid
};
int
i
=
1
;
tmp
.
field
.
Insert
(
0
,
item
.
realname
);
...
...
@@ -898,7 +899,7 @@ namespace Siger.ApiWMS.Controllers
[
HttpPost
]
public
IActionResult
AddLocation
([
FromBody
]
RequestAddLocationModel
req
)
{
if
(
req
.
storeID
.
ToInt
()
<=
0
||
req
.
locations
==
null
||
!
req
.
locations
.
Any
()
||
req
.
warehouseid
<=
0
)
if
(
req
.
storeID
.
ToInt
()
<=
0
||
req
.
storeArr
==
null
||
!
req
.
storeArr
.
Any
()
||
req
.
warehouseid
<=
0
)
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterError
);
}
...
...
@@ -914,12 +915,12 @@ namespace Siger.ApiWMS.Controllers
throw
new
BadRequestException
(
RequestEnum
.
WaveHouseIDNotExist
);
}
if
(
req
.
locations
.
Count
!=
locationTypes
.
Count
)
if
(
req
.
storeArr
.
Count
!=
locationTypes
.
Count
)
{
throw
new
BadRequestException
(
RequestEnum
.
LocationCountError
);
}
foreach
(
var
Location
in
req
.
locations
)
foreach
(
var
Location
in
req
.
storeArr
)
{
var
loca
=
location
.
Get
(
q
=>
q
.
realname
==
Location
.
val
&&
q
.
projectid
==
ProjectId
);
if
(
loca
!=
null
)
...
...
@@ -932,7 +933,7 @@ namespace Siger.ApiWMS.Controllers
var
parentid
=
0
;
foreach
(
var
locationType
in
sonLocationTypes
)
{
var
Location
=
req
.
locations
.
FirstOrDefault
(
q
=>
q
.
id
==
locationType
.
id
);
var
Location
=
req
.
storeArr
.
FirstOrDefault
(
q
=>
q
.
id
==
locationType
.
id
);
if
(
Location
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
//TODO
...
...
@@ -1017,7 +1018,7 @@ namespace Siger.ApiWMS.Controllers
[
HttpPost
]
public
IActionResult
UpdateLocation
([
FromBody
]
RequestAddLocationModel
req
)
{
if
(
req
.
storeID
.
ToInt
()
<=
0
||
req
.
locations
==
null
||
!
req
.
locations
.
Any
()
||
req
.
warehouseid
<=
0
)
if
(
req
.
storeID
.
ToInt
()
<=
0
||
req
.
storeArr
==
null
||
!
req
.
storeArr
.
Any
()
||
req
.
warehouseid
<=
0
)
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterError
);
}
...
...
@@ -1033,12 +1034,12 @@ namespace Siger.ApiWMS.Controllers
throw
new
BadRequestException
(
RequestEnum
.
WaveHouseIDNotExist
);
}
if
(
req
.
locations
.
Count
!=
locationTypes
.
Count
)
if
(
req
.
storeArr
.
Count
!=
locationTypes
.
Count
)
{
throw
new
BadRequestException
(
RequestEnum
.
LocationCountError
);
}
foreach
(
var
Location
in
req
.
locations
)
foreach
(
var
Location
in
req
.
storeArr
)
{
var
loca
=
location
.
Get
(
q
=>
q
.
realname
==
Location
.
val
&&
q
.
projectid
==
ProjectId
&&
q
.
id
!=
Location
.
locationid
.
ToInt
());
if
(
loca
!=
null
)
...
...
@@ -1050,7 +1051,7 @@ namespace Siger.ApiWMS.Controllers
var
ids
=
new
List
<
int
>();
foreach
(
var
locationType
in
sonLocationTypes
)
{
var
Location
=
req
.
locations
.
FirstOrDefault
(
q
=>
q
.
id
==
locationType
.
id
);
var
Location
=
req
.
storeArr
.
FirstOrDefault
(
q
=>
q
.
id
==
locationType
.
id
);
if
(
Location
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
//TODO
...
...
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