| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.result.SystemGrdoupBatt; |
| | | import com.whyc.mapper.*; |
| | | import com.whyc.pojo.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | List<StationInf> list = mapper.getSystemAll(userId); |
| | | for (StationInf inf : list) { |
| | | String stationId = inf.getStationId(); |
| | | //查询机房下最大的单体电压和单体 |
| | | BattRtdata maxData = rtdataMapper.maxData(stationId); |
| | | inf.setMaxVol(maxData.getMonVol()); |
| | | inf.setMaxNum(maxData.getMonNum()); |
| | | //查询机房下最低的单体电压和单体 |
| | | BattRtdata minData = rtdataMapper.minData(stationId); |
| | | inf.setMinVol(maxData.getMonVol()); |
| | | inf.setMinNum(maxData.getMonNum()); |
| | | //查询实时告警总数 |
| | | int battAlm = battAlmMapper.getbattAlm(stationId); |
| | | inf.setBattAlm(battAlm); |
| | | //查询分组电池信息 |
| | | 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(maxData.getMonVol()); |
| | | sgblist.get(i).setMinNum(maxData.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); |
| | | inf.setAlarmNum(battAlm + devAlm + pwrAlm); |
| | | } |
| | | map.put("data", list); |
| | | return new Response().setII(1, true, map, "站点实时数据推送"); |
| | |
| | | //查询指定机房信息 |
| | | StationInf inf = mapper.getSystemSkipStation(userId, stationId); |
| | | if (inf != null) { |
| | | //查询机房下最大的单体电压和单体 |
| | | BattRtdata maxData = rtdataMapper.maxData(stationId); |
| | | inf.setMaxVol(maxData.getMonVol()); |
| | | inf.setMaxNum(maxData.getMonNum()); |
| | | //查询机房下最低的单体电压和单体 |
| | | BattRtdata minData = rtdataMapper.minData(stationId); |
| | | inf.setMinVol(maxData.getMonVol()); |
| | | inf.setMinNum(maxData.getMonNum()); |
| | | //查询实时告警总数 |
| | | int battAlm = battAlmMapper.getbattAlm(stationId); |
| | | inf.setBattAlm(battAlm); |
| | | //查询分组电池信息 |
| | | 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(maxData.getMonVol()); |
| | | sgblist.get(i).setMinNum(maxData.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); |
| | | inf.setAlarmNum(battAlm + devAlm + pwrAlm); |
| | | return new Response().setII(1, true, inf, "指定站点详情"); |
| | | } else { |
| | | return new Response().set(1, false, "指定站点详情"); |
| | |
| | | //查询指定机房信息 |
| | | StationInf inf = mapper.getSystemSkipStation(userId, stationId); |
| | | if (inf != null) { |
| | | if (inf.getRtlist() != null && inf.getRtlist().size() > 0) { |
| | | for (int i = 0; i < inf.getRtlist().size(); i++) { |
| | | //查询分组电池信息 |
| | | List<SystemGrdoupBatt> sgblist = rtstateMapper.selectSystemGrdoupBatt(stationId); |
| | | if (sgblist != null && sgblist.size() > 0) { |
| | | for (int i = 0; i < sgblist.size(); i++) { |
| | | //判断是否落后 |
| | | int battGroupId = inf.getRtlist().get(i).getBattGroupId(); |
| | | int battGroupId = sgblist.get(i).getBattGroupId(); |
| | | int badbattFlag = badMapper.judgeBatt(battGroupId); |
| | | inf.getRtlist().get(i).setBadbattFlag(badbattFlag); |
| | | sgblist.get(i).setBadbattFlag(badbattFlag); |
| | | } |
| | | inf.setSgbList(sgblist); |
| | | } |
| | | //查询停电续航时间 |
| | | QueryWrapper wrapper = new QueryWrapper(); |