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
fa982333
Commit
fa982333
authored
Jan 22, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
c26b36f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
17 deletions
+41
-17
LocationController.cs
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
+38
-17
RequestEnum.cs
Server/Common/Siger.Middlelayer.Share/Enum/RequestEnum.cs
+3
-0
No files found.
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
View file @
fa982333
...
...
@@ -924,6 +924,7 @@ namespace Siger.ApiWMS.Controllers
throw
new
BadRequestException
(
RequestEnum
.
LocationTypeNotFound
);
}
var
sonLocationTypes
=
GetSonTypes
(
0
,
locationTypes
).
ToList
();
var
locationTypeId
=
sonLocationTypes
.
LastOrDefault
()?.
id
??
0
;
var
waveHouse
=
storage
.
Get
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
warehouseid
);
if
(
waveHouse
==
null
)
{
...
...
@@ -933,19 +934,28 @@ namespace Siger.ApiWMS.Controllers
if
(
req
.
storeArr
.
Count
!=
locationTypes
.
Count
)
{
throw
new
BadRequestException
(
RequestEnum
.
LocationCountError
);
}
}
foreach
(
var
Location
in
req
.
storeArr
)
{
if
(
req
.
storeArr
.
Count
(
q
=>
q
.
val
==
Location
.
val
)
>
1
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
loca
=
location
.
Get
(
q
=>
q
.
realname
==
Location
.
val
&&
q
.
projectid
==
ProjectId
);
if
(
loca
!=
null
)
if
(
Location
.
id
==
locationTypeId
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
var
locationIdExist
=
location
.
Get
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
typeid
==
locationTypeId
&&
q
.
locationid
==
req
.
storeID
.
ToInt
());
if
(
locationIdExist
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
IDExist
);
}
}
//判断名称重复
//if (req.storeArr.Count(q => q.val == Location.val) > 1)
//{
// throw new BadRequestException(RequestEnum.DataExist);
//}
//var loca = location.Get(q => q.realname == Location.val && q.projectid == ProjectId);
//if (loca != null)
//{
// throw new BadRequestException(RequestEnum.DataExist);
//}
}
var
ids
=
new
List
<
int
>();
...
...
@@ -1047,6 +1057,7 @@ namespace Siger.ApiWMS.Controllers
throw
new
BadRequestException
(
RequestEnum
.
LocationTypeNotFound
);
}
var
sonLocationTypes
=
GetSonTypes
(
0
,
locationTypes
).
ToList
();
var
locationTypeId
=
sonLocationTypes
.
LastOrDefault
()?.
id
??
0
;
var
waveHouse
=
storage
.
Get
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
warehouseid
);
if
(
waveHouse
==
null
)
{
...
...
@@ -1057,18 +1068,28 @@ namespace Siger.ApiWMS.Controllers
{
throw
new
BadRequestException
(
RequestEnum
.
LocationCountError
);
}
foreach
(
var
Location
in
req
.
storeArr
)
{
if
(
req
.
storeArr
.
Count
(
q
=>
q
.
val
==
Location
.
val
)
>
1
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
loca
=
location
.
Get
(
q
=>
q
.
realname
==
Location
.
val
&&
q
.
projectid
==
ProjectId
&&
q
.
id
!=
Location
.
locationid
.
ToInt
());
if
(
loca
!=
null
)
if
(
Location
.
id
==
locationTypeId
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
var
locationIdExist
=
location
.
Get
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
typeid
==
locationTypeId
&&
q
.
locationid
==
req
.
storeID
.
ToInt
()
&&
q
.
id
!=
Location
.
locationid
.
ToInt
());
if
(
locationIdExist
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
IDExist
);
}
}
//判断名称重复
//if (req.storeArr.Count(q => q.val == Location.val) > 1)
//{
// throw new BadRequestException(RequestEnum.DataExist);
//}
//var loca = location.Get(q => q.realname == Location.val && q.projectid == ProjectId && q.id != Location.locationid.ToInt());
//if (loca != null)
//{
// throw new BadRequestException(RequestEnum.DataExist);
//}
}
var
ids
=
new
List
<
int
>();
...
...
Server/Common/Siger.Middlelayer.Share/Enum/RequestEnum.cs
View file @
fa982333
...
...
@@ -1470,5 +1470,8 @@ namespace Siger.Middlelayer.Common
[
Description
(
"未找到工装信息"
)]
FixtureToolNotFound
,
[
Description
(
"ID重复"
)]
IDExist
,
}
}
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