Commit be8c9835 by lzy

绑定设备

parent d1861701
......@@ -9,6 +9,7 @@ import com.makeit.dto.platform.device.PlatDeviceDTO;
import com.makeit.dto.platform.space.PlatBedDeviceQueryDTO;
import com.makeit.dto.platform.space.PlatBedEditDTO;
import com.makeit.dto.platform.space.PlatBedQueryDTO;
import com.makeit.dto.platform.space.PlatSpaceDeviceQueryDTO;
import com.makeit.entity.platform.space.PlatBed;
import com.makeit.service.platform.space.PlatBedService;
import io.swagger.annotations.Api;
......@@ -65,12 +66,12 @@ public class PlatBedController {
@ApiOperation("设备列表(选择设备)")
@PostMapping("pageDevice")
public ApiResponseEntity<PageVO<PlatDeviceDTO>> pageDevice(@RequestBody PageReqDTO<PlatDeviceDTO> page) {
public ApiResponseEntity<PageVO<PlatDeviceDTO>> pageDevice(@RequestBody PageReqDTO<PlatSpaceDeviceQueryDTO> page) {
PageVO<PlatDeviceDTO> data = platBedService.pageDevice(page);
return ApiResponseUtils.success(data);
}
@ApiOperation("绑定设备列表")
@ApiOperation("绑定设备列表")
@PostMapping("listBindDevice")
public ApiResponseEntity<List<PlatDeviceDTO>> listBindDevice(@RequestBody PlatBedDeviceQueryDTO dto) {
List<PlatDeviceDTO> data = platBedService.listBindDevice(dto);
......
......@@ -66,4 +66,5 @@ public class PlatRoomController {
PageVO<PlatRoom> data = platRoomService.page(page);
return ApiResponseUtils.success(data);
}
}
package com.makeit.dto.platform.space;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author:lzy
* @Date:2023/9/7 14:58
* @Describe:
*/
@Data
@ApiModel("PlatSpaceDeviceQueryDTO 参数")
public class PlatSpaceDeviceQueryDTO {
@ApiModelProperty(value = "原始设备ID")
private String oriDeviceId;
@ApiModelProperty(value = "设备名称")
private String name;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "状态 数据字典 1 在线 0离线")
private String status;
@ApiModelProperty(value = "设备类型 device.category 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达")
private String category;
}
......@@ -5,9 +5,7 @@ import com.makeit.common.dto.StatusDTO;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.device.PlatDeviceDTO;
import com.makeit.dto.platform.space.PlatBedDeviceQueryDTO;
import com.makeit.dto.platform.space.PlatBedEditDTO;
import com.makeit.dto.platform.space.PlatBedQueryDTO;
import com.makeit.dto.platform.space.*;
import com.makeit.entity.platform.space.PlatBed;
import com.makeit.entity.platform.space.PlatRoom;
......@@ -58,7 +56,7 @@ public interface PlatBedService extends IService<PlatBed> {
* @param pageReqDTO
* @return
*/
PageVO<PlatDeviceDTO> pageDevice(PageReqDTO<PlatDeviceDTO> pageReqDTO);
PageVO<PlatDeviceDTO> pageDevice(PageReqDTO<PlatSpaceDeviceQueryDTO> pageReqDTO);
/**
* 已绑定设备
......@@ -67,6 +65,12 @@ public interface PlatBedService extends IService<PlatBed> {
*/
List<PlatDeviceDTO> listBindDevice(PlatBedDeviceQueryDTO dto);
/**
*
* @param dto
*/
void bindDevice(PlatRoomBindDeviceDTO dto);
......
......@@ -10,6 +10,7 @@ import com.makeit.dto.platform.device.PlatDeviceDTO;
import com.makeit.dto.platform.space.PlatBedDeviceQueryDTO;
import com.makeit.dto.platform.space.PlatBedEditDTO;
import com.makeit.dto.platform.space.PlatBedQueryDTO;
import com.makeit.dto.platform.space.PlatSpaceDeviceQueryDTO;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.platform.space.PlatBed;
import com.makeit.entity.platform.space.PlatRoom;
......@@ -149,18 +150,18 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
}
@Override
public PageVO<PlatDeviceDTO> pageDevice(PageReqDTO<PlatDeviceDTO> pageReqDTO) {
public PageVO<PlatDeviceDTO> pageDevice(PageReqDTO<PlatSpaceDeviceQueryDTO> pageReqDTO) {
LambdaQueryWrapper<PlatRoomBedDevice> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.select(PlatRoomBedDevice::getEquipmentId);
List<PlatRoomBedDevice> list = platRoomBedDeviceService.list(queryWrapper1);
List<String> listEquipmentIds = list.stream().map(item->item.getEquipmentId()).collect(Collectors.toList());
PlatDeviceDTO dto = pageReqDTO.getData();
PlatSpaceDeviceQueryDTO dto = pageReqDTO.getData();
Page<PlatDevice> p = PageUtil.toMpPage(pageReqDTO);
LambdaQueryWrapper<PlatDevice> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PlatDevice::getCategory, PlatDeviceEnum.CategoryEnum.HEART);
queryWrapper.notIn(PlatDevice::getId, listEquipmentIds);
queryWrapper.eq(PlatDevice::getCategory,dto.getCategory());
queryWrapper.like(StringUtil.isNotEmpty(dto.getOriDeviceId()), PlatDevice::getOriDeviceId, dto.getOriDeviceId());
queryWrapper.like(StringUtil.isNotEmpty(dto.getName()), PlatDevice::getName, dto.getName());
queryWrapper.like(StringUtil.isNotEmpty(dto.getProductName()), PlatDevice::getProductName, dto.getProductName());
......
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