Commit cbc44d4c by huangjy

fix:设备实时监测问题

parent b0a3e7d8
......@@ -414,6 +414,8 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
Set<String> orgIdList = getOrgIdListByUserId(userVOCanNull.getId());
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>()
.eq(StringUtils.isNotEmpty(param.getType()), PlatOrg::getType, param.getType())
.like(StringUtils.isNotEmpty(param.getName()), PlatOrg::getName, param.getName())
.eq(StringUtils.isNotEmpty(param.getStatus()), PlatOrg::getStatus, param.getStatus())
.in(BaseEntity::getId, orgIdList).eq(PlatOrg::getStatus, CommonEnum.YES.getValue()));
if (CollectionUtils.isEmpty(orgList)) {
return new ArrayList<>();
......
......@@ -385,16 +385,14 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
.orderByDesc(PlatAlarmRecord::getAlarmDate)
);
List<String> list = recordList.stream().map(i -> i.getAlarmDate().format(dateTimeFormatter)).distinct().collect(Collectors.toList());
voList.addAll(list);
voList.addAll(StreamUtil.map(recordList, i -> i.getAlarmDate().format(dateTimeFormatter)));
/* List<DeviceInfoContentFall> fallList = iotProductDeviceService.getDeviceLogByTimeRangeFall(e.getOriDeviceId(), 2 * 24 * 3600, start, end);
fallList = StreamUtil.filter(fallList, i -> DeviceInfoContentFallEnum.PersonStateEnum.FALL.getValue().equals(i.getProperties().getPersonState()));
*/
});
return voList;
return voList.stream().distinct().collect(Collectors.toList());
}
......
......@@ -119,7 +119,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
PlatDevice device = platDeviceService.getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getOriDeviceId, deviceId).last("limit 1"));
if (device != null) {
deviceList.add(platDevice);
deviceList.add(device);
}
}
......@@ -142,7 +142,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
PlatDevice device = platDeviceService.getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getOriDeviceId, deviceId).last("limit 1"));
if (device != null) {
deviceList.add(platDevice);
deviceList.add(device);
}
}
......@@ -495,8 +495,19 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
/* if (platElderIdDTO == null || StringUtils.isEmpty(platElderIdDTO.getElderId())) {
return voList;
}*/
List<PlatDevice> deviceListSpace = getSpaceDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
List<PlatDevice> fallDeviceList = getFallDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
List<PlatDevice> deviceListSpace = Lists.newArrayList();
List<PlatDevice> fallDeviceList = Lists.newArrayList();
if (StringUtils.isNotBlank(platElderIdDTO.getDeviceId())) {
PlatDevice device = platDeviceService.getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getOriDeviceId, platElderIdDTO.getDeviceId()).last("limit 1"));
if (device != null) {
deviceListSpace.add(device);
}
} else {
deviceListSpace = getSpaceDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
fallDeviceList = getFallDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
}
deviceListSpace.addAll(fallDeviceList);
for (PlatDevice platDevice : deviceListSpace) {
String spaceResult = redisTemplate.opsForValue().get(DEVICE_SPACE_DATA + platDevice.getOriDeviceId());
......
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