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
944f31d4
authored
Sep 21, 2023
by
lzy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复bug
parent
8c88df58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
server-common/src/main/java/com/makeit/enums/CodeMessageEnum.java
server-common/src/main/resources/locale/business_messages.properties
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
server-common/src/main/java/com/makeit/enums/CodeMessageEnum.java
View file @
944f31d4
...
...
@@ -99,6 +99,8 @@ public enum CodeMessageEnum {
PLATFORM_ERROR_SPACE_NAME_DUPLICATE
(
500
,
"PLATFORM.ERROR.SPACE.NAME.DUPLICATE"
),
PLATFORM_ERROR_SPACE_NOT_DEL
(
500
,
"PLATFORM.ERROR.SPACE.NOT.DEL"
),
PLATFORM_ERROR_SPACE_NOT_AUTH_PARENT
(
500
,
"PLATFORM.ERROR.SPACE.NOT.AUTH.PARENT"
),
PLATFORM_ERROR_SPACE_USER_NOT_ADD
(
500
,
"PLATFORM.ERROR.SPACE.USER.NOT.ADD"
),
PLATFORM_ERROR_ROOM_EXIT_BAD
(
500
,
"PLATFORM.ERROR.ROOM.EXIT.BAD"
),
PLATFORM_ERROR_ROOM_BAD_NUMBER_NOT_AUTH
(
500
,
"PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH"
),
PLATFORM_ERROR_ROOM_NAME_EXIT
(
500
,
"PLATFORM.ERROR.ROOM.NAME.EXIT"
),
...
...
server-common/src/main/resources/locale/business_messages.properties
View file @
944f31d4
...
...
@@ -94,6 +94,8 @@ PLATFORM.ERROR.ELDER.CERTIFICATENUMBER.DUPLICATE=证件号不能重复
PLATFORM.ERROR.SPACE.NAME.DUPLICATE
=
同一层级,空间名称不能重复
PLATFORM.ERROR.SPACE.NOT.DEL
=
该空间下存在下级或者房间,不可删除
PLATFORM.ERROR.SPACE.NOT.AUTH.PARENT
=
上级空间不能是自己的下级空间
PLATFORM.ERROR.SPACE.USER.NOT.ADD
=
当前用户没有所属组织,请先分配组织
PLATFORM.ERROR.ROOM.EXIT.BAD
=
房间中存在床位,不可删除
PLATFORM.ERROR.ROOM.NAME.EXIT
=
该房间名称已存在
PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH
=
床位数量不能改小
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatSpaceServiceImpl.java
View file @
944f31d4
...
...
@@ -77,6 +77,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
PlatSpace
space
=
BeanDtoVoUtils
.
convert
(
dto
,
PlatSpace
.
class
);
if
(
StringUtil
.
isEmpty
(
dto
.
getParentId
())){
PlatUserVO
userVO
=
PlatUserUtil
.
getUserVOCanNull
();
if
(
StringUtil
.
isEmpty
(
userVO
.
getOrgId
())){
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_SPACE_USER_NOT_ADD
);
}
space
.
setOrgId
(
userVO
.
getOrgId
());
PlatOrg
org
=
platOrgService
.
getById
(
space
.
getOrgId
());
if
(
org
!=
null
){
...
...
@@ -105,6 +108,13 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
space
.
setLongitude
(
dto
.
getLongitude
());
space
.
setParentId
(
dto
.
getParentId
());
space
.
setParentPath
(
dto
.
getParentPath
());
//上级空间
PlatSpace
parentSpace
=
this
.
getById
(
dto
.
getParentId
());
if
(
parentSpace
.
getParentPath
().
contains
(
dto
.
getId
())){
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_SPACE_NOT_DEL
);
}
this
.
updateById
(
space
);
}
...
...
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