| | |
| | | import com.whyc.dto.DeviceTypeDTO; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.paramter.RealTimePar; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private static Fbs9100ChargerstateService f9100Chargerstateservice;//Fbs9100Chargerstate |
| | | |
| | | private static Fbs9100sBuscoupleStateService fbs9100sBuscoupleStateService; |
| | | |
| | | private static BattInfService battInfService; |
| | | |
| | | private Session session; |
| | | |
| | |
| | | public void setService(Fbs9100sBuscoupleStateService fbs9100sBuscoupleStateService) { |
| | | RealTimeWebsocket.fbs9100sBuscoupleStateService = fbs9100sBuscoupleStateService; |
| | | } |
| | | @Autowired |
| | | public void setService(BattInfService battInfService) { |
| | | RealTimeWebsocket.battInfService = battInfService; |
| | | } |
| | | |
| | | @OnOpen |
| | | public void onOpen(Session session){ |
| | |
| | | case "power1": res=getPower1(realTimePar);break; |
| | | case "totalInfo": res=getTotalInfo(realTimePar);break; |
| | | } |
| | | //实时显示调整,增加电池数量,标称单体电压,放置于返回结果的data2 |
| | | Battinf battinf = battInfService.getBattGroupInfoByBattGroupId(realTimePar.getBattGroupId()); |
| | | res.setData2(battinf); |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | | synchronized (session) { |