| | |
| | | import com.whyc.dto.paramter.RealTimePar; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.PeakStatistics; |
| | | import com.whyc.pojo.PowerInf; |
| | | import com.whyc.pojo.StationInf; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | private static AcdcSecuityService acdcSecuityService; |
| | | |
| | | private static PowerInfService pinfService; |
| | | |
| | | private static Qgn618NbstateService qgnService; |
| | | |
| | | private Session session; |
| | | |
| | | private HttpSession httpSession; |
| | | |
| | | @Autowired |
| | | public void setService(PowerInfService pinfService) { |
| | | RealTimeWebsocket.pinfService = pinfService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setService(AcdcSecuityService acdcSecuityService) { |
| | | RealTimeWebsocket.acdcSecuityService = acdcSecuityService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setQgn618NbstateService(Qgn618NbstateService qgnService) { |
| | | RealTimeWebsocket.qgnService = qgnService; |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | public void setService(BattRtstateService rtstateservice) { |
| | |
| | | try { |
| | | Response res = new Response(); |
| | | switch (realTimePar.getPageType()) { |
| | | case "standard": |
| | | case "standard"://61850,61852 |
| | | res = getStandard(realTimePar, lang); |
| | | break; |
| | | case "dbs": |
| | |
| | | case "powerHr6159": |
| | | res = getPowerHr6159(realTimePar); |
| | | break; |
| | | case "intellect61853": |
| | | res = getIntellect61853(realTimePar); |
| | | break; |
| | | case "nibian6184": |
| | | res = getNibian6184(realTimePar,lang); |
| | | break; |
| | | case "nibian6186": |
| | | res = getNibian6186(realTimePar,lang); |
| | | break; |
| | | } |
| | | //实时显示调整,增加电池数量,标称单体电压,铅酸还是锂电,放置于返回结果的data2 |
| | | Battinf battinf = battInfService.getBattGroupInfoByBattGroupId(realTimePar.getBattGroupId()); |
| | |
| | | } |
| | | threadFlagMap.put(thread.getId(), false); |
| | | } |
| | | //if (session.isOpen()) { |
| | | // Response res=new Response(); |
| | | // switch (realTimePar.getPageType()){ |
| | | // case "standard": res=getStandard(realTimePar);break; |
| | | // case "a059": res=getA059(realTimePar);break; |
| | | // case "enestorage": res=getEnestorage(realTimePar);break; |
| | | // case "btssreen": res=getBtssreen(realTimePar);break; |
| | | // case "power": res=getPower(realTimePar);break; |
| | | // case "isolating": res=getIsolating(realTimePar);break; |
| | | // case "charger": res=getCharger(realTimePar);break; |
| | | // case "power1": res=getPower1(realTimePar);break; |
| | | // case "totalInfo": res=getTotalInfo(realTimePar);break; |
| | | // } |
| | | // //推送信息 |
| | | // session.getBasicRemote().sendObject(res); |
| | | //} |
| | | sleep(executeTime); |
| | | //} catch (IOException | InterruptedException | EncodeException e) { |
| | | } catch (Exception e) { |
| | | interrupt(); |
| | | } |
| | |
| | | thread.interrupt(); |
| | | } |
| | | threadMap.remove(session.getId()); |
| | | } |
| | | //只能61853的实时页面信息 |
| | | public Response getIntellect61853(RealTimePar realTimePar) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | //查询fbs9100信息 |
| | | Response f9100stateRes = f9100service.serchContactorState(realTimePar.getDevId()); |
| | | res.put("f9100state", f9100stateRes); |
| | | //查询电池组端信息2组数据同时获取分开放 |
| | | List<Battinf> binfList=battInfService.getBattGroupInfoByFBSDeviceId(realTimePar.getDevId()); |
| | | if(binfList!=null){ |
| | | for (Battinf binf:binfList) { |
| | | Response rtstateRes = rtstateservice.serchByCondition(binf.getBattGroupId()); |
| | | res.put("rtstate"+binf.getGroupIndexInFBSDevice(), rtstateRes); |
| | | //查询电池组单体信息 |
| | | Response rtdataRes = rtdataservice.serchByCondition(binf.getBattGroupId()); |
| | | res.put("rtdata"+binf.getGroupIndexInFBSDevice(), rtdataRes); |
| | | res.put("binf"+binf.getGroupIndexInFBSDevice(), binf); |
| | | } |
| | | } |
| | | return new Response().set(1, res); |
| | | } |
| | | |
| | | //kgdy的实时页面信息 |
| | |
| | | Response fbs9150Res = fbs9100sStemnodeStateService.serch9150BtsInfo(realTimePar.getDevId()); |
| | | res.put("fbs9150Res", fbs9150Res); |
| | | } |
| | | if(realTimePar.getStationId()!=null){ |
| | | //根据机房id获取机房下电源信息 |
| | | PowerInf pinf=pinfService.getPwrDevIdByStationId(realTimePar.getStationId()); |
| | | if(pinf!=null){ |
| | | //查询电源的ACDC信息(重庆bts4810(61850)需要用tb_pwrdev_acdcdata的实时负载电流和三相交流电压) |
| | | Response pwrdevAcdcRes=pwrdevAcdcservice.getDataByDevId(pinf.getPowerDeviceId()); |
| | | res.put("pwrdevAcdc",pwrdevAcdcRes); |
| | | } |
| | | } |
| | | |
| | | return new Response().set(1, res); |
| | | } |
| | | |
| | | //6184 |
| | | public Response getNibian6184(RealTimePar realTimePar, String lang) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | //获取逆变的其他信息 |
| | | Response fbs9100sBuscoupleState = fbs9100sBuscoupleStateService.serchByDevId(realTimePar.getDevId()); |
| | | res.put("fbs9100sBuscoupleState", fbs9100sBuscoupleState); |
| | | //查询fbs9100信息 |
| | | Response f9100stateRes = f9100service.serchContactorState(realTimePar.getDevId()); |
| | | res.put("f9100state", f9100stateRes); |
| | | //查询电池组端信息2组数据同时获取分开放 |
| | | List<Battinf> binfList=battInfService.getBattGroupInfoByFBSDeviceId(realTimePar.getDevId()); |
| | | if(binfList!=null){ |
| | | for (Battinf binf:binfList) { |
| | | Response rtstateRes = rtstateservice.serchByCondition(binf.getBattGroupId()); |
| | | res.put("rtstate"+binf.getGroupIndexInFBSDevice(), rtstateRes); |
| | | //查询电池组单体信息 |
| | | Response rtdataRes = rtdataservice.serchByCondition(binf.getBattGroupId()); |
| | | res.put("rtdata"+binf.getGroupIndexInFBSDevice(), rtdataRes); |
| | | res.put("binf"+binf.getGroupIndexInFBSDevice(), binf); |
| | | } |
| | | } |
| | | //获取615全功能逆变假负载开关以及逆变模块实时 |
| | | Response qgnRes= qgnService.serchByDevId(realTimePar.getDevId()); |
| | | res.put("qgnRes", qgnRes); |
| | | |
| | | return new Response().set(1, res); |
| | | } |
| | | |
| | | //6186 |
| | | public Response getNibian6186(RealTimePar realTimePar, String lang) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | //查询fbs9100信息 |
| | | Response f9100stateRes = f9100service.serchContactorState(realTimePar.getDevId()); |
| | | res.put("f9100state", f9100stateRes); |
| | | Response rtstateRes = rtstateservice.serchByCondition(realTimePar.getBattGroupId()); |
| | | res.put("rtstate", rtstateRes); |
| | | //查询电池组单体信息 |
| | | Response rtdataRes = rtdataservice.serchByCondition(realTimePar.getBattGroupId()); |
| | | res.put("rtdata", rtdataRes); |
| | | //最后一次核容放电数据 |
| | | Response tinfRes = batttestDataInfService.searchBattLastHrDataByIdDbs(realTimePar.getBattGroupId(), realTimePar.getDevId(), lang); |
| | | res.put("tinfdata", tinfRes); |
| | | return new Response().set(1, res); |
| | | } |
| | | |