Commit 1d18956b by 杨林龙

1.50.0 开发1.50.0需求版本

1 parent f6ed55de
......@@ -387,13 +387,10 @@ public class RiskAssessmentService {
// 通过车辆ID获取设备主有线设备
List<BasicDeviceDTO> basicDeviceDTOList = vehicleDeviceMapper.selectBindDeviceByVehicleIdOrderByCreatedDate(vehicleId);
Optional<BasicDeviceDTO> basicDeviceDTO = basicDeviceDTOList.stream().filter(dto -> TypeConverseEnum.SourceEnum.HAS_SOURCE.getSourceType().equals(dto.getSource())).findFirst();
basicDeviceDTO.orElseGet(() -> {
log.warn("该车辆绑定的主设备不存在");
throw new AdminException("该车辆绑定的主设备不存在");
});
UserBehaviorInformationVO userBehaviorInformationVO = new UserBehaviorInformationVO();
if (basicDeviceDTO.isPresent()) {
// 获取主设备
String sn = basicDeviceDTO.get().getSn();
UserBehaviorInformationVO userBehaviorInformationVO = new UserBehaviorInformationVO();
List<UserBehaviorWeekDTO> userBehaviorWeekDTOList = deviceJourneyMapper.statisticsDeviceJourneyWithWeek(sn);
// 获取最大的周数
Integer maxWeekNum = userBehaviorWeekDTOList.stream().map(UserBehaviorWeekDTO::getWeekNum).max(Integer::compareTo).orElse(0);
......@@ -415,6 +412,7 @@ public class RiskAssessmentService {
} else {
userBehaviorInformationVO.setUserBehaviorWeekDTOList(userBehaviorWeekDTOList.stream().filter(vo -> vo.getWeekNum() >= num).collect(Collectors.toList()));
}
}
return userBehaviorInformationVO;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!