Commit ab35a4ef by lzy

绑定床位判断

parent d9fc936e
......@@ -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"),
......
......@@ -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=不能在该节点下新增非管理员角色
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment