Commit 9471b8b7 by lzy

床位

parent 481ec1ef
...@@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* @Author:lzy * @Author:lzy
* @Date:2023/9/6 11:56 * @Date:2023/9/6 11:56
...@@ -38,6 +40,13 @@ public class PlatBedController { ...@@ -38,6 +40,13 @@ public class PlatBedController {
return ApiResponseUtils.success(data); return ApiResponseUtils.success(data);
} }
@ApiOperation("列表-无权限")
@PostMapping("listAuthIgnore")
public ApiResponseEntity<List<PlatBed>> listAuthIgnore(@RequestBody PlatBedQueryDTO dto) {
List<PlatBed> data = platBedService.list(dto);
return ApiResponseUtils.success(data);
}
@ApiOperation("详情") @ApiOperation("详情")
@PostMapping("view") @PostMapping("view")
public ApiResponseEntity<PlatBed> view(@RequestBody BaseIdDTO baseIdDTO) { public ApiResponseEntity<PlatBed> view(@RequestBody BaseIdDTO baseIdDTO) {
......
...@@ -57,4 +57,6 @@ public interface PlatBedService extends IService<PlatBed> { ...@@ -57,4 +57,6 @@ public interface PlatBedService extends IService<PlatBed> {
List<PlatBedPanoramaVO> selectBySpaceIdAndStatus(PlatBedPanoramaDTO dto); List<PlatBedPanoramaVO> selectBySpaceIdAndStatus(PlatBedPanoramaDTO dto);
List<PlatBedPanoramaVO> selectByRoomIdAndStatus(PlatBedPanoramaDTO dto); List<PlatBedPanoramaVO> selectByRoomIdAndStatus(PlatBedPanoramaDTO dto);
List<PlatBed> list(PlatBedQueryDTO dto);
} }
...@@ -157,5 +157,22 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl ...@@ -157,5 +157,22 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
return baseMapper.selectByRoomIdAndStatus(dto); return baseMapper.selectByRoomIdAndStatus(dto);
} }
@Override
public List<PlatBed> list(PlatBedQueryDTO dto) {
LambdaQueryWrapper<PlatRoomBedDevice> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PlatRoomBedDevice::getRoomId,dto.getRoomId());
queryWrapper.select(PlatRoomBedDevice::getBedId);
List<PlatRoomBedDevice> listDevices = platRoomBedDeviceService.list(queryWrapper);
List<String> listBedIds = listDevices.stream().map(item->item.getBedId()).collect(Collectors.toList());
LambdaQueryWrapper<PlatBed> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(StringUtil.isNotEmpty(dto.getRoomId()), PlatBed::getRoomId, dto.getRoomId());
queryWrapper1.notIn(!listBedIds.isEmpty(),PlatBed::getId,listBedIds);
List<PlatBed> list = list(queryWrapper1);
return list;
}
} }
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