| | |
| | | private AlarmDailyService alarmDailyService;
|
| | | @Resource
|
| | | private OrganizationLayoutService orgLayoutService;
|
| | | @Resource
|
| | | private DeviceVersionService dviceVersionService;
|
| | | /**
|
| | | * Screen login. 大屏登录
|
| | | *
|
| | |
| | | @ApiImplicitParam(name = "dimension", value = "维度(profession、region、monitorPoint选一)", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "sensorKey", value = "传感器key", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "accountId", value = "账户id", required = true, paramType = "query", dataType = "int"),
|
| | | @ApiImplicitParam(name = "timeType", value = "时间类型(month、day、hour选一)", required = true, paramType = "query", dataType = "int"), |
| | | })
|
| | | public ResultBean<List<Map<String, Object>>> getRegionRankingData(HttpServletRequest request){
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | |
| | | return ResultBean.fail();
|
| | | }
|
| | |
|
| | | } else {
|
| | | MonitorPoint monitorPoint = monitorPointService.queryMonitorPointById(Integer.parseInt(primaryKey));
|
| | | List<DeviceVersion> versionList = deviceVersionService.queryByOrgId(monitorPoint.getOrganizationId());
|
| | | if(versionList.size() > 0) {
|
| | | List<Integer> versionNolist = versionList.stream().map(item -> {
|
| | | return item.getVersion();
|
| | | }).collect(Collectors.toList());
|
| | | rtdLayout = orgLayoutService.queryRtdLayoutWithUnit(monitorPoint.getOrganizationId(),versionNolist);
|
| | | if(rtdLayout == null) {
|
| | | return ResultBean.fail();
|
| | | }
|
| | | }
|
| | | }
|
| | | if(rtdLayout.getDefaultMonitorItems().size() == 0 ) {
|
| | | rtdLayout.getDefaultMonitorItems().addAll(rtdLayout.getCoreMonitorItems());
|
| | | }
|
| | | return new ResultBean(rtdLayout);
|
| | | }
|
| | |
|
| | | @GetMapping("report_avg_data")
|
| | | @ApiOperation(value = "获取监测因子月平均值", notes = "获取监测因子月平均值")
|
| | | @ApiImplicitParams(value = {
|
| | | @ApiImplicitParam(name = "monitorPoint", value = "监控站id", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "mac", value = "设备mac", required = false, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "sensorKey", value = "传感器key,如有多个用逗号分隔", required = true, paramType = "query", dataType = "String"), |
| | | @ApiImplicitParam(name = "time", value = "时间,月份(格式:2018-03)", required = true, paramType = "query", dataType = "String"), |
| | | })
|
| | | public ResultBean<List<Map<String, Object>>> getMonitorPointOrDeviceAvgDataBySensorKey(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | parameters.put("type", "month");
|
| | | parameters.put("monitorPointId", parameters.remove("monitorPoint"));
|
| | | String[] sensorKeys = parameters.remove("sensorKey").toString().split(",");
|
| | | parameters.put("sensors", Arrays.asList(sensorKeys));
|
| | | List<Map<String, Object>> list = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters);
|
| | | |
| | | for (Map<String, Object> map : list) {
|
| | | String time = map.get("time").toString();
|
| | | time = time.substring(time.length() - 2);
|
| | | map.put("time", Integer.valueOf(time));
|
| | | }
|
| | | return new ResultBean<List<Map<String, Object>>>(list);
|
| | | }
|
| | |
|
| | | }
|