| | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.DocUser; |
| | | import com.whyc.service.BOMFeedbakService; |
| | | import com.whyc.service.WorksheetMainService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | private Thread thread; |
| | | private static WorksheetMainService mainService; |
| | | private static BOMFeedbakService feedbakService; |
| | | |
| | | @Autowired |
| | | public void setWorksheetMainService(WorksheetMainService mainService) { |
| | | WorksheetSocket.mainService = mainService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setFeedbakService(BOMFeedbakService feedbakService) { |
| | | WorksheetSocket.feedbakService = feedbakService; |
| | | } |
| | | @OnOpen |
| | | public void onOpen(Session session, EndpointConfig config){ |
| | | this.session = session; |
| | |
| | | try { |
| | | while (!currentThread().isInterrupted()) { |
| | | Map<String, Integer> statisticMap = mainService.getStatusStatistic((DocUser) httpSession.getAttribute("user")); |
| | | statisticMap.put("fk",1); |
| | | session.getBasicRemote().sendObject(new Response().set(1, statisticMap)); |
| | | sleep(2000); |
| | | } |