| | |
| | | return mapper.getStation(userId); |
| | | } |
| | | |
| | | //监控层首页:站点实时数据推送 |
| | | public Object getMonitorAll(int userId) { |
| | | return new Response().set(1, true, "站点实时数据推送"); |
| | | } |
| | | |
| | | //管理员首页:头部统计 |
| | | public Response getSystemSkipHead(int userId) { |
| | | try { |
| | | Map<String, Object> map = new HashMap(); |
| | | //头部统计数据 |
| | | int stationNum = mapper.getStation(userId); |
| | | map.put("stationNum", stationNum); |
| | | //浮充/充电 |
| | | List<BattRtstate> stateList = rtstateMapper.getBattStateStatic(userId); |
| | | Map<Integer, Integer> statemap = new HashMap(); |
| | | Map<Integer, List<BattRtstate>> battstateMap = stateList.stream().collect(Collectors.groupingBy(BattRtstate::getBattState)); |
| | | for (Integer state : battstateMap.keySet()) { |
| | | statemap.put(state, battstateMap.get(state).size()); |
| | | } |
| | | map.put("battState", statemap); |
| | | return new Response().setII(1, true, map, "管理员首页:头部统计"); |
| | | } catch (Exception e) { |
| | | return new Response().set(1, false, "发生异常:" + e.getCause()); |
| | | } |
| | | } |
| | | |
| | | //指定站点详情第一次跳转机房id为0:message |
| | | public Response getSystemSkipStation(int userId, String stationId) { |
| | | //查询指定机房信息 |
| | | StationInf inf = mapper.getSystemSkipStation(userId, stationId); |
| | | if (inf != null) { |
| | | //查询分组电池信息 |
| | | List<SystemGrdoupBatt> sgblist = rtstateMapper.selectSystemGrdoupBatt(stationId); |
| | | for (int i = 0; i < sgblist.size(); i++) { |
| | | int battGroupId = sgblist.get(i).getBattGroupId(); |
| | | //查询机房下最大的单体电压和单体 |
| | | BattRtdata maxData = rtdataMapper.maxData(battGroupId); |
| | | sgblist.get(i).setMaxVol(maxData.getMonVol()); |
| | | sgblist.get(i).setMaxNum(maxData.getMonNum()); |
| | | //查询机房下最低的单体电压和单体 |
| | | BattRtdata minData = rtdataMapper.minData(battGroupId); |
| | | sgblist.get(i).setMinVol(minData.getMonVol()); |
| | | sgblist.get(i).setMinNum(minData.getMonNum()); |
| | | //查询实时告警总数 |
| | | int battAlm = battAlmMapper.getbattAlm(battGroupId); |
| | | sgblist.get(i).setBattAlm(battAlm); |
| | | } |
| | | inf.setSgbList(sgblist); |
| | | int devAlm = devAlmMapper.getdevAlm(stationId); |
| | | inf.setDevAlm(devAlm); |
| | | int pwrAlm = pwrAlmMapper.getpwrAlm(stationId); |
| | | inf.setPwrAlm(pwrAlm); |
| | | return new Response().setII(1, true, inf, "指定站点详情"); |
| | | } else { |
| | | return new Response().set(1, false, "指定站点详情"); |
| | | } |
| | | |
| | | } |
| | | |
| | | //运维层首页:头部统计 |
| | | public Response getDevOpSkipHead(int userId) { |