| | |
| | | package com.jcdm.main.da.opcuaconfig.cert; |
| | | |
| | | import com.jcdm.framework.websocket.WebSocketServer; |
| | | import com.jcdm.framework.websocket.WebSocketUsers; |
| | | import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf; |
| | | import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService; |
| | | import com.jcdm.main.da.opcuaconfig.client.ClientHandler; |
| | |
| | | import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue; |
| | | import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId; |
| | | |
| | | import javax.websocket.Session; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.jcdm.main.da.opcuaconfig.client.ClientHandler.readValues; |
| | | |
| | | @Slf4j |
| | | public class MethodName { |
| | | Map<String, Session> map = WebSocketUsers.getUsers(); |
| | | private IDaCollectionParamConfService collectionParamConfService = BeanUtils.getBean(IDaCollectionParamConfService.class); |
| | | private IDaParamCollectionService daParamCollectionService = BeanUtils.getBean(IDaParamCollectionService.class); |
| | | private IDaPassingStationCollectionService daPassingStationCollectionService = BeanUtils.getBean(IDaPassingStationCollectionService.class); |
| | |
| | | PassingStationCollection.setInboundTime(new Date()); |
| | | daPassingStationCollectionService.insertDaPassingStationCollection(PassingStationCollection); |
| | | log.info("节点:{},响应结果:{}", node1.getIdentifier(),out1); |
| | | WebSocketUsers.sendMessageToUserByText(map.get(parts[1]), "IN"); |
| | | break; |
| | | case "2": //请求记录工位数据 |
| | | List<DaCollectionParamConf> b; |
| | |
| | | //更新PLC节点状态 |
| | | NodeEntity node2= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordDataDone").value("21").type("short").build(); |
| | | Boolean out2=clientHandler.write(node2); |
| | | WebSocketUsers.sendMessageToUserByText(map.get(parts[1]), "OUT"); |
| | | log.info("节点:{},响应结果:{}", node2.getIdentifier(),out2); |
| | | break; |
| | | default: |