huangzhen
2024-02-19 cd301e0d8f2ea3adc3d50ff3fc9b19a34b539f79
src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/MonitorDataServiceImpl.java
@@ -67,7 +67,7 @@
            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());
@@ -124,7 +124,7 @@
        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());
@@ -309,11 +309,10 @@
            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("【警告】气象折线图反射获取气体浓度失败");
@@ -360,9 +359,8 @@
            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("【警告】气象折线图反射获取气体浓度失败");