Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e331e534
authored
Nov 01, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:删除房间关联床位问题,导入空间属性问题
parent
2cf25453
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomServiceImpl.java
View file @
e331e534
...
...
@@ -122,6 +122,13 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
}
removeByIds
(
ids
);
List
<
PlatBed
>
bedList
=
platBedService
.
list
(
new
QueryWrapper
<
PlatBed
>().
lambda
()
.
in
(
PlatBed:
:
getRoomId
,
ids
));
boolean
hashFree
=
bedList
.
stream
().
anyMatch
(
platBed
->
CommonEnum
.
NO
.
getValue
().
equals
(
platBed
.
getStatus
()));
if
(
hashFree
)
{
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_BAD_NOT_DEL
);
}
//删除床位
platBedService
.
remove
(
new
QueryWrapper
<
PlatBed
>().
lambda
()
.
in
(
PlatBed:
:
getRoomId
,
ids
));
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
e331e534
...
...
@@ -132,6 +132,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
space
.
setParentId
(
null
);
}
else
{
space
.
setParentId
(
dto
.
getParentId
());
PlatSpace
parentSpace
=
getById
(
dto
.
getParentId
());
space
.
setOrgId
(
parentSpace
.
getOrgId
());
space
.
setAttribute
(
parentSpace
.
getAttribute
());
}
//上级空间
...
...
@@ -547,6 +550,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if
(
org
!=
null
)
{
platSpace
.
setAttribute
(
org
.
getType
());
}
PlatSpace
parentSpace
=
getById
(
firstId
);
if
(
parentSpace
!=
null
)
{
platSpace
.
setOrgId
(
parentSpace
.
getOrgId
());
platSpace
.
setAttribute
(
parentSpace
.
getAttribute
());
}
save
(
platSpace
);
childrenIdMap
.
put
(
secondKey
,
platSpace
.
getId
());
secondId
=
platSpace
.
getId
();
...
...
@@ -579,6 +587,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if
(
org
!=
null
)
{
platSpace
.
setAttribute
(
org
.
getType
());
}
PlatSpace
parentSpace
=
getById
(
secondId
);
if
(
parentSpace
!=
null
)
{
platSpace
.
setOrgId
(
parentSpace
.
getOrgId
());
platSpace
.
setAttribute
(
parentSpace
.
getAttribute
());
}
save
(
platSpace
);
childrenIdMap
.
put
(
threeKey
,
platSpace
.
getId
());
threeId
=
platSpace
.
getId
();
...
...
@@ -609,6 +622,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if
(
org
!=
null
)
{
platSpace
.
setAttribute
(
org
.
getType
());
}
PlatSpace
parentSpace
=
getById
(
threeId
);
if
(
parentSpace
!=
null
)
{
platSpace
.
setOrgId
(
parentSpace
.
getOrgId
());
platSpace
.
setAttribute
(
parentSpace
.
getAttribute
());
}
platSpace
.
setParentId
(
threeId
);
platSpace
.
setParentPath
(
firstId
+
","
+
secondId
+
","
+
threeId
);
save
(
platSpace
);
...
...
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