| | |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.core.websocket.config.WebSocketMessageSender; |
| | | import com.qianwen.core.websocket.handler.JsonMessageHandler; |
| | | import com.qianwen.smartman.modules.coproduction.entity.OrderWorkstation; |
| | | import com.qianwen.smartman.modules.coproduction.service.IOrderWorkstationService; |
| | | //import com.qianwen.smartman.modules.coproduction.entity.OrderWorkstation; |
| | | //import com.qianwen.smartman.modules.coproduction.service.IOrderWorkstationService; |
| | | import com.qianwen.smartman.modules.mdc.service.RealTimeDataService; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.socket.WebSocketSession; |
| | | |
| | |
| | | @Component |
| | | public class RealTimeDataJsonMessageHandler implements JsonMessageHandler<RealTimeDataRequestJsonWebSocketMessage> { |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | private final IOrderWorkstationService orderWorkstationService; |
| | | //private final IOrderWorkstationService orderWorkstationService; |
| | | |
| | | @Autowired |
| | | private RealTimeDataService realTimeDataService; |
| | | /* |
| | | public RealTimeDataJsonMessageHandler(final IOrderWorkstationService orderWorkstationService) { |
| | | this.orderWorkstationService = orderWorkstationService; |
| | | } |
| | | }*/ |
| | | |
| | | public void handle(WebSocketSession session, RealTimeDataRequestJsonWebSocketMessage message) { |
| | | List<String> workstationIdList = message.getWorkstationIdList(); |
| | |
| | | if("1656819188967653378".equals(workstationId)) { |
| | | log.info(workstationId+"收到:"+map); |
| | | } |
| | | long wid = Long.parseLong(workstationId); |
| | | realTimeDataService.addPreTimeInDeviceStatus(wid, map); |
| | | //map.put("orderCode", Func.isEmpty(orderWorkstationMap.get(Long.valueOf(workstationId))) ? "-" : orderWorkstationMap.get(Long.valueOf(workstationId))); |
| | | jsonWebSocketMessage.setData(map); |
| | | jsonWebSocketMessage.setId(workstationId); |