Commit 7639ccae authored by KeYong's avatar KeYong

更新

parent f0c2b63f
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IMcbWarningService; ...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IMcbWarningService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -14,9 +15,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -14,9 +15,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
@RestController @RestController
@Api(tags = "McbWarning Controller") @Api(tags = "McbWarning Controller")
...@@ -36,8 +39,18 @@ public class McbWarningController { ...@@ -36,8 +39,18 @@ public class McbWarningController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "[监测总览]近七日预警统计", notes = "[监测总览]近七日预警统计") @ApiOperation(httpMethod = "GET", value = "[监测总览]近七日预警统计", notes = "[监测总览]近七日预警统计")
@GetMapping(value = "/count/week") @GetMapping(value = "/count/week")
public ResponseModel<List<Map<String, Object>>> queryWeekCount() { public ResponseModel<Object> queryWeekCount() {
return ResponseHelper.buildResponse(mcbWarningService.queryWeekCount()); List<Map<String, Object>> list = mcbWarningService.queryWeekCount();
Map<String,Object> result = new HashMap<>();
List<Object> axisData = new ArrayList<>();
List<Object> seriesData = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)) {
axisData = list.stream().map(x -> x.get("axisData")).collect(Collectors.toList());
seriesData = list.stream().map(y -> y.get("seriesData")).collect(Collectors.toList());
}
result.put("axisData", axisData);
result.put("seriesData", seriesData);
return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment