Commit 6955f0e4 by huangjy

feat:saas端设备报告新增租户查询

parent ca400239
......@@ -4,6 +4,7 @@ package com.makeit.controller.device;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.elder.PlatElderDayReportDayService;
import com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO;
......@@ -43,6 +44,7 @@ public class SaasDeviceReportDayController {
@ApiOperation("睡眠评价")
@PostMapping("sleepEvaluation")
@TenantIdIgnore
@AuthIgnore
public ApiResponseEntity<PlatElderSleepEvaluationVO> sleepEvaluation(@RequestBody PlatElderReportDTO platElderIdDTO) {
return ApiResponseUtils.success(platElderDayReportDayService.sleepEvaluation(platElderIdDTO));
}
......
......@@ -1326,10 +1326,21 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
@Override
public PlatElder getByDeviceId(String deviceId, String tenantId) {
PlatRoomBedDevice platRoomBedDevice = platRoomBedDeviceService.getOne(new QueryWrapper<PlatRoomBedDevice>().lambda()
.eq(PlatRoomBedDevice::getDeviceId, deviceId)
.eq(StringUtils.isNotEmpty(tenantId), BaseBusEntity::getTenantId, tenantId)
.last("limit 1"));
PlatDevice platDevice = platDeviceService.getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getOriDeviceId, deviceId)
.eq(BaseBusEntity::getTenantId, tenantId));
PlatRoomBedDevice platRoomBedDevice;
if (platDevice == null) {
platRoomBedDevice = platRoomBedDeviceService.getOne(new QueryWrapper<PlatRoomBedDevice>().lambda()
.eq(PlatRoomBedDevice::getDeviceId, deviceId)
.eq(StringUtils.isNotEmpty(tenantId), BaseBusEntity::getTenantId, tenantId)
.last("limit 1"));
} else {
platRoomBedDevice = platRoomBedDeviceService.getOne(new QueryWrapper<PlatRoomBedDevice>().lambda()
.eq(PlatRoomBedDevice::getDeviceId, platDevice.getId())
.eq(StringUtils.isNotEmpty(tenantId), BaseBusEntity::getTenantId, tenantId)
.last("limit 1"));
}
if (platRoomBedDevice != null && StringUtils.isNotEmpty(platRoomBedDevice.getBedId())) {
PlatElder platElder = getOne(new QueryWrapper<PlatElder>().lambda()
.eq(PlatElder::getBedId, platRoomBedDevice.getBedId()));
......
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