| | |
| | | startTime = zeroTime; |
| | | endTime = nowTime; |
| | | } |
| | | List<GasConcentration> gasConcentrationList = gasConcentrationService.listDatabyTimeSlot(startTime,endTime); |
| | | List<GasConcentration> gasConcentrationList = gasConcentrationService.listDatabyTimeSlotAndPosition(startTime,endTime,reqDto.getPosition()); |
| | | if (CollectionUtils.isEmpty(gasConcentrationList)) |
| | | return success; |
| | | GasCategory gasCategory = gasCategoryService.findById(reqDto.getGasName()); |
| | |
| | | searchResult.setPageIndex(pageQuery.getPageIndex()); |
| | | searchResult.setPageSize(pageQuery.getPageSize()); |
| | | searchResult.setSuccess(); |
| | | Page<GasConcentration> pageResult = gasConcentrationService.listDatabyTimeSlotAndPage(pageQuery); |
| | | Page<GasConcentration> pageResult = gasConcentrationService.listDatabyTimeSlotAndPositionAndPage(pageQuery); |
| | | if (CollectionUtils.isEmpty(pageResult.getContent())) |
| | | return searchResult; |
| | | searchResult.setTotal(pageResult.getTotalElements()); |
| | |
| | | gasAtmosphereLineChartRespDTO.setTime(gasConcentration.getTime()); |
| | | Field[] fields = gasConcentration.getClass().getDeclaredFields(); |
| | | for (Field field : fields) { |
| | | field.setAccessible(true); // 设置字段可访问,即使是私有字段 |
| | | field.setAccessible(true); |
| | | if (field.getName().equals(reqDto.getAtmosphere())) { |
| | | Double value = null; |
| | | try { |
| | | value = (Double) field.get(gasConcentration); |
| | | Object value = field.get(gasConcentration); |
| | | gasAtmosphereLineChartRespDTO.setValue(value); |
| | | } catch (IllegalAccessException e) { |
| | | logger.info("【警告】气象折线图反射获取气体浓度失败"); |
| | |
| | | for (Field field : fields) { |
| | | field.setAccessible(true); // 设置字段可访问,即使是私有字段 |
| | | if (field.getName().equals(atmosphere)) { |
| | | Double value = null; |
| | | try { |
| | | value = (Double) field.get(gasConcentration); |
| | | Object value = field.get(gasConcentration); |
| | | gasAtmospherePageRespDTO.setValue(value); |
| | | } catch (IllegalAccessException e) { |
| | | logger.info("【警告】气象折线图反射获取气体浓度失败"); |