| | |
| | | import com.whyc.pojo.db_ram_db.DeviceState; |
| | | import com.whyc.pojo.db_ram_db.PwrdevAcdcdata; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | |
| | | |
| | | //电池组信息 |
| | | private static BattInfService battInfService; |
| | | |
| | | //机房信息 |
| | | private static StationInfService stationInfService; |
| | | |
| | | //电源信息 |
| | | private static PowerInfService powerInfService; |
| | | |
| | | |
| | | private volatile boolean runFlag = true; |
| | |
| | | } |
| | | |
| | | @Autowired |
| | | public void seBattInfService(BattInfService battInfService) { |
| | | public void setBattInfService(BattInfService battInfService) { |
| | | RealTimeSocket.battInfService = battInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setStationInfService(StationInfService stationInfService) { |
| | | RealTimeSocket.stationInfService = stationInfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setPowerInfService(PowerInfService powerInfService) { |
| | | RealTimeSocket.powerInfService = powerInfService; |
| | | } |
| | | |
| | | |
| | |
| | | topDto.setOnlineVol(battRtstate.getOnlineVol()); |
| | | topDto.setRecordtime(ThreadLocalUtil.format(battRtstate.getRecDatetime(),1)); |
| | | } |
| | | //实时获取电池组信息 |
| | | BattInf binf=battInfService.getBinfByBattgroupId(realDto.getBattgroupId()); |
| | | if(binf!=null){ |
| | | topDto.setBattGroupName(binf.getBattgroupName()); |
| | | topDto.setDevName(binf.getDevName()); |
| | | } |
| | | //获取机房信息 |
| | | StationInf stationInf = stationInfService.getStationInfById(binf.getStationId()); |
| | | if(stationInf!=null){ |
| | | topDto.setStationName(stationInf.getStationName()); |
| | | topDto.setProvice(stationInf.getProvice()); |
| | | topDto.setCity(stationInf.getCity()); |
| | | topDto.setCounty(stationInf.getCountry()); |
| | | topDto.setFullName(stationInf.getFullName()); |
| | | } |
| | | //获取电源信息 |
| | | PowerInf powerInf = powerInfService.getPowerInfById(binf.getPowerId()); |
| | | if(powerInf!=null){ |
| | | topDto.setPowerName(powerInf.getPowerName()); |
| | | } |
| | | //实时获取设备信息 |
| | | DeviceState deviceState = deviceStateService.getDevRealInfo(realDto.getDevId()); |
| | | if (deviceState != null) { |
| | |
| | | //剩余容量和剩余时间计算 |
| | | Float restCap = batttestdataInfService.getLastTestDataRestCap(realDto.getBattgroupId()); |
| | | topDto.setRestCap(restCap); |
| | | BattInf binf=battInfService.getBinfByBattgroupId(realDto.getBattgroupId()); |
| | | //实时组端电流,剩余容量,标称容量 |
| | | if(battRtstate!=null){ |
| | | Float restTime= BattCapFactory.getTheoryTime(battRtstate.getGroupCurr(), restCap, binf.getMoncapstd()); |