From 45199ae5da5ca4bcfae8d61fb97f1780e1305dcf Mon Sep 17 00:00:00 2001
From: cjl <909710561@qq.com>
Date: Tue, 02 Apr 2024 09:39:18 +0800
Subject: [PATCH] fix:臭氧预测功能开发

---
 screen-api/src/main/java/com/moral/api/controller/AqiController.java |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 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 c5180e8..af4eab5 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
@@ -16,6 +16,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.constraints.NotNull;
@@ -56,24 +57,26 @@
 
     @GetMapping("compareO3New")
     @ApiOperation(value = "���������������������������New", notes = "���������������������������New")
-    public ResultMessage compareO3New(@RequestParam @ApiParam(value = "regionCode",name = "������code") String regionCode,
-                                      @RequestParam @ApiParam(value = "time",name = "������") String time) {
+    public ResultMessage compareO3New(@RequestParam @ApiParam(value = "������code",name = "regionCode") String regionCode,
+                                      @RequestParam @ApiParam(value = "������",name = "time") String time) {
         Map<String, Object> params = new HashMap<>();
         params.put("regionCode",regionCode);
         params.put("time",time);
         List<Map<String, Object>> response = cityAqiService.measuredCompareForecastOfO3(params);
-        return ResultMessage.ok(response);
+        Map<Integer, List<Map<String, Object>>> groupMap = response.stream().collect(Collectors.groupingBy(it->it.get("type").toString().equals("������")?0:1));
+        return ResultMessage.ok(groupMap);
     }
 
     @GetMapping("getO38H")
-    @ApiOperation(value = "���������������������������New", notes = "���������������������������New")
-    public ResultMessage getO38H(@RequestParam @ApiParam(value = "regionCode",name = "������code") String regionCode,
-                                      @RequestParam @ApiParam(value = "time",name = "������") String time) {
+    @ApiOperation(value = "���������������������8������������New", notes = "���������������������8������������New")
+    public ResultMessage getO38H(@RequestParam @ApiParam(value = "������code",name = "regionCode") String regionCode,
+                                      @RequestParam @ApiParam(value = "������",name = "time") String time) {
         Map<String, Object> params = new HashMap<>();
         params.put("regionCode",regionCode);
         params.put("time",time);
         List<Map<String, Object>> response = cityAqiService.measuredCompareForecastOfO3_8H(params);
-        return ResultMessage.ok(response);
+        Map<Integer, List<Map<String, Object>>> groupMap = response.stream().collect(Collectors.groupingBy(it->it.get("type").toString().equals("������")?0:1));
+        return ResultMessage.ok(groupMap);
     }
 
     /**

--
Gitblit v1.8.0