jinpengyong
2024-03-13 3342a167067cc44154314cbdd39b13f60c608ce8
screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java
@@ -113,13 +113,36 @@
        /*if(monitorPoint.contains("")){
        }*/
        params.put("monitorPointList", monitorPoint);
        String[] monitorPointIds = monitorPoint.split(",");
        if (monitorPointIds.length > 7) {
            return ResultMessage.ok();
        }
        params.put("monitorPointIds", monitorPointIds);
        List<Object> response = historyFiveMinutelyService.getAreaWindData(params);
        return ResultMessage.ok(response);
    }
    @GetMapping("getWindDataCenter")
    @ApiOperation(value = "获取风场中心数据", notes = "获取风场中心数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
            @ApiImplicitParam(name = "monitorPointIds", value = "站点id", required = true, paramType = "query", dataType = "String")
    })
    public ResultMessage getWindDataCenter(HttpServletRequest request) {
        Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
        if (!params.containsKey("monitorPointIds")) {
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
        }
        String monitorPoint = params.remove("monitorPointIds").toString();
        params.put("monitorPointList", monitorPoint);
        String[] monitorPointIds = monitorPoint.split(",");
        if (monitorPointIds.length > 3) {
            return ResultMessage.ok();
        }
        params.put("monitorPointIds", monitorPointIds);
        List<Object> response = historyFiveMinutelyService.getAreaWindData(params);
        List<Object> response = historyFiveMinutelyService.getAreaWindDataCenter(params);
        return ResultMessage.ok(response);
    }
@@ -213,7 +236,7 @@
        @RequestParam @ApiParam(value = "reportType",name = "type") int reportType,
        @RequestParam @ApiParam(value = "endTime",name = "结束时间") String endTime*/
        List<MonitoringStationDTO> resList = monitorPointService.listMonitoringStationDTO(params,Integer.parseInt(params.get("reportType").toString()),params.get("startTime").toString(),params.get("endTime").toString());
        List<MonitoringStationDTOResult> list = new ArrayList<>();
        /*List<MonitoringStationDTOResult> list = new ArrayList<>();
        for(MonitoringStationDTO m : resList){
            MonitoringStationDTOResult result = new MonitoringStationDTOResult();
            result.setName(m.getName());
@@ -235,7 +258,7 @@
            result.setCO(m.getCO().compareTo(BigDecimal.ZERO)==0?"-":m.getCO().toString());
            result.setCONum(m.getCONum()==0?"-":String.valueOf(m.getCONum()));
            list.add(result);
        }
        return ResultMessage.ok(list);
        }*/
        return ResultMessage.ok(resList);
    }
}