| | |
| | | import com.moral.api.pojo.dto.cityAQI.ConcentrationAndPercent; |
| | | import com.moral.api.pojo.form.aqi.AirQualityComparisonForm; |
| | | import com.moral.api.pojo.vo.cityAQI.AirQualityComparisonVO; |
| | | import com.moral.api.pojo.vo.cityAQI.CityAreaRangeVO; |
| | | import com.moral.api.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.moral.constant.Constants; |
| | |
| | | |
| | | @Autowired |
| | | private HistoryHourlyService historyHourlyService; |
| | | |
| | | @Autowired |
| | | SpecialCitiesProperties citiesProperties; |
| | | |
| | | @Autowired |
| | | private SysAreaMapper sysAreaMapper; |
| | |
| | | } |
| | | }); |
| | | |
| | | //今日累计O3_8H计算,取每小时O3_8H最大值 |
| | | //今日累计O3_8H计算,取每小时O3——8H最大值 |
| | | if (!ObjectUtils.isEmpty(doubles)) { |
| | | dataMap.put("O3_8H", Collections.max(doubles)); |
| | | } |
| | |
| | | /** |
| | | * @Description: 从数据库查询数据 |
| | | * @Param: [regionCode] |
| | | * @return: java.util.Map<java.lang.String, java.lang.Object> |
| | | * @return: java.util.Map<java.lang.String , java.lang.Object> |
| | | * @Author: 陈凯裕 |
| | | * @Date: 2021/10/28 |
| | | */ |
| | |
| | | */ |
| | | private ConcentrationAndPercent contrastParam(Double data, Double comparisonData, String sensor) { |
| | | double percentD = MathUtils.division(data - comparisonData, comparisonData, 4); |
| | | String percent = MathUtils.mul(percentD, 100d) + "%"; |
| | | String percent = MathUtils.mul(percentD,100d) + "%"; |
| | | ConcentrationAndPercent concentrationAndPercent = new ConcentrationAndPercent(); |
| | | concentrationAndPercent.setPercent(percent); |
| | | if (sensor.equals("CO")) {//CO小数点保留一位 |
| | | Double CO = AmendUtils.sciCal(data, 1); |
| | | concentrationAndPercent.setConcentration(CO.toString()); |
| | | } else if (sensor.equals("compositeIndex")) { |
| | | }else if (sensor.equals("compositeIndex")){ |
| | | concentrationAndPercent.setConcentration(data.toString()); |
| | | } else { |
| | | }else{ |
| | | Double sensorD = AmendUtils.sciCal(data, 0); |
| | | Integer sensorI = new Double(sensorD).intValue(); |
| | | concentrationAndPercent.setConcentration(sensorI.toString()); |
| | |
| | | /** |
| | | * @Description: 根据时间类型查询对应的6参以及综合指数,自定义时间类型用日数据做均值处理 |
| | | * @Param: [comparisonType, startDate, endDate, regionCode] |
| | | * @return: java.util.Map<java.lang.String, java.lang.Object> |
| | | * @return: java.util.Map<java.lang.String , java.lang.Object> |
| | | * @Author: 陈凯裕 |
| | | * @Date: 2022/1/17 |
| | | */ |
| | |
| | | private List<SysArea> getSysAreasByRegionType(String regionType, Integer regionCode) { |
| | | List<SysArea> areas; |
| | | if (regionType.equals(Constants.TWENTY_EIGHT_CITIES)) { |
| | | SpecialCitiesProperties properties = new SpecialCitiesProperties(); |
| | | areas = properties.getTwentyEightCities(); |
| | | areas = citiesProperties.getTwentyEightCities(); |
| | | } else { |
| | | areas = sysAreaService.getChildren(regionCode); |
| | | } |
| | |
| | | /** |
| | | * @Description: 计算6参平均值 |
| | | * @Param: [cityAqiList] |
| | | * @return: java.util.Map<java.lang.String, java.lang.Double> |
| | | * @return: java.util.Map<java.lang.String , java.lang.Double> |
| | | * 返回值key为sensorCode,value为值 |
| | | * @Author: 陈凯裕 |
| | | * @Date: 2021/11/2 |