Commit 89cc73e3 by huangjy

fix:设备周报取值问题

parent a15f0218
......@@ -9,6 +9,7 @@ import com.makeit.entity.platform.elder.*;
import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum;
import com.makeit.enums.report.SleepTypeEnum;
import com.makeit.module.iot.vo.analysis.EvaluateReportVO;
import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.platform.elder.*;
import com.makeit.service.saas.SaasDiseaseReportService;
import com.makeit.service.saas.SaasElderReportConfigService;
......@@ -71,6 +72,8 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
private PlatElderSleepAnalysisService platElderSleepAnalysisService;
@Autowired
private PlatElderService platElderService;
@Autowired
private PlatDeviceService platDeviceService;
private LocalDateTime weekStartDateTime(LocalDateTime defaultTime) {
return weekStartDateTime(LocalDate.now().minusDays(1), defaultTime);
......@@ -408,7 +411,14 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
PlatDevice platDevice = platElderRealTimeService.getBreathDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
if (platDevice != null) {
deviceId = platDevice.getId();
if (!platDevice.getTenantId().equals(platElderIdDTO.getTenantId())) {
platDevice = platDeviceService.getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(BaseBusEntity::getTenantId,platElderIdDTO.getTenantId())
.eq(PlatDevice::getOriDeviceId, platElderIdDTO.getDeviceId()).last("limit 1"));
deviceId = platDevice.getId();
} else {
deviceId = platDevice.getId();
}
//oriDeviceId = platDevice.getOriDeviceId();
}
......
......@@ -2,6 +2,7 @@ package com.makeit.service.platform.elder.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.common.entity.BaseBusEntity;
import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.entity.platform.elder.PlatElderReportMonth;
import com.makeit.mapper.platform.elder.PlatElderReportMonthMapper;
......@@ -97,6 +98,7 @@ public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReport
.eq(StringUtils.isNotBlank(platElderIdDTO.getDeviceId()), PlatElderReportMonth::getBreatheOriDeviceId, platElderIdDTO.getDeviceId())
.ge(PlatElderReportMonth::getDay, start)
.le(PlatElderReportMonth::getDay, end)
.eq(StringUtils.isNotEmpty(platElderIdDTO.getTenantId()), BaseBusEntity::getTenantId,platElderIdDTO.getTenantId())
.orderByAsc(PlatElderReportMonth::getDay)
);
......
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