Commit 6955f0e4 by huangjy

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

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