From 016ede312448bae12c8f42724afb5a295f42935e Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Fri, 18 Mar 2022 17:39:22 +0800
Subject: [PATCH] 县市区数据接口
---
screen-api/src/main/java/com/moral/api/controller/AqiController.java | 97 ++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 85 insertions(+), 12 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/controller/AqiController.java b/screen-api/src/main/java/com/moral/api/controller/AqiController.java
index f89d725..381b20f 100644
--- a/screen-api/src/main/java/com/moral/api/controller/AqiController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/AqiController.java
@@ -2,15 +2,9 @@
import com.moral.api.config.properties.SpecialCitiesProperties;
import com.moral.api.entity.SysArea;
-import com.moral.api.pojo.dto.cityAQI.CityPollutionLevel;
-import com.moral.api.pojo.dto.cityAQI.ConcentrationAndPercent;
-import com.moral.api.pojo.dto.cityAQI.DataPercentRange;
-import com.moral.api.pojo.dto.cityAQI.MonthlyPollutionLevel;
+import com.moral.api.pojo.dto.cityAQI.*;
import com.moral.api.pojo.form.aqi.*;
-import com.moral.api.pojo.vo.cityAQI.AirQualityComparisonVO;
-import com.moral.api.pojo.vo.cityAQI.BarChartOfPollutionLevelVO;
-import com.moral.api.pojo.vo.cityAQI.BarChartTableOfPollutionLevelVO;
-import com.moral.api.pojo.vo.cityAQI.PieChartOfPollutionLevelVO;
+import com.moral.api.pojo.vo.cityAQI.*;
import com.moral.api.service.CityAqiDailyService;
import com.moral.api.service.CityAqiYearlyService;
@@ -20,6 +14,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
+import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
@@ -47,6 +42,10 @@
private CityAqiService cityAqiService;
@Autowired
private CityAqiDailyService cityAqiDailyService;
+ @Autowired
+ SpecialCitiesProperties specialCitiesProperties;
+ @Autowired
+ CityAqiYearlyService cityAqiYearlyService;
@GetMapping("compareO3")
@ApiOperation(value = "���������������������������", notes = "���������������������������")
@@ -282,10 +281,6 @@
return ResultMessage.ok(datas);
}
- @Autowired
- SpecialCitiesProperties specialCitiesProperties;
- @Autowired
- CityAqiYearlyService cityAqiYearlyService;
/**
* @Description: ������������������������
* @Param: [year, cityCode]
@@ -302,4 +297,82 @@
return ResultMessage.ok(result);
}
+ @GetMapping("queryComplianceDaysAnalysis")
+ public ResultMessage queryComplianceDaysAnalysis( String year, Integer cityCode){
+ if(year==null||cityCode==null)
+ return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
+ ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+ List<ComplianceDaysDTO> dtos = cityAqiYearlyService.analysisComplianceDays(year, cityCode);
+ return ResultMessage.ok(ComplianceDaysVO.convert(dtos));
+ }
+
+ @GetMapping("momDate")
+ public ResultMessage momDate(Integer regionCode, Integer size, Integer current, Integer orgId){
+ if(regionCode==null || size==null || current==null){
+ return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
+ ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+ }
+ Map<String, Object> result = cityAqiService.momData(regionCode, size, current, orgId);
+ return ResultMessage.ok(result);
+ }
+
+ /**
+ * @Description: ������������������������������ ������7
+ * @Param: [regionCode, time]
+ * @return: com.moral.constant.ResultMessage
+ * @Author: ���������
+ * @Date: 2022/3/16
+ */
+ @GetMapping("cityAreaRange")
+ public ResultMessage cityAreaRange(Integer regionCode,@DateTimeFormat(pattern = "yyyy-MM-dd") Date time){
+ if(regionCode==null || time==null){
+ return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
+ ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+ }
+ CityAreaRangeVO vo = new CityAreaRangeVO();
+
+ ConcentrationAndPercent cap = new ConcentrationAndPercent();
+ cap.setConcentration("������/������/������");
+ cap.setPercent("������");
+ cap.setCompareConcentration("������������");
+ ConcentrationAndPercent cap2 = new ConcentrationAndPercent();
+ cap2.setConcentration("������/������/������");
+ cap2.setPercent("������");
+
+ vo.setCityName("xxx");
+ vo.setRange(0);
+ vo.setCompositeIndex(cap);
+ vo.setCO(cap);
+ vo.setNO2(cap);
+ vo.setSO2(cap);
+ vo.setPM10(cap);
+ vo.setPM25(cap);
+ vo.setO3(cap);
+ vo.setServerDays(cap2);
+ vo.setFineDays(cap2);
+
+ List<CityAreaRangeVO> vos = new ArrayList<>();
+ vos.add(vo);
+ vos.add(vo);
+
+ return ResultMessage.ok(vos);
+ }
+
+ /**
+ *@Description: ���������������
+ *@Param: [regionCode]
+ *@return: com.moral.constant.ResultMessage
+ *@Author: lizijie
+ *@Date: 2022/3/16 16:54
+ **/
+ @GetMapping("countyData")
+ public ResultMessage countyData(Integer regionCode){
+ if(regionCode==null){
+ return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
+ ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+ }
+ Map<String, Object> resultMap = cityAqiService.countyData(regionCode);
+ return ResultMessage.ok(resultMap);
+ }
+
}
--
Gitblit v1.8.0