From 1b92eb61fee576a51c58e34ede99fc199dcb3f13 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Wed, 19 Oct 2022 14:40:46 +0800
Subject: [PATCH] 上传浑南区空气质量日报功能

---
 screen-api/src/main/java/com/moral/api/controller/AqiController.java |   72 ++++++++++++++++++++++++++++++------
 1 files changed, 60 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..3f6071e 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,57 @@
         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());
+        }
+        List<CityAreaRangeVO> vos = cityAqiDailyService.cityAreaRange(regionCode,time);
+        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