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
ab35a4ef
authored
Sep 27, 2023
by
lzy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
绑定床位判断
parent
d9fc936e
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/PlatRoomBedDeviceServiceImpl.java
server-common/src/main/java/com/makeit/enums/CodeMessageEnum.java
View file @
ab35a4ef
...
...
@@ -111,6 +111,7 @@ public enum CodeMessageEnum {
PLATFORM_ERROR_BAD_NAME_EXIT
(
500
,
"PLATFORM.ERROR.BAD.NAME.EXIT"
),
PLATFORM_ERROR_BAD_NOT_DEL
(
500
,
"PLATFORM.ERROR.BAD.NOT.DEL"
),
PLATFORM_ERROR_ROOM_OTHER_USED_NOT_DEL
(
500
,
"PLATFORM.ERROR.ROOM.OTHER.USED.NOT.DEL"
),
PLATFORM_ERROR_BED_BIND_DEVICE_NOT_AUTH
(
500
,
"PLATFORM.ERROR.BED.BIND_DEVICE_NOT_AUTH"
),
SYSTEM_ERROR_CANT_CHANGE_TENANT_STATUS
(
500
,
"SYSTEM.ERROR.CANT.CHANGE.TENANT.STATUS"
),
SYSTEM_ERROR_CANT_REMOVE_TENANT_USER_LINK
(
500
,
"SYSTEM.ERROR.CANT.REMOVE.TENANT.USER.LINK"
),
...
...
server-common/src/main/resources/locale/business_messages.properties
View file @
ab35a4ef
...
...
@@ -106,6 +106,7 @@ PLATFORM.ERROR.BAD.NAME.EXIT=床位名称已存在
PLATFORM.ERROR.BAD.NOT.DEL
=
床位已绑定长者或设备,不可删除
PLATFORM.ERROR.ROOM.OTHER.USED.NOT.DEL
=
该房间下有床位有其他长者入住
PLATFORM.ERROR.BED.BIND_DEVICE_NOT_AUTH
=
该床位已绑定设备,请重新选择床位
SYSTEM.ERROR.ROLE.ADMIN.CANT.ADD
=
不能在该节点下新增非管理员角色
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
View file @
ab35a4ef
...
...
@@ -16,8 +16,10 @@ import com.makeit.entity.platform.space.PlatBed;
import
com.makeit.entity.platform.space.PlatRoom
;
import
com.makeit.entity.platform.space.PlatRoomBedDevice
;
import
com.makeit.entity.platform.space.PlatSpace
;
import
com.makeit.enums.CodeMessageEnum
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.mapper.platform.space.PlatRoomBedDeviceMapper
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.space.*
;
...
...
@@ -63,6 +65,16 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
List
<
String
>
listEquipmentIds
=
dto
.
getListDeviceId
();
List
<
PlatRoomBedDevice
>
list
=
new
ArrayList
<>();
if
(
dto
.
getBedId
()
!=
null
){
LambdaQueryWrapper
<
PlatRoomBedDevice
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
PlatRoomBedDevice:
:
getRoomId
,
dto
.
getRoomId
());
queryWrapper
.
eq
(
PlatRoomBedDevice:
:
getBedId
,
dto
.
getBedId
());
queryWrapper
.
isNotNull
(
PlatRoomBedDevice:
:
getDeviceId
);
if
(
count
(
queryWrapper
)
>
0
){
throw
new
BusinessException
(
CodeMessageEnum
.
PLATFORM_ERROR_BED_BIND_DEVICE_NOT_AUTH
);
}
}
listEquipmentIds
.
forEach
(
item
->
{
PlatRoomBedDevice
data
=
new
PlatRoomBedDevice
();
...
...
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